RFR: 8261123: Augment discussion of equivalence classes in Object.equals and comparison methods [v2]
Brian Burkhalter
bpb at openjdk.java.net
Tue Feb 9 23:35:41 UTC 2021
On Tue, 9 Feb 2021 20:27:52 GMT, Joe Darcy <darcy at openjdk.org> wrote:
>> A follow-up of sorts to JDK-8257086, this change aims to improve the discussion of the relationship between Object.equals and compareTo and compare methods. The not-consistent-with-equals natural ordering of BigDecimal get more explication too. While updating Object, I added some uses of apiNote and implSpec, as appropriate. While a signum method did not exist when Comparable was added, it has existed for many years so I removed obsolete text that defined a "sgn" function to compute signum.
>>
>> Once the changes are agreed to, I'll reflow paragraphs and update the copyright years.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix typos found in code review.
src/java.base/share/classes/java/lang/Object.java line 148:
> 146: * relation, each equivalence class only has a single element.
> 147: *
> 148: * @apiNoted
`s/apiNoted/apiNote/`
src/java.base/share/classes/java/lang/Object.java line 198:
> 196: * need to be modified.
> 197: *
> 198: * @implspec
`s/implspec/implSpec/`
src/java.base/share/classes/java/math/BigDecimal.java line 3062:
> 3060:
> 3061: * @apiNote
> 3062: * Note: this class has a natural ordering that is inconsistent with equals.
Is `Note: ` really needed?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2471
More information about the core-libs-dev
mailing list