Summary: | Wrong "Unnecessary cast" warning with generic array instantiation | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Daniel Le Berre <leberre> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 M5 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Daniel Le Berre
2005-01-05 17:13:29 EST
With latest we report: ---------- 1. WARNING in C:\tests_sources\Toto.java (at line 3) T [] myarray = (T[]) new Object[10]; ^^^^^^^^^^^^^^^^^^^^ Type safety: The cast from Object[] to T[] is actually checking against the erased type Object[] ---------- In fact, javac is reporting an unchecked cast warning: Toto.java:3: warning: [unchecked] unchecked cast found : java.lang.Object[] required: T[] T [] myarray = (T[])new Object[10]; ^ 1 warning This looks consistent. Ok to close? ok, you can close. |