Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316864 - Eclipse can wipe out an existing file without prompting
Summary: Eclipse can wipe out an existing file without prompting
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows Vista
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 04:53 EDT by Craig Edwards CLA
Modified: 2010-06-15 06:06 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Edwards CLA 2010-06-15 04:53:26 EDT
Build Identifier: M20100211-1343

When creating a new file in the IDE in an existing project, existing files with the same name may be replaced with empty new files.

Reproducible: Always

Steps to Reproduce:
1. Find a folder within your project that contains an existing file with text content
2. Right click its parent folder, and choose new file
3. Name the new file with the same name as the existing file
4. You will now see a blank file with the requested name, which has replaced the old file without prompting.
Comment 1 Craig Edwards CLA 2010-06-15 04:54:34 EDT
In case this is required information i am also using the CFEclipse plugin with eclipse 3.5.2.
Comment 2 Prakash Rangaraj CLA 2010-06-15 05:20:43 EDT
> 3. Name the new file with the same name as the existing file

It shows me an error that a file already exists.
Comment 3 Craig Edwards CLA 2010-06-15 05:35:53 EDT
when trying here, i get no prompt or message. Could this be a behaviour specific to the CFEclipse plugin?
Comment 4 Prakash Rangaraj CLA 2010-06-15 05:39:29 EDT
(In reply to comment #3)
> when trying here, i get no prompt or message. Could this be a behaviour
> specific to the CFEclipse plugin?

   Which Wizard are you using to create the file? The New File wizard?
Comment 5 Craig Edwards CLA 2010-06-15 05:42:33 EDT
I believe so. right click parent folder, go through new -> cfml page, provide a
filename, click finish. I am pretty new to eclipse, so i am not sure exactly
what provides this functionality, e.g. if it is templated, or entirely part of
the plugin.
Comment 6 Prakash Rangaraj CLA 2010-06-15 05:52:37 EDT
(In reply to comment #5)
> I believe so. right click parent folder, go through new -> cfml page, provide a
> filename, click finish. I am pretty new to eclipse, so i am not sure exactly
> what provides this functionality, e.g. if it is templated, or entirely part of
> the plugin.
 

   New cfml Page is not from Eclipse. Could be from the CFEclipse plugin. Using PDE Spy (Alt+Shift+F1) in that page will help you to find the right plugin
Comment 7 Paul Webster CLA 2010-06-15 05:59:01 EDT
Also, check your error log <workspace>/.metadata/.log
Comment 8 Craig Edwards CLA 2010-06-15 06:06:42 EDT
These are the only errors i get relating to the file it replaced, i get this several times one for each time i tested this afterwards:

--------------------------------------------------------------

!MESSAGE Resource is out of sync with the file system: '/mobilitystocksys/templates/content/admin/index.cfm'.
!SUBENTRY 1 org.eclipse.search 4 4 2010-06-15 09:26:14.755
!MESSAGE File 'mobilitystocksys/templates/content/admin/getxml.cfm' has been skipped, problem while reading: ('Resource is out of sync with the file system: '/mobilitystocksys/templates/content/admin/getxml.cfm'.').
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource is out of sync with the file system: '/mobilitystocksys/templates/content/admin/getxml.cfm'.
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:664)
	at org.eclipse.core.internal.resources.File.getContents(File.java:288)
	at org.eclipse.core.internal.resources.File.getContents(File.java:277)
	at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.getInputStream(FileCharSequenceProvider.java:283)
	at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.initializeReader(FileCharSequenceProvider.java:277)
	at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.reset(FileCharSequenceProvider.java:269)
	at org.eclipse.search.internal.core.text.FileCharSequenceProvider$FileCharSequence.<init>(FileCharSequenceProvider.java:255)
	at org.eclipse.search.internal.core.text.FileCharSequenceProvider.newCharSequence(FileCharSequenceProvider.java:36)
	at org.eclipse.search.internal.core.text.TextSearchVisitor.processFile(TextSearchVisitor.java:260)
	at org.eclipse.search.internal.core.text.TextSearchVisitor.processFiles(TextSearchVisitor.java:196)
	at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:172)
	at org.eclipse.search.internal.core.text.TextSearchVisitor.search(TextSearchVisitor.java:184)
	at org.eclipse.search.core.text.TextSearchEngine$1.search(TextSearchEngine.java:54)
	at org.eclipse.search.internal.ui.text.FileSearchQuery.run(FileSearchQuery.java:182)
	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:91)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)