Skip to content

Commit af1a89d

Browse files
Merge pull request #8856 from shivam71/compact_src_file_implicit_class_end_pos_fix
Set end position for implicit class declaration tree part of a compact source file
2 parents f045559 + b59293f commit af1a89d

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)