|
|
 |
squeak-list
Fix OB refactoring: Creating accessor change the instance/class variable
by Mathieu Suen other posts by this author
Aug 11 2007 6:00AM messages near this date
Re: OT (slightly) - Linux on a MacBookPro
|
Re: Fix OB refactoring: Creating accessor change the instance/class variable
Hi,
If you use the refactoring create accessor for instance or class
variable some time fails:
If you have a class define as:
Object subclass: #A
instanceVariableNames: 'c b'
classVariableNames: ''
poolDictionaries: ''
category: 'Dummy'
And add A> >b: by hand.
After create the accessor for c with the refactoring in omnibrowser.
"A new b: 3" will affect c and not b.
This is because ob-refactoring sort the instance variable to display
in the alphabetical order:
ORCmdRefactoring> >instanceVariables
^ (target isKindOf: OBInstanceVariableNode)
ifTrue: [ Array with: target name ]
ifFalse: [ target theClass instVarNames asArray sort ]
I have patched this method with the #asSortedArray. See the attached
file
I think is the method #asArray who make the mess if you look at the
implementation of Array> >#asArray.
I would rather expect a copy of self.
I have open an issue: http://bugs.squeak.org/view.php?id=6602
Thread:
Mathieu Suen
Lukas Renggli
|
|
|
 |
|