On Thu, 16 Jul 2026 17:08:04 GMT, Chen Liang <[email protected]> wrote:

>> `ValueBased` talks about constructor avoidance but does not specify the 
>> reason. It's better to include the reason because it's not straightforward 
>> from the fact that there's no binary incompatibility.
>> 
>> Also `InvalidClassException` benefits from descriptions about 
>> strictly-initialized fields.
>> 
>> ---------
>> - [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 three additional commits since 
> the last revision:
> 
>  - Restructuring and rewording
>  - Merge branch 'lworld' of https://github.com/openjdk/valhalla into 
> doc/lw-vb-ctor-ice
>  - Minor ValueBased and InvalidClassException comments

src/java.base/share/classes/java/lang/doc-files/ValueBased.html line 37:

> 35: In a future release, they may become value classes (JLS
> 36: {@jls value-objects-8.1.1.5}).
> 37: The compiler and runtime enforce some properties for value-based classes

If it's appropriate to link to JEPs from javadoc:


The compiler and runtime provide <a 
href="https://openjdk.org/jeps/390";>warnings</a>
related to the misuse of value-based classes.


(Not really "enforcement", and I don't think we need to say anything more about 
migration.)

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2631#discussion_r3598304340

Reply via email to