Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 134162 Details for
Bug 274737
Relative Classpath entries should not be resolved relative to the workspace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Resolve relative library entries based on project instead of workspace
274737patch1.txt (text/plain), 4.65 KB, created by
David Wegener
on 2009-05-02 16:55:44 EDT
(
hide
)
Description:
Resolve relative library entries based on project instead of workspace
Filename:
MIME Type:
Creator:
David Wegener
Created:
2009-05-02 16:55:44 EDT
Size:
4.65 KB
patch
obsolete
>### 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 274737
: 134162 |
134163
|
185989
|
186986
|
187396
|
188870