[squeak-dev] The Inbox: PackageInfo-Base-jr.73.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jun 3 21:42:39 UTC 2020

A new version of PackageInfo-Base was added to project The Inbox:

==================== Summary ====================

Name: PackageInfo-Base-jr.73
Author: jr
Time: 3 June 2020, 11:42:40.862983 pm
UUID: 32a80aa1-d50d-8248-980d-0f01ca9249da
Ancestors: PackageInfo-Base-mt.72

Fix environment access in PackageInfo

An Environment's organization includes only the classes declared in the environment, not the imported classes. So use #at: to find the declared classes. This makes a difference if, though imports from other environments, a declared class gets hidden by a "foreign" class.

Also make sure to really look up in the organization of the current environment, so you can properly find classes and traits in other environments. Previously it would not have found classes in categories that do not exist in the default environment.

=============== Diff against PackageInfo-Base-mt.72 ===============

Item was changed:
  ----- Method: PackageInfo>>classes (in category 'listing') -----
  	| environment organization |
+ 	environment := Environment current.
- 	environment := Environment  current.
  	organization := environment organization.
  	^(self systemCategories gather:
  		[:cat |
  		(organization listAtCategoryNamed: cat)
+ 			collect: [:className | environment at: className]])
- 			collect: [:className | environment valueOf: className]])
  				sorted: [:a :b | a className <= b className]!

Item was changed:
  ----- Method: PackageInfo>>foreignClasses (in category 'listing') -----
  	| s environment |
  	s := IdentitySet new.
  	environment := Environment current.
  	self foreignSystemCategories
+ 		do: [:c | (environment organization listAtCategoryNamed: c)
- 		do: [:c | (SystemOrganization listAtCategoryNamed: c)
  				do: [:cl | 
  					| cls | 
+ 					cls := environment at: cl.
- 					cls := environment valueOf: cl.
  					s add: cls;
  					  add: cls class]].
  	^ s!

Item was changed:
  ----- Method: PackageInfo>>foreignSystemCategories (in category 'listing') -----
+ 	^ Environment current organization categories
- 	^ SystemOrganization categories
  		reject: [:cat | self includesSystemCategory: cat] !

Item was changed:
  ----- Method: PackageInfo>>includesClassNamed: (in category 'testing') -----
  includesClassNamed: aClassName
+ 	^ self includesSystemCategory: ((Environment current organization categoryOfElement: aClassName) ifNil: [^false])!
- 	^ self includesSystemCategory: ((SystemOrganization categoryOfElement: aClassName) ifNil: [^false])!

More information about the Squeak-dev mailing list