From cca78ad94d7eea4e976b142fbb8955dce014f65c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 7 Nov 2019 13:19:38 +0100 Subject: [PATCH] This is fixing a bug while loading code. In Pharo 7, the loading of code is using a cache for MCDefinitions. When you create a new definition, it checks if one equivalent was already created, if yes, it return this one. The equality of MCClassTraitDefinition does not take the category into account and I got bug while loading code because the MCClassTraitDefinition was wrong because it found one with another category. --- src/Monticello/MCClassTraitDefinition.class.st | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Monticello/MCClassTraitDefinition.class.st b/src/Monticello/MCClassTraitDefinition.class.st index 33bee1460f4..0de2441f16f 100644 --- a/src/Monticello/MCClassTraitDefinition.class.st +++ b/src/Monticello/MCClassTraitDefinition.class.st @@ -28,11 +28,10 @@ MCClassTraitDefinition class >> baseTraitName: aString classTraitComposition: cl { #category : #comparing } MCClassTraitDefinition >> = aDefinition [ - ^ (super = aDefinition) - and: [baseTrait = aDefinition baseTrait - and: [self classTraitCompositionString = aDefinition classTraitCompositionString]] - - + ^ super = aDefinition + and: [ baseTrait = aDefinition baseTrait + and: [ self classTraitCompositionString = aDefinition classTraitCompositionString + and: [ category = aDefinition category ] ] ] ] { #category : #visiting } @@ -91,8 +90,8 @@ MCClassTraitDefinition >> hash [ | hash | hash := String stringHash: baseTrait initialHash: 0. hash := String stringHash: self classTraitCompositionString initialHash: hash. - ^hash - + hash := String stringHash: category initialHash: hash. + ^ hash ] { #category : #initialization }