RFR: 8375561: Class NGGroup is in need of some cleanup

Kevin Rushforth kcr at openjdk.org
Fri Jan 16 19:15:10 UTC 2026


On Fri, 16 Jan 2026 18:14:35 GMT, Christopher Schnick <duke at openjdk.org> wrote:

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

This goes beyond addressing the removal of the try/catch. I'm not sure whether the value of the additional cleanup is worth the effort to review (and test) it. I highlighted one of the removed null checks where we need to see that there won't be any behavioral change.

At a minimum, please explain all of the non-obvious changes in the PR description or in a comment. Specifically:

1. Are you confident that the try/catch is no longer needed. I suspect that Michael was right and that it isn't, but I'd like to see at least a few words of explanation from you.
2. For the removed null checks, can you show that the object in question can never be null?

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

> 219:         List<NGNode> orderedChildren = getOrderedChildren();
> 220:         for (NGNode orderedChild : orderedChildren) {
> 221:             orderedChild.renderForcedContent(gOptional);

If `getOrderedChildren()` can ever return null, then the null check is needed, so I can't tell without digging a little whether this is a safe fix.

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

PR Review: https://git.openjdk.org/jfx/pull/2043#pullrequestreview-3672286753
PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2699635148


More information about the openjfx-dev mailing list