On Wed, 4 Nov 2020 15:41:12 GMT, Arun Joseph <[email protected]> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/PaintHelper.java 
>> line 754:
>> 
>>> 752: 
>>> 753:         BaseTransform paintXform = paint.getPatternTransformNoClone();
>>> 754:         if (paintXform != null) {
>> 
>> Minor: Is the null check needed ?  I could not find an instance where an 
>> object of `ImagePattern` is constructed using default constructor. 
>> If `ImagePattern.getPatternTransformNoClone()` could return null then should 
>> we do null check with other calls to 
>> `ImagePattern.getPatternTransformNoClone()` ? OR may be remove this null 
>> check.
>
> The null check is not actually required as instances of `ImagePattern` can't 
> have a null `patternTransform`. I added this check as `setLinearGradient` and 
> `setRadialGradient` functions have also added them, when instances of 
> `Gradient` can't have null as its transform. Should this null check be 
> removed?

I think leaving it for consistency is fine.

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

PR: https://git.openjdk.java.net/jfx/pull/190

Reply via email to