The Inbox: PackageInfo-Base-jr.73.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: PackageInfo-Base-jr.73.mcz

commits-2
A new version of PackageInfo-Base was added to project The Inbox:
http://source.squeak.org/inbox/PackageInfo-Base-jr.73.mcz

==================== 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') -----
  classes
  | 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') -----
  foreignClasses
  | 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') -----
  foreignSystemCategories
+ ^ 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])!