Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2189691 | OpenJDK6 | Maurizio Cimadamore | P3 | Resolved | Fixed | b19 |
FULL PRODUCT VERSION :
java version "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b27)
Java HotSpot(TM) Client VM (build 11.0-b14, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Compilation of the enclosed program is very sensitive to the order in which the source files are presented.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Unpack the sources and try
javac U.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiles successfully
ACTUAL -
Fails to compile
ERROR MESSAGES/STACK TRACES THAT OCCUR :
U.java:5: cannot find symbol
symbol : method i()
location: class E
E.V.i();
^
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
==> I.java <==
interface I {
void i();
}
==> E.java <==
enum E implements I {
V { public void i() { } };
// public abstract void i();
}
==> U.java <==
class U {
{
I i = E.V;
i.i();
E.V.i();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
running 'javac E.java && javac U.java' succeeds.
Uncommenting line 3 of E.java also works around the problem.
java version "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b27)
Java HotSpot(TM) Client VM (build 11.0-b14, mixed mode)
A DESCRIPTION OF THE PROBLEM :
Compilation of the enclosed program is very sensitive to the order in which the source files are presented.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Unpack the sources and try
javac U.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiles successfully
ACTUAL -
Fails to compile
ERROR MESSAGES/STACK TRACES THAT OCCUR :
U.java:5: cannot find symbol
symbol : method i()
location: class E
E.V.i();
^
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
==> I.java <==
interface I {
void i();
}
==> E.java <==
enum E implements I {
V { public void i() { } };
// public abstract void i();
}
==> U.java <==
class U {
{
I i = E.V;
i.i();
E.V.i();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
running 'javac E.java && javac U.java' succeeds.
Uncommenting line 3 of E.java also works around the problem.
- backported by
-
JDK-2189691 incorrect method resolution for enum classes entered as source files
-
- Resolved
-
- duplicates
-
JDK-6947909 javac cannot find method on enum constant with class body
-
- Closed
-
-
JDK-7049773 Inconsistent compilation results for enum implementing an interface
-
- Closed
-
- relates to
-
JDK-6628966 Valid code cannot be compiled
-
- Closed
-