Different classfiles depending on source order with fields of inner enum type

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 7u76, 8u25
    • Component/s: tools
    • None

      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.

        1. HasEnum.java
          0.2 kB
        2. UseEnum.java
          0.0 kB

            Assignee:
            Unassigned
            Reporter:
            Keimpe Bronkhorst (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: