Skip to content

Commit b59293f

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 b59293f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,11 @@ 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+
// see JDK-8364015
579+
target[2] = (int) info.getTrees().getSourcePositions().getEndPosition(cu, cu);
580+
}
576581
case INTERFACE:
577582
case ENUM:
578583
case ANNOTATION_TYPE:

0 commit comments

Comments
 (0)