View | Details | Raw Unified | Return to bug 166093 | Differences between
and this patch

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java (-16 / +50 lines)
Lines 675-686 Link Here
675
	char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');
675
	char[] importName = CharOperation.concatWith(importRef.getImportName(), '.');
676
	if (importRef.onDemand)
676
	if (importRef.onDemand)
677
		importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$
677
		importName = CharOperation.concat(importName, ".*" .toCharArray()); //$NON-NLS-1$
678
	Openable openable = this.currentPossibleMatch.openable;
678
//	Openable openable = this.currentPossibleMatch.openable;
679
	if (openable instanceof CompilationUnit)
679
//	if (openable instanceof CompilationUnit)
680
		return ((CompilationUnit) openable).getImport(new String(importName));
680
//		return ((CompilationUnit) openable).getImport(new String(importName));
681
	CompilationUnit unit = this.currentPossibleMatch.getCompilationUnit();
682
	if (unit != null) {
683
		return unit.getImport(new String(importName));
684
	}
681
685
682
	// binary types do not contain import statements so just answer the top-level type as the element
686
	// binary types do not contain import statements so just answer the top-level type as the element
683
	IType binaryType = ((ClassFile) openable).getType();
687
//	IType binaryType = ((ClassFile) this.currentPossibleMatch.openable).getType();
688
	IType binaryType = this.currentPossibleMatch.getClassFile().getType();
684
	String typeName = binaryType.getElementName();
689
	String typeName = binaryType.getElementName();
685
	int lastDollar = typeName.lastIndexOf('$');
690
	int lastDollar = typeName.lastIndexOf('$');
686
	if (lastDollar == -1) return binaryType;
691
	if (lastDollar == -1) return binaryType;
