### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core 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.433 diff -u -r1.433 JavaModelManager.java --- model/org/eclipse/jdt/internal/core/JavaModelManager.java 23 Apr 2009 15:32:17 -0000 1.433 +++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 2 May 2009 20:53:31 -0000 @@ -2226,7 +2226,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/ClasspathEntry.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java,v retrieving revision 1.117 diff -u -r1.117 ClasspathEntry.java --- model/org/eclipse/jdt/internal/core/ClasspathEntry.java 21 Apr 2009 04:39:55 -0000 1.117 +++ model/org/eclipse/jdt/internal/core/ClasspathEntry.java 2 May 2009 20:53:31 -0000 @@ -954,34 +954,19 @@ /* * 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; - IWorkspaceRoot root = 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 = (root = ResourcesPlugin.getWorkspace().getRoot()).getLocation(); - newPath = workspaceLocation; - } else { - newPath = path.removeFirstSegments(i); - } - } else { - if (newPath.segmentCount() > 0) { - newPath = newPath.removeLastSegments(1); - } else { - workspaceLocation = (root = ResourcesPlugin.getWorkspace().getRoot()).getLocation(); - newPath = workspaceLocation; - } + if (newPath == null){ + newPath = root; } - } else if (newPath != null) { - if (newPath.equals(workspaceLocation) && root.getProject(segment).isAccessible()) { - newPath = new Path(segment).makeAbsolute(); - } else { - newPath = newPath.append(segment); + if (newPath.segmentCount() > 0) { + newPath = newPath.removeLastSegments(1); } + } else if (newPath != null) { + newPath = newPath.append(segment); } } if (newPath == null) @@ -1367,8 +1352,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( @@ -1861,7 +1846,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/JavaProject.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java,v retrieving revision 1.424 diff -u -r1.424 JavaProject.java --- model/org/eclipse/jdt/internal/core/JavaProject.java 23 Apr 2009 15:32:16 -0000 1.424 +++ model/org/eclipse/jdt/internal/core/JavaProject.java 2 May 2009 20:53:31 -0000 @@ -2586,7 +2586,7 @@ if (cEntry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { // resolve ".." in library path - cEntry = cEntry.resolvedDotDot(); + cEntry = cEntry.resolvedDotDot(getProject().getLocation()); if (resolveChainedLibraries) { // resolve Class-Path: in manifest @@ -2602,7 +2602,7 @@ case IClasspathEntry.CPE_LIBRARY: // resolve ".." in library path - resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot(); + resolvedEntry = ((ClasspathEntry) rawEntry).resolvedDotDot(getProject().getLocation()); if (resolveChainedLibraries) { // resolve Class-Path: in manifest