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

org.eclipse.jdt.core.prefs overridden with default? values even if specified differently #2721

Closed
stefanrybacki opened this issue Oct 5, 2022 · 5 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#2264

Comments

@stefanrybacki
Copy link

In a gradle project we have:

eclipse.jdt.file.withProperties { props ->
        props.setProperty "org.eclipse.jdt.core.circularClasspath", "warning"
        props.setProperty "org.eclipse.jdt.core.compiler.processAnnotations", "enabled"
        props.setProperty "org.eclipse.jdt.core.compiler.annotation.nullanalysis", "disabled"
    }

and we have

eclipse {
      synchronizationTasks eclipseJdtApt, eclipseJdt, cleanEclipseFactorypath, eclipseFactorypath
    }

so running ./gradlew eclipseJdt for instance generated a correct org.eclipse.jdt.core.prefs file in .settings.
However, when clean and rebuilding from within vscode the org.eclipse.jdt.core.prefs file will be overridden not honoring the settings we set above, specifically org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled is overridden with enabled which causes class hierarchy issues in the compiler.

Environment
  • Operating System: Windows but running SSH remote in Linux
  • JDK version: 11
  • Visual Studio Code version: 1.71.2
  • Java extension version: 1.11.0
@snjeza
Copy link
Contributor

snjeza commented Oct 5, 2022

I can't reproduce the issue.
@stefanrybacki could you attach your settings.json, build.gradle and your log. See Enable logging

@snjeza
Copy link
Contributor

snjeza commented Oct 6, 2022

@stefanrybacki you may want to take a look at #2712 (comment)

@stefanrybacki
Copy link
Author

@snjeza thanks for looking into this. Unfortunately I cannot share the gradle and settings file as is, due to company policies. Let me check if I can create a reproducible project without critical information. I will also check if the linked component fixes my compile issues, however it might only the transitive compile problem I get due vscode overriding the jdt file.

@snjeza
Copy link
Contributor

snjeza commented Oct 10, 2022

@stefanrybacki Could you try to add

{
    "java.compile.nullAnalysis.nonnull": [],
    "java.compile.nullAnalysis.nullable": [],
}

to your settings.json?

@stefanrybacki
Copy link
Author

stefanrybacki commented Oct 11, 2022

@snjeza I can confirm that applying those settings and also changes the value of org.eclipse.jdt.core.compiler.annotation.nullanalysis to disabled in the jdt file.
So do those settings override the settings specified in the gradle file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants