On Sat, 14 Dec 2024 17:16:20 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

>> The `Paint` and `Material` classes can't be extended by user code, because 
>> their implementations require special support in internal JavaFX code. The 
>> classes should be sealed.
>
> 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?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1665#discussion_r1888982459

Reply via email to