<i18n dev> RFR: 8277868: Use Comparable.compare() instead of surrogate code [v6]

Roger Riggs rriggs at openjdk.java.net
Fri Dec 17 15:06:27 UTC 2021


On Thu, 9 Dec 2021 13:03:39 GMT, Сергей Цыпанов <duke at openjdk.java.net> wrote:

>> Instead of something like
>> 
>> long x;
>> long y;
>> return (x < y) ? -1 : ((x == y) ? 0 : 1);
>> 
>> we can use `return Long.compare(x, y);`
>> 
>> All replacements are done with IDE.
>
> Сергей Цыпанов has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - 8277868: Use Long.compare() for mostSigBits as well
>  - Revert "8277868: Adjust JavaDoc of UUID"
>    
>    This reverts commit f3b95d0e247cf6452955f4f24684fd60d5cb8902.

As it turns out replacing the code was not 100% equivalent and a test failure resulted.
See https://bugs.openjdk.java.net/browse/JDK-8278937

Double.compare and the original code handle the non-numeric forms of Double differently.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6575


More information about the i18n-dev mailing list