[squeak-dev] The Trunk: System-mt.1073.mcz

Jakob Reschke forums.jakob at resfarm.de
Thu Jul 25 08:08:21 UTC 2019


Am Mo., 22. Juli 2019 um 11:45 Uhr schrieb <commits at source.squeak.org>:

>
> Not sure about "self environment" vs. "aClass environment" because tools
> will usually create a system navigation with the correct environment set.
>
>
An environment can have bindings to classes in other environments (via
imports). When the imported name is different from the original class's
name, then the binding in the importing environment will be an Alias and
not the original Binding object. Then the SystemNavigation's environment
could give you the Alias, while theClass environment will always give you
the Binding. Does it make a difference to allCallsOn:fromBehaviors:sorted:?

The lower paragraph about sharedPools in either case only iterates the
classes "owned" by the particular environment, so I think both the old code
and the new code will not necessarily find all references to a class as a
pool dictionary.


> =============== Diff against System-mt.1072 ===============
>
> Item was changed:
>   ----- Method: SystemNavigation>>allCallsOnClass: (in category 'query')
> -----
> + allCallsOnClass: aBehaviorOrBinding
> - allCallsOnClass: aBehavior
>         "Answer a sorted collection of all the methods that refer to
> aBehavior."
>
> +       | binding thisClass result |
> +       binding := aBehaviorOrBinding isBehavior
> +               ifTrue: [self environment bindingOf: aBehaviorOrBinding
> theNonMetaClass name]
> +               ifFalse: [aBehaviorOrBinding].
> +       thisClass := binding value.
> +
> -       | theClass result |
> -       theClass := aBehavior theNonMetaClass.
>         result := self
> +               allCallsOn: binding
> -               allCallsOn: (theClass environment bindingOf: theClass name)
>                 fromBehaviors: self allBehaviors
>                 sorted: false.
> +
> +       self environment allClassesDo: [:otherClass |
> +               (otherClass sharedPools includes: thisClass) ifTrue: [
> +                       result add: (ClassReference class: otherClass) ] ].
> +
> +       ^ result sort!
> -       theClass environment allClassesDo: [ :class |
> -               (class sharedPools includes: theClass) ifTrue: [
> -                       result add: (ClassReference class: class) ] ].
> -       ^result sort!
>
> Item was changed:
>   ----- Method: SystemNavigation>>browseAllCallsOnClass: (in category
> 'browse') -----
> + browseAllCallsOnClass: aBehaviorOrBinding
> - browseAllCallsOnClass: aBehavior
>         "Create and schedule a message browser on each method that refers
> to aBehavior."
>         "self default browseAllCallsOnClass: Array"
>
>         | behaviorName |
> +       behaviorName := aBehaviorOrBinding isBehavior
> +               ifTrue: [aBehaviorOrBinding theNonMetaClass name]
> +               ifFalse: [aBehaviorOrBinding key].
> -       behaviorName := aBehavior theNonMetaClass name.
>         self
> +               browseMessageList: [ self allCallsOnClass:
> aBehaviorOrBinding ]
> -               browseMessageList: [ self allCallsOnClass: aBehavior ]
>                 name: 'Users of ', behaviorName
>                 autoSelect: behaviorName!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190725/5dec02ec/attachment.html>


More information about the Squeak-dev mailing list