[FIX] FileIn problem with nil organization

Michael Rueger Michael.Rueger.-ND at disney.com
Thu Jul 29 01:25:05 UTC 1999


Attached is a quick fix to work around the nil organization problem
described in

> When I tried to load a few fileOut's from my then-pending 2.5 image, 
> ClassBehavior classComment:stamp: whined with a Message Not 
> Understood classComment: as variable "organization" was nil.

You should fileIn this fix before filing in any other code after
applying the updates.


Michael

-- 

 "To improve is to change, to be perfect is to change often." 
                                            Winston Churchill
+------------------------------------------------------------+
| Michael Rueger                                             |
| Phone: ++1 (818) 623 3283        Fax:   ++1 (818) 623 3559 |
+--------Michael.Rueger.-ND at online.disney.com----------------+
'From Squeak 2.4c of May 10, 1999 on 28 July 1999 at 6:19:01 pm'!

!ClassDescription methodsFor: 'fileIn/Out' stamp: 'mir 7/28/1999 18:15'!
classComment: aString stamp: aStamp
	"Store the comment, aString or Text or RemoteString, associated with the class we are organizing.  Empty string gets stored only if had a non-empty one before."

	| ptr header file oldCommentRemoteStr |
	(aString isKindOf: RemoteString) ifTrue: [^ organization classComment: aString].
	oldCommentRemoteStr _ self organization commentRemoteStr.
	(aString size = 0) & (oldCommentRemoteStr == nil) ifTrue: [^ organization classComment: nil].
		"never had a class comment, no need to write empty string out"

	ptr _ oldCommentRemoteStr ifNil: [0] ifNotNil: [oldCommentRemoteStr sourcePointer].
	SourceFiles ifNotNil: [(file _ SourceFiles at: 2) ifNotNil: [
		file setToEnd; cr; nextPut: $!!.	"directly"
		"Should be saying (file command: 'H3') for HTML, but ignoring it here"
		header _ String streamContents: [:strm | strm nextPutAll: self name;
			nextPutAll: ' commentStamp: '.
			aStamp storeOn: strm.
			strm nextPutAll: ' prior: '; nextPutAll: ptr printString].
		file nextChunkPut: header]].
	aStamp size > 0 ifTrue: [self commentStamp: aStamp].
	organization classComment: (RemoteString newString: aString onFileNumber: 2).
	Smalltalk changes commentClass: self.	! !





More information about the Squeak-dev mailing list