[Pkg] The Trunk: System-mt.840.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jul 22 08:39:09 UTC 2016


Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.840.mcz

==================== Summary ====================

Name: System-mt.840
Author: mt
Time: 22 July 2016, 10:38:45.135908 am
UUID: 6ab5c492-6207-3e4f-b2df-8028d64fcf94
Ancestors: System-mt.839

Fixes a bug when filing out change sets with changed class definitions. The bug was that the concept of "fat class definition", which merges old and new inst vars for the loading process, did not account for existing vars in the super class.

=============== Diff against System-mt.839 ===============

Item was changed:
  ----- Method: ChangeSet>>fatDefForClass: (in category 'class changes') -----
  fatDefForClass: class
  
+ 	| newDef oldDef oldStrm newStrm outStrm oldVars newVars addedVars superVars |
- 	| newDef oldDef oldStrm newStrm outStrm oldVars newVars addedVars |
  	
  	class isBehavior ifFalse: [^class definition].
  	
  	newDef := class definition.
  	oldDef := (self changeRecorderFor: class) priorDefinition.
  	oldDef ifNil: [^ newDef].
  	oldDef = newDef ifTrue: [^ newDef].
  
  	oldStrm := ReadStream on: oldDef.
  	newStrm := ReadStream on: newDef.
  	outStrm := WriteStream on: (String new: newDef size * 2).
  
  	"Merge inst vars from old and new defs..."
  	oldStrm upToAll: 'instanceVariableNames'; upTo: $'.
  	outStrm 
  		nextPutAll: (newStrm upToAll: 'instanceVariableNames'); 
  		nextPutAll: 'instanceVariableNames:'.
  	newStrm peek = $: ifTrue: [newStrm next].	"may or may not be there, but already written"
  	outStrm
  		nextPutAll: (newStrm upTo: $'); nextPut: $'.
  	oldVars := (oldStrm upTo: $') findTokens: Character separators.
  	newVars := (newStrm upTo: $') findTokens: Character separators.
  	addedVars := oldVars asSet addAll: newVars; removeAll: oldVars; asOrderedCollection.
+ 	superVars := class allInstVarNames copyWithoutAll: class instVarNames.
+ 	oldVars := oldVars copyWithoutAll: superVars.
  	oldVars , addedVars do: [:var | outStrm nextPutAll: var; space].
  	outStrm nextPut: $'.
  
  	class isMeta ifFalse:
  		["Merge class vars from old and new defs..."
  		oldStrm upToAll: 'classVariableNames:'; upTo: $'.
  		outStrm nextPutAll: (newStrm upToAll: 'classVariableNames:'); nextPutAll: 'classVariableNames:';
  			nextPutAll: (newStrm upTo: $'); nextPut: $'.
  		oldVars := (oldStrm upTo: $') findTokens: Character separators.
  		newVars := (newStrm upTo: $') findTokens: Character separators.
  		addedVars := oldVars asSet addAll: newVars; removeAll: oldVars; asOrderedCollection.
+ 		superVars := class allClassVarNames copyWithoutAll: class classVarNames.
+ 		oldVars := oldVars copyWithoutAll: superVars.
  		oldVars , addedVars do: [:var | outStrm nextPutAll: var; space].
  		outStrm nextPut: $'].
  
  	outStrm nextPutAll: newStrm upToEnd.
  	^ outStrm contents
  !



More information about the Packages mailing list