Lines 7697-7700
Link Here
|
7697 |
"src/A.java int A.x(int) [param] EXACT_MATCH" |
7697 |
"src/A.java int A.x(int) [param] EXACT_MATCH" |
7698 |
); |
7698 |
); |
7699 |
} |
7699 |
} |
|
|
7700 |
|
7701 |
/** |
7702 |
* @bug 163984: [search] no results from SearchEngine.searchAllTypeNames with types in scope |
7703 |
* @test Ensure that types are found with scope made of elements |
7704 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=163984" |
7705 |
*/ |
7706 |
public void testONLY_Bug163984() throws CoreException { |
7707 |
// Search all type names with TypeNameMatchRequestor |
7708 |
TypeNameMatchCollector collector = new TypeNameMatchCollector() { |
7709 |
public String toString(){ |
7710 |
return toFullyQualifiedNamesString(); |
7711 |
} |
7712 |
}; |
7713 |
ICompilationUnit[] elements = getCompilationUnits("JavaSearchBugs", "src", "b163984"); |
7714 |
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements); |
7715 |
new SearchEngine().searchAllTypeNames( |
7716 |
null, |
7717 |
SearchPattern.R_EXACT_MATCH, |
7718 |
new char[] { '*' }, |
7719 |
SearchPattern.R_PATTERN_MATCH, |
7720 |
IJavaSearchConstants.TYPE, |
7721 |
scope, |
7722 |
collector, |
7723 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7724 |
null); |
7725 |
// Search all type names with TypeNameRequestor |
7726 |
TypeNameRequestor requestor = new SearchTests.SearchTypeNameRequestor(); |
7727 |
new SearchEngine().searchAllTypeNames( |
7728 |
null, |
7729 |
SearchPattern.R_EXACT_MATCH, |
7730 |
new char[] { '*' }, |
7731 |
SearchPattern.R_PATTERN_MATCH, |
7732 |
IJavaSearchConstants.TYPE, |
7733 |
scope, |
7734 |
requestor, |
7735 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
7736 |
null); |
7737 |
// Should have same types with these 2 searches |
7738 |
assertEquals("We should get 3 types!", 3, collector.size()); |
7739 |
assertEquals("Found types sounds not to be correct", requestor.toString(), collector.toString()); |
7740 |
} |
7700 |
} |
7741 |
} |