Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 40214

Summary: [Navigator] Renaming Folder in Navigator causes folder to appear twice in Navigator
Product: [Eclipse Project] Platform Reporter: Michael Valenta <Michael.Valenta>
Component: UIAssignee: 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 Flags
Navigator with same folder twice after rename none

Description Michael Valenta CLA 2003-07-16 10:17:23 EDT
I renamed a folder and the renamed foldered appeared twice. I will attach a 
screen shot. I am using I20030716.
Comment 1 Michael Valenta CLA 2003-07-16 10:19:13 EDT
Created attachment 5477 [details]
Navigator with same folder twice after rename
Comment 2 Knut Radloff CLA 2003-07-17 12:45:00 EDT
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?
Comment 3 Rafael Chaves CLA 2003-08-28 11:46:29 EDT
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). 
Comment 4 Knut Radloff CLA 2003-09-02 14:51:23 EDT
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.
Comment 5 Nick Edgar CLA 2003-09-02 16:08:06 EDT
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.
Comment 6 Mark Drew CLA 2003-09-18 08:32:57 EDT
*** Bug 43283 has been marked as a duplicate of this bug. ***
Comment 7 Nick Edgar CLA 2003-10-06 16:04:26 EDT
A patch went in for M4 to address the common case, but this needs to be 
revisited properly for M5.
Comment 8 Nick Edgar CLA 2003-11-17 22:03:41 EST
Kim, is this still an issue?  Not sure if the changes we discussed got released.
Comment 9 Kim Horne CLA 2003-11-18 09:12:41 EST
I believe this was fixed in the initial patch for Bug 44081, but that problem
still has some unresolved peculiars.

*** This bug has been marked as a duplicate of 44081 ***