Skip to content

Commit

Permalink
Fix isSelf issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Apr 12, 2024
1 parent f6ee8e2 commit d020617
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
9 changes: 5 additions & 4 deletions Moose-Blueprint-Models/FamixJavaMethod.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ FamixJavaMethod >> isCBInitializer [
FamixJavaMethod >> isCBSetter [

| hasSelfAccess |

self isSetter ifTrue: [ ^ true ].

hasSelfAccess := self accesses anySatisfy: [ :each |
each variable isSelf ].
each variable isImplicitVariable and: [
each variable isSelf ] ].
(self accesses size = 2 and: [
hasSelfAccess and: [ self parameters size = 1 ] ]) ifFalse: [
^ false ].

hasSelfAccess := self accesses anySatisfy: [ :acc1 |
acc1 previous isNotNil and: [
acc1 previous variable isSelf and: [
acc1 variable isAttribute ] ] ].
acc1 previous variable isImplicitVariable and: [
acc1 previous variable isSelf and: [
acc1 variable isAttribute ] ] ] ].

^ (self name beginsWith: 'set') and: [
hasSelfAccess and: [ self outgoingInvocations isEmpty ] ]
Expand Down
9 changes: 5 additions & 4 deletions Moose-Blueprint-Models/FamixStInvocation.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ FamixStInvocation >> isAttributeInvocation [
{ #category : #'*Moose-Blueprint-Models' }
FamixStInvocation >> isSelfInvocation [

(self receiver isNil or: [
self sender isNil or: [ self receiver isImplicitVariable not ] ]) ifTrue: [
^ false ].
(self receiver isNil or: [
self sender isNil or: [ self receiver isImplicitVariable not ] ])
ifTrue: [ ^ false ].

^ self receiver isSelf and: [ self sender isMethod ]
^ self receiver isImplicitVariable and: [
self receiver isSelf and: [ self sender isMethod ] ]
]
7 changes: 0 additions & 7 deletions Moose-Blueprint-Models/FamixTInvocationsReceiver.extension.st

This file was deleted.

0 comments on commit d020617

Please sign in to comment.