| Summary: | [compiler][null] Warnings not reported for objects not initialized | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | shankha banerjee <shankhba> |
| Component: | Core | Assignee: | shankha banerjee <shankhba> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | manoj.palat, shankhba, stephan.herrmann |
| Version: | 4.4 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
shankha banerjee
Please assign it to me. I thought we discussed that the *initialization* is to be flagged, i.e., either a field initializer or all constructors must assign non-null. Problems should be / are flagged against the field or the constructor. Why are you investigating *usage* of these fields? If @NonNullByDefault applies to the field (is this 1.7- or 1.8??) then each use of the field will consider it as @NonNull. The main bug is: @NonNullByDefault is applied on Y, only, not on X. Once corrected, which bug are you seeing (apart from bug 429906)? (In reply to Stephan Herrmann from comment #2) > I thought we discussed that the *initialization* is to be flagged, > i.e., either a field initializer or all constructors must assign non-null. > > Problems should be / are flagged against the field or the constructor. > > Why are you investigating *usage* of these fields? > > If @NonNullByDefault applies to the field (is this 1.7- or 1.8??) > then each use of the field will consider it as @NonNull. > Sorry. Bug 429906, Comment 3 does specify that error has to be reported on initialization. If we start reporting on usage the workspace will have lot of warning messages. So the bug is: @NonNullByDefault class Y {} public class X { Y y; // Warning should be reported here. Y[] y1; // Warning should be reported here. void bar() { y = new Y(); y1 = new Y[0]; } } > The main bug is: @NonNullByDefault is applied on Y, only, not on X. > Once corrected, which bug are you seeing (apart from bug 429906)? Nothing else other than this bug. The Bug 429906 was originally supposed to handle this case. I went ahead and solved the array initialization issue on that bug. Thanks *** This bug has been marked as a duplicate of bug 431965 *** |