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

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java (-3 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 616-622 Link Here
616
	int declaringLevel = subType
616
	int declaringLevel = subType
617
		? resolveLevelAsSubtype(qualifiedPattern, method.declaringClass, null)
617
		? resolveLevelAsSubtype(qualifiedPattern, method.declaringClass, null)
618
		: resolveLevelForType(qualifiedPattern, method.declaringClass);
618
		: resolveLevelForType(qualifiedPattern, method.declaringClass);
619
	return methodLevel > declaringLevel ? declaringLevel : methodLevel; // return the weaker match
619
	return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
620
}
620
}
621
protected int resolveLevel(MessageSend messageSend) {
621
protected int resolveLevel(MessageSend messageSend) {
622
	MethodBinding method = messageSend.binding;
622
	MethodBinding method = messageSend.binding;
Lines 666-672 Link Here
666
	} else {
666
	} else {
667
		declaringLevel = resolveLevelForType(qualifiedPattern, method.declaringClass);
667
		declaringLevel = resolveLevelForType(qualifiedPattern, method.declaringClass);
668
	}
668
	}
669
	return methodLevel > declaringLevel ? declaringLevel : methodLevel; // return the weaker match
669
	return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
670
}
670
}
671
671
672
/**
672
/**
(-)src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java (+19 lines)
Lines 12071-12074 Link Here
12071
		deleteProject("P");
12071
		deleteProject("P");
12072
	}
12072
	}
12073
}
12073
}
12074
12075
/**
12076
 * @bug 324109: [search] Java search shows incorrect results as accurate matches
12077
 * @test search of method declaration off missing types should report potential matches and not accurate.
12078
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=324109"
12079
 */
12080
public void testBug324109() throws CoreException {
12081
	this.workingCopies = new ICompilationUnit[1];
12082
	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b324109/X.java",
12083
		"package b324109;\n" +
12084
		"public class X extends A {\n" +
12085
		" public void run() {}\n" +
12086
		"}"
12087
	);
12088
	search("Worker.run()", METHOD, DECLARATIONS);
12089
	assertSearchResults(
12090
		"src/b324109/X.java void b324109.X.run() [run] POTENTIAL_MATCH"
12091
	);
12092
}
12074
}
12093
}

Return to bug 324109