If fields in source A have an enum type where that enum is an inner class of another source B, the class file of A is different depending if the source compile order is A.java B.java, or B.java A.java.
Either:
static #6= #5 of #18; //MyEnum=class HasEnum$MyEnum of class HasEnum
or
static abstract #6= #5 of #18; //MyEnum=class HasEnum$MyEnum of class HasEnum
Steps to reproduce:
javac UseEnum.java HasEnum.java
javap -v -cp . UseEnum
javac HasEnum.java UseEnum.java
javap -v -cp . UseEnum
Compare the two outputs.
Either:
static #6= #5 of #18; //MyEnum=class HasEnum$MyEnum of class HasEnum
or
static abstract #6= #5 of #18; //MyEnum=class HasEnum$MyEnum of class HasEnum
Steps to reproduce:
javac UseEnum.java HasEnum.java
javap -v -cp . UseEnum
javac HasEnum.java UseEnum.java
javap -v -cp . UseEnum
Compare the two outputs.
- duplicates
-
JDK-8068517 Compiler may generate wrong InnerClasses attribute for static enum reference
-
- Closed
-