Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPEs occur when building the new invisible projects #888

Closed
fbricon opened this issue Dec 7, 2018 · 2 comments
Closed

NPEs occur when building the new invisible projects #888

fbricon opened this issue Dec 7, 2018 · 2 comments
Assignees
Labels
bug priority/Blocker Severe security issue or crash requiring immediate fixing regression

Comments

@fbricon
Copy link
Contributor

fbricon commented Dec 7, 2018

After #880 has been merged, I'm seeing NPEs when an invisible project is a parameter of

https://github.com/eclipse/eclipse.jdt.ls/blob/29d339e5fd96cd74dba740d8cdec5501e5a54d05/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTUtils.java#L597-L599

turns out resource.getRawLocationURI() returns null (as allowed per the API) .

Seen when calling the build command:

[Trace - 7:18:49 PM] Sending request 'java/buildWorkspace - (5)'.
[Trace - 7:18:49 PM] Received notification 'window/logMessage'.
Params: {
    "type": 3,
    "message": "6-Dec-2018 7:18:49 PM >> java/buildWorkspace (incremental)"
}


[Info  - 7:18:49 PM] 6-Dec-2018 7:18:49 PM >> java/buildWorkspace (incremental)
[Trace - 7:18:49 PM] Received response 'java/buildWorkspace - (5)' in 20ms. Request failed: Internal error. (-32603).
Error data: "java.util.concurrent.CompletionException: java.lang.NullPointerException
java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604)
java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.NullPointerException
org.eclipse.jdt.ls.core.internal.ResourceUtils.fixURI(ResourceUtils.java:172)
 org.eclipse.jdt.ls.core.internal.JDTUtils.getFileURI(JDTUtils.java:598)
org.eclipse.jdt.ls.core.internal.handlers.BuildWorkspaceHandler.buildWorkspace(BuildWorkspaceHandler.java:59)
 org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$24(JDTLanguageServer.java:743)
 org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:793)
 java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
... 6 more"

I also saw it occur in WorkspaceDiagnosticsHandler, although I'm not able to reproduce it right now

@fbricon fbricon added this to the Mid December 2018 milestone Dec 7, 2018
@fbricon fbricon added the priority/Blocker Severe security issue or crash requiring immediate fixing label Dec 7, 2018
@testforstephen
Copy link
Contributor

Yes, i notice this NPE issue at the deprecated PR, forget to handle it in the new PR. i'll submit a fix.

@testforstephen
Copy link
Contributor

This issue can be reproduced when build the workspace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority/Blocker Severe security issue or crash requiring immediate fixing regression
Projects
None yet
Development

No branches or pull requests

3 participants