-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b42
-
x86
-
windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085283 | emb-9 | Jan Lahoda | P4 | Resolved | Fixed | team |
FULL PRODUCT VERSION :
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
static imports to nested classes in the same compilation unit fail in certain situations.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
>javac pack\C.java pack\sub\I.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiler should show no error
ACTUAL -
pack\C.java:13: error: cannot find symbol
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
File pack/C.java:
----snip----
package pack;
import static pack.C.E.A;
import pack.sub.I;
public class C
{
public void bla ()
{
System.out.println(A);
}
public static enum E implements I
{
A
}
}
----snip----
File pack/sub/I.java
----snip----
package pack.sub;
public interface I
{
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
swap import statements in C.java
remove import pack.sub.I, use FQN for definition of E
SUPPORT :
YES
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
static imports to nested classes in the same compilation unit fail in certain situations.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
>javac pack\C.java pack\sub\I.java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compiler should show no error
ACTUAL -
pack\C.java:13: error: cannot find symbol
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
File pack/C.java:
----snip----
package pack;
import static pack.C.E.A;
import pack.sub.I;
public class C
{
public void bla ()
{
System.out.println(A);
}
public static enum E implements I
{
A
}
}
----snip----
File pack/sub/I.java
----snip----
package pack.sub;
public interface I
{
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
swap import statements in C.java
remove import pack.sub.I, use FQN for definition of E
SUPPORT :
YES
- backported by
-
JDK-8085283 Static import to local nested class fails
-
- Resolved
-
- duplicates
-
JDK-7177814 Static import to local nested class fails
-
- Closed
-
-
JDK-8186962 Can't find class which is declared in a superclass
-
- Closed
-
- relates to
-
JDK-8056066 JEP 216: Process Import Statements Correctly
-
- Closed
-