matthiasblaesing opened a new pull request, #4327:
URL: https://github.com/apache/netbeans/pull/4327
While working with a typescript project, I multiple times copied files,
renamed, edited and closed them. I noticed, that I got a
NullPointerException from the LanguageClientImpl:
```
java.lang.NullPointerException: Cannot invoke
"org.openide.filesystems.FileObject.getLookup()" because "file" is null
at
org.netbeans.modules.lsp.client.bindings.LanguageClientImpl.publishDiagnostics(LanguageClientImpl.java:161)
Caused: java.lang.reflect.InvocationTargetException
at
jdk.internal.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at
org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
Caused: java.lang.RuntimeException
at
org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
at
org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
```
This looks like a race condition between the LSP server reporting
diagnostics and the URLMapper being updated or the LSP server reporting
diagnostics after the file was already closed.
LanguageClientImpl#publishDiagnostics already guards against missing
EditorCookies and Documents, so this change just expands this to the
FileObject itself.
--
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