[BUG?][FIX?] Class>>rename:

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Wed May 31 15:32:15 UTC 2000


In Class>>rename:, if the name is in Undeclared, the class is not renamed,
although the notifier suggests it should be renamed anyway. I'd say that's
a bug (just had that problem). Fix attached. Any objections?

-- Bert
-------------- next part --------------
'From Squeak2.8alpha of 18 January 2000 [latest update: #2210] on 31 May 2000 at 5:31:29 pm'!
"Change Set:		classRename-bf
Date:			31 May 2000
Author:			Bert Freudenberg

Renames a class even if it is declared undeclared. Huh?"!


!Class methodsFor: 'class name' stamp: 'bf 5/31/2000 17:24'!
rename: aString
	"The new name of the receiver is the argument, aString."

	| newName |
	(newName _ aString asSymbol) ~= self name
		ifTrue:
			[(Smalltalk includesKey: newName)
				ifTrue: [^self error: newName , ' already exists'].
			(Undeclared includesKey: newName)
				ifTrue: [SelectionMenu notify: 'There are references to, ' , aString printString , '
from Undeclared. Check them after this change.'].
			Smalltalk renameClass: self as: newName.
			name _ newName]! !



More information about the Squeak-dev mailing list