JDK-8347471 : Provide valid flags and mask in AccessFlag.Location
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-01-10
  • Updated: 2025-05-08
  • Resolved: 2025-04-30
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 25
25 b21Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Sub Tasks
JDK-8347709 :  
Description
Some AccessFlag parsing methods throw IAE because a flag mask is not valid in a location. However, there is no easy way to check what flag mask bits or what flags are valid for a location. We need such APIs to check, specific to each class file format version.

API would look like:
int flagsMask(CFFV); int flagsMask();
Set<AF> flags(CFFV); Set<AF> flags();

Also in the investigation, it's noted that ACC_SYNTHETIC is incorrectly represented - it is available since release 5.0 instead of release 7.  This bug is fixed together for implementation simplicity.
Comments
Changeset: dcffd9d9 Branch: master Author: Chen Liang <liach@openjdk.org> Date: 2025-04-30 00:39:02 +0000 URL: https://git.openjdk.org/jdk/commit/dcffd9d9ac1ad1ed814b5bb45222a25621eeccda
30-04-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23095 Date: 2025-01-14 07:38:30 +0000
14-01-2025