On Mon, 6 Jul 2026 23:36:05 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).

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

> 34: {@code java.time.LocalDate}, are <em>value-based</em>.
> 35: The compiler and runtime enforce the value based properties below if it 
> is declared
> 36: as {@code value class} and preview features are enabled.

I made this comment somewhere else, but it may have been dropped:

Identity classes can be "value-based". It doesn't really make sense to talk 
about a "value-based value class"—that's just a value class. Everything in this 
file is directed towards identity classes.

Suggest deleting this sentence.

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

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

Reply via email to