Community
Participate
Working Groups
If a previously null variable is set in a finally block, the compiler's null reference check remains convinced that the variable is null: public class NullBugTest { public void foo() { Object object = null; try { } finally { object = Object.class.getClass(); // The following line of code warns: // The variable object can only be null; it was either set to null or checked for null when last used object.getClass(); } } }
This may be releated to bug 176472, but without rooting through eclipse code, it's hard to say.
Released (inactive) test NullReferenceTest#532 in HEAD.
FinallyFlowContext#recordUsingNullReference missed an early return on definitely unknown variables.
Created attachment 61787 [details] Fix + test case
Released for 3.3 M7.
Verified for 3.3M7 using I20070427-0010