.java file can not define variable name which is the same to the innerclass name.
TEST PROGRAM:
---
class RegInnerClass
{
static class X { }
X X = new X();
}
---
REPRODUCE:
1. Compile the above test case
2. Run "javac class RegInnerClass"
C:\Users\licensees\javac-regression-5u25>javac -J-Duser.language=en RegInnerClass.java
RegInnerClass.java:4: RegInnerClass.X is already defined in RegInnerClass
X X = new X();
^
1 error
NOTE:
This occurs in jdk5u25( and later jdk5ux), but not in JDK5u24(and former jdk5ux), jdk6ux, jdk7ux and jdk8b83.
This seems regression in jdk5u25.
TEST PROGRAM:
---
class RegInnerClass
{
static class X { }
X X = new X();
}
---
REPRODUCE:
1. Compile the above test case
2. Run "javac class RegInnerClass"
C:\Users\licensees\javac-regression-5u25>javac -J-Duser.language=en RegInnerClass.java
RegInnerClass.java:4: RegInnerClass.X is already defined in RegInnerClass
X X = new X();
^
1 error
NOTE:
This occurs in jdk5u25( and later jdk5ux), but not in JDK5u24(and former jdk5ux), jdk6ux, jdk7ux and jdk8b83.
This seems regression in jdk5u25.
- relates to
-
JDK-6955829 Compilation did not fail as expected for 5 JCK Compiler negative tests with JDK 5u25 b02
- Closed