8257598: Clarify what component values are used in Record::equals

Reviewed-by: darcy, chegar
This commit is contained in:
Vicente Romero 2020-12-11 19:16:34 +00:00
parent a280182956
commit b7ac32d6ee
2 changed files with 134 additions and 3 deletions

View file

@ -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>
*