File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/javac Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,9 @@ private org.eclipse.jface.text.Position getPositionByNodeRangeOnly(Diagnostic<?>
393393 JCCompilationUnit trackedUnit = this .units .get (jcDiagnostic .getSource ());
394394 if (trackedUnit != null && trackedUnit .endPositions != null ) {
395395 int endPosition = jcTree .getEndPosition (trackedUnit .endPositions );
396- return new org .eclipse .jface .text .Position (startPosition , endPosition - startPosition );
396+ if ( endPosition != -1 ) {
397+ return new org .eclipse .jface .text .Position (startPosition , endPosition - startPosition );
398+ }
397399 } else if (jcTree instanceof JCIdent ident ) {
398400 return new org .eclipse .jface .text .Position (startPosition , ident .getName ().length ());
399401 }
You can’t perform that action at this time.
0 commit comments