Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8332726

javap fatal error on unexpected modifier bit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22, 23
    • core-libs
    • None

      I have a class file with a field whose 0x0800 flag bit is set. In 21, javap accepts the class file and (in verbose mode) prints the flag value. In 22, javap reports a "fatal error".

      Not sure if this is by design or a side-effect of some other change, but this is a valid class file per JVMS ("All bits of the access_flags item not assigned ... should be ignored by Java Virtual Machine implementations"), so it seems like the old behavior is more appropriate.

      > `javahome 21`/bin/javap classes/StrictField.class
      Compiled from "StrictField.jasm"
      public class StrictField {
        final int x;
        final int y;
        public StrictField();
      }

      > `javahome 22`/bin/javap classes/StrictField.class
      Compiled from "StrictField.jasm"
      public class StrictField {
      Error: Fatal error: Unmatched bit position 0x800 for location FIELD

      > `javahome 21`/bin/javap -v classes/StrictField.class
      ...
        final int x;
          descriptor: I
          flags: (0x0810) ACC_FINAL, 0x800
      ...

            vromero Vicente Arturo Romero Zaldivar
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: