On Tue, 14 Jan 2025 07:38:30 GMT, Chen Liang <li...@openjdk.org> wrote:
> 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. > > 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. > > The new methods are all in `AccessFlag.Location`: > - `Set<AccessFlag> flags()` > - `int flagsMask()` > - `Set<AccessFlag> flags(ClassFileFormatVersion)` > - `int flagsMask(ClassFileFormatVersion)` > > Also there is some simplification to `AccessFlag` itself to remove the > anonymous classes, which should be more startup-friendly. > > Testing: Tier 1-3 This pull request has now been integrated. Changeset: dcffd9d9 Author: Chen Liang <li...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/dcffd9d9ac1ad1ed814b5bb45222a25621eeccda Stats: 721 lines in 9 files changed: 400 ins; 142 del; 179 mod 8347471: Provide valid flags and mask in AccessFlag.Location Reviewed-by: rriggs ------------- PR: https://git.openjdk.org/jdk/pull/23095