Community
Participate
Working Groups
While playing with null analysis for more kinds of expressions (bug 331649 and bug 364326) I tried my current implementation against org.eclipse.jdt.junit.core to find the following interesting warning: 1. WARNING in src/org/eclipse/jdt/internal/junit/JUnitPropertyTester.java (in line 47): throw new IllegalArgumentException("Element must be of type 'IAdaptable', is " + receiver == null ? "null" : receiver.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Null comparison always yields false: this expression cannot be null I hope the above renders correctly in bugzilla so that you can see what the compiler sees :)
(In reply to comment #0) > I hope the above renders correctly in bugzilla so that you can see what the > compiler sees :) Automatic line wrapping didn't help, so here's the relevant part again: "Element must be of type 'IAdaptable', is " + receiver == null ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Null comparison always yields false: this expression cannot be null
That's a nice one. Fixed in master: 423f052c415eff05a9d05be3cf02e69b1d938ec6