Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsmore problem with non null and final fields
https://www.eclipse.org/forums/index.php/mv/msg/520074/1103801/#msg_1103801
1) CONST is static final, so can't be null, but the 'o = new B(CONST)' give warning
2) 'o' is final, and it is initialized in constructor, so can't be null
public class TestCase {
static class B {
B(@NonNull String s) { }
}
public static final String CONST = "";
public final B o;
TestCase() {
o = new B(CONST);
test1(o);
}
void test1(@NonNull B b) {
}
}
]]>Nicola Zanaga2013-09-07T10:15:48-00:00Re: more problem with non null and final fields
https://www.eclipse.org/forums/index.php/mv/msg/520074/1103806/#msg_1103806
https://bugs.eclipse.org/237236
Just recently I resumed that discussion in the light that
- null annotations for fields have been introduced meanwhile
- we don't perform *flow analysis* for fields (and don't plan to do it for the general case)