openErrorSignal arg: always a string
authorClaus Gittinger <cg@exept.de>
Thu, 01 Apr 2004 13:53:57 +0200
changeset 8281 76b406c7cc2b
parent 8280 0caa2f092e45
child 8282 b209958b06aa
openErrorSignal arg: always a string
Class.st
--- a/Class.st	Thu Apr 01 13:52:36 2004 +0200
+++ b/Class.st	Thu Apr 01 13:53:57 2004 +0200
@@ -2196,9 +2196,9 @@
      mySourceFileName sameFile s mySourceFileID anySourceRef|
 
     self isLoaded ifFalse:[
-	^ FileOutErrorSignal 
-	    raiseRequestWith:self
-		 errorString:' - will not fileOut unloaded class: ', self name
+        ^ FileOutErrorSignal 
+            raiseRequestWith:self
+                 errorString:' - will not fileOut unloaded class: ', self name
     ].
 
     fileName := fileNameString asFilename.
@@ -2209,87 +2209,87 @@
      and, if that worked rename afterwards ...
     "
     (fileName exists) ifTrue:[
-	sameFile := false.
-
-	"/ check carefully - maybe, my source does not really come from that
-	"/ file (i.e. all of my methods have their source as string)
-
-	anySourceRef := false.
-	self instAndClassMethodsDo:[:m |
-	    m sourcePosition notNil ifTrue:[
-		anySourceRef := true
-	    ]
-	].
-
-	anySourceRef ifTrue:[
-	    s := self sourceStream.
-	    s notNil ifTrue:[
-		mySourceFileID := s pathName asFilename info id.
-		sameFile := (fileName info id) == mySourceFileID.
-		s close.
-	    ] ifFalse:[
-		classFilename notNil ifTrue:[
-		    "
-		     check for overwriting my current source file
-		     this is not allowed, since it would clobber my methods source
-		     file ... you have to save it to some other place.
-		     This happens if you ask for a fileOut into the source-directory
-		     (from which my methods get their source)
-		    "
-		    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
-		    sameFile := (fileNameString = mySourceFileName).
-		    sameFile ifFalse:[
-			mySourceFileName notNil ifTrue:[
-			    sameFile := (fileName info id) == (mySourceFileName asFilename info id)
-			]
-		    ].
-		]
-	    ].
-	].
-
-	sameFile ifTrue:[
-	    ^ FileOutErrorSignal 
-		raiseRequestWith:fileNameString
-		errorString:(' - may not overwrite sourcefile:', fileNameString)
-	].
-
-	savFilename := Filename newTemporary.
-	fileName copyTo:savFilename.
-	newFileName := fileName withSuffix:'new'.
-	needRename := true
+        sameFile := false.
+
+        "/ check carefully - maybe, my source does not really come from that
+        "/ file (i.e. all of my methods have their source as string)
+
+        anySourceRef := false.
+        self instAndClassMethodsDo:[:m |
+            m sourcePosition notNil ifTrue:[
+                anySourceRef := true
+            ]
+        ].
+
+        anySourceRef ifTrue:[
+            s := self sourceStream.
+            s notNil ifTrue:[
+                mySourceFileID := s pathName asFilename info id.
+                sameFile := (fileName info id) == mySourceFileID.
+                s close.
+            ] ifFalse:[
+                classFilename notNil ifTrue:[
+                    "
+                     check for overwriting my current source file
+                     this is not allowed, since it would clobber my methods source
+                     file ... you have to save it to some other place.
+                     This happens if you ask for a fileOut into the source-directory
+                     (from which my methods get their source)
+                    "
+                    mySourceFileName := Smalltalk getSourceFileName:classFilename. 
+                    sameFile := (fileNameString = mySourceFileName).
+                    sameFile ifFalse:[
+                        mySourceFileName notNil ifTrue:[
+                            sameFile := (fileName info id) == (mySourceFileName asFilename info id)
+                        ]
+                    ].
+                ]
+            ].
+        ].
+
+        sameFile ifTrue:[
+            ^ FileOutErrorSignal 
+                raiseRequestWith:fileNameString
+                errorString:(' - may not overwrite sourcefile:', fileNameString)
+        ].
+
+        savFilename := Filename newTemporary.
+        fileName copyTo:savFilename.
+        newFileName := fileName withSuffix:'new'.
+        needRename := true
     ] ifFalse:[
-	"/ another possible trap: if my sourceFileName is
-	"/ the same as the written one AND the new files directory
-	"/ is along the sourcePath, we also need a temporary file
-	"/ first, to avoid accessing the newly written file.
-
-	anySourceRef := false.
-	self instAndClassMethodsDo:[:m |
-	    |mSrc|
-
-	    (mSrc := m sourceFilename) notNil ifTrue:[
-		mSrc asFilename baseName = fileName baseName ifTrue:[
-		    anySourceRef := true
-		]
-	    ]
-	].
-	anySourceRef ifTrue:[
-	    newFileName := fileName withSuffix:'new'.
-	    needRename := true
-	] ifFalse:[
-	    newFileName := fileName.
-	    needRename := false
-	]
+        "/ another possible trap: if my sourceFileName is
+        "/ the same as the written one AND the new files directory
+        "/ is along the sourcePath, we also need a temporary file
+        "/ first, to avoid accessing the newly written file.
+
+        anySourceRef := false.
+        self instAndClassMethodsDo:[:m |
+            |mSrc|
+
+            (mSrc := m sourceFilename) notNil ifTrue:[
+                mSrc asFilename baseName = fileName baseName ifTrue:[
+                    anySourceRef := true
+                ]
+            ]
+        ].
+        anySourceRef ifTrue:[
+            newFileName := fileName withSuffix:'new'.
+            needRename := true
+        ] ifFalse:[
+            newFileName := fileName.
+            needRename := false
+        ]
     ].
     [
-	aStream := newFileName writeStream.
+        aStream := newFileName writeStream.
     ] on:FileStream openErrorSignal do:[:ex|
-	savFilename notNil ifTrue:[
-	    savFilename delete
-	].
-	^ FileOutErrorSignal 
-		raiseRequestWith:newFileName
-		errorString:(' - cannot create file:', newFileName name)
+        savFilename notNil ifTrue:[
+            savFilename delete
+        ].
+        ^ FileOutErrorSignal 
+                raiseRequestWith:newFileName name
+                errorString:(' - cannot create file:', newFileName name)
     ].
     self fileOutOn:aStream.
     aStream close.
