|
Lines 45-51
Link Here
|
| 45 |
// org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; |
45 |
// org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; |
| 46 |
// TESTS_PREFIX = "testBug75816"; |
46 |
// TESTS_PREFIX = "testBug75816"; |
| 47 |
// TESTS_NAMES = new String[] { "testBug82208_SearchAllTypeNames_CLASS" }; |
47 |
// TESTS_NAMES = new String[] { "testBug82208_SearchAllTypeNames_CLASS" }; |
| 48 |
// TESTS_NUMBERS = new int[] { 96761, 96763 }; |
48 |
// TESTS_NUMBERS = new int[] { 98378 }; |
| 49 |
// TESTS_RANGE = new int[] { 83304, -1 }; |
49 |
// TESTS_RANGE = new int[] { 83304, -1 }; |
| 50 |
} |
50 |
} |
| 51 |
|
51 |
|
|
Lines 3556-3559
Link Here
|
| 3556 |
deleteFolder(pathRef); |
3556 |
deleteFolder(pathRef); |
| 3557 |
} |
3557 |
} |
| 3558 |
} |
3558 |
} |
|
|
3559 |
|
| 3560 |
/** |
| 3561 |
* Bug 98378: [search] does not find method references in anonymous class of imported jarred plugin |
| 3562 |
* @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=98378" |
| 3563 |
*/ |
| 3564 |
public void testBug98378() throws CoreException { |
| 3565 |
workingCopies = new ICompilationUnit[2]; |
| 3566 |
workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b98378/X.java", |
| 3567 |
"package b98378;\n" + |
| 3568 |
"public class X implements java.lang.CharSequence {\n" + |
| 3569 |
" public int length() {\n" + |
| 3570 |
" return 1;\n" + |
| 3571 |
" }\n" + |
| 3572 |
"}" |
| 3573 |
); |
| 3574 |
workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b98378/Y.java", |
| 3575 |
"package b98378;\n" + |
| 3576 |
"public class Y {\n" + |
| 3577 |
" public int length() {\n" + |
| 3578 |
" return -1;\n" + |
| 3579 |
" }\n" + |
| 3580 |
"}\n" |
| 3581 |
); |
| 3582 |
String jclPath = getExternalJCLPathString("1.5"); |
| 3583 |
IType type = getClassFile("JavaSearchBugs", jclPath, "java.lang", "CharSequence.class").getType(); |
| 3584 |
IMethod method = type.getMethod("length", new String[] {}); |
| 3585 |
search(method, DECLARATIONS, SearchEngine.createHierarchyScope(type, this.wcOwner)); |
| 3586 |
this.discard = false; |
| 3587 |
assertSearchResults( |
| 3588 |
jclPath + " int java.lang.CharSequence.length() EXACT_MATCH\n" + |
| 3589 |
jclPath + " int java.lang.String.length() EXACT_MATCH" |
| 3590 |
); |
| 3591 |
} |
| 3592 |
public void testBug98378b() throws CoreException { |
| 3593 |
assertNotNull("There should be working copies!", workingCopies); |
| 3594 |
assertEquals("Invalid number of working copies kept between tests!", 2, workingCopies.length); |
| 3595 |
String jclPath = getExternalJCLPathString("1.5"); |
| 3596 |
IType type = getClassFile("JavaSearchBugs", jclPath, "java.lang", "CharSequence.class").getType(); |
| 3597 |
IMethod method = type.getMethod("length", new String[] {}); |
| 3598 |
search(method, DECLARATIONS|IGNORE_DECLARING_TYPE|IGNORE_RETURN_TYPE, SearchEngine.createHierarchyScope(type, this.wcOwner)); |
| 3599 |
assertSearchResults( |
| 3600 |
"src/b98378/X.java int b98378.X.length() [length] EXACT_MATCH\n" + |
| 3601 |
jclPath + " int java.lang.CharSequence.length() EXACT_MATCH\n" + |
| 3602 |
jclPath + " int java.lang.String.length() EXACT_MATCH" |
| 3603 |
); |
| 3604 |
} |
| 3559 |
} |
3605 |
} |