-
Bug
-
Resolution: Fixed
-
P4
-
1.0.2, 1.1
-
1.2beta
-
sparc
-
solaris_2.5
-
Verified
Name: apC46001 Date: 12/17/96
JLS says [p. 167, 8.4.6.4 Inheriting Methods with the Same Signature]:
"It is possible for a class to inherit more than one method with the same signature.
Such a situation does not in itself cause a compile-time error.
There are then two possible cases:
If one of the inherited methods is not abstract, then there are two subcases:
If the method that is not abstract is static, a compile-time error occurs.
...
"
JDK 1.1 compiler does not produce the needed error message for the test below.
> javac -d . clss17301.java
> java clss17301
java.lang.UnknownError: javasoft/sqe/tests/lang/clss173/clss17301/clss17301_c
at java.lang.Thread.setPriority(Thread.java)
at javasoft.sqe.tests.lang.clss173.clss17301.clss17301.main(clss17301.java:25)
--------------------------clss17301.java------------------------------
package javasoft.sqe.tests.lang.clss173.clss17301;
import java.io.PrintStream;
interface clss17301_a {
int m1();
}
class clss17301_b {
static public int m1() {
return 666;
}
}
class clss17301_c extends clss17301_b implements clss17301_a {
int m2() {
return m1();
}
}
public class clss17301 {
public static void main(String argv[])
{
System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
}
public static int run(String argv[],PrintStream out) {
clss17301_c x = new clss17301_c();
return 2;
}
}
======================================================================