This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If (in -source 6 code) you have private static final String K1 = ...; private static final String K2 = ...; ... String k = ...; // known to be @NonNull if (k == K1) {...} else if (k == K2) {...} .. and you want to switch to using equals() without a null check using Inspect & Transform, you cannot: the dialog warns that there are multiple fixes and it will just pick the first one. (Which is particularly stupid in this case because the suggested code compares string _constants_ to null!) Disabling the option "Check for null using ternary conditional operator" in hint prefs does not help.
Workaround is to manually accept second hint fix on each affected line.
Could be improved, but only in limited cases, i.e. one side of the comparison is either a literal, or a final reference variable with an initializer. Definite assingment rules could be added, but I am not sure it cover enough cases to weight out the complexity. Could also work with @NonNull etc annotations (configurable in some other hint)