Possible Bug in VariableEnvironment ?? (Used in the Refactoring Browser Model)

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

Possible Bug in VariableEnvironment ?? (Used in the Refactoring Browser Model)

Gabriel Cotelli
Hi,

I think there's some problem here:

VariableEnvironment>>includesClass: aClass 
(super includesClass: aClass) ifFalse: [^false].
(instanceVariables includesKey: aClass) ifTrue: [^true].
(classVariables includesKey: aClass) ifTrue: [^true].
^((self selectorCacheFor: aClass) 
detect: [:each | self includesSelector: each in: aClass]
ifNone: [nil]) notNil

From what I understand instanceVariables and classVariables dictionaries uses the class names as keys (not the class itself). See for example "addClass: aClass classVariable: aSymbol ".

This part:
(instanceVariables includesKey: aClass) ifTrue: [^true].
(classVariables includesKey: aClass) ifTrue: [^true].
never returns true. 
Maybe it should be:
(instanceVariables includesKey: aClass name) ifTrue: [^true].
(classVariables includesKey: aClass name) ifTrue: [^true].
?

Regards,
Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/0mSDKIk6oPoJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug in VariableEnvironment ?? (Used in the Refactoring Browser Model)

John O'Keefe-3
Gabriel -
 
You are correct -- this has been broken since 1999 (at least).  I've opened case 48803 to track the fix (and an update to the RB's SUnit tests, since they should have caught this).
 
John

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/_4t44S4iExEJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug in VariableEnvironment ?? (Used in the Refactoring Browser Model)

John O'Keefe-3
In reply to this post by Gabriel Cotelli
Fixed in V8.6.1.

On Monday, September 19, 2011 4:06:57 PM UTC-4, Gabriel Cotelli wrote:
Hi,

I think there's some problem here:

VariableEnvironment>>includesClass: aClass 
(super includesClass: aClass) ifFalse: [^false].
(instanceVariables includesKey: aClass) ifTrue: [^true].
(classVariables includesKey: aClass) ifTrue: [^true].
^((self selectorCacheFor: aClass) 
detect: [:each | self includesSelector: each in: aClass]
ifNone: [nil]) notNil

From what I understand instanceVariables and classVariables dictionaries uses the class names as keys (not the class itself). See for example "addClass: aClass classVariable: aSymbol ".

This part:
(instanceVariables includesKey: aClass) ifTrue: [^true].
(classVariables includesKey: aClass) ifTrue: [^true].
never returns true. 
Maybe it should be:
(instanceVariables includesKey: aClass name) ifTrue: [^true].
(classVariables includesKey: aClass name) ifTrue: [^true].
?

Regards,
Gabriel

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.