RFR: 8347471: Provide valid flags and mask in AccessFlag.Location [v7]
Chen Liang
liach at openjdk.org
Sat Apr 26 19:32:31 UTC 2025
> 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
Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:
- Merge branch 'master' of https://github.com/openjdk/jdk into feature/af-location-accessors
- Doc updates, also put access flag set to collections test
- Merge branch 'master' of https://github.com/openjdk/jdk into feature/af-location-accessors
- Preview notes
- Further enhance the impl of access flags, make cffv aware to flags easier
- Merge branch 'master' of https://github.com/openjdk/jdk into feature/af-location-accessors
- Merge branch 'master' of https://github.com/openjdk/jdk into feature/af-location-accessors
- More links
- ClassLoading order, Typos in NPE test
- 8347471: Provide valid flags and mask in AccessFlag.Location
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/23095/files
- new: https://git.openjdk.org/jdk/pull/23095/files/1019812f..b89dc13e
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=23095&range=06
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=23095&range=05-06
Stats: 3682 lines in 112 files changed: 2426 ins; 844 del; 412 mod
Patch: https://git.openjdk.org/jdk/pull/23095.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23095/head:pull/23095
PR: https://git.openjdk.org/jdk/pull/23095
More information about the core-libs-dev
mailing list