Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8254275: [valhalla/jep390] Revise "value-based class" & apply to wrappers #222

Closed
wants to merge 11 commits into from
@@ -55,7 +55,6 @@ <h1 id="ValueBased">{@index "Value-based Classes"}</h1>
<li>the class is final, and extends either <code>Object</code> or a hierarchy of
abstract classes that declare no instance fields or instance initializers
and whose constructors are empty.</li>
<li>
</ul>

This comment has been minimized.

@RogerRiggs

RogerRiggs Nov 2, 2020
Collaborator

Perhaps as an intro to the following points to make it clear these are about what a program should and should not do.
Should use equals(); should use explicit synchronization using lock objects or instances that are not value-based classes, etc.
Programs should not attempt to distinguish the identities of value based class instances, otherwise the result may be unpredictable.

This comment has been minimized.

@dansmithcode

dansmithcode Nov 5, 2020
Author Collaborator

I'm not totally following. This is a revision to the "When two instances" paragraph? Can you propose an alternative phrasing for the entire paragraph?

This comment has been minimized.

@RogerRiggs

RogerRiggs Nov 5, 2020
Collaborator

These two paragraphs are fine, they express the negative, not what a developer should do.

<p>When two instances of a value-based class are equal (according to `equals`), a program