Skip to content

Commit 96bf942

Browse files
committed
Set end position for implicit final class declaration tree part of compact source file compilation unit to end position of compilation unit tree.
1 parent 5e99c5b commit 96bf942

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementOpen.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ static void fillInTreePositions(CompilationInfo info, Tree forTree, Object[] tar
573573
int[] span = null;
574574
switch(forTree.getKind()) {
575575
case CLASS:
576+
if ((int) target[1] >= 0 && (int) target[2] == -1) {
577+
// Compact Source file (JEP 512) issue implicit class end position not found in code
578+
target[2] = (int) info.getTrees().getSourcePositions().getEndPosition(cu, cu);
579+
}
576580
case INTERFACE:
577581
case ENUM:
578582
case ANNOTATION_TYPE:

0 commit comments

Comments
 (0)