RFR: 8346227: Seal Paint and Material [v2]

Andy Goryachev angorya at openjdk.org
Wed Dec 18 18:06:49 UTC 2024


On Wed, 18 Dec 2024 17:55:12 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:

>> this is not what I am asking though: in more than one place we have _callers_ like this
>> 
>> peer.setFillPaint(getFill() == null ? null : tk.getPaint(getFill()));
>> 
>> 
>> it could be changed to 
>> 
>> peer.setFillPaint(tk.getPaint(getFill()));
>
> Yes, that would make the callsite a bit easier. However, from an API perspective, I think it's not the best approach to handle nulls in the toolkit layer. A system that channels nulls thorugh various layers tends to become harder to reason about over time.

I disagree: it makes it more resilient by doing what the caller has to do anyway.
However, the answer is acceptable.

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

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


More information about the openjfx-dev mailing list