Bug 7920

Summary: JavaProject.canonicalizedPath
Product: [Eclipse Project] JDT Reporter: Frank Cornelissen <Frank.Cornelissen>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne
Version: 1.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: Unix All   
Whiteboard:

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