<div dir="ltr"><div dir="ltr">On Wed, Jan 21, 2026 at 1:34 PM Brian Goetz <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you read the spec for Record::equals, you'll see that this invariant <br>
-- take it apart with accessors, put it back together unchanged with the <br>
constructor, the result must be equals() -- is written into the Record <br>
spec. Not because we chose to "generate" equals and hashCode, but <br>
because of what the "just" in "just a carrier for S" means.<br></blockquote><div><br></div><div>That's a good requirement, and I agree that identity equality is wrong for records and carriers, but there was another way we could have achieved this requirement, i.e, by using value equality (i.e., using == on each component) instead of recursive equality (using equals() on each component) or identity equality (using == on this & that).</div><div><br></div><div>Asking in another way, how would you describe the conceptual distinction between a record and a value class?</div><div><br></div><div>Thanks,</div><div>-Archie</div></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>