Lines 692-700 Link Here
692
protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) {
697
protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) {
693
	if (unit.isPackageInfo()) {
698
	if (unit.isPackageInfo()) {
694
		char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.');
699
		char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.');
695
		Openable openable = this.currentPossibleMatch.openable;
700
//		Openable openable = this.currentPossibleMatch.openable;
696
		if (openable instanceof CompilationUnit) {
701
//		if (openable instanceof CompilationUnit) {
697
			return ((CompilationUnit) openable).getPackageDeclaration(new String(packName));
702
//			return ((CompilationUnit) openable).getPackageDeclaration(new String(packName));
703
//		}
704
		CompilationUnit cu = this.currentPossibleMatch.getCompilationUnit();
705
		if (cu != null) {
706
			return cu.getPackageDeclaration(new String(packName));
698
		}
707
		}
699
	}
708
	}
700
	return createTypeHandle(new String(unit.getMainTypeName()));
709
	return createTypeHandle(new String(unit.getMainTypeName()));
Lines 703-713 Link Here
703
 * Creates an IType from the given simple top level type name. 
712
 * Creates an IType from the given simple top level type name. 
704
 */
713
 */
705
protected IType createTypeHandle(String simpleTypeName) {
714
protected IType createTypeHandle(String simpleTypeName) {
706
	Openable openable = this.currentPossibleMatch.openable;
715
//	Openable openable = this.currentPossibleMatch.openable;
707
	if (openable instanceof CompilationUnit)
716
//	if (openable instanceof CompilationUnit)
708
		return ((CompilationUnit) openable).getType(simpleTypeName);
717
//		return ((CompilationUnit) openable).getType(simpleTypeName);
718
	CompilationUnit unit = this.currentPossibleMatch.getCompilationUnit();
719
	if (unit != null) {
720
		return unit.getType(simpleTypeName);
721
	}
709
722
710
	IType binaryType = ((ClassFile) openable).getType();
723
//	IType binaryType = ((ClassFile) openable).getType();
724
	IType binaryType = this.currentPossibleMatch.getClassFile().getType();
711
	String binaryTypeQualifiedName = binaryType.getTypeQualifiedName();
725
	String binaryTypeQualifiedName = binaryType.getTypeQualifiedName();
712
	if (simpleTypeName.equals(binaryTypeQualifiedName))
726
	if (simpleTypeName.equals(binaryTypeQualifiedName))
713
		return binaryType; // answer only top-level types, sometimes the classFile is for a member/local type
727
		return binaryType; // answer only top-level types, sometimes the classFile is for a member/local type
Lines 930-936 Link Here
930
/**
944
/**
931
 * Create a new parser for the given project, as well as a lookup environment.
945
 * Create a new parser for the given project, as well as a lookup environment.
932
 */
946
 */
933
public void initialize(JavaProject project, int possibleMatchSize) throws JavaModelException {
947
public void initialize(JavaProject project, int possibleMatchSize, long highestSourceLevel) throws JavaModelException {
934
	// clean up name environment only if there are several possible match as it is reused
948
	// clean up name environment only if there are several possible match as it is reused
935
	// when only one possible match (bug 58581)
949
	// when only one possible match (bug 58581)
936
	if (this.nameEnvironment != null && possibleMatchSize != 1)
950
	if (this.nameEnvironment != null && possibleMatchSize != 1)
Lines 949-954 Link Here
949
	Map map = project.getOptions(true);
963
	Map map = project.getOptions(true);
950
	map.put(CompilerOptions.OPTION_TaskTags, ""); //$NON-NLS-1$
964
	map.put(CompilerOptions.OPTION_TaskTags, ""); //$NON-NLS-1$
951
	this.options = new CompilerOptions(map);
965
	this.options = new CompilerOptions(map);
966
	// force source level to highest one
967
	// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=166093
968
	if (highestSourceLevel > this.options.sourceLevel) {
969
		this.options.sourceLevel = highestSourceLevel;
970
		if (highestSourceLevel > ClassFileConstants.JDK1_4) {
971
			this.options.complianceLevel = highestSourceLevel;
972
			this.options.targetJDK = highestSourceLevel;
973
		}
974
	}
952
	ProblemReporter problemReporter =
975
	ProblemReporter problemReporter =
953
		new ProblemReporter(
976
		new ProblemReporter(
954
			DefaultErrorHandlingPolicies.proceedWithAllProblems(),
977
			DefaultErrorHandlingPolicies.proceedWithAllProblems(),
Lines 970-976 Link Here
970
	this.matchesToProcess = new PossibleMatch[possibleMatchSize];
993
	this.matchesToProcess = new PossibleMatch[possibleMatchSize];
971
}
994
}
972
protected void locateMatches(JavaProject javaProject, PossibleMatch[] possibleMatches, int start, int length) throws CoreException {
995
protected void locateMatches(JavaProject javaProject, PossibleMatch[] possibleMatches, int start, int length) throws CoreException {
973
	initialize(javaProject, length);
996
	long highestSourceLevel = 0;
997
	for (int i = start, maxUnits = start + length; i < maxUnits; i++) {
998
		PossibleMatch possibleMatch = possibleMatches[i];
999
		long version = possibleMatch.getVersion();
1000
		if (version > highestSourceLevel) {
1001
			highestSourceLevel = version;
1002
		}
1003
	}
1004
	initialize(javaProject, length, highestSourceLevel);
974
1005
975
	// create and resolve binding (equivalent to beginCompilation() in Compiler)
1006
	// create and resolve binding (equivalent to beginCompilation() in Compiler)
976
	boolean mustResolvePattern = ((InternalSearchPattern)this.pattern).mustResolve;
1007
	boolean mustResolvePattern = ((InternalSearchPattern)this.pattern).mustResolve;
Lines 1515-1522 Link Here
1515
	CompilationUnitDeclaration unit = possibleMatch.parsedUnit;
1546
	CompilationUnitDeclaration unit = possibleMatch.parsedUnit;
1516
	try {
1547
	try {
1517
		if (unit.isEmpty()) {
1548
		if (unit.isEmpty()) {
1518
			if (this.currentPossibleMatch.openable instanceof ClassFile) {
1549
			ClassFile classFile = this.currentPossibleMatch.getClassFile();
1519
				ClassFile classFile = (ClassFile) this.currentPossibleMatch.openable;
1550
//			if (this.currentPossibleMatch.openable instanceof ClassFile) {
1551
			if (classFile != null) {
1552
//				ClassFile classFile = (ClassFile) this.currentPossibleMatch.openable;
1520
				IBinaryType info = getBinaryInfo(classFile, this.currentPossibleMatch.resource);
1553
				IBinaryType info = getBinaryInfo(classFile, this.currentPossibleMatch.resource);
1521
				if (info != null) {
1554
				if (info != null) {
1522
					boolean mayBeGeneric = this.patternLocator.mayBeGeneric;
1555
					boolean mayBeGeneric = this.patternLocator.mayBeGeneric;
Lines 2339-2345 Link Here
2339
	} else if (enclosingElement instanceof IMember) {
2372
	} else if (enclosingElement instanceof IMember) {
2340
	    IMember member = (IMember) parent;
2373
	    IMember member = (IMember) parent;
2341
		if (member.isBinary())  {
2374
		if (member.isBinary())  {
2342
			enclosingElement = ((IClassFile)this.currentPossibleMatch.openable).getType();
2375
//			enclosingElement = ((IClassFile)this.currentPossibleMatch.openable).getType();
2376
			enclosingElement = this.currentPossibleMatch.getClassFile().getType();
2343
		} else {
2377
		} else {
2344
			enclosingElement = member.getType(new String(type.name), occurrenceCount);
2378
			enclosingElement = member.getType(new String(type.name), occurrenceCount);
2345
		}
2379
		}
(-)search/org/eclipse/jdt/internal/core/search/matching/PossibleMatch.java (-1 / +35 lines)
Lines 15-20 Link Here
15
import org.eclipse.jdt.core.compiler.CharOperation;
15
import org.eclipse.jdt.core.compiler.CharOperation;
16
import org.eclipse.jdt.core.search.SearchDocument;
16
import org.eclipse.jdt.core.search.SearchDocument;
17
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
17
import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
18
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
18
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
19
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
19
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
20
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
20
import org.eclipse.jdt.internal.core.*;
21
import org.eclipse.jdt.internal.core.*;
Lines 32-37 Link Here
32
public SearchDocument document;
33
public SearchDocument document;
33
private String sourceFileName;
34
private String sourceFileName;
34
private char[] source;
35
private char[] source;
36
private long version = -1;
35
37
36
public PossibleMatch(MatchLocator locator, IResource resource, Openable openable, SearchDocument document, boolean mustResolve) {
38
public PossibleMatch(MatchLocator locator, IResource resource, Openable openable, SearchDocument document, boolean mustResolve) {
37
	this.resource = resource;
39
	this.resource = resource;
Lines 39-46 Link Here
39
	this.document = document;
41
	this.document = document;
40
	this.nodeSet = new MatchingNodeSet(mustResolve);
42
	this.nodeSet = new MatchingNodeSet(mustResolve);
41
	char[] qualifiedName = getQualifiedName();
43
	char[] qualifiedName = getQualifiedName();
42
	if (qualifiedName != null)
44
	if (qualifiedName != null) {
43
		this.compoundName = CharOperation.splitOn('.', qualifiedName);
45
		this.compoundName = CharOperation.splitOn('.', qualifiedName);
46
	}
47
	if (openable instanceof CompilationUnit) {
48
		this.version = 0;
49
	}
44
}
50
}
45
public void cleanUp() {
51
public void cleanUp() {
46
	this.source = null;
52
	this.source = null;
Lines 58-63 Link Here
58
	// Even .class files for secondary types and their nested types
64
	// Even .class files for secondary types and their nested types
59
	return CharOperation.equals(this.compoundName, ((PossibleMatch) obj).compoundName);
65
	return CharOperation.equals(this.compoundName, ((PossibleMatch) obj).compoundName);
60
}
66
}
67
public ClassFile getClassFile() {
68
	if (this.version >= ClassFileConstants.JDK1_1) {
69
		return (ClassFile) this.openable;
70
	}
71
	if (this.version == -1) {
72
		if (this.openable instanceof ClassFile) {
73
			return (ClassFile) this.openable;
74
		}
75
	}
76
	return null;
77
}
78
public CompilationUnit getCompilationUnit() {
79
	if (this.version == 0) {
80
		return (CompilationUnit) this.openable;
81
	}
82
	return null;
83
}
61
public char[] getContents() {
84
public char[] getContents() {
62
	if (this.source != null) return this.source;
85
	if (this.source != null) return this.source;
63
86
Lines 128-137 Link Here
128
		if (reader != null) {
151
		if (reader != null) {
129
			String fileName = type.sourceFileName(reader);
152
			String fileName = type.sourceFileName(reader);
130
			this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName;
153
			this.sourceFileName = fileName == null ? NO_SOURCE_FILE_NAME : fileName;
154
			this.version = reader.getVersion();
131
		}
155
		}
132
	}
156
	}
133
	return this.sourceFileName;
157
	return this.sourceFileName;
134
}	
158
}	
159
/**
160
 * Returns the version of the associated .class file, 0 for source file
161
 * and -1 when the class file has not been opened yet
162
 *
163
 * @return the JDK level of the associated .class file. Returns 0 for
164
 * 	compilation unit or -1 when the class file is not opened yet.
165
 */
166
public long getVersion() {
167
	return this.version;
168
}
135
public int hashCode() {
169
public int hashCode() {
136
	if (this.compoundName == null) return super.hashCode();
170
	if (this.compoundName == null) return super.hashCode();
137
171
(-)search/org/eclipse/jdt/internal/core/search/matching/SuperTypeNamesCollector.java (-2 / +2 lines)
Lines 135-141 Link Here
135
		this.result = new char[1][][];
135
		this.result = new char[1][][];
136
		this.resultIndex = 0;
136
		this.resultIndex = 0;
137
		JavaProject javaProject = (JavaProject) this.type.getJavaProject();
137
		JavaProject javaProject = (JavaProject) this.type.getJavaProject();
138
		this.locator.initialize(javaProject, 0);
138
		this.locator.initialize(javaProject, 0, -1);
139
		try {
139
		try {
140
			if (this.type.isBinary()) {
140
			if (this.type.isBinary()) {
141
				BinaryTypeBinding binding = this.locator.cacheBinaryType(this.type, null);
141
				BinaryTypeBinding binding = this.locator.cacheBinaryType(this.type, null);
Lines 179-185 Link Here
179
			IJavaProject project = openable.getJavaProject();
179
			IJavaProject project = openable.getJavaProject();
180
			if (!project.equals(previousProject)) {
180
			if (!project.equals(previousProject)) {
181
				previousProject = (JavaProject) project;
181
				previousProject = (JavaProject) project;
182
				this.locator.initialize(previousProject, 0);
182
				this.locator.initialize(previousProject, 0, -1);
183
			}
183
			}
184
			if (openable instanceof ICompilationUnit) {
184
			if (openable instanceof ICompilationUnit) {
185
				ICompilationUnit unit = (ICompilationUnit) openable;
185
				ICompilationUnit unit = (ICompilationUnit) openable;
(-)search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java (-1 / +1 lines)
Lines 334-340 Link Here
334
			// verify closest match if pattern was bound
334
			// verify closest match if pattern was bound
335
			// (see bug 70827)
335
			// (see bug 70827)
336
			if (focus != null && focus.getElementType() == IJavaElement.METHOD) {
336
			if (focus != null && focus.getElementType() == IJavaElement.METHOD) {
337
				if (methodBinding != null) {
337
				if (methodBinding != null && methodBinding.isValidBinding()) {
338
					boolean isPrivate = Flags.isPrivate(((IMethod) focus).getFlags());
338
					boolean isPrivate = Flags.isPrivate(((IMethod) focus).getFlags());
339
					if (isPrivate && !CharOperation.equals(methodBinding.declaringClass.sourceName, focus.getParent().getElementName().toCharArray())) {
339
					if (isPrivate && !CharOperation.equals(methodBinding.declaringClass.sourceName, focus.getParent().getElementName().toCharArray())) {
340
						return; // finally the match was not possible
340
						return; // finally the match was not possible
(-)model/org/eclipse/jdt/core/IClasspathEntry.java (-37 / +37 lines)
Lines 15-21 Link Here
15
/** 
15
/** 
16
 * An entry on a Java project classpath identifying one or more package fragment
16
 * An entry on a Java project classpath identifying one or more package fragment
17
 * roots. A classpath entry has a content kind (either source, 
17
 * roots. A classpath entry has a content kind (either source, 
18
 * <code>K_SOURCE</code>, or binary, <code>K_BINARY</code>), which is inherited
18
 * {@link IPackageFragmentRoot#K_SOURCE}, or binary, {@link IPackageFragmentRoot#K_BINARY}), which is inherited
19
 * by each package fragment root and package fragment associated with the entry.
19
 * by each package fragment root and package fragment associated with the entry.
20
 * <p>
20
 * <p>
21
 * A classpath entry can refer to any of the following:<ul>
21
 * A classpath entry can refer to any of the following:<ul>
Lines 29-35 Link Here
29
 *		represent compilation units. All compilation units will be compiled when
29
 *		represent compilation units. All compilation units will be compiled when
30
 * 		the project is built. The classpath entry must specify the
30
 * 		the project is built. The classpath entry must specify the
31
 *		absolute path to the root folder. Entries of this kind are 
31
 *		absolute path to the root folder. Entries of this kind are 
32
 *		associated with the <code>CPE_SOURCE</code> constant.
32
 *		associated with the {@link #CPE_SOURCE} constant.
33
 *      Source classpath entries can carry inclusion and exclusion patterns for
33
 *      Source classpath entries can carry inclusion and exclusion patterns for
34
 *      selecting which source files appear as compilation
34
 *      selecting which source files appear as compilation
35
 *      units and get compiled when the project is built.
35
 *      units and get compiled when the project is built.
Lines 40-46 Link Here
40
 *		package fragments and <code>.class</code> files.  The classpath entry
40
 *		package fragments and <code>.class</code> files.  The classpath entry
41
 *		must specify the absolute path to the JAR (or root folder), and in case it refers
41
 *		must specify the absolute path to the JAR (or root folder), and in case it refers
42
 *		to an external JAR, then there is no associated resource in the workbench. Entries 
42
 *		to an external JAR, then there is no associated resource in the workbench. Entries 
43
 *		of this kind are associated with the <code>CPE_LIBRARY</code> constant.</li>
43
 *		of this kind are associated with the {@link #CPE_LIBRARY} constant.</li>
44
 * 
44
 * 
45
 *	<li>A required project. In this case the entry identifies another project in
45
 *	<li>A required project. In this case the entry identifies another project in
46
 *		the workspace. The required project is used as a binary library when compiling
46
 *		the workspace. The required project is used as a binary library when compiling
Lines 51-100 Link Here
51
 *		is performed against a required project's source code, and compilation is 
51
 *		is performed against a required project's source code, and compilation is 
52
 *		performed against a required project's last built state.  The
52
 *		performed against a required project's last built state.  The
53
 *		classpath entry must specify the absolute path to the
53
 *		classpath entry must specify the absolute path to the
54
 *		project. Entries of this kind are  associated with the <code>CPE_PROJECT</code>
54
 *		project. Entries of this kind are  associated with the {@link #CPE_PROJECT}
55
 *		constant. 
55
 *		constant. 
56
 * 		Note: referencing a required project with a classpath entry refers to the source 
56
 * 		Note: referencing a required project with a classpath entry refers to the source 
57
 *     code or associated <code>.class</code> files located in its output location. 
57
 *     code or associated <code>.class</code> files located in its output location. 
58
 *     It will also automatically include any other libraries or projects that the required project's classpath 
58
 *     It will also automatically include any other libraries or projects that the required project's classpath 
59
 *     refers to, iff the corresponding classpath entries are tagged as being exported 
59
 *     refers to, iff the corresponding classpath entries are tagged as being exported 
60
 *     (<code>IClasspathEntry#isExported</code>). 
60
 *     ({@link IClasspathEntry#isExported}). 
61
 *    Unless exporting some classpath entries, classpaths are not chained by default - 
61
 *    Unless exporting some classpath entries, classpaths are not chained by default - 
62
 *    each project must specify its own classpath in its entirety.</li>
62
 *    each project must specify its own classpath in its entirety.</li>
63
 * 
63
 * 
64
 *  <li> A path beginning in a classpath variable defined globally to the workspace.
64
 *  <li> A path beginning in a classpath variable defined globally to the workspace.
65
 *		Entries of this kind are  associated with the <code>CPE_VARIABLE</code> constant.  
65
 *		Entries of this kind are  associated with the {@link #CPE_VARIABLE} constant.  
66
 *      Classpath variables are created using <code>JavaCore#setClasspathVariable</code>,
66
 *      Classpath variables are created using {@link JavaCore#setClasspathVariable(String, IPath, org.eclipse.core.runtime.IProgressMonitor)},
67
 * 		and gets resolved, to either a project or library entry, using
67
 * 		and gets resolved, to either a project or library entry, using
68
 *      <code>JavaCore#getResolvedClasspathVariable</code>.
68
 *      {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)}.
69
 *		It is also possible to register an automatic initializer (<code>ClasspathVariableInitializer</code>),
69
 *		It is also possible to register an automatic initializer ({@link ClasspathVariableInitializer}),
70
 * 	which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer".
70
 * 	which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer".
71
 * 	After resolution, a classpath variable entry may either correspond to a project or a library entry. </li>
71
 * 	After resolution, a classpath variable entry may either correspond to a project or a library entry. </li>
72
 * 
72
 * 
73
 *  <li> A named classpath container identified by its container path.
73
 *  <li> A named classpath container identified by its container path.
74
 *     A classpath container provides a way to indirectly reference a set of classpath entries through
74
 *     A classpath container provides a way to indirectly reference a set of classpath entries through
75
 *     a classpath entry of kind <code>CPE_CONTAINER</code>. Typically, a classpath container can
75
 *     a classpath entry of kind {@link #CPE_CONTAINER}. Typically, a classpath container can
76
 *     be used to describe a complex library composed of multiple JARs, projects or classpath variables,
76
 *     be used to describe a complex library composed of multiple JARs, projects or classpath variables,
77
 *     considering also that containers can be mapped differently on each project. Several projects can
77
 *     considering also that containers can be mapped differently on each project. Several projects can
78
 *     reference the same generic container path, but have each of them actually bound to a different
78
 *     reference the same generic container path, but have each of them actually bound to a different
79
 *     container object.
79
 *     container object.
80
 *     The container path is a formed by a first ID segment followed with extra segments, 
80
 *     The container path is a formed by a first ID segment followed with extra segments, 
81
 *     which can be used as additional hints for resolving this container reference. If no container was ever 
81
 *     which can be used as additional hints for resolving this container reference. If no container was ever 
82
 *     recorded for this container path onto this project (using <code>setClasspathContainer</code>, 
82
 *     recorded for this container path onto this project (using {@link JavaCore#setClasspathContainer}, 
83
 * 	then a <code>ClasspathContainerInitializer</code> will be activated if any was registered for this 
83
 * 	then a {@link ClasspathContainerInitializer} will be activated if any was registered for this 
84
 * 	container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer".
84
 * 	container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer".
85
 * 	A classpath container entry can be resolved explicitly using <code>JavaCore#getClasspathContainer</code>
85
 * 	A classpath container entry can be resolved explicitly using {@link JavaCore#getClasspathContainer}
86
 * 	and the resulting container entries can contain any non-container entry. In particular, it may contain variable
86
 * 	and the resulting container entries can contain any non-container entry. In particular, it may contain variable
87
 *     entries, which in turn needs to be resolved before being directly used. 
87
 *     entries, which in turn needs to be resolved before being directly used. 
88
 * 	<br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same
88
 * 	<br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same
89
 * 	container path to be interpreted in different ways for different projects. </li>
89
 * 	container path to be interpreted in different ways for different projects. </li>
90
 * </ul>
90
 * </ul>
91
 * </p>
91
 * </p>
92
 * The result of <code>IJavaProject#getResolvedClasspath</code> will have all entries of type
92
 * The result of {@link IJavaProject#getResolvedClasspath} will have all entries of type
93
 * <code>CPE_VARIABLE</code> and <code>CPE_CONTAINER</code> resolved to a set of 
93
 * {@link #CPE_VARIABLE} and {@link #CPE_CONTAINER} resolved to a set of 
94
 * <code>CPE_SOURCE</code>, <code>CPE_LIBRARY</code> or <code>CPE_PROJECT</code>
94
 * {@link #CPE_SOURCE}, {@link #CPE_LIBRARY} or {@link #CPE_PROJECT}
95
 * classpath entries.
95
 * classpath entries.
96
 * <p>
96
 * <p>
97
 * Any classpath entry other than a source folder (kind <code>CPE_SOURCE</code>) can
97
 * Any classpath entry other than a source folder (kind {@link #CPE_SOURCE}) can
98
 * be marked as being exported. Exported entries are automatically contributed to
98
 * be marked as being exported. Exported entries are automatically contributed to
99
 * dependent projects, along with the project's default output folder, which is
99
 * dependent projects, along with the project's default output folder, which is
100
 * implicitly exported, and any auxiliary output folders specified on source
100
 * implicitly exported, and any auxiliary output folders specified on source
Lines 102-108 Link Here
102
 * followed by the any exported entries.
102
 * followed by the any exported entries.
103
 * <p>
103
 * <p>
104
 * This interface is not intended to be implemented by clients.
104
 * This interface is not intended to be implemented by clients.
105
 * Classpath entries can be created via methods on <code>JavaCore</code>.
105
 * Classpath entries can be created via methods on {@link JavaCore}.
106
 * </p>
106
 * </p>
107
 *
107
 *
108
 * @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
108
 * @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
Lines 170-180 Link Here
170
	 * Returns the kind of files found in the package fragments identified by this
170
	 * Returns the kind of files found in the package fragments identified by this
171
	 * classpath entry.
171
	 * classpath entry.
172
	 *
172
	 *
173
	 * @return <code>IPackageFragmentRoot.K_SOURCE</code> for files containing
173
	 * @return {@link IPackageFragmentRoot#K_SOURCE} for files containing
174
	 *   source code, and <code>IPackageFragmentRoot.K_BINARY</code> for binary
174
	 *   source code, and {@link IPackageFragmentRoot#K_BINARY} for binary
175
	 *   class files.
175
	 *   class files.
176
	 *   There is no specified value for an entry denoting a variable (<code>CPE_VARIABLE</code>)
176
	 *   There is no specified value for an entry denoting a variable ({@link #CPE_VARIABLE})
177
	 *   or a classpath container (<code>CPE_CONTAINER</code>).
177
	 *   or a classpath container ({@link #CPE_CONTAINER}).
178
	 */
178
	 */
179
	int getContentKind();
179
	int getContentKind();
180
180
Lines 183-198 Link Here
183
	 *
183
	 *
184
	 * @return one of:
184
	 * @return one of:
185
	 * <ul>
185
	 * <ul>
186
	 * <li><code>CPE_SOURCE</code> - this entry describes a source root in
186
	 * <li>{@link #CPE_SOURCE} - this entry describes a source root in
187
	 		its project
187
	 		its project
188
	 * <li><code>CPE_LIBRARY</code> - this entry describes a folder or JAR
188
	 * <li>{@link #CPE_LIBRARY} - this entry describes a folder or JAR
189
	 		containing binaries
189
	 		containing binaries
190
	 * <li><code>CPE_PROJECT</code> - this entry describes another project
190
	 * <li>{@link #CPE_PROJECT} - this entry describes another project
191
	 *
191
	 *
192
	 * <li><code>CPE_VARIABLE</code> - this entry describes a project or library
192
	 * <li>{@link #CPE_VARIABLE} - this entry describes a project or library
193
	 *  	indirectly via a classpath variable in the first segment of the path
193
	 *  	indirectly via a classpath variable in the first segment of the path
194
	 * *
194
	 * *
195
	 * <li><code>CPE_CONTAINER</code> - this entry describes set of entries
195
	 * <li>{@link #CPE_CONTAINER} - this entry describes set of entries
196
	 *  	referenced indirectly via a classpath container
196
	 *  	referenced indirectly via a classpath container
197
	 * </ul>
197
	 * </ul>
198
	 */
198
	 */
Lines 344-354 Link Here
344
	/**
344
	/**
345
	 * Returns the full path to the specific location where the builder writes 
345
	 * Returns the full path to the specific location where the builder writes 
346
	 * <code>.class</code> files generated for this source entry 
346
	 * <code>.class</code> files generated for this source entry 
347
	 * (entry kind <code>CPE_SOURCE</code>).
347
	 * (entry kind {@link #CPE_SOURCE}).
348
	 * <p>
348
	 * <p>
349
	 * Source entries can optionally be associated with a specific output location.
349
	 * Source entries can optionally be associated with a specific output location.
350
	 * If none is provided, the source entry will be implicitly associated with its project
350
	 * If none is provided, the source entry will be implicitly associated with its project
351
	 * default output location (see <code>IJavaProject#getOutputLocation</code>).
351
	 * default output location (see {@link IJavaProject#getOutputLocation}).
352
	 * </p><p>
352
	 * </p><p>
353
	 * NOTE: A specific output location cannot coincidate with another source/library entry.
353
	 * NOTE: A specific output location cannot coincidate with another source/library entry.
354
	 * </p>
354
	 * </p>
Lines 364-387 Link Here
364
	 * Returns the path of this classpath entry.
364
	 * Returns the path of this classpath entry.
365
	 *
365
	 *
366
	 * The meaning of the path of a classpath entry depends on its entry kind:<ul>
366
	 * The meaning of the path of a classpath entry depends on its entry kind:<ul>
367
	 *	<li>Source code in the current project (<code>CPE_SOURCE</code>) -  
367
	 *	<li>Source code in the current project ({@link #CPE_SOURCE}) -  
368
	 *      The path associated with this entry is the absolute path to the root folder. </li>
368
	 *      The path associated with this entry is the absolute path to the root folder. </li>
369
	 *	<li>A binary library in the current project (<code>CPE_LIBRARY</code>) - the path
369
	 *	<li>A binary library in the current project ({@link #CPE_LIBRARY}) - the path
370
	 *		associated with this entry is the absolute path to the JAR (or root folder), and 
370
	 *		associated with this entry is the absolute path to the JAR (or root folder), and 
371
	 *		in case it refers to an external JAR, then there is no associated resource in 
371
	 *		in case it refers to an external JAR, then there is no associated resource in 
372
	 *		the workbench.
372
	 *		the workbench.
373
	 *	<li>A required project (<code>CPE_PROJECT</code>) - the path of the entry denotes the
373
	 *	<li>A required project ({@link #CPE_PROJECT}) - the path of the entry denotes the
374
	 *		path to the corresponding project resource.</li>
374
	 *		path to the corresponding project resource.</li>
375
	 *  <li>A variable entry (<code>CPE_VARIABLE</code>) - the first segment of the path 
375
	 *  <li>A variable entry ({@link #CPE_VARIABLE}) - the first segment of the path 
376
	 *      is the name of a classpath variable. If this classpath variable
376
	 *      is the name of a classpath variable. If this classpath variable
377
	 *		is bound to the path <i>P</i>, the path of the corresponding classpath entry
377
	 *		is bound to the path <i>P</i>, the path of the corresponding classpath entry
378
	 *		is computed by appending to <i>P</i> the segments of the returned
378
	 *		is computed by appending to <i>P</i> the segments of the returned
379
	 *		path without the variable.</li>
379
	 *		path without the variable.</li>
380
	 *  <li> A container entry (<code>CPE_CONTAINER</code>) - the path of the entry
380
	 *  <li> A container entry ({@link #CPE_CONTAINER}) - the path of the entry
381
	 * 	is the name of the classpath container, which can be bound indirectly to a set of classpath 
381
	 * 	is the name of the classpath container, which can be bound indirectly to a set of classpath 
382
	 * 	entries after resolution. The containerPath is a formed by a first ID segment followed with 
382
	 * 	entries after resolution. The containerPath is a formed by a first ID segment followed with 
383
	 *     extra segments that can be used as additional hints for resolving this container 
383
	 *     extra segments that can be used as additional hints for resolving this container 
384
	 * 	reference (also see <code>IClasspathContainer</code>).
384
	 * 	reference (also see {@link IClasspathContainer}).
385
	 * </li>
385
	 * </li>
386
	 * </ul>
386
	 * </ul>
387
	 *
387
	 *
Lines 410-416 Link Here
410
	 * Returns the path within the source archive or folder where package fragments
410
	 * Returns the path within the source archive or folder where package fragments
411
	 * are located. An empty path indicates that packages are located at
411
	 * are located. An empty path indicates that packages are located at
412
	 * the root of the source archive or folder. Returns a non-<code>null</code> value
412
	 * the root of the source archive or folder. Returns a non-<code>null</code> value
413
	 * if and only if <code>getSourceAttachmentPath</code> returns 
413
	 * if and only if {@link #getSourceAttachmentPath} returns 
414
	 * a non-<code>null</code> value.
414
	 * a non-<code>null</code> value.
415
	 *
415
	 *
416
	 * @return the path within the source archive or folder, or <code>null</code> if
416
	 * @return the path within the source archive or folder, or <code>null</code> if
Lines 421-427 Link Here
421
	/**
421
	/**
422
	 * Returns whether this entry is exported to dependent projects.
422
	 * Returns whether this entry is exported to dependent projects.
423
	 * Always returns <code>false</code> for source entries (kind
423
	 * Always returns <code>false</code> for source entries (kind
424
	 * <code>CPE_SOURCE</code>), which cannot be exported.
424
	 * {@link #CPE_SOURCE}), which cannot be exported.
425
	 * 
425
	 * 
426
	 * @return <code>true</code> if exported, and <code>false</code> otherwise
426
	 * @return <code>true</code> if exported, and <code>false</code> otherwise
427
	 * @since 2.0
427
	 * @since 2.0

Return to bug 166093