@@ -917,9 +917,12 @@ MolComponentFactory >> rebuildComponent: aComponentClass traitsAdding: aTraitsLi
917
917
" Cannot add the traits if already present in superclasses"
918
918
classes do: [ :c | toBeAddedTrait ifNotNil: [ (c allTraits includes: trait) ifTrue: [toBeAddedTrait := nil ] ]].
919
919
toBeAddedTrait ifNotNil: [
920
- aComponentClass traitComposition isEmpty
921
- ifTrue: [aComponentClass setTraitComposition: toBeAddedTrait]
922
- ifFalse: [ aComponentClass addToComposition: toBeAddedTrait].
920
+
921
+ [ " see issue #210"
922
+ aComponentClass traitComposition isEmpty
923
+ ifTrue: [aComponentClass setTraitComposition: toBeAddedTrait]
924
+ ifFalse: [ aComponentClass addToComposition: toBeAddedTrait]
925
+ ] on: KeyNotFound do: [ :ex | MolUtils log: ex printString ].
923
926
].
924
927
].
925
928
].
@@ -936,16 +939,15 @@ MolComponentFactory >> rebuildComponent: aComponentClass traitsRemoving: aTraits
936
939
( aComponentClass isComposedBy: trait ) ifTrue: [
937
940
[ aComponentClass removeFromComposition: trait ] on: KeyNotFound do: [ :e |
938
941
" When an originaly method injected by a Trait is remove, there is a KeyNotFound exception - catch it because finally we need to remove"
939
- " Need to do another try in a fork with a delay to considere system installation"
942
+ " Need to do another try in a fork with a delay to considere system installation - see issue #210 "
940
943
self flag: ' laborde: write a Pharo issue? Usecase: remove an overridden method of a Traits then remove the trait from composition' .
941
944
MolUtils log: e printString.
942
945
[
943
946
10 milliSeconds wait.
944
947
[ (aComponentClass isComposedBy: trait) ifTrue: [ aComponentClass removeFromComposition: trait ] ]
945
948
on: KeyNotFound
946
- do: [ :ex | " do nothing - fork terminated " ex return: nil ].
949
+ do: [ :ex | MolUtils log: ex printString ].
947
950
] fork.
948
- e return: nil .
949
951
].
950
952
].
951
953
].
0 commit comments