From ###@###.### Mon Jan 8 16:11:19 1996
Date: Mon, 8 Jan 1996 16:07:15 -0800
From: ###@###.### (Rafael Bracho)
To: fy@Eng
Subject: Bug #2
Cc: avh@Eng, sami@Eng
X-Sun-Charset: US-ASCII
Frank,
We've found a few more bugs we'd like to report -- if we were still
at Sun we would simply file them with bugtool :-(
We'd appreciate it if you could tell us whether (1) you know about
this bug, (2) it's fixed already in some version we'll get eventually,
or (3) it's scheduled for FCS. I guess if it's decided that it won't
be fixed, we'd like to know that, too.
Thanks a bunch,
-Rafael
Compile the following test. It will give a strange error message:
Main.java:25: Reference to clone is ambiguous. It is defined in
java.lang.Object clone() and java.lang.Object clone().
r.clone();
^
1 error
If the "i2" interface is used instead of the "i3" interface in "o2"
and "Main", then the error is not generated.
interface i1 extends java.lang.Cloneable {
public Object clone();
}
interface i2 extends i1 {
}
interface i3 extends i2 {
}
class o1 {
public Object clone()
throws java.lang.CloneNotSupportedException
{
return super.clone();
}
}
class o2
extends o1
implements i3
{ }
public class Main {
public static void main(String argv[]) {
i3 r = (i3)new o2();
r.clone();
}
}
Date: Mon, 8 Jan 1996 16:07:15 -0800
From: ###@###.### (Rafael Bracho)
To: fy@Eng
Subject: Bug #2
Cc: avh@Eng, sami@Eng
X-Sun-Charset: US-ASCII
Frank,
We've found a few more bugs we'd like to report -- if we were still
at Sun we would simply file them with bugtool :-(
We'd appreciate it if you could tell us whether (1) you know about
this bug, (2) it's fixed already in some version we'll get eventually,
or (3) it's scheduled for FCS. I guess if it's decided that it won't
be fixed, we'd like to know that, too.
Thanks a bunch,
-Rafael
Compile the following test. It will give a strange error message:
Main.java:25: Reference to clone is ambiguous. It is defined in
java.lang.Object clone() and java.lang.Object clone().
r.clone();
^
1 error
If the "i2" interface is used instead of the "i3" interface in "o2"
and "Main", then the error is not generated.
interface i1 extends java.lang.Cloneable {
public Object clone();
}
interface i2 extends i1 {
}
interface i3 extends i2 {
}
class o1 {
public Object clone()
throws java.lang.CloneNotSupportedException
{
return super.clone();
}
}
class o2
extends o1
implements i3
{ }
public class Main {
public static void main(String argv[]) {
i3 r = (i3)new o2();
r.clone();
}
}
- duplicates
-
JDK-4047816 javac fails on classes implements Clonealbe.
-
- Closed
-