View | Details | Raw Unified | Return to bug 81556
Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/matching/ClasspathSourceDirectory.java (-1 / +8 lines)
Lines 29-36 Link Here
29
	String encoding;
29
	String encoding;
30
	SimpleLookupTable directoryCache;
30
	SimpleLookupTable directoryCache;
31
	String[] missingPackageHolder = new String[1];
31
	String[] missingPackageHolder = new String[1];
32
	char[][] fullExclusionPatternChars;
33
	char[][] fulInclusionPatternChars;
32
34
33
ClasspathSourceDirectory(IContainer sourceFolder) {
35
ClasspathSourceDirectory(IContainer sourceFolder, char[][] fullExclusionPatternChars, char[][] fulInclusionPatternChars) {
34
	this.sourceFolder = sourceFolder;
36
	this.sourceFolder = sourceFolder;
35
	IPath location = sourceFolder.getLocation();
37
	IPath location = sourceFolder.getLocation();
36
	this.sourceLocation = location != null ? location.addTrailingSeparator().toString() : ""; //$NON-NLS-1$
38
	this.sourceLocation = location != null ? location.addTrailingSeparator().toString() : ""; //$NON-NLS-1$
Lines 42-47 Link Here
42
		// let use no encoding by default
44
		// let use no encoding by default
43
	}
45
	}
44
	this.directoryCache = new SimpleLookupTable(5);
46
	this.directoryCache = new SimpleLookupTable(5);
47
	this.fullExclusionPatternChars = fullExclusionPatternChars;
48
	this.fulInclusionPatternChars = fulInclusionPatternChars;
45
}
49
}
46
50
47
public void cleanup() {
51
public void cleanup() {
Lines 96-101 Link Here
96
100
97
public NameEnvironmentAnswer findClass(String sourceFileWithoutExtension, String qualifiedPackageName, String qualifiedSourceFileWithoutExtension) {
101
public NameEnvironmentAnswer findClass(String sourceFileWithoutExtension, String qualifiedPackageName, String qualifiedSourceFileWithoutExtension) {
98
	
102
	
103
	String sourceFolderPath = this.sourceFolder.getFullPath().toString() + IPath.SEPARATOR;
99
	for (int i = 0, length = Util.JAVA_LIKE_EXTENSIONS.length; i < length; i++) {
104
	for (int i = 0, length = Util.JAVA_LIKE_EXTENSIONS.length; i < length; i++) {
100
		String extension = new String(Util.JAVA_LIKE_EXTENSIONS[i]);
105
		String extension = new String(Util.JAVA_LIKE_EXTENSIONS[i]);
101
		String sourceFileName = sourceFileWithoutExtension + extension;
106
		String sourceFileName = sourceFileWithoutExtension + extension;
Lines 103-108 Link Here
103
	
108
	
104
		String qualifiedSourceFileName = qualifiedSourceFileWithoutExtension + extension;
109
		String qualifiedSourceFileName = qualifiedSourceFileWithoutExtension + extension;
105
		String fullSourcePath = this.sourceLocation + qualifiedSourceFileName;
110
		String fullSourcePath = this.sourceLocation + qualifiedSourceFileName;
111
		if (org.eclipse.jdt.internal.compiler.util.Util.isExcluded((sourceFolderPath + qualifiedSourceFileName).toCharArray(), this.fulInclusionPatternChars, this.fullExclusionPatternChars, false/*not a folder path*/))
112
			continue;
106
		IPath path = new Path(qualifiedSourceFileName);
113
		IPath path = new Path(qualifiedSourceFileName);
107
		IFile file = this.sourceFolder.getFile(path);
114
		IFile file = this.sourceFolder.getFile(path);
108
		String fileEncoding = this.encoding;
115
		String fileEncoding = this.encoding;
(-)search/org/eclipse/jdt/internal/core/search/matching/JavaSearchNameEnvironment.java (-2 / +3 lines)
Lines 32-37 Link Here
32
import org.eclipse.jdt.internal.core.JavaModel;
32
import org.eclipse.jdt.internal.core.JavaModel;
33
import org.eclipse.jdt.internal.core.JavaModelManager;
33
import org.eclipse.jdt.internal.core.JavaModelManager;
34
import org.eclipse.jdt.internal.core.JavaProject;
34
import org.eclipse.jdt.internal.core.JavaProject;
35
import org.eclipse.jdt.internal.core.PackageFragmentRoot;
35
import org.eclipse.jdt.internal.core.builder.ClasspathJar;
36
import org.eclipse.jdt.internal.core.builder.ClasspathJar;
36
import org.eclipse.jdt.internal.core.builder.ClasspathLocation;
37
import org.eclipse.jdt.internal.core.builder.ClasspathLocation;
37
import org.eclipse.jdt.internal.core.util.Util;
38
import org.eclipse.jdt.internal.core.util.Util;
Lines 88-94 Link Here
88
	int index = 0;
89
	int index = 0;
89
	JavaModelManager manager = JavaModelManager.getJavaModelManager();
90
	JavaModelManager manager = JavaModelManager.getJavaModelManager();
90
	for (int i = 0; i < length; i++) {
91
	for (int i = 0; i < length; i++) {
91
		IPackageFragmentRoot root = roots[i];
92
		PackageFragmentRoot root = (PackageFragmentRoot) roots[i];
92
		IPath path = root.getPath();
93
		IPath path = root.getPath();
93
		try {
94
		try {
94
			if (root.isArchive()) {
95
			if (root.isArchive()) {
Lines 97-103 Link Here
97
			} else {
98
			} else {
98
				Object target = JavaModel.getTarget(workspaceRoot, path, false);
99
				Object target = JavaModel.getTarget(workspaceRoot, path, false);
99
				if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
100
				if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {
100
					cpLocations[index++] = new ClasspathSourceDirectory((IContainer)target);
101
					cpLocations[index++] = new ClasspathSourceDirectory((IContainer)target, root.fullExclusionPatternChars(), root.fullInclusionPatternChars());
101
				} else {
102
				} else {
102
					cpLocations[index++] = ClasspathLocation.forBinaryFolder((IContainer) target, false, ((ClasspathEntry) root.getRawClasspathEntry()).getImportRestriction());
103
					cpLocations[index++] = ClasspathLocation.forBinaryFolder((IContainer) target, false, ((ClasspathEntry) root.getRawClasspathEntry()).getImportRestriction());
103
				}
104
				}

Return to bug 81556