RFR: 8340493: Fix some Asserts failure messages
Daniel Jeliński
djelinski at openjdk.org
Tue Dec 17 13:00:40 UTC 2024
On Mon, 16 Dec 2024 22:32:39 GMT, Valerie Peng <valeriep at openjdk.org> wrote:
>> `Asserts.assertNotEquals` shows "expected 12345 to not equal 12345" which sounds redundant, just say "expected not equals but was 12345".
>>
>> `Asserts.assertEqualsByteArray` uses the words "expected... to equal...". Modify it to follow the `assertEquals` style ""expected... but was...".
>
> test/lib/jdk/test/lib/Asserts.java line 448:
>
>> 446: if ((lhs == rhs) || (lhs != null && lhs.equals(rhs))) {
>> 447: msg = Objects.toString(msg, "assertNotEquals")
>> 448: + ": expected not equals but was " + Objects.toString(lhs);
>
> Same comment as above `assertNotEqualsByteArray(byte[] lhs, byte[] rhs, String msg)`
This might hide problems with the implementation of `equals`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21101#discussion_r1888478460
More information about the core-libs-dev
mailing list