Andreas Raab uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ar.278.mcz ==================== Summary ==================== Name: System-ar.278 Author: ar Time: 5 March 2010, 8:13:05.989 pm UUID: c61c013d-92df-0840-8c5c-b7e37dec6722 Ancestors: System-ar.277 Update handling of class rename and removal in the new Smalltalk/SystemDictionary scheme. =============== Diff against System-ar.277 =============== Item was changed: ----- Method: SystemDictionary>>renameClass:from: (in category 'class names') ----- renameClass: aClass from: oldName "Rename the class, aClass, to have the title newName." | oldref newName category | newName := aClass name. category := SystemOrganization categoryOfElement: oldName. + self organization classify: newName under: category. + self organization removeElement: oldName. - SystemOrganization classify: newName under: category. - SystemOrganization removeElement: oldName. oldref := self associationAt: oldName. self removeKey: oldName. oldref key: newName. self add: oldref. "Old association preserves old refs" + Smalltalk renamedClass: aClass from: oldName to: newName. - (Array with: StartUpList with: ShutDownList) do: - [:list | | i | i := list indexOf: oldName ifAbsent: [0]. - i > 0 ifTrue: [list at: i put: newName]]. self flushClassNameCache. - SystemChangeNotifier uniqueInstance classRenamed: aClass from: oldName to: newName inCategory: category! Item was changed: ----- Method: SmalltalkImage>>renameClass:as: (in category 'classes and traits') ----- renameClass: aClass as: newName "Rename the class, aClass, to have the title newName." + + ^globals renameClass: aClass as: newName! - "Original one I want to keep but needs to be fixed" - - | oldref oldName category | - oldName := aClass name. - category := aClass category. - SystemOrganization classify: newName under: aClass category. - SystemOrganization removeElement: aClass name. - oldref := self associationAt: aClass name. - self removeKey: aClass name. - oldref key: newName. - self add: oldref. "Old association preserves old refs" - (Array with: StartUpList with: ShutDownList) do: - [:list | | i | i := list indexOf: aClass name ifAbsent: [0]. - i > 0 ifTrue: [list at: i put: newName]]. - self flushClassNameCache. - SystemChangeNotifier uniqueInstance classRenamed: aClass from: oldName to: newName inCategory: category! Item was added: + ----- Method: SmalltalkImage>>renamedClass:from:to: (in category 'classes and traits') ----- + renamedClass: aClass from: oldName to: newName + "Inform Smalltalk that aClass has been renamed" + (Array with: StartUpList with: ShutDownList) do:[:list | | index | + index := list indexOf: oldName ifAbsent: [0]. + index > 0 ifTrue: [list at: index put: newName]. + ]. + ! Item was changed: ----- Method: SmalltalkImage>>organization (in category 'accessing') ----- organization "Return the organizer for the receiver" + ^globals organization! - ^SystemOrganization! Item was changed: ----- Method: SystemDictionary>>forgetClass:logged: (in category 'class and trait names') ----- forgetClass: aClass logged: aBool "Delete the class, aClass, from the system. Note that this doesn't do everything required to dispose of a class - to do that use Class>>removeFromSystem." + aBool ifTrue: [SystemChangeNotifier uniqueInstance classRemoved: aClass fromCategory: aClass category]. + self organization removeElement: aClass name. + Smalltalk removeFromStartUpList: aClass. + Smalltalk removeFromShutDownList: aClass. - aBool ifTrue: [SystemChangeNotifier uniqueInstance classRemoved: aClass fromCategory: aClass category]. - SystemOrganization removeElement: aClass name. - self removeFromStartUpList: aClass. - self removeFromShutDownList: aClass. self removeKey: aClass name ifAbsent: []. + self flushClassNameCache.! - self flushClassNameCache! Item was changed: ----- Method: SmalltalkImage>>renameClass:from: (in category 'classes and traits') ----- + renameClass: aClass from: oldName - renameClass: aClass from: oldName "Rename the class, aClass, to have the title newName." - | oldref newName category | - newName := aClass name. - category := SystemOrganization categoryOfElement: oldName. - SystemOrganization classify: newName under: category. - SystemOrganization removeElement: oldName. - oldref := self associationAt: oldName. - self removeKey: oldName. - oldref key: newName. - self add: oldref. "Old association preserves old refs" - (Array with: StartUpList with: ShutDownList) do: - [:list | | i | i := list indexOf: oldName ifAbsent: [0]. - i > 0 ifTrue: [list at: i put: newName]]. - self flushClassNameCache. + ^globals renameClass: aClass from: oldName! - SystemChangeNotifier uniqueInstance classRenamed: aClass from: oldName to: newName inCategory: category! Item was changed: ----- Method: SystemDictionary>>renameClass:as: (in category 'class and trait names') ----- renameClass: aClass as: newName "Rename the class, aClass, to have the title newName." "Original one I want to keep but needs to be fixed" | oldref oldName category | oldName := aClass name. category := aClass category. + self organization classify: newName under: aClass category. + self organization removeElement: aClass name. - SystemOrganization classify: newName under: aClass category. - SystemOrganization removeElement: aClass name. oldref := self associationAt: aClass name. self removeKey: aClass name. oldref key: newName. self add: oldref. "Old association preserves old refs" + Smalltalk renamedClass: aClass from: aClass name to: newName. - (Array with: StartUpList with: ShutDownList) do: - [:list | | i | i := list indexOf: aClass name ifAbsent: [0]. - i > 0 ifTrue: [list at: i put: newName]]. self flushClassNameCache. SystemChangeNotifier uniqueInstance classRenamed: aClass from: oldName to: newName inCategory: category! Item was changed: ----- Method: SmalltalkImage>>forgetClass:logged: (in category 'classes and traits') ----- forgetClass: aClass logged: aBool + "Delete the class, aClass, from the system." - "Delete the class, aClass, from the system. - Note that this doesn't do everything required to dispose of a class - to do that use Class>>removeFromSystem." + ^globals forgetClass: aClass logged: aBool! - aBool ifTrue: [SystemChangeNotifier uniqueInstance classRemoved: aClass fromCategory: aClass category]. - SystemOrganization removeElement: aClass name. - self removeFromStartUpList: aClass. - self removeFromShutDownList: aClass. - self removeKey: aClass name ifAbsent: []. - self flushClassNameCache! |
Free forum by Nabble | Edit this page |