Bug 190824 - Incorrect result for DStore#getSeparator() function when parent is "/"
Summary: Incorrect result for DStore#getSeparator() function when parent is "/"
Status: CLOSED 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: 3.0 M3   Edit
Assignee: Xuan Chen CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-04 10:55 EDT by Xuan Chen CLA
Modified: 2012-05-23 17:36 EDT (History)
0 users

See Also:


Attachments
Deal with the case where parentPath is "/" in DStoreFileService#getSeparator() (2.02 KB, patch)
2007-06-04 23:11 EDT, Xuan Chen CLA
no flags Details | Diff
update the patch since file has been changed in (2.29 KB, patch)
2007-07-08 15:59 EDT, Xuan Chen CLA
no flags Details | Diff
Update the patch since the source file been changed in between. (2.12 KB, patch)
2007-07-12 14:06 EDT, Xuan Chen 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 Xuan Chen CLA 2007-06-04 10:55:33 EDT
the logic in first line of
getSeparator() is not correct, since the purpose of this function is to get
what was the character need to be inserted between parent and child.

if (parentPath == null || parentPath.length() < 2) return "/"; //$NON-NLS-1$

In the case of parent is "/", it returns "/",
which is not a correct result according to the purpose of this function.

This function is called by the following method in DStoreFileService:

DStoreFileService
copy(String, String, String, String, IProgressMonitor)
copyBatch(String[], String[], String, IProgressMonitor)
createFile(String, String, IProgressMonitor)
createFolder(String, String, IProgressMonitor)
delete(String, String, IProgressMonitor)
deleteBatch(String[], String[], IProgressMonitor)
download(String, String, File, boolean, String, IProgressMonitor)
getFile(String, String, IProgressMonitor)
getInputStream(String, String, boolean, IProgressMonitor)
getOutputStream(String, String, boolean, IProgressMonitor)
rename(String, String, String, IHostFile, IProgressMonitor)
rename(String, String, String, IProgressMonitor)
setLastModified(String, String, long, IProgressMonitor)
setReadOnly(String, String, boolean, IProgressMonitor)
upload(File, String, String, boolean, String, String, IProgressMonitor)
upload(InputStream, String, String, boolean, String, IProgressMonitor)
Comment 1 Martin Oberhuber CLA 2007-06-04 12:05:05 EDT
I think this is a number of occurrences that's manageable for manual review.

Looks like each of these occurrences could potentially create an incorrect absoluteName like //newFile after a copy or rename operation, instead of /newFile. Since absoluteNames are important, we should try and get it right.
Comment 2 Xuan Chen CLA 2007-06-04 23:11:57 EDT
Created attachment 70065 [details]
Deal with the case where parentPath is "/" in DStoreFileService#getSeparator()

Legal Message: I, Xuan Chen, 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 3 Xuan Chen CLA 2007-07-08 15:59:37 EDT
Created attachment 73275 [details]
update the patch since file has been changed in 

Patch needs to be updated since its file has been changed.

Legal Message: I, Xuan Chen, 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 4 Xuan Chen CLA 2007-07-12 14:06:09 EDT
Created attachment 73689 [details]
Update the patch since the source file been changed in between.

Please review this change.  Thanks.

Legal Message: I, Xuan Chen, 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 5 Martin Oberhuber CLA 2007-10-01 07:57:15 EDT
Bulk update target milestone 2.0.1 -> 3.0
Comment 6 Xuan Chen CLA 2007-10-04 09:50:44 EDT
I've committed the fix into cvs.
Comment 7 Xuan Chen CLA 2007-11-09 01:13:09 EST
This is fixed.
Comment 8 Martin Oberhuber CLA 2012-05-23 17:36:35 EDT
Comment on attachment 73689 [details]
Update the patch since the source file been changed in between.

Xuan became committer on 19-Jul-2007, so technically the contribution needs to be iplog+ since it was made before being committer:

http://dev.eclipse.org/mhonarc/lists/dsdp-tm-dev/msg01376.html