avoid NullPointerException for warning diagnostic
This commit is contained in:
@@ -77,9 +77,13 @@ public class RuntimeJavaCompiler {
|
|||||||
String sourceCode =null;
|
String sourceCode =null;
|
||||||
try {
|
try {
|
||||||
sourceCode = (String)diagnostic.getSource().getCharContent(true);
|
sourceCode = (String)diagnostic.getSource().getCharContent(true);
|
||||||
} catch (IOException ioe) {
|
}
|
||||||
|
catch (IOException ioe) {
|
||||||
// Unexpected, but leave sourceCode null to indicate it was not retrievable
|
// Unexpected, but leave sourceCode null to indicate it was not retrievable
|
||||||
}
|
}
|
||||||
|
catch (NullPointerException npe) {
|
||||||
|
// TODO: should we skip warning diagnostics in the loop altogether?
|
||||||
|
}
|
||||||
int startPosition = (int)diagnostic.getPosition();
|
int startPosition = (int)diagnostic.getPosition();
|
||||||
if (startPosition == Diagnostic.NOPOS) {
|
if (startPosition == Diagnostic.NOPOS) {
|
||||||
startPosition = (int)diagnostic.getStartPosition();
|
startPosition = (int)diagnostic.getStartPosition();
|
||||||
|
|||||||
Reference in New Issue
Block a user