-
Notifications
You must be signed in to change notification settings - Fork 227
Don't create dummy item when removing invalid element from tree #3525 #3527
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
base: master
Are you sure you want to change the base?
Conversation
|
@laeubi This fixes the issue with the project explorer. Though I'd still like to add a proper test case. |
|
@ptziegler good finding! I can guess its hard to come of with a simple testcase here given JDT is involved and we likely do not want to include it as a dependency. |
|
Considering M3 is this week, I would prefer to postpone this change to 4.39 (assuming it works() in general and not only for specific use case). This change (which affects org.eclipse.jface.viewers.AbstractTreeViewer.remove(Object...)` behavior must be tested for a longer time before release. |
Test Results 3 018 files ± 0 3 018 suites ±0 2h 18m 19s ⏱️ -14s For more details on these failures, see this check. Results for commit 562ad67. ± Comparison against base commit 6d2b614. ♻️ This comment has been updated with latest results. |
|
I had a closer look at Bug 210747 and whatever was done with f1899ad doesn't work, regardless of my change.
As it is, eclipse.platform.ui/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java Lines 3125 to 3127 in 39d028e
What a mess... |
652520a to
657b1b7
Compare
|
I've adapted the check so that for the use-case described in Bug 210747, where an element was removed from the tree that hasn't been realized yet, the I'm still not sure what the reasoning behind the initial change was, but I'm fairly confident that what was described in the bug was never fixed and probably can't be reasonbly fixed. I've added a test case for this bug, which will obviously fail. Perhaps someone who is more familiar with the TreeViewer can have a look, otherwise I'll remove it again for the next M1.
That's fine by me. This problem has existed for almost two decades, so three more months won't make much of a difference. |
|
I'm a little bit concerned about this code block here, which is also responsible for the test failure and which was added with #810 eclipse.platform.ui/bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java Lines 2065 to 2084 in 601b0d3
In short, if |
241e3fc to
ad4c5c7
Compare
…se-platform#3525 Due to the fix for Bug 210747, a dummy tree-item is added to the viewer if the same element is removed twice. The problem is that this fix doesn't distinguish between nodes that haven't been realized yet and nodes that are not part of the model. This check has been refined to only call updatePlus(...) if the removed object is associated with such a dummy node. To reproduce: - Create a new project "Project A" and "Project B" - Create a new text file "test" in "Project A" - Move "test" to "Project B" Closes eclipse-platform#3525

Due to the fix for Bug 210747, a dummy tree-item is added to the viewer if the same element is removed twice. The problem is that this fix doesn't distinguish between nodes that haven't been realized yet and nodes that are not part of the model.
This check has been refined to only call updatePlus(...) if the removed object is associated with such a dummy node.
To reproduce:
Closes #3525