New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8290348: TreeTableView jumping to top #836
Conversation
In the (unlikely) event that the recalculation triggers a new recalculation (e.g. when the height of a Cell is changed), do not start this recalculation. The cache and cache size may become inconsistent if a recursive calculation is started. This fixes JDK-8290348
|
Webrevs
|
/reviewers 2 |
@kevinrushforth |
I tested on macOS. It is observed that the newly added test passes even without the |
I'll make the test more deterministic.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I confirm that both the visual test and updated unit test fail without the fix and pass with the fix. I left one question inline, but I doubt it is a problem.
@@ -3107,7 +3110,7 @@ private void recalculateAndImproveEstimatedSize(int improve) { | |||
this.absoluteOffset = newOffset + oldOffset; | |||
adjustPosition(); | |||
} | |||
|
|||
recalculating = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it likely that this method might get an exception? I was wondering whether the assignment to false should be in a try / finally. If there is no probable way an exception could occur, or if an exception is non-recoverable (which is quite possible), then no need for a try / finally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. There should be no non-recoverable exceptions in the VirtualFlow specific code. However, since IndexedCell.updateItem() and others might get called from this method, exceptions there might propagate.
My initial thought was to fail-fast, but it is probably better to use a try/finally so that at least this method is still "working" somehow. I'll add that.
@johanvos This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
…ating anymore after a single exception)
/integrate |
Going to push as commit 6da05c2.
Your commit was automatically rebased without conflicts. |
Do not recalculate total estimated size recursively.
In the (unlikely) event that the recalculation triggers a new recalculation (e.g. when the height of a Cell is changed), do not start this recalculation.
The cache and cache size may become inconsistent if a recursive calculation is started.
This fixes JDK-8290348
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/836/head:pull/836
$ git checkout pull/836
Update a local copy of the PR:
$ git checkout pull/836
$ git pull https://git.openjdk.org/jfx pull/836/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 836
View PR using the GUI difftool:
$ git pr show -t 836
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/836.diff