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

Set o.e.j.c.compiler.problem.nullUncheckedConversion to ignore by default #3067

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Feb 20, 2024

@@ -164,6 +164,7 @@ public static void initializeJavaCoreOptions() {
// workaround for https://github.com/redhat-developer/vscode-java/issues/718
javaCoreOptions.put(JavaCore.CORE_CIRCULAR_CLASSPATH, JavaCore.WARNING);
javaCoreOptions.put(JavaCore.COMPILER_IGNORE_UNNAMED_MODULE_FOR_SPLIT_PACKAGE, JavaCore.ENABLED);
javaCoreOptions.put(JavaCore.COMPILER_PB_NULL_UNCHECKED_CONVERSION, JavaCore.IGNORE);
Copy link
Contributor

@rgrunber rgrunber Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to put it within the if/else at

private Map<String, String> generateProjectNullAnalysisOptions(String nonnullType, String nullableType, String nonnullbydefaultType) {
? Otherwise, looks fine.

@rgrunber rgrunber added this to the Mid March 2024 milestone Feb 20, 2024
@rgrunber
Copy link
Contributor

rgrunber commented Feb 20, 2024

Also, looks like testMixedNullAnalysis needs to be adjusted :

IMarker marker3 = getWarningMarker(project, "Null type mismatch: required '@Nonnull List<String>' but the provided value is specified as @Nullable");

.. or is this an issue.

@snjeza
Copy link
Contributor Author

snjeza commented Feb 20, 2024

@rgrunber I have updated the PR..

@rgrunber rgrunber merged commit 6d8eb7a into eclipse-jdtls:master Feb 20, 2024
7 checks passed
@agriffis
Copy link

I promise I'm not trying to be a troublemaker 😂

I'm still chasing a problem in #2655 where org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore and it's not clear to me that this PR is doing the right thing. (Although it might be! I'm theorizing a bunch in an area that isn't very familiar to me!)

See my comment at redhat-developer/vscode-java#3501 (comment)

I'd love if someone could authoritatively say that this change makes sense whenever null analysis is enabled, or if possibly it's a hammer fix to a problem that could/should be solved differently. Thanks!

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

Successfully merging this pull request may close these issues.

Null type safety not working with jakarta.validation.constraints.NotNull
3 participants