-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b03
-
generic
-
solaris_8
-
Verified
Is the compiler right or wrong here?
==========$ cat -n A1.java
1 package p1;
2
3 public class A1<T> {
4 int f(T t) { return 0; }
5 }
==========$ cat -n A2.java
1 package p2;
2
3 public class A2<T> extends p1.A1<T> {}
==========$ cat -n B.java
1 package p1;
2
3 public abstract class B<T,U> extends p2.A2<U> {
4 abstract int f(T t);
5 // abstract I2 f(String s);
6 }
==========$ cat -n C.java
1 package p1;
2
3 public class C extends B<String,String> {
4 // indirect overrider f(String) from A1
5 }
==========$ newjavac *.java
C.java:3: p1.C is not abstract and does not override abstract method f(java.lang.String) in p1.B
public class C extends B<String,String> {
^
1 error
==========$
==========$ cat -n A1.java
1 package p1;
2
3 public class A1<T> {
4 int f(T t) { return 0; }
5 }
==========$ cat -n A2.java
1 package p2;
2
3 public class A2<T> extends p1.A1<T> {}
==========$ cat -n B.java
1 package p1;
2
3 public abstract class B<T,U> extends p2.A2<U> {
4 abstract int f(T t);
5 // abstract I2 f(String s);
6 }
==========$ cat -n C.java
1 package p1;
2
3 public class C extends B<String,String> {
4 // indirect overrider f(String) from A1
5 }
==========$ newjavac *.java
C.java:3: p1.C is not abstract and does not override abstract method f(java.lang.String) in p1.B
public class C extends B<String,String> {
^
1 error
==========$