Bug 183772 - no error message when creating a duplicate file
Summary: no error message when creating a duplicate file
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
: 174850 184007 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-24 08:03 EDT by David Dykstal CLA
Modified: 2011-05-25 10:11 EDT (History)
1 user (show)

See Also:


Attachments
Changed name validator used to ValidatorFileUniqueName (5.57 KB, patch)
2007-05-07 12:57 EDT, Kevin Doyle CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Dykstal CLA 2007-04-24 08:03:20 EDT
Using a file subsystem select a directory. Create a file in that directory. Immediately create another file in that directory of the same name. No error message appears. A "duplicate name dialog" should appear.

Using the head stream.
Comment 1 David Dykstal CLA 2007-04-24 08:14:56 EDT
This error does not appear in I20070419-0640.
Comment 2 Martin Oberhuber CLA 2007-04-24 09:54:32 EDT
Could this be due to a change in the ElementComparer?
Comment 3 David Dykstal CLA 2007-04-24 14:30:56 EDT
This apparently only happens using the local file service.
Comment 4 David McKnight CLA 2007-04-27 13:45:32 EDT
I saw this for both local and remote with the new file wizard.  The new file wizard name validator is not having names passed in.  I've put a fix in so that we query the parent directory for names to pass into the validator.  Could you update from cvs and see if you still see the same problem.

Comment 5 David Dykstal CLA 2007-04-27 17:18:54 EDT
This is a different behavior than it was previously. It used to let you attempt to create the file and give you a duplicate name dialog - requesting either to overwrite the old file or to rename the new file. This requires the caller of the wizard to pass in a "used name" context, but forces you to create something that is different than anything else. I think that's OK, but is this what was intended? Are there cases where the names context is not known (i.e. the used names)? Are there cases where the case handling in the target file system may screw up the validator?
Comment 6 David McKnight CLA 2007-04-27 17:41:15 EDT
I'm not sure there would be much benefit to overwriting an existing file with an empty new file.  The eclipse new file dialog doesn't let you do that either, so I think the new way is more consistent with Eclipse.  The validator already had support for name handling, and I'm assuming it knows how to deal with case (i.e. via the isCaseSensitive() subsystem configuration method).  All that was missing was the initial names list.
Comment 7 Kevin Doyle CLA 2007-04-27 22:19:43 EDT
Should it say "name in use" when you type in the name of a folder?  

Right now on local if you type in the name of a folder that exists you can click Finish and no error is displayed.  Thats because no exception is thrown when it detects the file exists.  Thats part of <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=182221">bug 182221</a>.
Comment 8 David Dykstal CLA 2007-04-27 22:29:22 EDT
I don't have a problem with the concept. I just want to make sure the behavior is right - correct name collision detection for the target file system, and, as Kevin points out, the right resources present in the list.
Comment 9 Kevin Doyle CLA 2007-04-27 23:08:53 EDT
Issue's found:

1. Name validator shows no "name in use" when creating files/folders in the root of my second drive.  Works on C:\ though.
2. If you have a file/folder that contains uppercase then creating a new file/folder with that name won't show "name in use".  
Comment 10 Javier Montalvo Orús CLA 2007-04-30 06:24:16 EDT
*** Bug 184007 has been marked as a duplicate of this bug. ***
Comment 11 Kevin Doyle CLA 2007-05-07 12:57:22 EDT
Created attachment 66150 [details]
Changed name validator used to ValidatorFileUniqueName

Legal Message: I, Kevin Doyle, declare that I developed attached code from
scratch, without referencing any 3rd party materials except material licensed
under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this
contribution under the EPL.
Comment 12 David McKnight CLA 2007-05-07 14:48:23 EDT
ValidatorFileUniqueName doesn't make use of the cache however, I'm fine with that since a query per dialog shouldn't be too expensive.  I'll apply the patch.
Comment 13 David McKnight CLA 2007-05-08 15:08:41 EDT
*** Bug 174850 has been marked as a duplicate of this bug. ***
Comment 14 David McKnight CLA 2007-05-08 15:17:52 EDT
The patch was applied and now this is fixed.
Comment 15 Martin Oberhuber CLA 2008-08-13 13:18:34 EDT
[target cleanup] 2.0 M7 was the original target milestone for this bug