JDK-8072024 : Different classfiles depending on source order with fields of inner enum type
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 7u76,8u25
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2015-01-30
  • Updated: 2015-01-30
  • Resolved: 2015-01-30
Related Reports
Duplicate :  
Description
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. 
Comments
Great! I searched for duplicates, but did not find that duplicate. Thanks.
30-01-2015

This is a duplicate of a known bug.
30-01-2015