-
Bug
-
Resolution: Fixed
-
P2
-
1.4.2, 5.0
Failing tests : javac/regression/tigerbugs/5079756
Name: rmT116609 Date: 07/12/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b56)
Java HotSpot(TM) Client VM (build 1.5.0-beta3-b56, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
The invocation of generic method m1() has return type C1&I1&I2. The compiler allows methods on I1 & I2 to be invoked, but it complains about methods on C1.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
javac Test.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Program compiles without errors.
ACTUAL -
Test.java:9: cannot find symbol
symbol: method c1m1()
m1(c2, c3).c1m1();
^
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
static String foo;
public static void main(String[] args) {
C2 c2 = null;
C3 c3 = null;
m1(c2, c3).c1m1();
m1(c2, c3).i1m1();
m1(c2, c3).i2m1();
}
public static <T> T m1(T t1, T t2) {
return null;
}
class C1 { void c1m1() {} }
interface I1 { void i1m1(); }
interface I2 { void i2m1(); }
class C2 extends C1 implements I1, I2 {
public void i1m1() { }
public void i2m1() { }
}
class C3 extends C1 implements I1, I2 {
public void i1m1() { }
public void i2m1() { }
}
}
---------- END SOURCE ----------
(Incident Review ID: 285400)
======================================================================
###@###.### 2005-03-03 00:15:59 GMT
Name: rmT116609 Date: 07/12/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta3-b56)
Java HotSpot(TM) Client VM (build 1.5.0-beta3-b56, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
The invocation of generic method m1() has return type C1&I1&I2. The compiler allows methods on I1 & I2 to be invoked, but it complains about methods on C1.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
javac Test.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Program compiles without errors.
ACTUAL -
Test.java:9: cannot find symbol
symbol: method c1m1()
m1(c2, c3).c1m1();
^
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
static String foo;
public static void main(String[] args) {
C2 c2 = null;
C3 c3 = null;
m1(c2, c3).c1m1();
m1(c2, c3).i1m1();
m1(c2, c3).i2m1();
}
public static <T> T m1(T t1, T t2) {
return null;
}
class C1 { void c1m1() {} }
interface I1 { void i1m1(); }
interface I2 { void i2m1(); }
class C2 extends C1 implements I1, I2 {
public void i1m1() { }
public void i2m1() { }
}
class C3 extends C1 implements I1, I2 {
public void i1m1() { }
public void i2m1() { }
}
}
---------- END SOURCE ----------
(Incident Review ID: 285400)
======================================================================
###@###.### 2005-03-03 00:15:59 GMT
- duplicates
-
JDK-5079756 Conditional operator misinterprets/mixes up access modifiers for polymorph
- Closed
- relates to
-
JDK-6407257 javac locks up when encountering cyclic inheritance
- Closed