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

Bug 373989

Summary: Can't use Rename to change letter cases
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ServerAssignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, msuknair
Version: 0.5   
Target Milestone: 2.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Szymon Brandys CLA 2012-03-12 12:57:23 EDT
Steps:

1) Create a file called test.js
2) Try to rename to Test.js

I get "A file or folder with the same name already exists at this location" error.
Comment 1 Meera Nair CLA 2012-11-20 20:02:05 EST
I would appreciate a review of my fix for this bug.

Fork on github:- https://github.com/Meeranair/orion.server.git
Branch:- Bug373989
Commit id:- cb7700ef3e8cbe5b498de6ef8349793922b429a8
Comment 2 John Arthorne CLA 2012-11-21 10:56:45 EST
Reviewing.
Comment 3 John Arthorne CLA 2012-11-21 13:45:08 EST
Thank you for the patch Meera. However while reviewing I noticed the pre-condition check wasn't quite right. It just checked if the simple file name was the same. However this can also happen if you are moving for example:

/some/source/folder/FOO.txt  -> /some/dest/folder/foo.txt

In this case your patch allowed the overwrite to occur. The test we want is whether the source and destination path represent the same file. However it turns out the EFS library that we are using already handles all these strange corner cases, so I made an alternate fixed where I just passed the "overwrite" flag down into the EFS method, and let it handle all the corner cases. I have committed and pushed this new fix, along with a regression test:

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=65c52a5eed8b3e6349a733c418aa3fe5664a9575