RFR: 8257512: Remove use of deprecated primitive constructors in JavaFX [v3]
Ambarish Rapte
arapte at openjdk.java.net
Thu Mar 11 06:55:08 UTC 2021
On Thu, 11 Mar 2021 00:18:17 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.base/src/test/java/test/javafx/util/DurationTest.java line 289:
>
>> 287: @Test public void add_ZERO_and_INDEFINITE_ResultsInIndefinite() {
>> 288: //assertTrue(0.0 + Double.POSITIVE_INFINITY == Double.POSITIVE_INFINITY); // sanity check
>> 289: assertEquals(Double.valueOf(Double.POSITIVE_INFINITY), Double.valueOf(0.0 + Double.POSITIVE_INFINITY)); // sanity check
>
> I don't understand why convert to `Double` for the assertion test, but more than that, I don't understand why this test is needed for `Duration`. Isn't this is a guaranteed behavior of fp arithmetic?
>
> Same for all other such asserts.
>From the look of these tests, many look unnecessary to be here. But As these tests exist from very beginning, there might have been a good reason that they were added. As long as they don't harm, and if you don't have any hard call on them, let's keep them as is.(with just the `valueOf` change)
-------------
PR: https://git.openjdk.java.net/jfx/pull/423
More information about the openjfx-dev
mailing list