### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/ClasspathEntry.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java,v retrieving revision 1.127 diff -u -r1.127 ClasspathEntry.java --- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 26 Oct 2010 15:50:28 -0000 1.127 +++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 4 Jan 2011 09:08:09 -0000 @@ -1002,34 +1002,20 @@ /* * Resolves the ".." in the given path. Returns the given path if it contains no ".." segment. */ - public static IPath resolveDotDot(IPath path) { + public static IPath resolveDotDot(IPath root, IPath path) { IPath newPath = null; - IPath workspaceLocation = null; for (int i = 0, length = path.segmentCount(); i < length; i++) { String segment = path.segment(i); if (DOT_DOT.equals(segment)) { - if (newPath == null) { - if (i == 0) { - workspaceLocation = workspaceRoot.getLocation(); - newPath = workspaceLocation; - } else { - newPath = path.removeFirstSegments(i); - } - } else { - if (newPath.segmentCount() > 0) { - newPath = newPath.removeLastSegments(1); - } else { - workspaceLocation = workspaceRoot.getLocation(); - newPath = workspaceLocation; - } + if (newPath == null){ + newPath = root; } + if (newPath.segmentCount() > 0) { + newPath = newPath.removeLastSegments(1); + } } else if (newPath != null) { - if (newPath.equals(workspaceLocation) && workspaceRoot.getProject(segment).isAccessible()) { - newPath = new Path(segment).makeAbsolute(); - } else { - newPath = newPath.append(segment); - } - } + newPath = newPath.append(segment); + } } if (newPath == null) return path; @@ -1419,8 +1405,8 @@ return buffer.toString(); } - public ClasspathEntry resolvedDotDot() { - IPath resolvedPath = resolveDotDot(this.path); + public ClasspathEntry resolvedDotDot(IPath root) { + IPath resolvedPath = resolveDotDot(root, this.path); if (resolvedPath == this.path) return this; return new ClasspathEntry( @@ -1919,7 +1905,7 @@ // library entry check case IClasspathEntry.CPE_LIBRARY : - path = ClasspathEntry.resolveDotDot(path); + path = ClasspathEntry.resolveDotDot(project.getProject().getLocation(), path); // do not validate entries from Class-Path: in manifest // (these entries are considered optional since the user cannot act on them) Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v retrieving revision 1.463 diff -u -r1.463 JavaModelManager.java --- model/org/eclipse/jdt/internal/core/JavaModelManager.java 20 Dec 2010 10:37:11 -0000 1.463 +++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 4 Jan 2011 09:08:09 -0000 @@ -2417,7 +2417,7 @@ IPath resolvedPath = getResolvedVariablePath(entry.getPath(), usePreviousSession); if (resolvedPath == null) return null; - resolvedPath = ClasspathEntry.resolveDotDot(resolvedPath); + resolvedPath = ClasspathEntry.resolveDotDot(ResourcesPlugin.getWorkspace().getRoot().getLocation(), resolvedPath); Object target = JavaModel.getTarget(resolvedPath, false); if (target == null) Index: model/org/eclipse/jdt/internal/core/JavaProject.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v retrieving revision 1.441 diff -u -r1.441 JavaProject.java --- model/org/eclipse/jdt/internal/core/JavaProject.java 22 Dec 2010 05:56:55 -0000 1.441 +++ model/org/eclipse/jdt/internal/core/JavaProject.java 4 Jan 2011 09:08:09 -0000 @@ -2588,7 +2588,7 @@ for (int index = 0; index < rawClasspath.length; index++) { IClasspathEntry currentEntry = rawClasspath[index]; if (currentEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { - rawLibrariesPath.add(ClasspathEntry.resolveDotDot(currentEntry.getPath())); + rawLibrariesPath.add(ClasspathEntry.resolveDotDot(getProject().getLocation(), currentEntry.getPath())); } } if (referencedEntries != null) { @@ -2676,7 +2676,7 @@ if (cEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { // resolve ".." in library path - cEntry = cEntry.resolvedDotDot(); + cEntry = cEntry.resolvedDotDot(getProject().getLocation()); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965 // Do not resolve if the system attribute is set to false if (resolveChainedLibraries @@ -2697,7 +2697,7 @@ case IClasspathEntry.CPE_LIBRARY: // resolve ".." in library path - resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot(); + resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot(getProject().getLocation()); if (resolveChainedLibraries && result.rawReverseMap.get(resolvedEntry.getPath()) == null) { // resolve Class-Path: in manifest