RFR: 8358820: Allow interpolation outside of range [0,1] [v3]

Michael Strauß mstrauss at openjdk.org
Wed Sep 3 18:19:50 UTC 2025


On Wed, 3 Sep 2025 09:29:33 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> modules/javafx.graphics/src/test/java/test/javafx/scene/paint/RadialGradientTest.java line 291:
>> 
>>> 289:         try {
>>> 290:             RadialGradient.valueOf("radial-gradient(radius -100, red 0%, blue 30%, black 100%)");
>>> 291:             fail("IllegalArgument should have been thrown.");
>> 
>> nice: these tests do more than a simple `assertThrows` would do.
>
> You can do this actually as `assertThrows` returns the exception thrown:
> 
>             assertEquals("message", assertThrows(
>                 IllegalArgumentException.class, 
>                 () -> RadialGradient.valueOf("radial-gradient(radius -100, red 0%, blue 30%, black 100%)")
>             ).getMessage());

That's true, but I don't want to refactor all of the tests here at this time.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1822#discussion_r2319820527


More information about the openjfx-dev mailing list