Community
Participate
Working Groups
The null ansalysis for fields currently has some limitations - there's no analysis for fields of objects other than 'this' (this is however solved by applying null annotations) - the analysis does not deal with aliases Quoting from bug 369487 - We need to make sure that right expectations are set by documenting that it is only the receiver object whose fields get analyzed (add the other nuances here). I myself was surprised by this during my testing. Once you know the details of the implementation you can see why that is the case, but for an end user it will be a surprise too. - The current implementation basically adopts the ostrich approach when it comes to aliases. This may be OK since we only report potential problems/warnings. For example, the warning below is most likely bogus: // --- public class X { Object field; void goo(X x) { X that = this; if (this.field == null) { that.field = new Object(); this.field.toString(); // potential NPE warning here. } } } // --- We don't have any infrastructure for alias analysis and so this will have to be documented as a known limitation. Once bug 331649 is fixed, the documentation should be suitably revised and all limitations noted down.
As the implementation from https://bugs.eclipse.org/bugs/show_bug.cgi?id=247564 has been withdrawn, the current bug has lost its relevance and can be closed as INVALID.
Verified for 3.8 M6.