| Summary: | Unnecessary null type safety warning for instanceof variable used as method call parameter | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Sergey Orlov <sergey.i.orlov> | ||||
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
| Status: | CLOSED MOVED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | holger.kanwischer, stephan.herrmann | ||||
| Version: | 4.18 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 10 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
*** Bug 577181 has been marked as a duplicate of this bug. *** Let's continue in https://github.com/eclipse-jdt/eclipse.jdt.core/issues/350 |
Created attachment 285831 [details] Test project package test; import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; final class Test { private static final void accept(@Nullable Object o) { if (o instanceof Test test) { accept(test); // <== Null type safety (type annotations): The expression of type 'Test' needs unchecked conversion to conform to '@NonNull Test' } } private static final void accept(@NonNull Test test) { System.out.println(test); } public static final void main(String[] arguments) { accept((Object) null); } }