-
Bug
-
Resolution: Fixed
-
P4
-
6u31, 7
-
b42
-
x86
-
linux_ubuntu, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085282 | emb-9 | Jan Lahoda | P4 | Resolved | Fixed | team |
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HosSpot(TM) Server VM (build 21.0-b17, mixed mode))
ADDITIONAL OS VERSION INFORMATION :
Linux Computer 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 :21:18_14 UTC 2011 i686 i686 i386 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
In some situations the order of imports in a class may be imported to let javac
compile all classes:
Let X be a class having an inner class X_1 extending some class Y in a
different package. If a subtype of X_1 have to be imported (e.g. it has
another inner class which is referenced) and it is imported before Y is
imported, then X_1 is not compiled.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create Z.java in package z with content:
{{{
package z;
public class Z{}
}}}
Create A.java in package a with content:
{{{
package a;
import a.A.B.C;
import z.Z;
public class A {
class B extends Z {
class C {}
}
class D {
Class foo() {
return C.class;
}
}
}
}}}
try to run: javac a/A.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A compiles without problems.
ACTUAL -
A does not compile
ERROR MESSAGES/STACK TRACES THAT OCCUR :
a/A.java:5 error: cannot find symbol
class B extends Z {
^
symbol: class Z
location: class A
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Reorder the imports or do not nest the classes.
- backported by
-
JDK-8085282 Compiling depends on order of imports
-
- Resolved
-
- blocks
-
JDK-8031570 Refactor annotations pipeline in javac
-
- Open
-
- duplicates
-
JDK-6391197 static import seems to hide non-static import in a very special case
-
- Closed
-
-
JDK-6707323 javac fails to compile inner class when secondary inner class is involved: "cannot find symbol"
-
- Closed
-
-
JDK-6959402 javac fail with nonsensical errors due to cyclical source dependencies
-
- Closed
-
-
JDK-6994109 static import of nested enum hides interface import
-
- Closed
-
-
JDK-7084633 static import fails to resolve interfaces on nested enums via import statements
-
- Closed
-
-
JDK-7185290 javac fails to compile inner class when secondary inner class is involved
-
- Closed
-
-
JDK-8066856 javac fails based on order of import statements
-
- Closed
-
-
JDK-8148472 static import may hide other imports
-
- Closed
-
-
JDK-8176260 Build of the project breaks on one host; but succeeds on other
-
- Closed
-
- is blocked by
-
JDK-8031569 Refactor javac scope implementation to enable lazy imports
-
- Closed
-
- relates to
-
JDK-8048890 Add option to keep track of symbol completion dependencies
-
- Closed
-
-
JDK-7084633 static import fails to resolve interfaces on nested enums via import statements
-
- Closed
-
-
JDK-8056066 JEP 216: Process Import Statements Correctly
-
- Closed
-