-
Notifications
You must be signed in to change notification settings - Fork 411
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
Add an option to enable/disable null analysis #2279
Add an option to enable/disable null analysis #2279
Conversation
When changing the null analysis settings, the users can easily encounter the buildship deadlock bug (eclipse-buildship/buildship#1148 and eclipse-buildship/buildship#1185). Since this PR will send a notification to let user change the settings, I'll investigate more about the bug before marking it ready for review. update: I just left a comment in buildship side: eclipse-buildship/buildship#1185 (comment), since the dead lock can be easily reproduced when we change the JDT compiler options and we will pop up a notification to guide user to change the null analysis options, I suggest we hold this PR now and keep eyes on the bug. You can now easily reproduce this:
|
Let's wait and see if there are more regression issues reported about null annotation analysis. If so, I'd rather disable it by default. |
return this.updateAnnotationNullAnalysisOptions(true); | ||
case interactive: | ||
if (this.hasAnnotationNullAnalysisTypes()) { | ||
String cmd = "java.compile.nullAnalysis.setMode"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command can be implemented via delegateCommand, and store it in workspace cache.
Do we want this in for the 1.17.0 release ? If so, we could let the release slip to the 31st (Monday). |
@rgrunber Let's wait for more feedback and hope the buildship bug can be fixed. I suggest this can be included in the next release. |
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good to me. Just a small fix to make regarding the message prompt.
org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen <[email protected]>
fd614fb
to
d1f2d4e
Compare
Signed-off-by: Shi Chen [email protected]
related to redhat-developer/vscode-java#2747
add new preference
java.compile.nullAnalysis.mode
, which type isFeatureStatus
.interactive
(default), a notification will show once null annotation types are detected when project is imported or null analysis related configuration changed.automatic
, the null analysis will be enabled.disabled
, the null analysis will be disabled.