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

AccessFlag::locations(ClassFileFormatVersion cffv) and locations() results are inconsistent

XMLWordPrintable

      As per the spec:
      locations() - "Returns kinds of constructs the flag can be applied to in the latest class file format version."

      locations(ClassFileFormatVersion cffv) - "Returns kinds of constructs the flag can be applied to in the given class file format version.

      Expected that, when locations(ClassFileFormatVersion cffv) invoked with ClassFileFormatVersion.latest() parameter the results should match with the results of locations().

      Actual Behavior :
      The results mismatch for the AccessFlag STRICT.

      Please find the attached code to demonstrate this.

      Also observed an API note for https://download.java.net/java/early_access/jdk20/docs/api/java.base/java/lang/reflect/AccessFlag.html#STRICT
      that "The ACC_STRICT access flag is defined for class file major versions 46 through 60, inclusive (JVMS 4.6), corresponding to Java SE 1.2 through 16."

      Technically the locations() as well shall not return any values for AccessFlag STRICT.

            darcy Joe Darcy
            kganapureddy Krushnareddy Ganapureddy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: