dont forget to rename private classes as well.
authorClaus Gittinger <cg@exept.de>
Fri, 14 Feb 1997 18:59:06 +0100
changeset 2405 939f4e751ef3
parent 2404 77c6111ce6ba
child 2406 ca517087511a
dont forget to rename private classes as well.
Smalltalk.st
--- a/Smalltalk.st	Fri Feb 14 18:28:58 1997 +0100
+++ b/Smalltalk.st	Fri Feb 14 18:59:06 1997 +0100
@@ -11,15 +11,15 @@
 "
 
 Object subclass:#Smalltalk
-        instanceVariableNames:''
-        classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath
-                StartupClass StartupSelector StartupArguments CommandLine
-                CommandLineArguments CachedAbbreviations SilentLoading
-                Initializing StandAlone LogDoits LoadBinaries RealSystemPath
-                ResourcePath SourcePath BitmapPath BinaryPath FileInPath
-                ImageStartTime ImageRestartTime DemoMode'
-        poolDictionaries:''
-        category:'System-Support'
+	instanceVariableNames:''
+	classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses SystemPath
+		StartupClass StartupSelector StartupArguments CommandLine
+		CommandLineArguments CachedAbbreviations SilentLoading
+		Initializing StandAlone LogDoits LoadBinaries RealSystemPath
+		ResourcePath SourcePath BitmapPath BinaryPath FileInPath
+		ImageStartTime ImageRestartTime DemoMode'
+	poolDictionaries:''
+	category:'System-Support'
 !
 
 !Smalltalk class methodsFor:'documentation'!
@@ -707,7 +707,11 @@
      oldNameSpace newNameSpace oldBaseName privateClasses|
 
     oldName := aClass name.
-    oldNameSpace := aClass nameSpace.
+    aClass isPrivate ifTrue:[
+        oldNameSpace := aClass topOwningClass nameSpace.
+    ] ifFalse:[
+        oldNameSpace := aClass nameSpace.
+    ].
     oldBaseName := aClass nameWithoutNameSpacePrefix.
     oldSym := oldName asSymbol.
     privateClasses := aClass privateClasses.
@@ -787,16 +791,21 @@
 
     aClass addChangeRecordForClassRename:oldSym to:newSym.
 
-    newNameSpace := aClass nameSpace.
+    aClass isPrivate ifTrue:[
+        newNameSpace := aClass topOwningClass nameSpace.
+    ] ifFalse:[    
+        newNameSpace := aClass nameSpace.
+    ].
+
+    privateClasses notNil ifTrue:[
+        "/ must rename privateClasses as well
+        privateClasses do:[:aPrivateClass |
+            self renameClass:aPrivateClass
+                 to:(newSym , '::' , aPrivateClass nameWithoutPrefix)   
+        ]
+    ].
+
     oldNameSpace ~~ newNameSpace ifTrue:[
-        privateClasses notNil ifTrue:[
-            "/ must rename privateClasses as well
-            privateClasses do:[:aPrivateClass |
-                self renameClass:aPrivateClass
-                     to:(newNameSpace name , '::' , aPrivateClass nameWithoutNameSpacePrefix)   
-            ]
-        ].
-
         "/ all those referencing the class from the old nameSpace
         "/ must be recompiled ...
         "/ (to now access the global from smalltalk)
@@ -825,7 +834,7 @@
 
     "Created: 29.10.1995 / 19:58:32 / cg"
     "Modified: 18.6.1996 / 14:20:50 / stefan"
-    "Modified: 29.1.1997 / 23:26:57 / cg"
+    "Modified: 14.2.1997 / 18:56:38 / cg"
 ! !
 
 !Smalltalk class methodsFor:'copying'!
@@ -3610,5 +3619,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.225 1997-02-12 01:22:02 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.226 1997-02-14 17:59:06 cg Exp $'
 ! !