diff --git a/src/Famix-Tagging-Tests-Entities/FamixTagTestClass.class.st b/src/Famix-Tagging-Tests-Entities/FamixTagTestClass.class.st index bf23204..d7dd75b 100644 --- a/src/Famix-Tagging-Tests-Entities/FamixTagTestClass.class.st +++ b/src/Famix-Tagging-Tests-Entities/FamixTagTestClass.class.st @@ -17,5 +17,5 @@ FamixTagTestClass class >> annotation [ { #category : #ambiguous } FamixTagTestClass >> numberOfLinesOfCode: aNumber [ - self privateState cacheAt: #numberOfLinesOfCode put: aNumber + self cacheAt: #numberOfLinesOfCode put: aNumber ] diff --git a/src/Famix-Tagging-Tests/FamixTagMooseModelTest.class.st b/src/Famix-Tagging-Tests/FamixTagMooseModelTest.class.st index 0e9b3d4..4bf2375 100644 --- a/src/Famix-Tagging-Tests/FamixTagMooseModelTest.class.st +++ b/src/Famix-Tagging-Tests/FamixTagMooseModelTest.class.st @@ -96,44 +96,44 @@ FamixTagMooseModelTest >> testAllTagsWithHiddenTags [ FamixTagMooseModelTest >> testClassicCachesAreNotResetWhenAddingATag [ "When using tags we do not want to invalidate model caches all the time. Only the ones relative to tags." - model privateState cacheAt: #fursona put: #jecisc. + model cacheAt: #fursona put: #jecisc. model createTagNamed: 'NewTag'. - model privateState cacheAt: #fursona ifAbsent: [ self fail ] + model cacheAt: #fursona ifAbsent: [ self fail ] ] { #category : #tests } FamixTagMooseModelTest >> testClassicCachesAreNotResetWhenEntityWasTagged [ "When using tags we do not want to invalidate model caches all the time. Only the ones relative to tags." - model privateState cacheAt: #fursona put: #jecisc. + model cacheAt: #fursona put: #jecisc. (model entityNamed: 'Package2') tagWithName: 'dead-code'. - model privateState cacheAt: #fursona ifAbsent: [ self fail ] + model cacheAt: #fursona ifAbsent: [ self fail ] ] { #category : #tests } FamixTagMooseModelTest >> testClassicCachesAreNotResetWhenEntityWasUntagged [ "When using tags we do not want to invalidate model caches all the time. Only the ones relative to tags." - model privateState cacheAt: #fursona put: #jecisc. + model cacheAt: #fursona put: #jecisc. (model entityNamed: 'Package1::Class1') removeTags. - model privateState cacheAt: #fursona ifAbsent: [ self fail ] + model cacheAt: #fursona ifAbsent: [ self fail ] ] { #category : #tests } FamixTagMooseModelTest >> testClassicCachesAreNotResetWhenRemovingATag [ "When using tags we do not want to invalidate model caches all the time. Only the ones relative to tags." - model privateState cacheAt: #fursona put: #jecisc. + model cacheAt: #fursona put: #jecisc. model tags first remove. - model privateState cacheAt: #fursona ifAbsent: [ self fail ] + model cacheAt: #fursona ifAbsent: [ self fail ] ] { #category : #tests } diff --git a/src/Famix-Tagging/FamixTag.class.st b/src/Famix-Tagging/FamixTag.class.st index c934f32..9ccd4f9 100644 --- a/src/Famix-Tagging/FamixTag.class.st +++ b/src/Famix-Tagging/FamixTag.class.st @@ -85,7 +85,7 @@ FamixTag class >> named: tagName [ { #category : #ston } FamixTag class >> stonAllInstVarNames [ - ^ super stonAllInstVarNames reject: [ :instVar | #(#mooseName #mooseID #state #mooseModel #subTags) includes: instVar ] + ^ super stonAllInstVarNames reject: [ :instVar | #(#mooseName #mooseID #cache #entityAttributes #mooseModel #subTags) includes: instVar ] ] { #category : #accessing } diff --git a/src/Famix-Tagging/FamixTagCategory.class.st b/src/Famix-Tagging/FamixTagCategory.class.st index b006d00..8b4c4a3 100644 --- a/src/Famix-Tagging/FamixTagCategory.class.st +++ b/src/Famix-Tagging/FamixTagCategory.class.st @@ -49,7 +49,7 @@ FamixTagCategory class >> named: aString [ { #category : #ston } FamixTagCategory class >> stonAllInstVarNames [ - ^ super stonAllInstVarNames \ #(#mooseID #state #mooseModel #markedTags) + ^ super stonAllInstVarNames \ #(#mooseName #mooseID #cache #entityAttributes #mooseModel #markedTags) ] { #category : #adding } diff --git a/src/Famix-Tagging/MooseEntityState.extension.st b/src/Famix-Tagging/MooseEntityState.extension.st deleted file mode 100644 index 550f983..0000000 --- a/src/Famix-Tagging/MooseEntityState.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : #MooseEntityState } - -{ #category : #'*Famix-Tagging' } -MooseEntityState >> removeTagProperties [ - "I am used when we remove tags to update the caches" - - cache keysAndValuesRemove: [ :key :value | key asString includesSubstring: 'FamixTag' ] -] diff --git a/src/Famix-Tagging/MooseModel.extension.st b/src/Famix-Tagging/MooseModel.extension.st index ea2ef9c..97bc491 100644 --- a/src/Famix-Tagging/MooseModel.extension.st +++ b/src/Famix-Tagging/MooseModel.extension.st @@ -5,19 +5,26 @@ MooseModel >> addTaggingEntityFirst: anElement [ "Since we can add and remove tags a lot, we prefer to have it at the start of the entity storage. Also, we do not want to flush all caches but only the ones related to tags." self entityStorage addTaggingEntityFirst: anElement. - self privateState removeTagProperties. + self removeTagProperties. anElement privateSetMooseModel: self. self announcer announce: (MooseEntityAdded new entity: anElement). ^ anElement ] +{ #category : #'*Famix-Tagging' } +MooseModel >> removeTagProperties [ + "I am used when we remove tags to update the caches" + + cache keysAndValuesRemove: [ :key :value | key asString includesSubstring: 'FamixTag' ] +] + { #category : #'*Famix-Tagging' } MooseModel >> removeTaggingEntity: anElement [ "Do not flush all caches because we detag something." self entityStorage remove: anElement. anElement privateSetMooseModel: nil. - self privateState removeTagProperties. + self removeTagProperties. self announcer announce: (MooseEntityRemoved new entity: anElement). ^ anElement ]