Bug 6876 - Path.isPrefixOf incorrect for root path
Summary: Path.isPrefixOf incorrect for root path
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: Other Windows 98
: P3 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-12 16:55 EST by DJ Houghton CLA
Modified: 2002-01-03 13:44 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2001-12-12 16:55:17 EST
Path.isPrefixOf() returns false for "/" and "c:/temp/e-in-e" but the spec says 
that the root is the prefix for all paths.

Note that both of the above paths correctly return "true" for isAbsolute().
Comment 1 DJ Houghton CLA 2001-12-12 16:59:51 EST
Problem looks like it is in the first couple of lines where it compares the 
devices for the path. If one path has a device and the other doesn't, it 
incorrectly returns false.
Comment 2 DJ Houghton CLA 2001-12-13 14:34:56 EST
Have determined that the spec needs to be re-worded to be more precise, rather 
than a code change. Therefore the root path is not a prefix of any path which 
has a device.

Comment 3 John Arthorne CLA 2002-01-03 12:57:10 EST
I have updated and released changes to the wording in the API.

Old wording:

"Modulo device ids, an empty path is a prefix of all paths;
a root path is a prefix of all absolute paths."

New wording:

"An empty path is a prefix of all paths with the same device; 
a root path is a prefix of all absolute paths with the same device."