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

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/JavaElement.java (+6 lines)
Lines 31-36 Link Here
31
import org.eclipse.jdt.core.dom.ASTNode;
31
import org.eclipse.jdt.core.dom.ASTNode;
32
import org.eclipse.jdt.core.dom.CompilationUnit;
32
import org.eclipse.jdt.core.dom.CompilationUnit;
33
import org.eclipse.jdt.internal.compiler.lookup.Binding;
33
import org.eclipse.jdt.internal.compiler.lookup.Binding;
34
import org.eclipse.jdt.internal.core.search.BasicSearchEngine;
34
import org.eclipse.jdt.internal.core.util.MementoTokenizer;
35
import org.eclipse.jdt.internal.core.util.MementoTokenizer;
35
import org.eclipse.jdt.internal.core.util.Util;
36
import org.eclipse.jdt.internal.core.util.Util;
36
37
Lines 154-162 Link Here
154
155
155
		try {
156
		try {
156
			getElementInfo();
157
			getElementInfo();
158
			if (BasicSearchEngine.VERBOSE) 
159
				System.out.println("JavaElement#exists " + this); //$NON-NLS-1$
157
			return true;
160
			return true;
158
		} catch (JavaModelException e) {
161
		} catch (JavaModelException e) {
159
			// element doesn't exist: return false
162
			// element doesn't exist: return false
163
			if (BasicSearchEngine.VERBOSE) 
164
				System.out.println("Logged an exception for " + this); //$NON-NLS-1$
165
			Util.log(e);
160
		}
166
		}
161
		return false;
167
		return false;
162
	}
168
	}
(-)search/org/eclipse/jdt/internal/core/search/JavaSearchScope.java (+4 lines)
Lines 581-586 Link Here
581
 * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String)
581
 * @see AbstractJavaSearchScope#packageFragmentRoot(String, int, String)
582
 */
582
 */
583
public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) {
583
public IPackageFragmentRoot packageFragmentRoot(String resourcePathString, int jarSeparatorIndex, String jarPath) {
584
	if (BasicSearchEngine.VERBOSE) 
585
		System.out.println("PackageFragmentRoot for " + resourcePathString); //$NON-NLS-1$
584
	int index = -1;
586
	int index = -1;
585
	boolean isJarFile = jarSeparatorIndex != -1;
587
	boolean isJarFile = jarSeparatorIndex != -1;
586
	if (isJarFile) {
588
	if (isJarFile) {
Lines 592-597 Link Here
592
		index = indexOf(resourcePathString);
594
		index = indexOf(resourcePathString);
593
	}
595
	}
594
	if (index >= 0) {
596
	if (index >= 0) {
597
		if (BasicSearchEngine.VERBOSE) 
598
			System.out.println("PackageFragmentRoot RelativePath " + this.relativePaths[index]); //$NON-NLS-1$
595
		int idx = this.projectIndexes[index];
599
		int idx = this.projectIndexes[index];
596
		String projectPath = idx == -1 ? null : (String) this.projectPaths.get(idx);
600
		String projectPath = idx == -1 ? null : (String) this.projectPaths.get(idx);
597
		if (projectPath != null) {
601
		if (projectPath != null) {
(-)search/org/eclipse/jdt/internal/core/search/TypeNameMatchRequestorWrapper.java (-1 / +5 lines)
Lines 181-189 Link Here
181
			&& (rootPathLength = this.lastPkgFragmentRootPath.length()) > 0
181
			&& (rootPathLength = this.lastPkgFragmentRootPath.length()) > 0
182
			&& resourcePath.charAt(rootPathLength) == '/')) {
182
			&& resourcePath.charAt(rootPathLength) == '/')) {
183
		PackageFragmentRoot root = (PackageFragmentRoot) ((AbstractJavaSearchScope)this.scope).packageFragmentRoot(resourcePath, -1/*not a jar*/, null/*no jar path*/);
183
		PackageFragmentRoot root = (PackageFragmentRoot) ((AbstractJavaSearchScope)this.scope).packageFragmentRoot(resourcePath, -1/*not a jar*/, null/*no jar path*/);
184
		if (root == null) return null;
184
		if (root == null) return null;		
185
		this.lastPkgFragmentRoot = root;
185
		this.lastPkgFragmentRoot = root;
186
		this.lastPkgFragmentRootPath = root.internalPath().toString();
186
		this.lastPkgFragmentRootPath = root.internalPath().toString();
187
		if (BasicSearchEngine.VERBOSE) 
188
			System.out.println("Got PackageFragmentRoot " + this.lastPkgFragmentRootPath); //$NON-NLS-1$
187
		this.packageHandles = new HashtableOfArrayToObject(5);
189
		this.packageHandles = new HashtableOfArrayToObject(5);
188
	}
190
	}
189
	// create handle
191
	// create handle
Lines 202-207 Link Here
202
		pkgFragment= ((PackageFragmentRoot) this.lastPkgFragmentRoot).getPackageFragment(pkgName);
204
		pkgFragment= ((PackageFragmentRoot) this.lastPkgFragmentRoot).getPackageFragment(pkgName);
203
		this.packageHandles.put(pkgName, pkgFragment);
205
		this.packageHandles.put(pkgName, pkgFragment);
204
	}
206
	}
207
	if (BasicSearchEngine.VERBOSE)
208
		System.out.println("Package Fragment for " + pkgName + " is " + pkgFragment); //$NON-NLS-1$ //$NON-NLS-2$
205
	String simpleName= simpleNames[length];
209
	String simpleName= simpleNames[length];
206
	if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(simpleName)) {
210
	if (org.eclipse.jdt.internal.core.util.Util.isJavaLikeFileName(simpleName)) {
207
		ICompilationUnit unit= pkgFragment.getCompilationUnit(simpleName);
211
		ICompilationUnit unit= pkgFragment.getCompilationUnit(simpleName);

Return to bug 309903