ClassDefinitionChange.st
changeset 1904 d025e9f1cb8b
parent 1887 8dac6c403660
child 1909 ec92c9dabf66
--- a/ClassDefinitionChange.st	Mon Nov 13 13:04:07 2006 +0100
+++ b/ClassDefinitionChange.st	Mon Nov 13 17:29:06 2006 +0100
@@ -303,11 +303,23 @@
 
 isPrivateClassDefinitionChange
     private isNil ifTrue:[
-        self setupFromSource.
+        (className includes:$:) ifFalse:[
+            "/ cannot be private
+            private := false
+        ] ifTrue:[
+            (self changeClass notNil
+            and:[self changeClass isLoaded not]) ifTrue:[
+                "/ cannot be private
+                private := false
+            ] ifTrue:[
+                self setupFromSource.
+            ].
+        ].
     ].
     ^ private
 
     "Created: / 11-10-2006 / 14:19:03 / cg"
+    "Modified: / 13-11-2006 / 17:04:32 / cg"
 !
 
 owningClassName
@@ -328,7 +340,7 @@
      Skip private classes.
      Enter class file name as abbreviation"
 
-    |parseTree sel cat clsName cls catIdx|
+    |parseTree sel cat clsName cls catIdx pkg|
 
     parseTree := Parser parseExpression:self source.
     parseTree isMessage ifFalse:[
@@ -345,12 +357,14 @@
 
     clsName := self className asSymbol.
     cls := Smalltalk at:clsName.
+
+    pkg := package ? Project current package.   
+
     (cls isNil 
      or:[cls isBehavior not
      or:[cls isLoaded not]]) ifTrue:[
-        |pkg autoloadedClass|
+        |autoloadedClass|
 
-        pkg := package ? Project current package.   
         autoloadedClass := Smalltalk 
            installAutoloadedClassNamed:clsName 
            category:cat 
@@ -360,9 +374,17 @@
             autoloadedClass setClassFilename:aFilenameString.
             "/ Smalltalk setFilename:aFilenameString forClass:clsName package:pkg.
         ]
-    ]
+    ] ifFalse:[
+        cls notNil ifTrue:[
+            cls isBehavior ifTrue:[
+                cls package ~= pkg ifTrue:[
+Transcript showCR:'oops - package change in ',clsName.
+                ]
+            ].
+        ].
+    ].
 
-    "Modified: / 06-10-2006 / 13:10:05 / cg"
+    "Modified: / 13-11-2006 / 17:18:50 / cg"
 !
 
 setupFromSource
@@ -397,5 +419,5 @@
 !ClassDefinitionChange class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.43 2006-10-26 17:37:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic3/ClassDefinitionChange.st,v 1.44 2006-11-13 16:29:06 cg Exp $'
 ! !