On Thu, 2 Jul 2026 14:50:38 GMT, Chen Liang <[email protected]> wrote:

>> Reflective preview APIs can be used out of preview. Thus it is meaningful 
>> for us to note how they behave when preview features are disabled.
>> 
>> I hope this can clarify some common misconceptions and help onboarding to 
>> the JEP 401 reflection model.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> 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 eight additional commits since 
> the last revision:
> 
>  - Alan reviews
>  - Merge branch 'lworld' of https://github.com/openjdk/valhalla into 
> doc/lw-reflect-preview-api-0
>  - Merge branch 'lworld' of https://github.com/openjdk/valhalla into 
> doc/lw-reflect-preview-api-0
>  - Merge branch 'lworld' of https://github.com/openjdk/valhalla into 
> doc/lw-reflect-preview-api-0
>  - Merge branch 'lworld' of https://github.com/openjdk/valhalla into 
> doc/lw-reflect-preview-api-0
>  - Reword recommendations
>  - Make requireIdentity reflective
>  - Reflective preview API behavior out of preview

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

> 1395:      *          <p>
> 1396:      *          When preview features are disabled, such a {@code 
> Class} object
> 1397:      *          does not have its {@code identity} modifier set.

You should be able to use the definite article in this sentence so it reads 
"the Class object" rather "such a Class object". I think that would be easier 
to read here.

(Same thing in Class::accessFlags preview block)

src/java.base/share/classes/java/lang/classfile/attribute/StackMapFrameInfo.java
 line 89:

> 87:      * depend on preview features, the list of unset fields is always 
> empty;
> 88:      * otherwise, the {@code class} file must declare that it depends on 
> preview
> 89:      * features if the unset fields list contains any item.

The first part is fine. I think the second part would be easier to read if you 
drop "otherwise" and just say "If the class file depends on preview features 
then it returns list of unset fields".

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2578#discussion_r3518672654
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2578#discussion_r3518633192

Reply via email to