-
Bug
-
Resolution: Unresolved
-
P4
-
8
The declaration of C.m should be illegal here, because it does not override A.m, but at run time an invocation of A.m will have the effect of calling C.m.
public class A<T> {
public void m(T arg) { System.out.println("A.m"); }
}
public class B<U extends Number> extends A<U> {
public void m(Number arg) { System.out.println("B.m"); }
}
public class C<V extends Integer> extends B<V> {
public void m(Number arg) { System.out.println("C.m"); }
}
This requires an accompanying spec change; see JDK-8010681.
public class A<T> {
public void m(T arg) { System.out.println("A.m"); }
}
public class B<U extends Number> extends A<U> {
public void m(Number arg) { System.out.println("B.m"); }
}
public class C<V extends Integer> extends B<V> {
public void m(Number arg) { System.out.println("C.m"); }
}
This requires an accompanying spec change; see JDK-8010681.
- relates to
-
JDK-8010681 Adjust 8.4.8.3 erased signature check for subsignatures
- Open