Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 145049 - Deleting resources containing linked resources deletes linked targets
Summary: Deleting resources containing linked resources deletes linked targets
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 3.2.1   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 152727 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-02 08:30 EDT by Dennis Nienhüser CLA
Modified: 2006-10-12 11:58 EDT (History)
2 users (show)

See Also:


Attachments
minimal fix (1.46 KB, patch)
2006-06-05 11:05 EDT, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Nienhüser CLA 2006-06-02 08:30:10 EDT
When I delete a folder in the workspace (using the delete action offered by the Navigator or Project Explorer) which contains linked resources (folders or files) the link targets are removed from the filesystem. I'd expect the same behaviour as when deleting linked resources directly (only link is deleted, resources on the filesystem untouched) instead.

Steps to reproduce:
1) Create a folder 'somefolder' in the filesystem and a file 'somefile' in it
2) Create a simple project in eclipse
3) Create a folder 'parent' in that project
4) Create a subfolder 'child' that links to 'somefolder' (Advanced tab in the wizard)
5) Select "Delete" on 'parent'

Afterwards 'parent' and 'child' are removed from the workspace, 'somefolder' still exists in the filesystem, but 'somefile' is gone.
Comment 1 John Arthorne CLA 2006-06-02 12:12:23 EDT
I can reproduce this.
Comment 2 John Arthorne CLA 2006-06-05 10:36:44 EDT
Bug occurs when the KEEP_HISTORY flag is set.  On delete, files are moved into the local history.  When keeping history we shouldn't recurse into links because they are not being deleted.
Comment 3 John Arthorne CLA 2006-06-05 11:05:24 EDT
Created attachment 43468 [details]
minimal fix
Comment 4 John Arthorne CLA 2006-06-06 10:22:48 EDT
I have released a fix to the 3.3 stream, but will leave this open to backport to 3.2.1 when that stream is open for development.
Comment 5 John Arthorne CLA 2006-06-06 10:25:06 EDT
Also released a test case in 3.3 stream: LinkedResourceTest.testDeleteLinkParent
Comment 6 Dennis Nienhüser CLA 2006-06-06 10:32:11 EDT
Thanks for the quick fix. Having it backported to 3.2.1 would be great since I cannot make use of linked resources without this fix.
Comment 7 John Arthorne CLA 2006-07-10 14:34:00 EDT
Fix released to 3_2_maintenance stream for next 3.2.1 build.
Comment 8 John Arthorne CLA 2006-08-03 09:38:13 EDT
*** Bug 152727 has been marked as a duplicate of this bug. ***