Community
Participate
Working Groups
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; }
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.
Frank said the patch solves his problem. Released in both R1.0 and 2.0 streams.
*** Bug 7221 has been marked as a duplicate of this bug. ***
Released in 1.0 Rollup2