Repository navigation
Closed
Labels
Milestone
Description
I tried the latest pre-release in VSCode with a petclinic sample application, hacking some stuff in some classes. Afterwards, I found these exceptions (a bunch of them) on the log of the language server:
12:34:07.710 [pool-4-thread-6] ERROR o.s.i.v.b.j.r.JdtReconciler -
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.CompilationUnit.accept(org.eclipse.jdt.core.dom.ASTVisitor)" because "cu" is null
at org.springframework.ide.vscode.boot.java.reconcilers.AnnotationNodeReconciler.reconcile(AnnotationNodeReconciler.java:82)
at org.springframework.ide.vscode.boot.java.reconcilers.JdtReconciler.reconcile(JdtReconciler.java:87)
at org.springframework.ide.vscode.boot.java.rewrite.RewriteCodeActionHandler.lambda$handle$0(RewriteCodeActionHandler.java:114)
at org.springframework.ide.vscode.boot.java.utils.CompilationUnitCache.withCompilationUnit(CompilationUnitCache.java:233)
at org.springframework.ide.vscode.boot.java.rewrite.RewriteCodeActionHandler.handle(RewriteCodeActionHandler.java:109)
at org.springframework.ide.vscode.boot.java.handlers.BootJavaCodeActionProvider.lambda$handle$0(BootJavaCodeActionProvider.java:52)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(Unknown Source)
at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.springframework.ide.vscode.boot.java.handlers.BootJavaCodeActionProvider.handle(BootJavaCodeActionProvider.java:57)
at org.springframework.ide.vscode.commons.languageserver.composable.CompositeLanguageServerComponents$3.lambda$handle$0(CompositeLanguageServerComponents.java:119)
at java.base/java.util.Optional.map(Unknown Source)
at org.springframework.ide.vscode.commons.languageserver.composable.CompositeLanguageServerComponents$3.handle(CompositeLanguageServerComponents.java:119)
at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.computeCodeActions(SimpleTextDocumentService.java:471)
at org.springframework.ide.vscode.commons.languageserver.util.SimpleTextDocumentService.lambda$codeAction$12(SimpleTextDocumentService.java:517)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
There was also a user visible problem happening on the UI, the content-assist was blocked (did not show any proposals anymore, just loading...), but I am not sure whether it is related or not.
Nevertheless, we need to fix this NPE issue, whether it is related to the auto-complete problem or not.
Activity
martinlippert commentedon Oct 5, 2023
It looks like the exception is thrown by all the various reconcilers, I can see the same or a similar exception from all of them, for example:
or
BoykoAlex commentedon Oct 5, 2023
@martinlippert Wonder if you get the same issues in reconcilers once you restart VSCode/Eclipse...
I have a bad a feeling that what you got into is not an easily reproducible scenario and it has to do something with some issues in CU Cache Java parsing.
BoykoAlex commentedon Oct 5, 2023
NPE is fixed 862fd9b It was good to fix it indeed. All other paths to the
JdtReconciler#reconole(...)method all check for CU not beingnullbefore calling.