vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Errors in MacOS makes editor out of sync

Open pablocarle opened this issue 1 year ago • 5 comments

Editor in MacOS stops synchronizing changes, does not update errors, etc. In output of Launguage Support for Java I see the following errors:

Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isStatic()" because "this.binding" is null
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isStatic()" because "this.binding" is null
[Error - 16:54:33] Request textDocument/semanticTokens/full failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.CompilationUnit.getJavaElement()" because "root" is null
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.dom.CompilationUnit.getJavaElement()" because "root" is null
	at org.eclipse.jdt.ls.core.internal.handlers.SemanticTokensHandler.getAst(SemanticTokensHandler.java:84)
	at org.eclipse.jdt.ls.core.internal.handlers.SemanticTokensHandler.full(SemanticTokensHandler.java:50)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$53(JDTLanguageServer.java:1147)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	... 7 more

Environment
  • Operating System: MacOS Ventura 13.4.1
  • JDK version: embedded
  • Visual Studio Code version: 1.81.1
  • Java extension version: 1.21.0

pablocarle avatar Aug 29 '23 15:08 pablocarle

We have found issues that are potential duplicates:

  • #3215 (70%)

If any of the issues listed above are a duplicate, please consider closing this issue & upvoting/commenting the original one. Alternatively, if neither of the listed issues addresses your feature/bug, keep this issue open.

github-actions[bot] avatar Aug 29 '23 15:08 github-actions[bot]

Also, tried with the pre-release version, similar errors and this one:

null
java.lang.NullPointerException

[Error - 17:16:45] 29 Aug 2023, 17:16:45 Exception occurred during problem detection:

pablocarle avatar Aug 29 '23 15:08 pablocarle

@pablocarle Could you provide a project example?

snjeza avatar Aug 29 '23 16:08 snjeza

The second error looks like eclipse-jdtls/eclipse.jdt.ls#2876, which has now been fixed.

0dinD avatar Oct 23 '23 16:10 0dinD

The first error mentioned here looks like this: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/452

And this still happens in the latest JDT core builds (tried Eclipse 2023-12 M3).

martinlippert avatar Nov 23 '23 15:11 martinlippert