Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v retrieving revision 1.46 diff -u -r1.46 JavaSearchBugsTests.java --- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 8 Jun 2005 16:53:11 -0000 1.46 +++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 13 Jun 2005 12:22:31 -0000 @@ -43,7 +43,7 @@ static { // org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; // org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; -// TESTS_PREFIX = "testBug75816"; +// TESTS_PREFIX = "testBug97547"; // TESTS_NAMES = new String[] { "testBug82208_SearchAllTypeNames_CLASS" }; // TESTS_NUMBERS = new int[] { 96761, 96763 }; // TESTS_RANGE = new int[] { 83304, -1 }; @@ -64,6 +64,12 @@ if (packageName == null) return getJavaSearchScopeBugs(); return getJavaSearchPackageScope("JavaSearchBugs", packageName, addSubpackages); } + public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException { + if (this.wcOwner == null) { + this.wcOwner = new WorkingCopyOwner() {}; + } + return getWorkingCopy(path, source, this.wcOwner, null/*don't compute problems*/); + } protected void search(IJavaElement element, int limitTo) throws CoreException { search(element, limitTo, EXACT_RULE, getJavaSearchScopeBugs(), resultCollector); } @@ -1359,7 +1365,7 @@ } /** - * Test fix for bug 82088: [search][javadoc] Method parameter types references not found in @see/@link tags + * Bug 82088: [search][javadoc] Method parameter types references not found in @see/@link tags * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=82088" */ public void testBug82088method() throws CoreException { @@ -2629,7 +2635,7 @@ } /** - * Test fix for bug 89848: [search] does not find method references in anonymous class of imported jarred plugin + * Bug 89848: [search] does not find method references in anonymous class of imported jarred plugin * @see "http://bugs.eclipse.org/bugs/show_bug.cgi?id=89848" */ public void testBug89848() throws CoreException { @@ -2834,6 +2840,7 @@ "g5.m.def.Multiple\n" + "g5.m.def.Single\n" + "java.io.Serializable\n" + + "java.lang.CharSequence\n" + "java.lang.Class\n" + "java.lang.CloneNotSupportedException\n" + "java.lang.Comparable\n" + @@ -2950,6 +2957,7 @@ "g5.m.def.Multiple\n" + "g5.m.def.Single\n" + "java.io.Serializable\n" + + "java.lang.CharSequence\n" + "java.lang.Class\n" + "java.lang.CloneNotSupportedException\n" + "java.lang.Comparable\n" + @@ -3045,6 +3053,7 @@ "b87627.List\n" + "b92944.B92944_I\n" + "java.io.Serializable\n" + + "java.lang.CharSequence\n" + "java.lang.Comparable\n" + "java.lang.annotation.Annotation", // Annotation is an interface in java.lang requestor); @@ -3448,6 +3457,33 @@ } /** + * Bug 97547: [search] Package search does not find references in member types import clause + * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97547" + */ + public void testBug97547() throws CoreException { + workingCopies = new ICompilationUnit[2]; + workingCopies[0] = getWorkingCopy("/JavaSearchBugs/src/b97547/IX.java", + "package b97547;\n" + + "public interface IX {\n" + + " public interface IX1 {}\n" + + "}" + ); + workingCopies[1] = getWorkingCopy("/JavaSearchBugs/src/b97547/X.java", + "package b97547;\n" + + "import b97547.IX.*;\n" + + "class X {\n" + + " IX x;\n" + + "}" + ); + IPackageDeclaration[] packages = workingCopies[0].getPackageDeclarations(); + assertTrue("Invalid number of packages declaration!", packages!=null && packages.length==1); + search(packages[0], REFERENCES); + assertSearchResults( + "src/b97547/X.java [b97547] EXACT_MATCH" + ); + } + + /** * Bug 97606: [1.5][search] Raw type reference is reported as exact match for qualified names * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=97606" */