| Summary: | NonNullByDefault applied to local variable does not cancel enclosing NonNullByDefault | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Clovis Seragiotto <clovis.seragiotto> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | register.eclipse |
| Version: | 4.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
Thanks for reporting and providing a standalone test case. You are right, this is simply not implemented yet. *** This bug has been marked as a duplicate of bug 484926 *** |
In the class below, NonNullByDefault({}) cancels the enclosing NonNullByDefault when applied to the method but not when applied to the local variable. @org.eclipse.jdt.annotation.NonNullByDefault public class Main { @org.eclipse.jdt.annotation.NonNullByDefault({}) static void a() { java.util.List<Object> list = new javax.management.AttributeList(); System.out.println(list); } static void b() { @org.eclipse.jdt.annotation.NonNullByDefault({}) java.util.List<Object> list = new javax.management.AttributeList(); // <-- unexpected warning at this line System.out.println(list); } }