RFR: 8346227: Seal Paint and Material [v2]
Michael Strauß
mstrauss at openjdk.org
Tue Dec 17 18:15:47 UTC 2024
On Tue, 17 Dec 2024 18:01:57 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>>
>> use exhaustive switch pattern
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/tk/Toolkit.java line 597:
>
>> 595:
>> 596: public Object getPaint(Paint paint) {
>> 597: return switch (paint) {
>
> standard warning: not equivalent change (in the case of null `paint`).
> it's ok in this case, since it looks like this method is never called with a null argument thanks to guards like this replicated across the code base:
>
>
> peer.setFillPaint(getFill() == null ? null : tk.getPaint(getFill()));
>
>
> would it have been easier to allow null argument and return null from `getPaint()` instead?
`null` is not a valid argument for this method, and has never been. `acc_getPlatformPaint()` previously asserted that the return value is not `null`.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1665#discussion_r1888999112
More information about the openjfx-dev
mailing list