On Fri, 16 Jan 2026 18:14:35 GMT, Christopher Schnick <[email protected]> wrote:

> This should improve the code quality of the class while preserving its 
> original workings

modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGGroup.java line 
204:

> 202:      * @param blendMode cannot be null
> 203:      */
> 204:     public void setBlendMode(Blend.Mode blendMode) {

This method looks unused, may as well remove if we're cleaning up stuff.

modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGGroup.java line 
268:

> 266:                 if (child != null) {
> 267:                     child.render(g);
> 268:                 }

That's some pretty poor code to begin with. If there is any worry at all that 
this can be called from multiple threads, then `synchronized` should be used.

modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGGroup.java line 
287:

> 285:         } while (bot == null || !idValid);
> 286: 
> 287:         bot.unref();

This `null` check could be important if a `Group` is empty.  Please verify.

modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGGroup.java line 
451:

> 449:             NGNode child;
> 450:             List<NGNode> orderedChildren = getOrderedChildren();
> 451:             for (NGNode orderedChild : orderedChildren) {

You may want to stick with the normal `for` loops as they don't require 
allocating an iterator object.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2700114515
PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2700119175
PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2700124885
PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2700126762

Reply via email to