RFR: 8257512: Remove use of deprecated primitive constructors in JavaFX [v3]
Ambarish Rapte
arapte at openjdk.java.net
Thu Mar 11 06:32:10 UTC 2021
On Thu, 11 Mar 2021 00:23:48 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> Ambarish Rapte has updated the pull request incrementally with one additional commit since the last revision:
>>
>> correct Float.valueOf()
>
> modules/javafx.controls/src/test/java/test/javafx/scene/chart/XYChartTest.java line 85:
>
>> 83: Font f = yaxis.getTickLabelFont();
>> 84: // default caspian value for font size = 10
>> 85: assertEquals(10, Double.valueOf(f.getSize()).intValue());
>
> Any reason to convert `f.getSize()` to `int` and then to `Double`? Is it for flooring the `double`?
>
> Same for the other places.
`f.getSize()` returns a double value, the statement can also be written as `assertEquals(10, f.getSize(), 0f);`
But, as this change is a cleanup and is intended to remove the calls to deprecated constructors, I think it should be limited to changing calls to autobox or to use `valueOf()` method.
-------------
PR: https://git.openjdk.java.net/jfx/pull/423
More information about the openjfx-dev
mailing list