On Wed, 10 Mar 2021 23:59:05 GMT, Nir Lisker <nlis...@openjdk.org> wrote:

>> Ambarish Rapte has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   correct Float.valueOf()
>
> apps/toys/LayoutDemo/src/layout/CustomPane.java line 92:
> 
>> 90:         Collections.sort(sortedManagedChidlren, (c1, c2)
>> 91:                 -> Double.valueOf(c2.prefHeight(-1)).compareTo(
>> 92:                         Double.valueOf(c1.prefHeight(-1))));
> 
> This can be replaced with
> 
>     Collections.sort(sortedManagedChidlren, (c1, c2) -> 
> Double.compare(c2.prefHeight(-1), c1.prefHeight(-1)));
> 
> or
> 
>     Collections.sort(sortedManagedChidlren, 
> Comparator.<Node>comparingDouble(n -> n.prefHeight(-1)).reversed());
> 
> I think.
> Same for the other places that do comparing.

As this change is a cleanup and intended to replace deprecated constructor 
calls with autoboxing or `valueOf()` method, I think we should not make other 
changes as part of this PR.

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

PR: https://git.openjdk.java.net/jfx/pull/423

Reply via email to