Metaclass.st
changeset 9175 2d009bbc418b
parent 8765 97227ad9480c
child 9197 e900514c8065
--- a/Metaclass.st	Tue Feb 21 14:20:02 2006 +0100
+++ b/Metaclass.st	Tue Feb 21 14:20:50 2006 +0100
@@ -379,11 +379,11 @@
     "append an expression on aStream, which defines myself."
 
     |s owner ns nsName fullName forceNoNameSpace superNameWithoutNameSpacePrefix cls topOwner
-     superclass superclassNamespace nm useStoreString BOLD_ON BOLD_OFF|
+     superclass superclassNamespace nm useStoreString boldOn boldOff|
 
     syntaxHilighting ifTrue:[
-        BOLD_ON := [aStream bold].
-        BOLD_OFF := [aStream normal].
+        boldOn := [aStream bold].
+        boldOff := [aStream normal].
     ].
 
     fullName := FileOutNameSpaceQuerySignal query == true.
@@ -416,9 +416,9 @@
                     nsName := '''' , nsName , ''''
                 ].
                 aStream nextPutAll:'"{ NameSpace: '.
-                BOLD_ON value.
+                boldOn value.
                 aStream nextPutAll:nsName.
-                BOLD_OFF value.
+                boldOff value.
                 aStream nextPutAll:' }"'; cr; cr.
             ]
         ].
@@ -430,9 +430,22 @@
         s := 'nil'
     ] ifFalse:[
         superclassNamespace := superclass nameSpace.
-
         fullName ifTrue:[
             s := superclass name.
+            "/ be careful: if the superclasses ns is Smalltalk,
+            "/ AND this is the definition of a private class,
+            "/ AND a private class with the same name as my superclas
+            "/ exists in my owning class,
+            "/ THEN we MUST add the smalltalk-prefix.
+            "/ (otherwise, we get the private class as superclass when accepting the
+            "/  next time)
+            owner notNil ifTrue:[
+                superclassNamespace == Smalltalk ifTrue:[
+                    (owner privateClassesAt:superclass name) notNil ifTrue:[
+                        s := superclass nameWithNameSpacePrefix.
+                    ].
+                ].
+            ].
         ] ifFalse:[
             (ns == superclassNamespace 
             and:[superclass owningClass isNil]) ifTrue:[
@@ -493,9 +506,9 @@
         ]
     ].
 
-    BOLD_ON value.
+    boldOn value.
     aStream nextPutAll:s.   "/ superclass
-    BOLD_OFF value.
+    boldOff value.
     aStream space.
     aClass basicFileOutInstvarTypeKeywordOn:aStream.
 
@@ -513,32 +526,32 @@
     useStoreString ifTrue:[
         aStream nextPutAll:''''.
     ].
-    BOLD_ON value.
+    boldOn value.
     aStream nextPutAll:nm.
-    BOLD_OFF value.
+    boldOff value.
     useStoreString ifTrue:[
         aStream nextPutAll:''''.
     ].
 
     aStream crtab. 
     aStream nextPutAll:'instanceVariableNames:'''.
-    BOLD_ON value.
+    boldOn value.
     aClass printInstVarNamesOn:aStream indent:16.
-    BOLD_OFF value.
+    boldOff value.
     aStream nextPutAll:''''.
 
     aStream crtab.
     aStream nextPutAll:'classVariableNames:'''.
-    BOLD_ON value.
+    boldOn value.
     aClass printClassVarNamesOn:aStream indent:16.
-    BOLD_OFF value.
+    boldOff value.
     aStream nextPutAll:''''.
 
     aStream crtab.
     aStream nextPutAll:'poolDictionaries:'''.
-    BOLD_ON value.
+    boldOn value.
     aClass printSharedPoolNamesOn:aStream indent:16.
-    BOLD_OFF value.
+    boldOff value.
     aStream nextPutAll:''''.
 
     aStream crtab.
@@ -554,14 +567,14 @@
     ] ifFalse:[
         "/ a private class
         aStream nextPutAll:'privateIn:'.
-        BOLD_ON value.
+        boldOn value.
         fullName ifTrue:[
             s := owner name.
         ] ifFalse:[
             s := owner nameWithoutNameSpacePrefix.
         ].
         aStream nextPutAll:s.
-        BOLD_OFF value.
+        boldOff value.
     ].
     aStream cr
 
@@ -818,7 +831,7 @@
 !Metaclass class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.192 2005-03-01 17:58:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Metaclass.st,v 1.193 2006-02-21 13:20:50 cg Exp $'
 ! !
 
 Metaclass initialize!