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

45 views
Skip to first unread message

Gabriel Cotelli

unread,
Sep 19, 2011, 4:06:57 PM9/19/11
to va-sma...@googlegroups.com
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

John O'Keefe

unread,
Oct 4, 2011, 4:48:26 PM10/4/11
to va-sma...@googlegroups.com
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

John O'Keefe

unread,
Jun 6, 2014, 11:23:36 AM6/6/14
to va-sma...@googlegroups.com
Fixed in V8.6.1.
Reply all
Reply to author
Forward
0 new messages