Summary: | [1.5][compiler] Hiding of static method in superclass: Eclipse errors where java allows unchecked conversion | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> |
Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
Status: | RESOLVED WORKSFORME | QA Contact: | |
Severity: | minor | ||
Priority: | P3 | ||
Version: | 3.1 | ||
Target Milestone: | 3.1 RC2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Markus Keller
2005-01-19 06:54:33 EST
(In reply to comment #0) This problem doesn't seem to be limited to static methods. Consider this method: List<String> createStringList(final String[] array) { return new AbstractList<String>() { public int size() { return array.length; } public String get(int i) { // Here is where the problem lies return array[i]; } }; } M4 flags the return value of the get(int) method with an unchecked conversion warning very much like the one described in the original report. The applicable value of the List's type parameter is known to the compiler at this point, but it doesn't seem to be used. The anonymous class is using a covariant return type, true, but that's a legal. Sun's version 1.5.0 compiler handles the code without warning. Kent - is this still an issue ? Both of these cases work for me with the latest. Unsure when exactly they were fixed. |