Summary: | IJavaSearchScope.enclosingProjectsAndJars doc misleading, hard to use | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Martin Aeschlimann <martinae> |
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0 | ||
Target Milestone: | 2.1 M2 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Martin Aeschlimann
2002-10-01 03:42:26 EDT
Clarified the spec: /** * Returns the paths to the enclosing projects and JARs for this search scope. * <ul> * <li> If the path is a project path, this is the full path of the project * (see <code>IResource.getFullPath()</code>). * E.g. /MyProject * </li> * <li> If the path is a JAR path and this JAR is internal to the workspace, * this is the full path of the JAR file (see <code>IResource.getFullPath ()</code>). * E.g. /MyProject/mylib.jar * </li> * <li> If the path is a JAR path and this JAR is external to the workspace, * this is the full OS path to the JAR file on the file system. * E.g. d:\libs\mylib.jar * </li> * </ul> * * @return an array of paths to the enclosing projects and JARS. */ Otherwise to distinguish an internal jar from an external jar, from a project, you can use IContainer.findMember(...). See JavaModel.getTarget(...) for an example. This does not help with the problem that xy.jar might point - to a project named xy.jar - to an external jar /xy.jar Like in the internal/external JAR case: The resolve order must be specified or a find method offered. The same path cannot correspond to both an external jar and a project. If findMember() returns a non-null value, then it is internal to the workspace and thus in this case it is a project. Verified. |