[squeak-dev] The Trunk: Monticello-jr.726.mcz

Levente Uzonyi leves at caesar.elte.hu
Mon Apr 12 22:29:35 UTC 2021


Hi Nicolas,

I haven't reviewed this change, but the original bug related to 
ReadStream >> #match: has been fixed a while ago.


Levente

On Mon, 12 Apr 2021, commits at source.squeak.org wrote:

> Nicolas Cellier uploaded a new version of Monticello to project The Trunk:
> http://source.squeak.org/trunk/Monticello-jr.726.mcz
>
> ==================== Summary ====================
>
> Name: Monticello-jr.726
> Author: jr
> Time: 28 June 2020, 10:07:19.980052 pm
> UUID: e8c6b590-8826-0144-a535-13cfa140b5dd
> Ancestors: Monticello-mt.725
>
> Fix wrong traitCompositions in packages loaded from source.st
>
> As of Collections-ul.900, ReadStream>>match: does not alter the Stream position if the search sequence was not found. Failure to find the search sequence is indicated via the return value, but it was not checked in classDefinitionFrom:.
>
> The error could trigger load failures after loading Monticello-jr.720, in which the trait composition became relevant beyond just creating the class.
>
> The error did not surface for .mcz version files that contain a correct snapshot.bin file, which allows to forego the reading of the source.st file.
>
> There are versions out there without the snapshot.bin file. INIFile-jf.3.mcz as served by Squeaksource is such a version at the moment.
>
> =============== Diff against Monticello-mt.725 ===============
>
> Item was changed:
>  ----- Method: MCStReader>>classDefinitionFrom: (in category 'converting') -----
>  classDefinitionFrom: aPseudoClass
> + 	| tokens definitionStream hasTraitComposition traitCompositionString lastIndex hasClassTraitComposition classTraitCompositionString typeOfSubclass className |
> - 	| tokens traitCompositionString lastIndex classTraitCompositionString typeOfSubclass className |
>  	tokens := Scanner new scanTokens: aPseudoClass definition.
> + 	definitionStream := ReadStream on: aPseudoClass definition.
> + 	hasTraitComposition := definitionStream match: 'uses:'.
> + 	traitCompositionString := hasTraitComposition ifTrue: [(definitionStream upToAll: 'instanceVariableNames:') withBlanksTrimmed] ifFalse: ['{}'].
> + 	definitionStream := ReadStream on: aPseudoClass metaClass definition asString.
> + 	hasClassTraitComposition := definitionStream match: 'uses:'.
> + 	classTraitCompositionString := hasClassTraitComposition ifTrue: [(definitionStream upToAll: 'instanceVariableNames:') withBlanksTrimmed] ifFalse: ['{}'].
> - 	traitCompositionString := ((ReadStream on: aPseudoClass definition)
> - 		match: 'uses:';
> - 		upToAll: 'instanceVariableNames:') withBlanksTrimmed.
> - 	classTraitCompositionString := ((ReadStream on: aPseudoClass metaClass definition asString)
> - 		match: 'uses:';
> - 		upToAll: 'instanceVariableNames:') withBlanksTrimmed.
> - 	traitCompositionString isEmpty ifTrue: [traitCompositionString := '{}'].
> - 	classTraitCompositionString isEmpty ifTrue: [classTraitCompositionString := '{}'].
>  	lastIndex := tokens size.
>
>  	className := tokens at: 3.
>  	typeOfSubclass := self typeOfSubclass: (tokens at: 2).
>  	"Compiled code classes are special cases of the #bytes class type"
>  	(#bytes == typeOfSubclass and: [self compiledCodeClassNames includes: className])
>  		ifTrue: [typeOfSubclass := #compiledMethod].
>
>  	^ MCClassDefinition
>  		name: className
>  		superclassName: (tokens at: 1)
>  		traitComposition: traitCompositionString
>  		classTraitComposition: classTraitCompositionString
>  		category: (tokens at: lastIndex)
>  		instVarNames: ((tokens at: lastIndex - 6) findTokens: ' ')
>  		classVarNames: ((tokens at: lastIndex - 4) findTokens: ' ')
>  		poolDictionaryNames: ((tokens at: lastIndex - 2) findTokens: ' ')
>  		classInstVarNames: (self classInstVarNamesFor: aPseudoClass)
>  		type: typeOfSubclass
>  		comment: (self commentFor: aPseudoClass)
>  		commentStamp: (self commentStampFor: aPseudoClass)!


More information about the Squeak-dev mailing list