RFR: JDK-8266670: Better modeling of access flags in core reflection [v17]

Joe Darcy darcy at openjdk.org
Tue Jun 21 22:12:45 UTC 2022


On Fri, 29 Apr 2022 18:49:26 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Joe Darcy 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 26 additional commits since the last revision:
>> 
>>  - Respond to review feedback.
>>  - Merge branch 'master' into JDK-8266670
>>  - Make workding changes suggested in review feedback.
>>  - Merge branch 'master' into JDK-8266670
>>  - Typo fix; add implSpec to Executable.
>>  - Appease jcheck.
>>  - Fix some bugs found by inspection, docs cleanup.
>>  - Merge branch 'master' into JDK-8266670
>>  - Initial support for accessFlags methods
>>  - Add mask to access flag functionality.
>>  - ... and 16 more: https://git.openjdk.org/jdk/compare/217d0507...14980605
>
> src/java.base/share/classes/java/lang/Class.java line 1328:
> 
>> 1326:      * @since 19
>> 1327:      */
>> 1328:     public Set<AccessFlag> accessFlags() {
> 
> The access flags of a hidden class has no difference than that of a normal class.  A hidden class is created with normal `ClassFile` except that it's created via `Lookup::defineHiddenClass` API. 
> 
> I think the `Class::accessFlags` method should specify the access flags for primitive type, void, and array classes as `Class::getModifiers` specified.

Expanded the spec of Class.accessFlags() to explicitly cover primitives and arrays. Small implementation update needed; test coverage expanded accordingly. Thanks.

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

PR: https://git.openjdk.org/jdk/pull/7445


More information about the core-libs-dev mailing list