Do not change existing class filenames when filing in a class (e.g. from CVS)
authorStefan Vogel <sv@exept.de>
Tue, 24 Oct 2006 09:31:38 +0200
changeset 10130 e16908ae50a8
parent 10129 6103c9187040
child 10131 b9f97a04561a
Do not change existing class filenames when filing in a class (e.g. from CVS)
ClassBuilder.st
--- a/ClassBuilder.st	Mon Oct 23 22:16:08 2006 +0200
+++ b/ClassBuilder.st	Tue Oct 24 09:31:38 2006 +0200
@@ -315,15 +315,13 @@
 !ClassBuilder methodsFor:'building'!
 
 buildClass
-
     "this is the main workhorse for installing new classes - special care
      has to be taken, when changing an existing classes definition. In this
      case, some or all of the methods and subclasses methods have to be
      recompiled.
      Also, the old class(es) are still kept (but not accessable as a global),
      to allow existing instances some life. 
-     This might change in the future.
-    "
+     This might change in the future."
 
     |newClass newMetaclass newComment sourceContainer|
 
@@ -517,16 +515,18 @@
     "/ for new classes, we are almost done here
     "/ (also for autoloaded classes)
 
-    sourceContainer := PeekableStream currentSourceContainer.
-    sourceContainer isFileStream ifTrue:[
-        newClass setClassFilename:sourceContainer pathName asFilename baseName.
-    ].
 
     (oldClass isNil or:[oldClass isLoaded not]) ifTrue:[
+        sourceContainer := PeekableStream currentSourceContainer.
+        sourceContainer isFileStream ifTrue:[
+            newClass setClassFilename:sourceContainer pathName asFilename baseName.
+        ].
         self handleNewlyCreatedClass:newClass.
         ^ newClass
     ].
 
+    newClass setClassFilename:oldClass getClassFilename.
+
     "/ here comes the hard part - we are actually changing the
     "/ definition of an existing class ....
     "/ Try hard to get away WITHOUT recompiling, since it is both slow
@@ -2130,5 +2130,5 @@
 !ClassBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.61 2006-10-23 13:58:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.62 2006-10-24 07:31:38 stefan Exp $'
 ! !