-
Enhancement
-
Resolution: Duplicate
-
P5
-
None
-
5.0
-
generic
-
generic
Consider the program:
1 import java.util.List;
2 class A<E> {
3 public void x(List<String> s) { }
4 }
5 class B extends A/*raw!*/ {
6 public void x(List<String> s) { }
7 }
Which produces this error message:
A.java:5: name clash: x(java.util.List<java.lang.String>) in B and x(java.util.List<java.lang.String>) in A have the same erasure, yet neither overrides the other
class B extends A/*raw!*/ {
^
1 error
The error is correct but the message could be improved:
A.java:5: name clash: x(java.util.List<java.lang.String>) in B and x(java.util.List) in A have the same erasure, yet neither overrides the other
class B extends A/*raw!*/ {
^
1 error
See http://forum.java.sun.com/thread.jspa?forumID=316&threadID=653504
1 import java.util.List;
2 class A<E> {
3 public void x(List<String> s) { }
4 }
5 class B extends A/*raw!*/ {
6 public void x(List<String> s) { }
7 }
Which produces this error message:
A.java:5: name clash: x(java.util.List<java.lang.String>) in B and x(java.util.List<java.lang.String>) in A have the same erasure, yet neither overrides the other
class B extends A/*raw!*/ {
^
1 error
The error is correct but the message could be improved:
A.java:5: name clash: x(java.util.List<java.lang.String>) in B and x(java.util.List) in A have the same erasure, yet neither overrides the other
class B extends A/*raw!*/ {
^
1 error
See http://forum.java.sun.com/thread.jspa?forumID=316&threadID=653504
- duplicates
-
JDK-7170058 Confusing error message from javac when overriding a method from a raw supertype
-
- Resolved
-