Skip to content

Commit b5fff9a

Browse files
committed
Again handle endPos and startPos when nil and not nil
1 parent d0a5485 commit b5fff9a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/FamixJavaModelUpdater/TFJMUEntityFactory.trait.st

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,14 @@ TFJMUEntityFactory >> fileAnchorPath: anObject [
7777
TFJMUEntityFactory >> generateAnchorBasedOn: famixSourceAnchor for: aFastJavaEntity [
7878

7979
| safeStart |
80-
safeStart := self newStartPosition ifNil: [ 0 ].
80+
81+
safeStart := self newStartPosition
82+
ifNotNil: [ :pos | pos - 1 ]
83+
ifNil: [ 0 ].
8184

8285
^ (self create: FamixJavaIndexedFileAnchor)
83-
startPos: safeStart + aFastJavaEntity startPos - 1 ;
84-
endPos: safeStart + aFastJavaEntity endPos - 1 ;
86+
startPos: safeStart + aFastJavaEntity startPos ;
87+
endPos: safeStart + aFastJavaEntity endPos ;
8588
fileName: famixSourceAnchor ;
8689
yourself
8790
]

0 commit comments

Comments
 (0)