NPE on JsonArray.size() codeAction failure in VSCode after getData() is null
evie-lau opened this issue · comments
Evie Lau commented
[Error - 2:07:32 PM] Request textDocument/codeAction failed.
Message: Request jakarta/java/codeaction failed with message: java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonArray.size()" because "diagnosticData" is null
Code: -32603
To reproduce:
- In ScopeDeclaration.java, hover over the diagnostic for the method
Files that seem to call this method and may have this issue:
Paul Gooderham commented
This is likely caused by the getData() is null problem.
JsonArray diagnosticData = (JsonArray) diagnostic.getData();
List<String> annotations = IntStream.range(0, diagnosticData.size())
Related to #416