| Summary: | [Navigator] Renaming Folder in Navigator causes folder to appear twice in Navigator | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Michael Valenta <Michael.Valenta> | ||||
| Component: | UI | Assignee: | Kim Horne <eclipse> | ||||
| Status: | RESOLVED DUPLICATE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse, mdrew, n.a.edgar, Tod_Creasey | ||||
| Version: | 3.0 | ||||||
| Target Milestone: | 3.0 M6 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Michael Valenta
Created attachment 5477 [details]
Navigator with same folder twice after rename
Does renaming the folder work in the Package Explorer? Do you see this with other folders/is this reproducable? Does the duplicate folder disappear when you close and reopen the Navigator? Just got something like this with i20030827. Steps to reproduce: 1 - Create a simple project containing a folder "folder1" and a file in "file.txt" inside this folder. 2 - Select "folder1", copy, select the project and paste (name the new folder folder2). 3 - Inside folder2, rename file.txt to file2.txt. Bug: there will be two "file2.txt" entries inside "folder2". It does not happen with the Package Explorer (and the Resource Navigator does not show duplicates when the test case is applied to the package explorer). The duplicated resource disappears when the resource navigator is closed and reopened (running the Core Tools it is clear that there are two entries in the Navigator for the same resource handle). The WorkbenchContentProvider removes the old/renamed element using AbstractTreeViewer.remove. This uses StructuredViewer.preservingSelection to maintain the existing selection. During selection, the parent is expanded and children created from the content provider. This prematurely adds the new file. The WorkbenchContentProvider later processes the resource delta for the new file and adds it again (it does not check whether the file already exists). Reassigning to Nick since he is taking ownership of the Navigator. Here's another instance of a regression due to the recent change to AbstractTreeViewer.add to actually do just an add instead of a refresh. *** Bug 43283 has been marked as a duplicate of this bug. *** A patch went in for M4 to address the common case, but this needs to be revisited properly for M5. Kim, is this still an issue? Not sure if the changes we discussed got released. |