@@ -2300,11 +2300,11 @@
      we have to do a copy ...
     "
     needRename ifTrue:[
-	newFileName copyTo:fileName.
-	newFileName delete
+        newFileName copyTo:fileName.
+        newFileName delete
     ].
     savFilename notNil ifTrue:[
-	savFilename delete
+        savFilename delete
     ].
 
     "
@@ -2757,18 +2757,18 @@
     |aStream fileName|
 
     self isLoaded ifFalse:[
-	^ FileOutErrorSignal 
-	    raiseRequestWith:self
-		 errorString:' - will not fileOut unloaded class: ', self name
+        ^ FileOutErrorSignal 
+            raiseRequestWith:self
+                 errorString:' - will not fileOut unloaded class: ', self name
     ].
 
     fileName := fileNameOrString asFilename.
     [
-	aStream := fileName writeStream.
+        aStream := fileName writeStream.
     ] on:FileStream openErrorSignal do:[:ex|
-	^ FileOutErrorSignal 
-		raiseRequestWith:fileName
-		errorString:(' - cannot create file: ', fileName name)
+        ^ FileOutErrorSignal 
+                raiseRequestWith:fileName name
+                errorString:(' - cannot create file: ', fileName name)
     ].
     self fileOutXMLOn:aStream.
     aStream close.
@@ -4698,5 +4698,5 @@
 !Class class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.469 2004-03-30 18:53:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.470 2004-04-01 11:53:57 cg Exp $'
 ! !