[lworld] RFR: 8281463: [lworld] VALUE / PRIMITIVE modifiers should be supported by reflection [v13]

Mandy Chung mchung at openjdk.org
Fri Sep 2 21:58:40 UTC 2022


On Fri, 2 Sep 2022 21:35:08 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Add support to java.lang.reflect.AccessFlag ACC_IDENTITY, ACC_VALUE, and ACC_PRIMITIVE.
>> Added corresponding flags to j.l.reflect.Modifier so the "source" of the AccessFlag is the Modifer mask.
>> Remove PERMITS_VALUE; moving the definition used by HotSpot to HotSpot code.
>> 
>> Add comments to java.l.reflect.Modifier suggesting use of AccessFlag instead and limitations.
>
> Roger Riggs has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 27 commits:
> 
>  - Updated defneHiddenClass/BasicTest for EmptyHiddenAbstractClass
>    to expect ACC_IDENTITY.
>    Since the generated class is bytecode V14 = 58, the ACC_IDENTITY is inserted by the VM.
>  - Merge branch 'lworld' into 8281463-value-modifiers
>  - Merge branch 'lworld' into 8281463-value-modifiers
>  - Match up AccessFlag and Modifier
>  - Merge branch 'lworld' into 8281463-value-modifiers
>  - Revert additions of ACC_PRIMITIVE to Modifier and AccessFlags.
>    The design is in flux.
>  - Restore some tests and cleanup
>  - Resync with mainline AccessFlag changes
>  - Merge branch '8287250-class-identity' into 8281463-value-modifiers
>  - Merge branch 'lworld' into 8287250-class-identity
>  - ... and 17 more: https://git.openjdk.org/valhalla/compare/28c8958c...28ef42ff

Looks good with minor comments.

src/java.base/share/classes/java/lang/Class.java line 641:

> 639: 
> 640:     /**
> 641:      * Returns {@code true} if this class is an identity class.

Nit: can replace this with the simplified form `{@return ...}`

src/java.base/share/classes/java/lang/Class.java line 659:

> 657:      */
> 658:     public boolean isValue() {
> 659:         return (this.getModifiers() & Modifier.VALUE) != 0;

the private static `VALUE_CLASS` constant should be removed

-------------

Marked as reviewed by mchung (Committer).

PR: https://git.openjdk.org/valhalla/pull/698



More information about the valhalla-dev mailing list