mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8257598: Clarify what component values are used in Record::equals
Reviewed-by: darcy, chegar
This commit is contained in:
parent
a280182956
commit
b7ac32d6ee
2 changed files with 134 additions and 3 deletions
|
@ -111,15 +111,14 @@ public abstract class Record {
|
|||
* <li> If the component is of a reference type, the component is
|
||||
* considered equal if and only if {@link
|
||||
* java.util.Objects#equals(Object,Object)
|
||||
* Objects.equals(this.c(), r.c()} would return {@code true}.
|
||||
* Objects.equals(this.c, r.c} would return {@code true}.
|
||||
*
|
||||
* <li> If the component is of a primitive type, using the
|
||||
* corresponding primitive wrapper class {@code PW} (the
|
||||
* corresponding wrapper class for {@code int} is {@code
|
||||
* java.lang.Integer}, and so on), the component is considered
|
||||
* equal if and only if {@code
|
||||
* PW.valueOf(this.c()).equals(PW.valueOf(r.c()))} would return
|
||||
* {@code true}.
|
||||
* PW.compare(this.c, r.c)} would return {@code 0}.
|
||||
*
|
||||
* </ul>
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue