Community
Participate
Working Groups
Looking at QuickFixProcessor.process() two kinds of problems could actually trigger insertion of null annotations while annotation-based null analysis is disabled: IProblem.NonNullLocalVariableComparisonYieldsFalse IProblem.RedundantNullCheckOnNonNullLocalVariable Checks should be inserted to prevent bogus proposals. Even if null annotations are enabled, some proposals offered on this route don't make much sense, I'm afraid. I'll investigate.
Created attachment 229402 [details] proposed fix Proposed solution in two small steps: - check enablement of annotation-based null analysis (the original issue) - migrate from the two mentions IProblems to their newer counter-parts since bug 365859, which already ensure that a null annotation was the reason behind the problem Included tests & another tiny logic bug. Note, that this patch was created on top of the patch in bug 400668.
Thanks for the patch. Committed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=17c7783177bc359beb03a7575237fd347cc3ba49 together with other fixes.