lahodaj opened a new pull request, #7983: URL: https://github.com/apache/netbeans/pull/7983
When code like: ``` package javaapplication2; public class JavaApplication2 { public static void main(String[] args) { new G() { }; } } class G { @Deprecated G() {} } ``` is indexed with `-Xlint:deprecation`, writing error/warning index may fail due to an exception like: ``` java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 605 at com.sun.tools.javac.util.Position$LineTabMapImpl.getColumnNumber(Position.java:266) at com.sun.tools.javac.util.Position$LineMapImpl.getColumnNumber(Position.java:236) at com.sun.tools.javac.util.Position$LineTabMapImpl.getColumnNumber(Position.java:253) at org.netbeans.modules.java.source.indexing.JavaCustomIndexer$ErrorConvertorImpl.getRange(JavaCustomIndexer.java:1329) ``` This is because the Diagnostics has end position `-1`. This patch simply proposes to treat this case as a missing end position. Separately, it should be investigated if javac should produce errors or warnings like this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists