Lines 11070-11073
Link Here
|
11070 |
removeClasspathEntry(JAVA_PROJECT, new Path(libPath)); |
11070 |
removeClasspathEntry(JAVA_PROJECT, new Path(libPath)); |
11071 |
} |
11071 |
} |
11072 |
} |
11072 |
} |
|
|
11073 |
/** |
11074 |
* @bug 293861: Problem with refactoring when existing jar with invalid package names |
11075 |
* @test Ensure that the search doesn't return classes with invalid package names |
11076 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=293861" |
11077 |
*/ |
11078 |
public void testBug293861a() throws CoreException { |
11079 |
try |
11080 |
{ |
11081 |
IJavaProject project = createJavaProject("P"); |
11082 |
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b293861.jar"), null, null)); |
11083 |
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS; |
11084 |
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); |
11085 |
|
11086 |
search("b293861TestFunc", IJavaSearchConstants.METHOD, IJavaSearchConstants.DECLARATIONS, scope); |
11087 |
assertSearchResults("No search results expected", "", this.resultCollector); |
11088 |
} finally { |
11089 |
deleteProject("P"); |
11090 |
} |
11091 |
} |
11092 |
|
11093 |
/* |
11094 |
* SearchEngine#searchAllTypeNames should also not return classes with invalid package names |
11095 |
*/ |
11096 |
public void testBug293861b() throws CoreException { |
11097 |
try |
11098 |
{ |
11099 |
IJavaProject project = createJavaProject("P"); |
11100 |
addClasspathEntry(project, JavaCore.newLibraryEntry(new Path("/JavaSearchBugs/lib/b293861.jar"), null, null)); |
11101 |
int mask = IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.SOURCES | IJavaSearchScope.REFERENCED_PROJECTS; |
11102 |
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, mask); |
11103 |
|
11104 |
TypeNameMatchCollector collector = new TypeNameMatchCollector(); |
11105 |
new SearchEngine().searchAllTypeNames( |
11106 |
null, |
11107 |
new char[][] {"b293861Test".toCharArray()}, |
11108 |
scope, |
11109 |
collector, |
11110 |
IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, |
11111 |
null); |
11112 |
assertSearchResults("No search results expected", "", collector); |
11113 |
} finally { |
11114 |
deleteProject("P"); |
11115 |
} |
11116 |
} |
11073 |
} |
11117 |
} |