| Summary: | Pattern Matching for instanceof and @NonNullByDefault | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Holger Kanwischer <holger.kanwischer> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | stephan.herrmann |
| Version: | 4.22 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 10 | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 571933 *** |
Annotation-bases null analysis is enabled. import org.eclipse.jdt.annotation.NonNullByDefault; @NonNullByDefault public class NonNullByDefaultAndInstanceof { void test2(Object o) { if (o instanceof Long l) { test2(l); //<<< } } void test2(Long l) { System.out.println(l); } } The following invalid warning is issued for the line marked with "<<<": Null type safety (type annotations): The expression of type 'Long' needs unchecked conversion to conform to '@NonNull Long'