RFR: 8375561: Class NGGroup is in need of some cleanup [v2]

Andy Goryachev angorya at openjdk.org
Fri Jan 16 22:25:43 UTC 2026


On Fri, 16 Jan 2026 22:15:19 GMT, Christopher Schnick <duke at openjdk.org> wrote:

>> 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.
>
> Good catch, removed it

Are you sure?  What about Android/iOS/other platform supported by Gluon?  @johanvos

>> 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.
>
> Is that nowadays still not optimized internally to some degree? Since for each loops are so common now, I thought that the compiler would perform good enough optimizations.
> 
> I chose for each loops here because the original issue was caused by the indicies in the for loop

Optimization: I don't know.  Maybe, maybe not.  I suspect the contract is to create the iterator.

My main point  - it is a completely unnecessary change, a change for the sake of change.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2700154304
PR Review Comment: https://git.openjdk.org/jfx/pull/2043#discussion_r2700163429


More information about the openjfx-dev mailing list