redhat-developer / redhat-developer/vscode-java

Unexpected errors produced when "javac" support enabled with Lombok

Open
#4,112 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

javac Lombok
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

  1. os:win11
  2. jdk:openjdk24
  3. project jdk:openjdk21
  4. build with gradle

workspace setting

{ "java.import.gradle.home": "D:\\Applications\\Scoop\\apps\\gradle\\current\\", "java.import.gradle.java.home": "D:\\Applications\\Scoop\\apps\\openjdk21\\current", "java.configuration.updateBuildConfiguration": "interactive", "gradle.allowParallelRun": true, "java.compile.nullAnalysis.mode": "automatic", "java.jdt.ls.javac.enabled": "on", "java.completion.engine": "dom", "java.jdt.ls.vmargs": "-Xmx2G --enable-preview", "java.project.encoding": "setDefault", "java.jdt.ls.lombokSupport.enabled": false }
work good in self class

Image

but not work in other class
Image

build.gradle

plugins {
    `java-library`
    `maven-publish`
    id("io.freefair.lombok") version "8.14"
}


group = "com.j.c"
version = "0.0.1-SNAPSHOT"
description = "gradle-test"



allprojects{

    if (project.name == "gradle-platform") return@allprojects

    repositories {
        maven ( url="https://maven.aliyun.com/repository/public" )
        maven ( url="https://repo.maven.apache.org/maven2" )
        maven ( url="https://repo.spring.io/libs-snapshot" )
        maven ( url="https://repo.spring.io/libs-milestone" )
        mavenLocal()
        mavenCentral()
    }
    apply(plugin = "java-library")
    apply(plugin = "io.freefair.lombok")
    java.sourceCompatibility = JavaVersion.VERSION_21
    java.targetCompatibility = JavaVersion.VERSION_21


    tasks.withType<JavaCompile>() {
        options.encoding = "UTF-8"
        options.compilerArgs.add("--enable-preview")
    }

    tasks.withType<Javadoc>() {
        options.encoding = "UTF-8"
    }

}

publishing {
    publications.create<MavenPublication>("maven") {
        from(components["java"])
        }
}

errorlog

[Error - 4:57:53 PM] Jul 13, 2025, 4:57:53 PM Error in calling delegate command handler
gradle-platform does not exist
Java Model Exception: Error in Java Model (code 969): gradle-platform does not exist
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:548)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2549)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:2361)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:2434)
at org.eclipse.jdt.internal.core.JavaProject.getAllPackageFragmentRoots(JavaProject.java:1806)
at org.eclipse.jdt.internal.core.JavaProject.getAllPackageFragmentRoots(JavaProject.java:1797)
at com.microsoft.jdtls.ext.core.ProjectCommand.getMainClasses(ProjectCommand.java:243)
at com.microsoft.jdtls.ext.core.CommandHandler.executeCommand(CommandHandler.java:35)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:616)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:692)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:529)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1394)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1970)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)

Jul 13, 2025 4:57:53 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
����: Internal error: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IMethod.getCompilationUnit()" because "iMethod" is null
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IMethod.getCompilationUnit()" because "iMethod" is null
at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:325)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:361)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:366)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:695)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:529)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1394)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1970)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IMethod.getCompilationUnit()" because "iMethod" is null
at org.eclipse.jdt.internal.corext.refactoring.code.makestatic.InitialConditionsChecker.checkSourceAvailable(InitialConditionsChecker.java:181)
at org.eclipse.jdt.internal.corext.refactoring.code.MakeStaticRefactoring.checkInitialConditions(MakeStaticRefactoring.java:127)
at org.eclipse.jdt.ls.core.internal.corrections.RefactorProcessor.getMakeMethodStaticRefactoringProposal(RefactorProcessor.java:1189)
at org.eclipse.jdt.ls.core.internal.corrections.RefactorProcessor.getProposals(RefactorProcessor.java:228)
at org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler.getCodeActionCommands(CodeActionHandler.java:221)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$15(JDTLanguageServer.java:775)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:692)
... 5 more

[Error - 4:57:53 PM] Request textDocument/codeAction failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IMethod.getCompilationUnit()" because "iMethod" is null
at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:325)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:361)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:366)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:695)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:529)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1394)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1970)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IMethod.getCompilationUnit()" because "iMethod" is null
at org.eclipse.jdt.internal.corext.refactoring.code.makestatic.InitialConditionsChecker.checkSourceAvailable(InitialConditionsChecker.java:181)
at org.eclipse.jdt.internal.corext.refactoring.code.MakeStaticRefactoring.checkInitialConditions(MakeStaticRefactoring.java:127)
at org.eclipse.jdt.ls.core.internal.corrections.RefactorProcessor.getMakeMethodStaticRefactoringProposal(RefactorProcessor.java:1189)
at org.eclipse.jdt.ls.core.internal.corrections.RefactorProcessor.getProposals(RefactorProcessor.java:228)
at org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler.getCodeActionCommands(CodeActionHandler.java:221)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$15(JDTLanguageServer.java:775)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:692)
... 5 more

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows 11 case with JDK 24, project JDK 21, Gradle, Lombok, and javac support enabled, using the supplied build.gradle and workspace settings. Start with ProjectCommand.getMainClasses and the code-action path through CodeActionHandler, RefactorProcessor, and MakeStaticRefactoring; determine why the missing gradle-platform project leads to these errors. Done means the reported code actions no longer produce the logged failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.