9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 |
12 |
13 Object subclass:#Smalltalk |
13 Object subclass:#Smalltalk |
14 instanceVariableNames:'' |
14 instanceVariableNames:'' |
15 classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath |
15 classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath |
16 StartupClass StartupSelector StartupArguments CommandLine |
16 StartupClass StartupSelector StartupArguments CommandLine |
17 CommandLineArguments CachedAbbreviations SilentLoading |
17 CommandLineArguments CachedAbbreviations SilentLoading |
18 Initializing StandAlone LogDoits LoadBinaries RealSystemPath |
18 Initializing StandAlone LogDoits LoadBinaries RealSystemPath |
19 ResourcePath SourcePath BitmapPath BinaryPath FileInPath |
19 ResourcePath SourcePath BitmapPath BinaryPath FileInPath |
20 ImageStartTime ImageRestartTime DemoMode' |
20 ImageStartTime ImageRestartTime DemoMode' |
21 poolDictionaries:'' |
21 poolDictionaries:'' |
22 category:'System-Support' |
22 category:'System-Support' |
23 ! |
23 ! |
24 |
24 |
25 !Smalltalk class methodsFor:'documentation'! |
25 !Smalltalk class methodsFor:'documentation'! |
26 |
26 |
27 copyright |
27 copyright |
705 |
705 |
706 |oldName oldSym newSym names oldCVSym newCVSym value oldNameToNewName |
706 |oldName oldSym newSym names oldCVSym newCVSym value oldNameToNewName |
707 oldNameSpace newNameSpace oldBaseName privateClasses| |
707 oldNameSpace newNameSpace oldBaseName privateClasses| |
708 |
708 |
709 oldName := aClass name. |
709 oldName := aClass name. |
710 oldNameSpace := aClass nameSpace. |
710 aClass isPrivate ifTrue:[ |
|
711 oldNameSpace := aClass topOwningClass nameSpace. |
|
712 ] ifFalse:[ |
|
713 oldNameSpace := aClass nameSpace. |
|
714 ]. |
711 oldBaseName := aClass nameWithoutNameSpacePrefix. |
715 oldBaseName := aClass nameWithoutNameSpacePrefix. |
712 oldSym := oldName asSymbol. |
716 oldSym := oldName asSymbol. |
713 privateClasses := aClass privateClasses. |
717 privateClasses := aClass privateClasses. |
714 |
718 |
715 ((self at:oldSym) ~~ aClass) ifTrue:[ |
719 ((self at:oldSym) ~~ aClass) ifTrue:[ |
785 "/ ] |
789 "/ ] |
786 ]. |
790 ]. |
787 |
791 |
788 aClass addChangeRecordForClassRename:oldSym to:newSym. |
792 aClass addChangeRecordForClassRename:oldSym to:newSym. |
789 |
793 |
790 newNameSpace := aClass nameSpace. |
794 aClass isPrivate ifTrue:[ |
|
795 newNameSpace := aClass topOwningClass nameSpace. |
|
796 ] ifFalse:[ |
|
797 newNameSpace := aClass nameSpace. |
|
798 ]. |
|
799 |
|
800 privateClasses notNil ifTrue:[ |
|
801 "/ must rename privateClasses as well |
|
802 privateClasses do:[:aPrivateClass | |
|
803 self renameClass:aPrivateClass |
|
804 to:(newSym , '::' , aPrivateClass nameWithoutPrefix) |
|
805 ] |
|
806 ]. |
|
807 |
791 oldNameSpace ~~ newNameSpace ifTrue:[ |
808 oldNameSpace ~~ newNameSpace ifTrue:[ |
792 privateClasses notNil ifTrue:[ |
|
793 "/ must rename privateClasses as well |
|
794 privateClasses do:[:aPrivateClass | |
|
795 self renameClass:aPrivateClass |
|
796 to:(newNameSpace name , '::' , aPrivateClass nameWithoutNameSpacePrefix) |
|
797 ] |
|
798 ]. |
|
799 |
|
800 "/ all those referencing the class from the old nameSpace |
809 "/ all those referencing the class from the old nameSpace |
801 "/ must be recompiled ... |
810 "/ must be recompiled ... |
802 "/ (to now access the global from smalltalk) |
811 "/ (to now access the global from smalltalk) |
803 |
812 |
804 oldNameSpace ~~ Smalltalk ifTrue:[ |
813 oldNameSpace ~~ Smalltalk ifTrue:[ |