[vwnc] overridden selectors

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

[vwnc] overridden selectors

Holger Kleinsorgen-3
Hello,

today I was curious why sometimes methods are displayed as overriden
(=red) in the selector list part of the RB, and suddenly are displayed
as non-overriden (=black) when I click on them. I first suspected some
sort of caching in the RB, but it actually was caused by the override
machinery itself. The following code is used to determine if a method is
overriden:


MethodDefinition>>isOverridden
    ^Override isOverriddenSelector: selector class: implementingClass

Override class>>isOverriddenSelector: selector class: aClass
   "Answer true if the definition for aClassOrNameSpace has been
overridden."
       
   ^( self overriddenMethods at: aClass ifAbsent: [ ^false ] )
      includesKey: selector


The dictionary returned by "self overriddenMethods at: aClass" still has
an empty collection for the selector, so #includesKey: returns true.
But there is also the following gem:

Override class>>overridesForSelector: selector class: aClass

   | overs dict |
   overs := ( dict :=  self overriddenMethods at: aClass ifAbsent: [
^nil ]  )
      at: selector ifAbsent: [ ^nil ].

    overs isEmpty
       ifFalse: [ ^overs ].
    dict removeKey: selector.
    ^nil.

This method is used by some RB tools, so when clicking on the method,
the bogus dictionary entry disappears.

looks like a bug. seen in 7.4.1 and 7.6
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] overridden selectors

Paul Baumann
I saw this before too. It went away once ambiguous references were
fixed. Use Browse->Ambiguous References from the transcript window.

Paul Baumann


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Holger Kleinsorgen
Sent: Friday, May 02, 2008 8:49 AM
To: VWNC
Subject: [vwnc] overridden selectors

Hello,

today I was curious why sometimes methods are displayed as overriden
(=red) in the selector list part of the RB, and suddenly are displayed
as non-overriden (=black) when I click on them. I first suspected some
sort of caching in the RB, but it actually was caused by the override
machinery itself. The following code is used to determine if a method is
overriden:


MethodDefinition>>isOverridden
    ^Override isOverriddenSelector: selector class: implementingClass

Override class>>isOverriddenSelector: selector class: aClass
   "Answer true if the definition for aClassOrNameSpace has been
overridden."
       
   ^( self overriddenMethods at: aClass ifAbsent: [ ^false ] )
      includesKey: selector


The dictionary returned by "self overriddenMethods at: aClass" still has
an empty collection for the selector, so #includesKey: returns true.
But there is also the following gem:

Override class>>overridesForSelector: selector class: aClass

   | overs dict |
   overs := ( dict :=  self overriddenMethods at: aClass ifAbsent: [
^nil ]  )
      at: selector ifAbsent: [ ^nil ].

    overs isEmpty
       ifFalse: [ ^overs ].
    dict removeKey: selector.
    ^nil.

This method is used by some RB tools, so when clicking on the method,
the bogus dictionary entry disappears.

looks like a bug. seen in 7.4.1 and 7.6
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
 
--------------------------------------------------------
This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] overridden selectors

Holger Kleinsorgen-3
Paul Baumann schrieb:
> I saw this before too. It went away once ambiguous references were
> fixed. Use Browse->Ambiguous References from the transcript window.

found no ambigous references in the image
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] overridden selectors

Holger Kleinsorgen-3
cooking recipe (7.4.1)

- take a plain image, load store
- create Packages P1 and P2
- create a class C in P1, add a method to C
- publish P1 and P2
- save image
- move  C to P2
- publish P1 and P2
- exit
- load image
- load P2
- load P1

now C and its method will be displayed as overriden until one clicks on
them.
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc