On Sun, 29 Mar 2026 20:57:38 GMT, Charlie Schlosser <[email protected]> wrote:

>> modules/javafx.controls/src/main/java/javafx/scene/control/TableView.java 
>> line 1762:
>> 
>>> 1760:                     }
>>> 1761:                     if (prevSize != newSize) {
>>> 1762:                         // tail was purely removed (prevSize > 
>>> newSize) or purely added (prevSize < newSize)
>> 
>> I'm not sure I understand the comment. What does tail mean, in what context? 
>> So I would prefer more clear comments, even if they are multiple lines long. 
>> As this code is not super trivial to understand, and we will likely be 
>> reading this code many times in the coming years.
>
> - `prevSize > newSize` : the elements `[newSize, prevSize)` in `prevState` 
> were removed
> - `prevSize < newSize` : the elements `[prevSize, newSize)` in `newState` 
> were added
> 
> Both cases are handled when `from = minSize`, `to = newSize`, and `removed = 
> prevState.subList(minSize, prevSize)`

I will have a closer look. But feel free to document whatever you think might 
be good for other developers to know/understand

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2131#discussion_r3009224417

Reply via email to