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

John Hendrikx jhendrikx at openjdk.org
Wed Sep 3 09:32:53 UTC 2025


On Fri, 29 Aug 2025 16:24:45 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Michael Strauß has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' into feature/relaxed-interpolation
>>  - javadoc
>>  - Allow interpolation outside of range [0,1]
>
> 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());

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

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


More information about the openjfx-dev mailing list