Bug 7920 - JavaProject.canonicalizedPath
Summary: JavaProject.canonicalizedPath
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 1.0   Edit
Hardware: PC Unix All
: P3 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 7221 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-01-21 04:53 EST by Frank Cornelissen CLA
Modified: 2002-02-14 11:07 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Cornelissen CLA 2002-01-21 04:53:22 EST
This function seems to think that the cannonicalPath (which is a path resolved
by following links) will always have more segments. If you link a directory to 
a lower part in the filesystem (say Java/a/b/ive to Java/ive) and try to
canonicalizePath the first , the externalPath will have more segments than the
canonicalPath which will cause the following part to throw an exception.

The following is the relevant part of JavaProject.canonicalizePath, with the > 
line being the culprit. I can't understand the meaning of the comment...

	// keep only segments that were in original path and device if it was there
>
IPath result = canonicalPath.removeFirstSegments(canonicalPath.segmentCount() -
externalPath.segmentCount());
	if (externalPath.getDevice() == null) {
		return result.setDevice(null);
	} else {
		return result;
	}
Comment 1 Jerome Lanneluc CLA 2002-01-21 06:41:42 EST
The canonicalizedPath(IPath) method is useful on win32 file systems only (it 
transforms path like c:\Jdk1.3\lib\rt.jar into C:\JDK1.3\rt.jar). On file 
systems that are case sensitive, it should return the original path.

Fix is to detect if the underlying file system is case sensisitive. In this 
case, the original path is returned.

Sent patch to Frank. 
Comment 2 Jerome Lanneluc CLA 2002-01-21 11:28:20 EST
Frank said the patch solves his problem.

Released in both R1.0 and 2.0 streams.
Comment 3 Jerome Lanneluc CLA 2002-01-24 06:56:16 EST
*** Bug 7221 has been marked as a duplicate of this bug. ***
Comment 4 Philipe Mulet CLA 2002-02-08 06:56:11 EST
Released in 1.0 Rollup2