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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java (+30 lines)
Lines 11137-11142 Link Here
11137
}
11137
}
11138
11138
11139
/**
11139
/**
11140
 * @bug 295894: Search shows focus type implementation for nested types even though the scope is restricted to subtypes.
11141
 * @test explicitly including the focus type, which has no subtypes.
11142
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=295894"
11143
 */
11144
public void testBug295894c() throws Exception {
11145
	this.workingCopies = new ICompilationUnit[1];
11146
	this.workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/A.java",
11147
		"public class A {\n" + 
11148
		"    void test() {\n" + 
11149
		"        A a= new A();\n" + 
11150
		"        a.toString();\n" + 
11151
		"    }\n" + 
11152
		"    @Override\n" +
11153
		"    public String toString() {\n" +
11154
		"        return \"\";\n" + 
11155
		"    }\n" + 
11156
		"}\n" + 
11157
		""
11158
	);
11159
	search(
11160
		"toString",
11161
		METHOD,
11162
		DECLARATIONS,
11163
		SearchEngine.createStrictHierarchyScope(null, this.workingCopies[0].findPrimaryType(), true, true, null),
11164
		this.resultCollector);
11165
	assertSearchResults(
11166
		"src/A.java String A.toString() [toString] EXACT_MATCH"
11167
	);
11168
}
11169
/**
11140
 * @bug 288174: NullPointerException when searching for type references
11170
 * @bug 288174: NullPointerException when searching for type references
11141
 * @test Ensure that no NPE occurs when searching for type references
11171
 * @test Ensure that no NPE occurs when searching for type references
11142
 * 		when a binary type has matches in several member or anonymous types
11172
 * 		when a binary type has matches in several member or anonymous types

Return to bug 295894