> Currently, the preview access flag enum constants are made available with a > ClassFileFormatVersion.CURRENT_PREVIEW_FEATURES constant. Such a constant is > questionable design. > > We can have an approach to model preview access flags without such a > constant, losing the ability for users to inspect through > `ClassFileFormatVersion`, but otherwise keeping these interfaces intact: > > 1. `accessFlags()` factory methods in core reflection > 2. Inspection of AccessFlag through ClassFile API > 3. The outputs of javap > > The new design makes use of a new internal API, > `jdk.internal.reflect.PreviewAccessFlags`. It replaces the AccessFlag APIs > that previously took `ClassFileFormatVersion.CURRENT_PREVIEW_FEATURES`. This > introduces a new qualified export from `java.base/jdk.internal.reflect` to > `jdk.jdeps` for Javap usage. > > In addition, with the recent awareness that core reflection/HotSpot only has > one unique representation of modifiers, we can remove some contrived > representation of access flags present in mainline (that required pulling > class version from Class mirrors) and migrate to our simplified system that > decodes the uniform representation used by hotspot.
Chen Liang has updated the pull request incrementally with two additional commits since the last revision: - Comment update - Remove meaingless bouncer in Reflection ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/2209/files - new: https://git.openjdk.org/valhalla/pull/2209/files/48401c93..b1dec392 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2209&range=07 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2209&range=06-07 Stats: 36 lines in 7 files changed: 7 ins; 11 del; 18 mod Patch: https://git.openjdk.org/valhalla/pull/2209.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2209/head:pull/2209 PR: https://git.openjdk.org/valhalla/pull/2209
