Name: ngR10089 Date: 01/27/2004
The latest spec of "Adding Generics to the Java Programming Language: Public
Draft Specification, Version 2.0", 3.2 reads:
"It is a compile time error if a class inherits more than one concrete
method with the same signature.
This can happen, if a superclass is parameteric, and it has two methods
that were distinct in the generic declaration, but have the same signature
in the particular instantiation used."
However javac (jdk1.5.0-b35) successfully compiles test below.
--------------- clss44001.java-------------
package javasoft.sqe.tests.lang.clss44.clss44001;
import java.io.PrintStream;
class clss44001b<A> {
void method(A v) {
}
void method(Integer v) {
}
}
class clss44001a<A> extends clss44001b<Integer> {
}
public class clss44001 {
public static void main(String argv[]) {
System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[],PrintStream out) {
return 0/*STATUS_PASSED*/;
}
}
---------------------------------------
New JCK tests
lang/CLSS/clss440/clss44001/clss44001.html
lang/CLSS/clss440/clss44002/clss44002.html
lang/CLSS/clss440/clss44003/clss44003.html
lang/EXPR/expr684/expr68402/expr68402.html
fail due to this bug.
======================================================================