Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325007 - [DND] Eclipse deletes files when attempting to move them to the root project directory
Summary: [DND] Eclipse deletes files when attempting to move them to the root project ...
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.0   Edit
Hardware: PC All
: P3 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-10 15:30 EDT by stone1549 CLA
Modified: 2014-07-09 08:51 EDT (History)
3 users (show)

See Also:


Attachments
The project with the strange issue (7.82 KB, application/x-bzip)
2010-09-10 15:38 EDT, stone1549 CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description stone1549 CLA 2010-09-10 15:30:39 EDT
Build Identifier: 20100617-1415

I have a project where copying a file from a interior directory to the root project directory causes the file to be deleted.  This behavior has been observed in multiple Operating Systems and versions of Eclipse.

A stripped down version of the project with this issue is located at http://vm0.aatcons.com/eclipse/StrangeEclipseIssue.tar.bz2 , we were able to reproduce the issue on multiple machines running multiple versions of eclipse (Galileo and Helios) on multiple platforms (Linux and Win7, 32 and 64 bit).

Reproducible: Always

Steps to Reproduce:
1.Download and decompress the project from http://vm0.aatcons.com/eclipse/StrangeEclipseIssue.tar.bz2.
2.Import the attached project into eclipse as an existing Java project.
3.Drag SystemUtilities.properties.test to the WebContent directory in the package view.
4) Drag SystemUtilities.properties.test back to the root directory of the project in the package view.
5) Observe how the file is no longer on disk.
Comment 1 stone1549 CLA 2010-09-10 15:38:03 EDT
Created attachment 178656 [details]
The project with the strange issue
Comment 2 stone1549 CLA 2010-09-10 16:38:07 EDT
I've also confirmed that you can right click on SystemUtilities.properties.test (package view) select "Copy" then paste it into the WebContent directory and it will delete the original after copying it to WebContent.
Comment 3 stone1549 CLA 2010-09-16 10:48:21 EDT
Unchecking "build automatically" in Window -> Preferences -> General -> Workspace appears to resolve the issue.
Comment 4 Eric Moffatt CLA 2010-09-21 11:25:06 EDT
First observation is that you can get it back using 'Undo'...
Comment 5 Eric Moffatt CLA 2010-09-21 11:34:53 EDT
Is the behavior consistent ? 

I did (I think) see the problem on my very first try but every other attempt has worked as expected. I've cleaned the WS and re-extracted the project to a completely different directory (in case I was being saved by some internal file system cache).

I'm using I20100608-0911 but don't expect that to make much difference. I'm also on XP which may...
Comment 6 stone1549 CLA 2010-09-22 11:49:59 EDT
The behavior appears to be consistent on our end.

I tested this by creating three workspaces and extracting a copy of the attached sample project in each one.  I then opened each workspace, imported the project, and move SystemUtilities.properties.test to the WebContent directory and back to the root directory.  In each instance the file was deleted.

I am also able to create new files in the root of the project and reproduce the issue by moving the new file to WebContent and then back to the root.  On top of that, copying the file by right clicking it, then pasting it into WebContent causes the file in the root directory to be deleted.

These tests were done on the latest version of Ubuntu, and we previously consistently reproduced the issue in Windows Vista and Windows 7.  I may be able to track down an XP machine to test with.
Comment 7 todorskia CLA 2010-09-28 16:40:59 EDT
This problem has cost me several days worth of work.  I am developing on Debian Linux and also experienced it with a dynamic web project.
Comment 8 atkaaz CLA 2011-08-09 14:07:13 EDT
I tried to move an entire package from the root of a source folder (src/main/java) of one project to the root of another project (also src/main/java) via drag and drop and to my surprise the source package was gone (from harddisk too, but still in Local History and thus recoverable) and the destination project had an empty package with the last segment cut off ie.
if org.a.b.c.d was source
then org.a.b.c  was on destination and empty

The package was basically deleted from source project, and never copied/moved to destination project. Was nowhere on the harddisk.

After recovery, Ctrl+C on source package in project 1, and Ctrl+V on destination source folder in project 2 worked.

I'd suggest to not delete the source package unless the first part (copying it to destination location) completed successfully. Seems to me the second part (delete from source) was executed regardless of first part's success. 
 Please fix this! I believe it's the third time I've experienced it since I've been using eclipse (it's just that it's been a while since the first two times to even remember).

Thanks!

PS: was using:

Eclipse SDK
Version: 4.1.0
Build id: M20110804-1800
Comment 9 atkaaz CLA 2011-08-09 14:38:34 EDT
Looks like what I said only happens when both projects are under EGIT, and so it's unrelated to this bug. Disregard my comment then. Sorry.
Comment 10 stone1549 CLA 2011-08-11 15:21:12 EDT
This appears to be fixed in Indigo.  I attempted to duplicate the issue using Eclipse Indigo (64 bit) with build id 20110615-0604 on Ubuntu 11.04 (64 bit) and was unable to do so.
Comment 11 Remy Suen CLA 2011-08-15 08:25:28 EDT
(In reply to comment #9)
> Looks like what I said only happens when both projects are under EGIT, and so
> it's unrelated to this bug. Disregard my comment then. Sorry.

For referencing purposes, the EGit bug is bug 354293.
Comment 12 Daniel Rolka CLA 2014-07-09 08:51:19 EDT
(In reply to stone1549 from comment #0)
> Build Identifier: 20100617-1415
> 
> I have a project where copying a file from a interior directory to the root
> project directory causes the file to be deleted.  This behavior has been
> observed in multiple Operating Systems and versions of Eclipse.
> 
> A stripped down version of the project with this issue is located at
> http://vm0.aatcons.com/eclipse/StrangeEclipseIssue.tar.bz2 , we were able to
> reproduce the issue on multiple machines running multiple versions of
> eclipse (Galileo and Helios) on multiple platforms (Linux and Win7, 32 and
> 64 bit).
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1.Download and decompress the project from
> http://vm0.aatcons.com/eclipse/StrangeEclipseIssue.tar.bz2.
> 2.Import the attached project into eclipse as an existing Java project.
> 3.Drag SystemUtilities.properties.test to the WebContent directory in the
> package view.
> 4) Drag SystemUtilities.properties.test back to the root directory of the
> project in the package view.
> 5) Observe how the file is no longer on disk.

I'm not able to recreate the issue in the build: 4.4-win32-x86_64 and the steps above. It works fine for me. I will close the bug. Please reopen it when the issue still occurs

Daniel