JDK-8293627 : AccessFlag::locations(ClassFileFormatVersion cffv) and locations() results are inconsistent
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-12
  • Updated: 2022-09-19
  • Resolved: 2022-09-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b15Fixed
Related Reports
Cloners :  
Description
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.


Comments
[~darcy] Thank you.
16-09-2022

[~kganapureddy], I don't think it is incorrect to have the next in question as an apiNote rather than normative text. The primary document for such historical information about the evolution of the class file format should by the JVMS.
15-09-2022

[~darcy] Currently it's an API Note "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." this statement is more of normative? If yes then API note can be removed? Thanks.
14-09-2022

Changeset: 1dc5039f Author: Joe Darcy <darcy@openjdk.org> Date: 2022-09-13 16:51:01 +0000 URL: https://git.openjdk.org/jdk/commit/1dc5039fed9494f4d9b6c7002d28da9bc466fb10
13-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10243 Date: 2022-09-12 18:14:26 +0000
12-09-2022