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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists