[squeak-dev] The Inbox: Monticello-jr.783.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Aug 7 22:06:12 UTC 2022

A new version of Monticello was added to project The Inbox:

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

Name: Monticello-jr.783
Author: jr
Time: 8 August 2022, 12:06:12.526085 am
UUID: 01da1063-034e-5444-be24-853128075cad
Ancestors: Monticello-mt.782

Fix: when writing only modified definitions to a file tree repository, writing the MCTraitDefinition of a trait that uses another trait without also writing the MCClassTraitDefinition would trim away the word "classTrait" from the value of the "classtraitcomposition" property in the properties.json file.

Compare with MCFileTreeStCypressWriter>>#writeTraitDefinition:

Usually, when introducing trait T to a class C (or another trait), the properties C become { "classtraitcomposition" : "T classTrait", "traitcomposition" : "T", ... }. Through the bug, this can be inadvertently changed to "classtraitcomposition" : "T". When the package is subsequently loaded from the files, instance methods of T will additionally appear on the class side of C. Probably the T classTrait methods will also be missing from C class, but I did not verify this.

When using plain file tree repositories, the bug does not appear because all files are removed and written again using all the definitions, including the MCClassTraitDefinition. Squot tries to optimize commit performance by passing only the changes through to the file tree writer. The situation before this patch requires to also collect and pass along the MCClassTraitDefinitions even if these were not changed.

MCTraitDefinition should not override classTraitCompositionString and it should not conflate it with the traitCompositionString. Just use the method inherited from MCClassDefinition.

I checked in Pharo 10: the override of classTraitCompositionString does not exist there either.

=============== Diff against Monticello-mt.782 ===============

Item was removed:
- ----- Method: MCTraitDefinition>>classTraitCompositionString (in category 'accessing') -----
- classTraitCompositionString
- 	^self traitComposition ifNil: ['{}'].!

More information about the Squeak-dev mailing list