Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 83867 Details for
Bug 155013
[search] [DCR] More finegrained options for Java search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v07.txt (text/plain), 279.78 KB, created by
Frederic Fusier
on 2007-11-27 10:11:50 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-11-27 10:11:50 EST
Size:
279.78 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v >retrieving revision 1.132 >diff -u -r1.132 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 27 Nov 2007 08:42:06 -0000 1.132 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 27 Nov 2007 15:09:15 -0000 >@@ -9216,8 +9216,8 @@ > this.resultCollector.showSelection = true; > search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); > assertSearchResults( >- "src/generics/Generic.java [import java.io.§|Serializable|§;] EXACT_MATCH\n" + >- "src/generics/Generic.java [import type.def.§|Types|§;] EXACT_MATCH\n" + >+ "src/generics/Generic.java [import §|java.io.Serializable|§;] EXACT_MATCH\n" + >+ "src/generics/Generic.java [import §|type.def.Types|§;] EXACT_MATCH\n" + > "src/generics/Generic.java generics.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {] EXACT_MATCH\n" + > "src/generics/Generic.java generics.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {] EXACT_MATCH\n" + > "src/generics/Generic.java generics.Generic [public class Generic<T extends Types, U extends Types & §|Comparable|§<Types> & Serializable, V extends A<? super Types>> {] EXACT_MATCH\n" + >@@ -9255,8 +9255,9 @@ > this.resultCollector.showSelection = true; > search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector); > assertSearchResults( >- "src/test/Ref.java [import pack.§|Test|§;] EXACT_MATCH\n" + >+ "src/test/Ref.java [import §|pack.Test|§;] EXACT_MATCH\n" + > "src/test/Ref.java test.Ref.test [ §|Test|§ test;] EXACT_MATCH" > ); > } >+ > } >\ No newline at end of file >Index: src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java,v >retrieving revision 1.16 >diff -u -r1.16 RunJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java 29 Mar 2006 04:03:07 -0000 1.16 >+++ src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java 27 Nov 2007 15:09:15 -0000 >@@ -23,6 +23,8 @@ > > public final static List TEST_CLASSES = new ArrayList(); > static { >+ // All test suites put in this list should use the same tests projects >+ // (eg. JavaSearch and JavaSearch15) > TEST_CLASSES.add(JavaSearchTests.class); > TEST_CLASSES.add(JavaSearchGenericTypeTests.class); > TEST_CLASSES.add(JavaSearchGenericTypeEquivalentTests.class); >@@ -36,6 +38,7 @@ > TEST_CLASSES.add(JavaSearchGenericConstructorEquivalentTests.class); > TEST_CLASSES.add(WorkingCopySearchTests.class); > TEST_CLASSES.add(JavaSearchJavadocTests.class); >+ TEST_CLASSES.add(JavaSearchFineGrainTests.class); > } > > public static Class[] getTestClasses() { >Index: src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java,v >retrieving revision 1.30 >diff -u -r1.30 AbstractJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 27 Nov 2007 08:42:06 -0000 1.30 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 27 Nov 2007 15:09:13 -0000 >@@ -59,6 +59,7 @@ > public boolean showPotential = true; > public boolean showProject; > public boolean showSynthetic; >+ public boolean showOffset = false; > public int showFlavors = 0; > public int count = 0; > List lines = new ArrayList(); >@@ -177,6 +178,10 @@ > if (lineEnd == -1) lineEnd = contents.length; > line.append(CharOperation.subarray(contents, end, lineEnd)); > } >+ if (this.showOffset) { >+ line.append('@'); >+ line.append(start); >+ } > } else { > line.append("No source"); > } >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java >=================================================================== >RCS file: src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java >diff -N src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1628 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jdt.core.tests.model; >+ >+import junit.framework.Test; >+ >+import org.eclipse.core.runtime.*; >+import org.eclipse.jdt.core.*; >+import org.eclipse.jdt.core.search.IJavaSearchScope; >+import org.eclipse.jdt.core.search.SearchEngine; >+import org.eclipse.jdt.core.search.SearchPattern; >+ >+ >+/** >+ * Specific test suite for fine grained search. >+ * >+ * @bug 155013: [search] [DCR] More finegrained options for Java search >+ * @test Several tests sets trying to cover as many cases as possible. >+ * <p> >+ * Each set is organize the same way: >+ * <ul> >+ * <li>specific method defining the test case called by all the tests of the set,</li> >+ * <li>first test performs a search request without any fine grain flag defined >+ * to have a precise idea of what are the entire expected references,</li> >+ * <li>second test performs a search request with all fine grain flags >+ * defined to verify that flags combination works well</li> >+ * <li>each following test each defines one of the possible fine grain flag >+ * to verify that it works properly with the given test case,</li> >+ * </ul> >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=155013" >+ */ >+public class JavaSearchFineGrainTests extends JavaSearchTests { >+ >+public JavaSearchFineGrainTests(String name) { >+ super(name); >+} >+public static Test suite() { >+ return buildModelTestSuite(JavaSearchFineGrainTests.class); >+} >+static { >+// org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; >+} >+ >+IJavaSearchScope getJavaSearchScope() { >+ return super.getJavaSearchScope15(); >+} >+public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException { >+ if (this.wcOwner == null) { >+ this.wcOwner = new WorkingCopyOwner() {}; >+ } >+ return getWorkingCopy(path, source, this.wcOwner); >+} >+ >+protected void setUp () throws Exception { >+ super.setUp(); >+ this.resultCollector = new JavaSearchResultCollector(); >+ resultCollector.showInsideDoc = false; >+ resultCollector.showAccuracy = true; >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+} >+ >+static { >+// TESTS_PREFIX = "testMethodRef"; >+} >+ >+/* >+ * References to a specific IField >+ */ >+private final static int ALL_FIELD_METHOD_FINE_GRAIN_FLAGS = >+ SUPER_REFERENCE | >+ QUALIFIED_REFERENCE | >+ THIS_REFERENCE | >+ IMPLICIT_THIS_REFERENCE; >+private IField setUpFieldRef() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[2]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/field/def/Fields.java", >+ "package field.def;\n" + >+ "public class Fields {\n" + >+ " public Object field;\n" + >+ "}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearch15/src/field/ref/TestFields.java", >+ "package field.ref;\n" + >+ "import field.def.Fields;\n" + >+ "public class TestFields extends Fields {\n" + >+ " boolean foo(Fields param) {\n" + >+ " return super.field == null ||\n" + >+ " param.field == null ||\n" + >+ " this.field == null ||\n" + >+ " field == null;\n" + >+ " }\n" + >+ "}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+ return workingCopies[0].getType("Fields").getField("field"); >+} >+public void testFieldRef() throws CoreException { >+ search(setUpFieldRef(), REFERENCES); >+ assertSearchResults( >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ return super.§|field|§ == null ||@129] EXACT_MATCH\n" + >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ param.§|field|§ == null ||@155] EXACT_MATCH\n" + >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ this.§|field|§ == null ||@180] EXACT_MATCH\n" + >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ §|field|§ == null;@200] EXACT_MATCH" >+ ); >+} >+public void testFieldRef_AllFlags() throws CoreException { >+ search(setUpFieldRef(), ALL_FIELD_METHOD_FINE_GRAIN_FLAGS); >+ assertSearchResults( >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ return super.§|field|§ == null ||@129] EXACT_MATCH\n" + >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ param.§|field|§ == null ||@155] EXACT_MATCH\n" + >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ this.§|field|§ == null ||@180] EXACT_MATCH\n" + >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ §|field|§ == null;@200] EXACT_MATCH" >+ ); >+} >+public void testFieldRef_Qualified() throws CoreException { >+ search(setUpFieldRef(), QUALIFIED_REFERENCE); >+ assertSearchResults( >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ param.§|field|§ == null ||@155] EXACT_MATCH" >+ ); >+} >+public void testFieldRef_Simple() throws CoreException { >+ search(setUpFieldRef(), IMPLICIT_THIS_REFERENCE); >+ assertSearchResults( >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ §|field|§ == null;@200] EXACT_MATCH" >+ ); >+} >+public void testFieldRef_Super() throws CoreException { >+ search(setUpFieldRef(), SUPER_REFERENCE); >+ assertSearchResults( >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ return super.§|field|§ == null ||@129] EXACT_MATCH" >+ ); >+} >+public void testFieldRef_This() throws CoreException { >+ search(setUpFieldRef(), THIS_REFERENCE); >+ assertSearchResults( >+ "src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [ this.§|field|§ == null ||@180] EXACT_MATCH" >+ ); >+} >+ >+/* >+ * References to a specific IMethod >+ */ >+private IMethod setUpMethodRef() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[2]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/meth/def/Methods.java", >+ "package meth.def;\n" + >+ "public class Methods {\n" + >+ " public void method() {}\n" + >+ "}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearch15/src/meth/ref/TestMethods.java", >+ "package meth.ref;\n" + >+ "import meth.def.Methods;\n" + >+ "public class TestMethods extends Methods {\n" + >+ " void foo(Methods param) {\n" + >+ " super.method();\n" + >+ " param.method();\n" + >+ " this.method();\n" + >+ " method();\n" + >+ " }\n" + >+ "}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+ return workingCopies[0].getType("Methods").getMethod("method", new String[0]); >+} >+public void testMethodRef() throws CoreException { >+ search(setUpMethodRef(), REFERENCES); >+ assertSearchResults( >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ super.§|method()|§;@121] EXACT_MATCH\n" + >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ param.§|method()|§;@139] EXACT_MATCH\n" + >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ this.§|method()|§;@156] EXACT_MATCH\n" + >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ §|method()|§;@168] EXACT_MATCH" >+ ); >+} >+public void testMethodRef_AllFlags() throws CoreException { >+ search(setUpMethodRef(), ALL_FIELD_METHOD_FINE_GRAIN_FLAGS); >+ assertSearchResults( >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ super.§|method()|§;@121] EXACT_MATCH\n" + >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ param.§|method()|§;@139] EXACT_MATCH\n" + >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ this.§|method()|§;@156] EXACT_MATCH\n" + >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ §|method()|§;@168] EXACT_MATCH" >+ ); >+} >+public void testMethodRef_Qualified() throws CoreException { >+ search(setUpMethodRef(), QUALIFIED_REFERENCE); >+ assertSearchResults( >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ param.§|method()|§;@139] EXACT_MATCH" >+ ); >+} >+public void testMethodRef_Simple() throws CoreException { >+ search(setUpMethodRef(), IMPLICIT_THIS_REFERENCE); >+ assertSearchResults( >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ §|method()|§;@168] EXACT_MATCH" >+ ); >+} >+public void testMethodRef_Super() throws CoreException { >+ search(setUpMethodRef(), SUPER_REFERENCE); >+ assertSearchResults( >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ super.§|method()|§;@121] EXACT_MATCH" >+ ); >+} >+public void testMethodRef_This() throws CoreException { >+ search(setUpMethodRef(), THIS_REFERENCE); >+ assertSearchResults( >+ "src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [ this.§|method()|§;@156] EXACT_MATCH" >+ ); >+} >+ >+private final static int ALL_TYPE_FINE_GRAIN_FLAGS = >+ FIELD_TYPE_DECLARATION_TYPE_REFERENCE | >+ LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE | >+ PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE | >+ SUPERTYPE_TYPE_REFERENCE | >+ SUPERINTERFACE_TYPE_REFERENCE | >+ THROWS_CLAUSE_TYPE_REFERENCE | >+ CAST_TYPE_REFERENCE | >+ CATCH_TYPE_REFERENCE | >+ ALLOCATION_EXPRESSION_TYPE_REFERENCE | >+ RETURN_TYPE_REFERENCE | >+ IMPORT_DECLARATION_TYPE_REFERENCE | >+ ANNOTATION_TYPE_REFERENCE | >+ TYPE_VARIABLE_BOUND_TYPE_REFERENCE | >+ PARAMETERIZED_TYPE_REFERENCE | >+ WILDCARD_BOUND_TYPE_REFERENCE; >+ >+/* >+ * References to a specific IType >+ */ >+private IType setUpTypeRef(int typeIndex) throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[3]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java", >+ "package type.def;\n" + >+ "@Bug\n" + >+ "@ATest\n" + >+ "public class Types extends Exception implements ITest1, ITest2 {\n" + >+ " ITest1 test1;\n" + >+ " ITest2 test2;\n" + >+ "}\n" + >+ "@Bug\n" + >+ "interface ITest1 {}\n" + >+ "@ATest\n" + >+ "interface ITest2 extends ITest1 {}\n" + >+ "@Bug\n" + >+ "@ATest\n" + >+ "enum ETest {}\n" + >+ "@Bug\n" + >+ "@interface ATest {}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearch15/src/type/def/Bug.java", >+ "package type.def;\n" + >+ "public @interface Bug {\n" + >+ " int num() default 0;\n" + >+ " String comment() default \"\";\n" + >+ "}\n" >+ ); >+ workingCopies[2] = getWorkingCopy("/JavaSearch15/src/type/ref/TestTypes.java", >+ "package type.ref;\n" + >+ "import type.def.Types;\n" + >+ "import type.def.Bug;\n" + >+ "\n" + >+ "@Bug(num=155013)\n" + >+ "public class TestTypes extends Types {\n" + >+ " @Bug(comment=\"field\")\n" + >+ " Types field;\n" + >+ " @Bug(comment=\"method\", num=155013)\n" + >+ " Types method(Types param) throws Types {\n" + >+ " Object obj = new Types();\n" + >+ " Types local = (Types) obj;\n" + >+ " return local;\n" + >+ " }\n" + >+ " Bug bar(Bug bug) {\n" + >+ " try {\n" + >+ " method(this);\n" + >+ " } catch (Types ex) {\n" + >+ " }\n" + >+ " return bug;\n" + >+ " }\n" + >+ "}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ ICompilationUnit cu = workingCopies[typeIndex]; >+ String cuName = cu.getElementName(); >+ return cu.getType(cuName.substring(0, cuName.indexOf('.'))); >+} >+public void testTypeRef() throws CoreException { >+ search(setUpTypeRef(0), REFERENCES); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java [import §|type.def.Types|§;@25] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java type.ref.TestTypes [public class TestTypes extends §|Types|§ {@111] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java type.ref.TestTypes.field [ §|Types|§ field;@143] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ §|Types|§ method(Types param) throws Types {@193] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types method(§|Types|§ param) throws Types {@206] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types method(Types param) throws §|Types|§ {@226] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Object obj = new §|Types|§();@253] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ §|Types|§ local = (Types) obj;@264] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types local = (§|Types|§) obj;@279] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Bug type.ref.TestTypes.bar(Bug) [ } catch (§|Types|§ ex) {@366] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_AllFlags() throws CoreException { >+ search(setUpTypeRef(0), ALL_TYPE_FINE_GRAIN_FLAGS); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java [import §|type.def.Types|§;@25] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java type.ref.TestTypes [public class TestTypes extends §|Types|§ {@111] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java type.ref.TestTypes.field [ §|Types|§ field;@143] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types method(§|Types|§ param) throws Types {@206] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types method(Types param) throws §|Types|§ {@226] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ §|Types|§ method(Types param) throws Types {@193] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Object obj = new §|Types|§();@253] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ §|Types|§ local = (Types) obj;@264] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types local = (§|Types|§) obj;@279] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Bug type.ref.TestTypes.bar(Bug) [ } catch (§|Types|§ ex) {@366] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Allocation() throws CoreException { >+ search(setUpTypeRef(0), ALLOCATION_EXPRESSION_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Object obj = new §|Types|§();@253] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Annotation() throws CoreException { >+ search(setUpTypeRef(1), ANNOTATION_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/def/Types.java type.def.Types [@§|Bug|§@19] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest1 [@§|Bug|§@128] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ETest [@§|Bug|§@195] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ATest [@§|Bug|§@221] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java type.ref.TestTypes [@§|Bug|§(num=155013)@64] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java type.ref.TestTypes.field [ @§|Bug|§(comment=\"field\")@121] EXACT_MATCH\n" + >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ @§|Bug|§(comment=\"method\", num=155013)@158] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Cast() throws CoreException { >+ search(setUpTypeRef(0), CAST_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types local = (§|Types|§) obj;@279] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Catch() throws CoreException { >+ search(setUpTypeRef(0), CATCH_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Bug type.ref.TestTypes.bar(Bug) [ } catch (§|Types|§ ex) {@366] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Field() throws CoreException { >+ search(setUpTypeRef(0), FIELD_TYPE_DECLARATION_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java type.ref.TestTypes.field [ §|Types|§ field;@143] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Import() throws CoreException { >+ search(setUpTypeRef(0), IMPORT_DECLARATION_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java [import §|type.def.Types|§;@25] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_MethodParameter() throws CoreException { >+ search(setUpTypeRef(0), PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types method(§|Types|§ param) throws Types {@206] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Return() throws CoreException { >+ search(setUpTypeRef(0), RETURN_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ §|Types|§ method(Types param) throws Types {@193] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Superinterface() throws CoreException { >+ IType type = setUpTypeRef(0); >+ search(((ICompilationUnit) type.getParent()).getType("ITest1"), SUPERINTERFACE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/type/def/Types.java type.def.Types [public class Types extends Exception implements §|ITest1|§, ITest2 {@78] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest2 [interface ITest2 extends §|ITest1|§ {}@184] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Supertype() throws CoreException { >+ search(setUpTypeRef(0), SUPERTYPE_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java type.ref.TestTypes [public class TestTypes extends §|Types|§ {@111] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Throws() throws CoreException { >+ search(setUpTypeRef(0), THROWS_CLAUSE_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ Types method(Types param) throws §|Types|§ {@226] EXACT_MATCH" >+ ); >+} >+public void testTypeRef_Variable() throws CoreException { >+ search(setUpTypeRef(0), LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [ §|Types|§ local = (Types) obj;@264] EXACT_MATCH" >+ ); >+} >+ >+/* >+ * References to a all types (using '*' string pattern) >+ */ >+private void setUpTypeRefAll() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[3]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java", >+ "package type.def;\n" + >+ "@Bug\n" + >+ "@ATest\n" + >+ "public class Types extends Exception implements ITest1, ITest2 {\n" + >+ " ITest1 test1;\n" + >+ " ITest2 test2;\n" + >+ "}\n" + >+ "@Bug\n" + >+ "interface ITest1 {}\n" + >+ "@ATest\n" + >+ "interface ITest2 extends ITest1 {}\n" + >+ "@Bug\n" + >+ "@ATest\n" + >+ "enum ETest {}\n" + >+ "@Bug\n" + >+ "@interface ATest {}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearch15/src/type/def/Bug.java", >+ "package type.def;\n" + >+ "public @interface Bug {\n" + >+ " int num() default 0;\n" + >+ " String comment() default \"\";\n" + >+ "}\n" >+ ); >+ workingCopies[2] = getWorkingCopy("/JavaSearch15/src/all/types/ref/TestTypes.java", >+ "package all.types.ref;\n" + >+ "\n" + >+ "import type.def.Bug;\n" + >+ "import type.def.Types;\n" + >+ "\n" + >+ "@Bug(num=155013)\n" + >+ "public class TestTypes extends Types {\n" + >+ " @Bug(comment=\"field\")\n" + >+ " Types field = new Types(), local, other = new Types();\n" + >+ " {\n" + >+ " Object o;\n" + >+ " Types t;\n" + >+ " if (this.field == null) {\n" + >+ " try {\n" + >+ " t = new TestTypes();\n" + >+ " } catch (RuntimeException e) {\n" + >+ " t = new Types();\n" + >+ " } \n" + >+ " } else {\n" + >+ " o = this.field;\n" + >+ " t = (Types) o;\n" + >+ " }\n" + >+ " local = t;\n" + >+ " };\n" + >+ " @Bug(comment=\"method\", num=155013)\n" + >+ " Types method(Types param) throws Types {\n" + >+ " Object obj = new Types();\n" + >+ " Types local = (Types) obj;\n" + >+ " return local;\n" + >+ " }\n" + >+ " Bug bar(Bug bug) {\n" + >+ " try {\n" + >+ " method(this);\n" + >+ " }\n" + >+ " catch (Types ex) {}\n" + >+ " catch (Exception ex) {}\n" + >+ " return bug; \n" + >+ " }\n" + >+ " // Other types references\n" + >+ " Object object;\n" + >+ " String str;\n" + >+ " TestTypes() throws Types, RuntimeException {\n" + >+ " if (this.object instanceof String) {\n" + >+ " this.str = (String) this.object;\n" + >+ " } else {\n" + >+ " this.str = new String();\n" + >+ " this.object = new Object();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+} >+public void testTypeRefAll_Allocation() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, ALLOCATION_EXPRESSION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ Types field = new §|Types|§(), local, other = new Types();@167] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.other [ Types field = new Types(), local, other = new §|Types|§();@195] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ t = new §|TestTypes|§();@279] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ t = new §|Types|§();@338] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ Object obj = new §|Types|§();@519] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ this.str = new §|String|§();@897] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ this.object = new §|Object|§();@928] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Annotation() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, ANNOTATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes [@§|Bug|§(num=155013)@70] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ @§|Bug|§(comment=\"field\")@127] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ @§|Bug|§(comment=\"method\", num=155013)@424] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [@§|Bug|§@19] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [@§|ATest|§@24] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest1 [@§|Bug|§@128] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest2 [@§|ATest|§@153] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ETest [@§|Bug|§@195] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ETest [@§|ATest|§@200] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ATest [@§|Bug|§@221] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Cast() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, CAST_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ t = (§|Types|§) o;@391] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ Types local = (§|Types|§) obj;@545] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ this.str = (§|String|§) this.object;@847] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Catch() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, CATCH_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ } catch (§|RuntimeException|§ e) {@304] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [ catch (§|Types|§ ex) {}@634] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [ catch (§|Exception|§ ex) {}@656] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Field() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, FIELD_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ §|Types|§ field = new Types(), local, other = new Types();@149] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.object [ §|Object|§ object;@719] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.str [ §|String|§ str;@735] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types.test1 [ §|ITest1|§ test1;@96] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types.test2 [ §|ITest2|§ test2;@111] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Import() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, IMPORT_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java [import §|type.def.Bug|§;@31] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java [import §|type.def.Types|§;@52] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_MethodParameter() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ Types method(§|Types|§ param) throws Types {@472] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [ Bug bar(§|Bug|§ bug) {@585] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Return() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, RETURN_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ §|Types|§ method(Types param) throws Types {@459] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [ §|Bug|§ bar(Bug bug) {@577] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Superinterface() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, SUPERINTERFACE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/type/def/Types.java type.def.Types [public class Types extends Exception implements §|ITest1|§, ITest2 {@78] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [public class Types extends Exception implements ITest1, §|ITest2|§ {@86] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest2 [interface ITest2 extends §|ITest1|§ {}@184] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Supertype() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, SUPERTYPE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes [public class TestTypes extends §|Types|§ {@117] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [public class Types extends §|Exception|§ implements ITest1, ITest2 {@57] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Throws() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, THROWS_CLAUSE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ Types method(Types param) throws §|Types|§ {@492] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ TestTypes() throws §|Types|§, RuntimeException {@767] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ TestTypes() throws Types, §|RuntimeException|§ {@774] EXACT_MATCH" >+ ); >+} >+public void testTypeRefAll_Variable() throws CoreException { >+ setUpTypeRefAll(); >+ search("*", TYPE, LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ §|Object|§ o;@209] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ §|Types|§ t;@221] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ §|Object|§ obj = new Types();@502] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [ §|Types|§ local = (Types) obj;@530] EXACT_MATCH" >+ ); >+} >+ >+private final static int ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS = >+ TYPE_VARIABLE_BOUND_TYPE_REFERENCE | >+ PARAMETERIZED_TYPE_REFERENCE | >+ WILDCARD_BOUND_TYPE_REFERENCE; >+ >+/* >+ * References to a specific generic IType and all types. >+ */ >+private IType setUpTypeRefGeneric01() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[3]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java", >+ "package type.def;\n" + >+ "public class Types {}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearch15/src/test01/Generic.java", >+ "package test01;\n" + >+ "import java.io.Serializable;\n" + >+ "import type.def.Types;\n" + >+ "public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {\n" + >+ " Generic<? extends Types, ?, ?> field;\n" + >+ " Comparable<String> comp;\n" + >+ " Class<? extends Exception> clazz;\n" + >+ "}\n" + >+ "class A<R> {}\n" >+ ); >+ workingCopies[2] = getWorkingCopy("/JavaSearch15/src/test01/TestGeneric.java", >+ "package test01;\n" + >+ "import java.io.Serializable;\n" + >+ "import type.def.Types;\n" + >+ "public class TestGeneric<T> extends Generic<Types, UClass, VClass> {\n" + >+ " TestGeneric<Types> test;\n" + >+ " TestGeneric<String> foo(TestGeneric<Types> param1, Comparable<String> param2) {\n" + >+ " return null;\n" + >+ " }\n" + >+ " Comparable<TestGeneric<Types>> bar() {\n" + >+ " return null;\n" + >+ " } \n" + >+ "}\n" + >+ "class UClass extends Types implements Comparable<Types>, Serializable {\n" + >+ " private static final long serialVersionUID = 1L;\n" + >+ " public int compareTo(Types o) {\n" + >+ " return 0;\n" + >+ " }\n" + >+ "}\n" + >+ "class VClass extends A<Types> {}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+ return workingCopies[0].getType("Types"); >+} >+public void testTypeRefGeneric01() throws CoreException { >+ search(setUpTypeRefGeneric01(), REFERENCES); >+ assertSearchResults( >+ "src/test01/Generic.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {@99] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {@116] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<§|Types|§> & Serializable, V extends A<? super Types>> {@135] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super §|Types|§>> {@178] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<§|Types|§> param1, Comparable<String> param2) {@200] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends §|Types|§ implements Comparable<Types>, Serializable {@345] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [ public int compareTo(§|Types|§ o) {@468] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGeneric01_AllFlags() throws CoreException { >+ search(setUpTypeRefGeneric01(), ALL_TYPE_FINE_GRAIN_FLAGS); >+ assertSearchResults( >+ "src/test01/Generic.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {@99] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {@116] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<§|Types|§> & Serializable, V extends A<? super Types>> {@135] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super §|Types|§>> {@178] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<§|Types|§> param1, Comparable<String> param2) {@200] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends §|Types|§ implements Comparable<Types>, Serializable {@345] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [ public int compareTo(§|Types|§ o) {@468] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGeneric01_Parameterized() throws CoreException { >+ search(setUpTypeRefGeneric01(), PARAMETERIZED_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<§|Types|§> & Serializable, V extends A<? super Types>> {@135] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<§|Types|§> param1, Comparable<String> param2) {@200] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGeneric01_TypeVariableBound() throws CoreException { >+ search(setUpTypeRefGeneric01(), TYPE_VARIABLE_BOUND_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {@99] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {@116] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGeneric01_WildcardBound() throws CoreException { >+ search(setUpTypeRefGeneric01(), WILDCARD_BOUND_TYPE_REFERENCE); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super §|Types|§>> {@178] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll01() throws CoreException { >+ setUpTypeRefGeneric01(); >+ search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test01/Generic.java [import §|java.io.Serializable|§;@23] EXACT_MATCH\n" + >+ "src/test01/Generic.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {@99] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {@116] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & §|Comparable|§<Types> & Serializable, V extends A<? super Types>> {@124] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<§|Types|§> & Serializable, V extends A<? super Types>> {@135] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & §|Serializable|§, V extends A<? super Types>> {@144] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends §|A|§<? super Types>> {@168] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super §|Types|§>> {@178] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ §|Generic|§<? extends Types, ?, ?> field;@189] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.comp [ §|Comparable|§<String> comp;@228] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.comp [ Comparable<§|String|§> comp;@239] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.clazz [ §|Class|§<? extends Exception> clazz;@254] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.clazz [ Class<? extends §|Exception|§> clazz;@270] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java [import §|java.io.Serializable|§;@23] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends §|Generic|§<Types, UClass, VClass> {@104] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, §|UClass|§, VClass> {@119] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, UClass, §|VClass|§> {@127] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ §|TestGeneric|§<Types> test;@138] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ §|TestGeneric|§<String> foo(TestGeneric<Types> param1, Comparable<String> param2) {@164] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<§|String|§> foo(TestGeneric<Types> param1, Comparable<String> param2) {@176] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(§|TestGeneric|§<Types> param1, Comparable<String> param2) {@188] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<§|Types|§> param1, Comparable<String> param2) {@200] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<Types> param1, §|Comparable|§<String> param2) {@215] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<Types> param1, Comparable<§|String|§> param2) {@226] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ §|Comparable|§<TestGeneric<Types>> bar() {@264] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<§|TestGeneric|§<Types>> bar() {@275] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends §|Types|§ implements Comparable<Types>, Serializable {@345] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements §|Comparable|§<Types>, Serializable {@362] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<Types>, §|Serializable|§ {@381] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass.serialVersionUID [ private static final §|long|§ serialVersionUID = 1L;@418] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [ public §|int|§ compareTo(Types o) {@454] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [ public int compareTo(§|Types|§ o) {@468] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends §|A|§<Types> {}@517] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll01_AllGenericFlags() throws CoreException { >+ setUpTypeRefGeneric01(); >+ search("*", TYPE, ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {@99] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {@116] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & §|Comparable|§<Types> & Serializable, V extends A<? super Types>> {@124] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<§|Types|§> & Serializable, V extends A<? super Types>> {@135] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & §|Serializable|§, V extends A<? super Types>> {@144] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends §|A|§<? super Types>> {@168] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super §|Types|§>> {@178] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.comp [ Comparable<§|String|§> comp;@239] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.clazz [ Class<? extends §|Exception|§> clazz;@270] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, §|UClass|§, VClass> {@119] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, UClass, §|VClass|§> {@127] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<§|String|§> foo(TestGeneric<Types> param1, Comparable<String> param2) {@176] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<§|Types|§> param1, Comparable<String> param2) {@200] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<Types> param1, Comparable<§|String|§> param2) {@226] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<§|TestGeneric|§<Types>> bar() {@275] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll01_Parameterized() throws CoreException { >+ setUpTypeRefGeneric01(); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<§|Types|§> & Serializable, V extends A<? super Types>> {@135] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.comp [ Comparable<§|String|§> comp;@239] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, §|UClass|§, VClass> {@119] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, UClass, §|VClass|§> {@127] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.TestGeneric.test [ TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<§|String|§> foo(TestGeneric<Types> param1, Comparable<String> param2) {@176] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<§|Types|§> param1, Comparable<String> param2) {@200] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java TestGeneric<String> test01.TestGeneric.foo(TestGeneric<Types>, Comparable<String>) [ TestGeneric<String> foo(TestGeneric<Types> param1, Comparable<§|String|§> param2) {@226] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<§|TestGeneric|§<Types>> bar() {@275] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [ Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + >+ "src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll01_TypeVariableBound() throws CoreException { >+ setUpTypeRefGeneric01(); >+ search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends §|Types|§, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {@99] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends §|Types|§ & Comparable<Types> & Serializable, V extends A<? super Types>> {@116] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & §|Comparable|§<Types> & Serializable, V extends A<? super Types>> {@124] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & §|Serializable|§, V extends A<? super Types>> {@144] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends §|A|§<? super Types>> {@168] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll01_WildcardBound() throws CoreException { >+ setUpTypeRefGeneric01(); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test01/Generic.java test01.Generic [public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super §|Types|§>> {@178] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.field [ Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + >+ "src/test01/Generic.java test01.Generic.clazz [ Class<? extends §|Exception|§> clazz;@270] EXACT_MATCH" >+ ); >+} >+/* >+ * Same test than previous ones with another example >+ */ >+private IType setUpTypeRefGeneric02() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/test02/Test.java", >+ "package test02;\n" + >+ "public class Test <T, U, V> {\n" + >+ " Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, X<String>> () {\n" + >+ " X<String> x;\n" + >+ " Test<A, B, C> t;\n" + >+ " Test<X<Y<Z<String>>>, Y<Z<String>>, Z<String>> bar() {\n" + >+ " return new Test<X<Y<Z<String>>>, Y<Z<String>>, Z<String>>();\n" + >+ " }\n" + >+ " };\n" + >+ " Test<? super A, B, ? extends C> foo(Test<? extends A, ? super B, C> param) {\n" + >+ " return null;\n" + >+ " };\n" + >+ "}\n" + >+ "class A {}\n" + >+ "class B {}\n" + >+ "class C extends X<String> {}\n" + >+ "class X<R> {}\n" + >+ "class Y<S> extends A {}\n" + >+ "class Z<P> extends B {}\n" + >+ "\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+ return workingCopies[0].getType("Types"); >+} >+public void testTypeRefGenericAll02() throws CoreException { >+ setUpTypeRefGeneric02(); >+ search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test02/Test.java test02.Test.field:<anonymous>#1 [ Test<A, ? extends B, ? super C> field = new §|Test|§<A, Z<String>, X<String>> () {@91] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.x [ §|X|§<String> x;@128] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.x [ X<§|String|§> x;@130] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ §|Test|§<A, B, C> t;@143] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<§|A|§, B, C> t;@148] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<A, §|B|§, C> t;@151] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<A, B, §|C|§> t;@154] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ §|Test|§<X<Y<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@162] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<§|X|§<Y<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@167] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<§|Y|§<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@169] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<§|Z|§<String>>>, Y<Z<String>>, Z<String>> bar() {@171] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<§|String|§>>>, Y<Z<String>>, Z<String>> bar() {@173] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, §|Y|§<Z<String>>, Z<String>> bar() {@184] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<§|Z|§<String>>, Z<String>> bar() {@186] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<§|String|§>>, Z<String>> bar() {@188] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<String>>, §|Z|§<String>> bar() {@198] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<String>>, Z<§|String|§>> bar() {@200] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new §|Test|§<X<Y<Z<String>>>, Y<Z<String>>, Z<String>>();@231] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<§|X|§<Y<Z<String>>>, Y<Z<String>>, Z<String>>();@236] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<§|Y|§<Z<String>>>, Y<Z<String>>, Z<String>>();@238] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<§|Z|§<String>>>, Y<Z<String>>, Z<String>>();@240] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<§|String|§>>>, Y<Z<String>>, Z<String>>();@242] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, §|Y|§<Z<String>>, Z<String>>();@253] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<§|Z|§<String>>, Z<String>>();@255] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<§|String|§>>, Z<String>>();@257] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<String>>, §|Z|§<String>>();@267] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<String>>, Z<§|String|§>>();@269] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ §|Test|§<A, ? extends B, ? super C> field = new Test<A, Z<String>, X<String>> () {@47] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<§|A|§, ? extends B, ? super C> field = new Test<A, Z<String>, X<String>> () {@52] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends §|B|§, ? super C> field = new Test<A, Z<String>, X<String>> () {@65] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super §|C|§> field = new Test<A, Z<String>, X<String>> () {@76] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<§|A|§, Z<String>, X<String>> () {@96] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, §|Z|§<String>, X<String>> () {@99] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<§|String|§>, X<String>> () {@101] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, §|X|§<String>> () {@110] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, X<§|String|§>> () {@112] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ §|Test|§<? super A, B, ? extends C> foo(Test<? extends A, ? super B, C> param) {@290] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super §|A|§, B, ? extends C> foo(Test<? extends A, ? super B, C> param) {@303] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, §|B|§, ? extends C> foo(Test<? extends A, ? super B, C> param) {@306] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends §|C|§> foo(Test<? extends A, ? super B, C> param) {@319] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(§|Test|§<? extends A, ? super B, C> param) {@326] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends §|A|§, ? super B, C> param) {@341] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends A, ? super §|B|§, C> param) {@352] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends A, ? super B, §|C|§> param) {@355] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.C [class C extends §|X|§<String> {}@426] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.C [class C extends X<§|String|§> {}@428] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Y [class Y<S> extends §|A|§ {}@472] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Z [class Z<P> extends §|B|§ {}@496] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll02_AllGenericFlags() throws CoreException { >+ setUpTypeRefGeneric02(); >+ search("*", TYPE, ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.x [ X<§|String|§> x;@130] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<§|A|§, B, C> t;@148] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<A, §|B|§, C> t;@151] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<A, B, §|C|§> t;@154] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<§|X|§<Y<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@167] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<§|Y|§<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@169] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<§|Z|§<String>>>, Y<Z<String>>, Z<String>> bar() {@171] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<§|String|§>>>, Y<Z<String>>, Z<String>> bar() {@173] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, §|Y|§<Z<String>>, Z<String>> bar() {@184] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<§|Z|§<String>>, Z<String>> bar() {@186] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<§|String|§>>, Z<String>> bar() {@188] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<String>>, §|Z|§<String>> bar() {@198] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<String>>, Z<§|String|§>> bar() {@200] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<§|X|§<Y<Z<String>>>, Y<Z<String>>, Z<String>>();@236] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<§|Y|§<Z<String>>>, Y<Z<String>>, Z<String>>();@238] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<§|Z|§<String>>>, Y<Z<String>>, Z<String>>();@240] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<§|String|§>>>, Y<Z<String>>, Z<String>>();@242] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, §|Y|§<Z<String>>, Z<String>>();@253] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<§|Z|§<String>>, Z<String>>();@255] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<§|String|§>>, Z<String>>();@257] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<String>>, §|Z|§<String>>();@267] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<String>>, Z<§|String|§>>();@269] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<§|A|§, ? extends B, ? super C> field = new Test<A, Z<String>, X<String>> () {@52] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends §|B|§, ? super C> field = new Test<A, Z<String>, X<String>> () {@65] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super §|C|§> field = new Test<A, Z<String>, X<String>> () {@76] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<§|A|§, Z<String>, X<String>> () {@96] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, §|Z|§<String>, X<String>> () {@99] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<§|String|§>, X<String>> () {@101] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, §|X|§<String>> () {@110] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, X<§|String|§>> () {@112] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super §|A|§, B, ? extends C> foo(Test<? extends A, ? super B, C> param) {@303] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, §|B|§, ? extends C> foo(Test<? extends A, ? super B, C> param) {@306] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends §|C|§> foo(Test<? extends A, ? super B, C> param) {@319] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends §|A|§, ? super B, C> param) {@341] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends A, ? super §|B|§, C> param) {@352] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends A, ? super B, §|C|§> param) {@355] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.C [class C extends X<§|String|§> {}@428] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll02_Parameterizedl() throws CoreException { >+ setUpTypeRefGeneric02(); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.x [ X<§|String|§> x;@130] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<§|A|§, B, C> t;@148] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<A, §|B|§, C> t;@151] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field:<anonymous>#1.t [ Test<A, B, §|C|§> t;@154] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<§|X|§<Y<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@167] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<§|Y|§<Z<String>>>, Y<Z<String>>, Z<String>> bar() {@169] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<§|Z|§<String>>>, Y<Z<String>>, Z<String>> bar() {@171] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<§|String|§>>>, Y<Z<String>>, Z<String>> bar() {@173] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, §|Y|§<Z<String>>, Z<String>> bar() {@184] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<§|Z|§<String>>, Z<String>> bar() {@186] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<§|String|§>>, Z<String>> bar() {@188] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<String>>, §|Z|§<String>> bar() {@198] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ Test<X<Y<Z<String>>>, Y<Z<String>>, Z<§|String|§>> bar() {@200] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<§|X|§<Y<Z<String>>>, Y<Z<String>>, Z<String>>();@236] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<§|Y|§<Z<String>>>, Y<Z<String>>, Z<String>>();@238] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<§|Z|§<String>>>, Y<Z<String>>, Z<String>>();@240] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<§|String|§>>>, Y<Z<String>>, Z<String>>();@242] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, §|Y|§<Z<String>>, Z<String>>();@253] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<§|Z|§<String>>, Z<String>>();@255] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<§|String|§>>, Z<String>>();@257] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<String>>, §|Z|§<String>>();@267] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<X<Y<Z<String>>>,Y<Z<String>>,Z<String>> test02.Test.field:<anonymous>#1.bar() [ return new Test<X<Y<Z<String>>>, Y<Z<String>>, Z<§|String|§>>();@269] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<§|A|§, ? extends B, ? super C> field = new Test<A, Z<String>, X<String>> () {@52] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<§|A|§, Z<String>, X<String>> () {@96] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, §|Z|§<String>, X<String>> () {@99] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<§|String|§>, X<String>> () {@101] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, §|X|§<String>> () {@110] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, X<§|String|§>> () {@112] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, §|B|§, ? extends C> foo(Test<? extends A, ? super B, C> param) {@306] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends A, ? super B, §|C|§> param) {@355] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.C [class C extends X<§|String|§> {}@428] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAll02_TypeVariableBound() throws CoreException { >+ setUpTypeRefGeneric02(); >+ search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults(""); >+} >+public void testTypeRefGenericAll02_WildcardBound() throws CoreException { >+ setUpTypeRefGeneric02(); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends §|B|§, ? super C> field = new Test<A, Z<String>, X<String>> () {@65] EXACT_MATCH\n" + >+ "src/test02/Test.java test02.Test.field [ Test<A, ? extends B, ? super §|C|§> field = new Test<A, Z<String>, X<String>> () {@76] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super §|A|§, B, ? extends C> foo(Test<? extends A, ? super B, C> param) {@303] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends §|C|§> foo(Test<? extends A, ? super B, C> param) {@319] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends §|A|§, ? super B, C> param) {@341] EXACT_MATCH\n" + >+ "src/test02/Test.java Test<? super A,B,? extends C> test02.Test.foo(Test<? extends A,? super B,C>) [ Test<? super A, B, ? extends C> foo(Test<? extends A, ? super §|B|§, C> param) {@352] EXACT_MATCH" >+ ); >+} >+ >+/* >+ * References to all qualified types (using '*' string pattern) >+ */ >+private void setUpTypeRefGenericMethod() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[1]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/test/Test.java", >+ "package test;\n" + >+ "public class Test {\n" + >+ " void foo(A<String> a) {\n" + >+ " a.<String>foo();\n" + >+ " a.<A<? extends Exception>>foo();\n" + >+ " }\n" + >+ "}\n" + >+ "class A<T> {\n" + >+ " <U> void foo() {}\n" + >+ "}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+} >+public void testTypeRefGenericMethod_AllGenericFlags() throws CoreException { >+ setUpTypeRefGenericMethod(); >+ search("*", TYPE, ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test/Test.java void test.Test.foo(A<String>) [ void foo(A<§|String|§> a) {@46] EXACT_MATCH\n" + >+ "src/test/Test.java void test.Test.foo(A<String>) [ a.<§|String|§>foo();@64] EXACT_MATCH\n" + >+ "src/test/Test.java void test.Test.foo(A<String>) [ a.<§|A|§<? extends Exception>>foo();@83] EXACT_MATCH\n" + >+ "src/test/Test.java void test.Test.foo(A<String>) [ a.<A<? extends §|Exception|§>>foo();@95] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericMethod_Parameterized() throws CoreException { >+ setUpTypeRefGenericMethod(); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test/Test.java void test.Test.foo(A<String>) [ void foo(A<§|String|§> a) {@46] EXACT_MATCH\n" + >+ "src/test/Test.java void test.Test.foo(A<String>) [ a.<§|String|§>foo();@64] EXACT_MATCH\n" + >+ "src/test/Test.java void test.Test.foo(A<String>) [ a.<§|A|§<? extends Exception>>foo();@83] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericMethod_TypeVariableBound() throws CoreException { >+ setUpTypeRefGenericMethod(); >+ search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults(""); >+} >+public void testTypeRefGenericMethod_WildcardBound() throws CoreException { >+ setUpTypeRefGenericMethod(); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/test/Test.java void test.Test.foo(A<String>) [ a.<A<? extends §|Exception|§>>foo();@95] EXACT_MATCH" >+ ); >+} >+ >+/* >+ * References to all qualified types (using '*' string pattern) >+ */ >+private void setUpTypeRefQualifiedAll() throws JavaModelException { >+ final ProblemRequestor problemRequestor = new ProblemRequestor(); >+ this.wcOwner = new WorkingCopyOwner() { >+ public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) { >+ return problemRequestor; >+ } >+ }; >+ workingCopies = new ICompilationUnit[3]; >+ workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java", >+ "package type.def;\n" + >+ "@Bug\n" + >+ "@ATest\n" + >+ "public class Types extends Exception implements ITest1, ITest2 {\n" + >+ " ITest1 test1;\n" + >+ " ITest2 test2;\n" + >+ "}\n" + >+ "@Bug\n" + >+ "interface ITest1 {}\n" + >+ "@ATest\n" + >+ "interface ITest2 extends ITest1 {}\n" + >+ "@Bug\n" + >+ "@ATest\n" + >+ "enum ETest {}\n" + >+ "@Bug\n" + >+ "@interface ATest {}\n" >+ ); >+ workingCopies[1] = getWorkingCopy("/JavaSearch15/src/type/def/Bug.java", >+ "package type.def;\n" + >+ "public @interface Bug {\n" + >+ " int num() default 0;\n" + >+ " String comment() default \"\";\n" + >+ "}\n" >+ ); >+ workingCopies[2] = getWorkingCopy("/JavaSearch15/src/all/types/ref/TestTypes.java", >+ "package all.types.ref;\n" + >+ "\n" + >+ "@type.def.Bug(num=155013)\n" + >+ "public class TestTypes extends type.def.Types {\n" + >+ " @type.def.Bug(comment=\"field\")\n" + >+ " type.def.Types field = new type.def.Types(), local, other = new type.def.Types();\n" + >+ " {\n" + >+ " Object o;\n" + >+ " type.def.Types t;\n" + >+ " if (this.field == null) {\n" + >+ " try {\n" + >+ " t = new TestTypes();\n" + >+ " } catch (RuntimeException e) {\n" + >+ " t = new type.def.Types();\n" + >+ " } \n" + >+ " } else {\n" + >+ " o = this.field;\n" + >+ " t = (type.def.Types) o;\n" + >+ " }\n" + >+ " local = t;\n" + >+ " };\n" + >+ " @type.def.Bug(comment=\"method\", num=155013)\n" + >+ " type.def.Types method(type.def.Types param) throws type.def.Types {\n" + >+ " Object obj = new type.def.Types();\n" + >+ " type.def.Types local = (type.def.Types) obj;\n" + >+ " return local;\n" + >+ " }\n" + >+ " type.def.Bug bar(type.def.Bug bug) {\n" + >+ " try {\n" + >+ " method(this);\n" + >+ " }\n" + >+ " catch (type.def.Types ex) {}\n" + >+ " catch (Exception ex) {}\n" + >+ " return bug; \n" + >+ " }\n" + >+ " // Other types references\n" + >+ " Object object;\n" + >+ " String str;\n" + >+ " TestTypes() throws type.def.Types, RuntimeException {\n" + >+ " if (this.object instanceof String) {\n" + >+ " this.str = (String) this.object;\n" + >+ " } else {\n" + >+ " this.str = new String();\n" + >+ " this.object = new Object();\n" + >+ " }\n" + >+ " }\n" + >+ "}\n" >+ ); >+ assertEquals("CU Should not have any problem!", >+ "----------\n" + >+ "----------\n", >+ problemRequestor.problems.toString() >+ ); >+ this.resultCollector.showSelection = true; >+ this.resultCollector.showOffset = true; >+} >+public void testTypeRefQualifiedAll_Allocation() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, ALLOCATION_EXPRESSION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ type.def.Types field = new §|type.def.Types|§(), local, other = new type.def.Types();@158] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.other [ type.def.Types field = new type.def.Types(), local, other = new §|type.def.Types|§();@195] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ t = new §|TestTypes|§();@297] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ t = new §|type.def.Types|§();@356] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ Object obj = new §|type.def.Types|§();@591] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ this.str = new §|String|§();@1032] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ this.object = new §|Object|§();@1063] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Annotation() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, ANNOTATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes [@§|type.def.Bug|§(num=155013)@25] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ @§|type.def.Bug|§(comment=\"field\")@100] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ @§|type.def.Bug|§(comment=\"method\", num=155013)@460] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [@§|Bug|§@19] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [@§|ATest|§@24] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest1 [@§|Bug|§@128] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest2 [@§|ATest|§@153] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ETest [@§|Bug|§@195] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ETest [@§|ATest|§@200] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ATest [@§|Bug|§@221] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Cast() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, CAST_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ t = (§|type.def.Types|§) o;@418] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ type.def.Types local = (§|type.def.Types|§) obj;@635] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ this.str = (§|String|§) this.object;@982] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Catch() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, CATCH_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ } catch (§|RuntimeException|§ e) {@322] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Bug all.types.ref.TestTypes.bar(type.def.Bug) [ catch (§|type.def.Types|§ ex) {}@751] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Bug all.types.ref.TestTypes.bar(type.def.Bug) [ catch (§|Exception|§ ex) {}@782] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Field() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, FIELD_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [ §|type.def.Types|§ field = new type.def.Types(), local, other = new type.def.Types();@131] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.object [ §|Object|§ object;@845] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.str [ §|String|§ str;@861] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types.test1 [ §|ITest1|§ test1;@96] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types.test2 [ §|ITest2|§ test2;@111] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Import() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, IMPORT_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults(""); >+} >+public void testTypeRefQualifiedAll_MethodParameter() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ type.def.Types method(§|type.def.Types|§ param) throws type.def.Types {@526] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Bug all.types.ref.TestTypes.bar(type.def.Bug) [ type.def.Bug bar(§|type.def.Bug|§ bug) {@693] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Return() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, RETURN_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ §|type.def.Types|§ method(type.def.Types param) throws type.def.Types {@504] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Bug all.types.ref.TestTypes.bar(type.def.Bug) [ §|type.def.Bug|§ bar(type.def.Bug bug) {@676] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Superinterface() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, SUPERINTERFACE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/type/def/Types.java type.def.Types [public class Types extends Exception implements §|ITest1|§, ITest2 {@78] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [public class Types extends Exception implements ITest1, §|ITest2|§ {@86] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.ITest2 [interface ITest2 extends §|ITest1|§ {}@184] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Supertype() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, SUPERTYPE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes [public class TestTypes extends §|type.def.Types|§ {@81] EXACT_MATCH\n" + >+ "src/type/def/Types.java type.def.Types [public class Types extends §|Exception|§ implements ITest1, ITest2 {@57] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Throws() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, THROWS_CLAUSE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ type.def.Types method(type.def.Types param) throws §|type.def.Types|§ {@555] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ TestTypes() throws §|type.def.Types|§, RuntimeException {@893] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [ TestTypes() throws type.def.Types, §|RuntimeException|§ {@909] EXACT_MATCH" >+ ); >+} >+public void testTypeRefQualifiedAll_Variable() throws CoreException { >+ setUpTypeRefQualifiedAll(); >+ search("*", TYPE, LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope()); >+ assertSearchResults( >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ §|Object|§ o;@218] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [ §|type.def.Types|§ t;@230] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ §|Object|§ obj = new type.def.Types();@574] EXACT_MATCH\n" + >+ "src/all/types/ref/TestTypes.java type.def.Types all.types.ref.TestTypes.method(type.def.Types) [ §|type.def.Types|§ local = (type.def.Types) obj;@611] EXACT_MATCH" >+ ); >+} >+ >+/* >+ * Tests using classes defined in JavaSearch15 project >+ */ >+public void testTypeRefGenericAllG1_Parameterized() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g1/t/s/ref/R3.java").getType("R3"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, scope); >+ assertSearchResults( >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_obj [ public Generic<§|Object|§>.MemberGeneric<Object> gen_obj;@393] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_obj [ public Generic<Object>.MemberGeneric<§|Object|§> gen_obj;@415] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_exc [ public Generic<§|Exception|§>.MemberGeneric<Exception> gen_exc;@448] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_exc [ public Generic<Exception>.MemberGeneric<§|Exception|§> gen_exc;@473] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_obj [ public g1.t.s.def.Generic<§|Object|§>.MemberGeneric<Object> qgen_obj;@803] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_obj [ public g1.t.s.def.Generic<Object>.MemberGeneric<§|Object|§> qgen_obj;@825] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_exc [ public g1.t.s.def.Generic<§|Exception|§>.MemberGeneric<Exception> qgen_exc;@870] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_exc [ public g1.t.s.def.Generic<Exception>.MemberGeneric<§|Exception|§> qgen_exc;@895] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG1_WildcardBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g1/t/s/ref/R3.java").getType("R3"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, scope); >+ assertSearchResults( >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_thr [ public Generic<? extends §|Throwable|§>.MemberGeneric<? super RuntimeException> gen_thr;@564] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_thr [ public Generic<? extends Throwable>.MemberGeneric<? super §|RuntimeException|§> gen_thr;@597] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_run [ public Generic<? super §|RuntimeException|§>.MemberGeneric<? extends Throwable> gen_run;@648] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.gen_run [ public Generic<? super RuntimeException>.MemberGeneric<? extends §|Throwable|§> gen_run;@690] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_thr [ public g1.t.s.def.Generic<? extends §|Throwable|§>.MemberGeneric<? super RuntimeException> qgen_thr;@1010] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_thr [ public g1.t.s.def.Generic<? extends Throwable>.MemberGeneric<? super §|RuntimeException|§> qgen_thr;@1043] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_run [ public g1.t.s.def.Generic<? super §|RuntimeException|§>.MemberGeneric<? extends Throwable> qgen_run;@1106] EXACT_MATCH\n" + >+ "src/g1/t/s/ref/R3.java g1.t.s.ref.R3.qgen_run [ public g1.t.s.def.Generic<? super RuntimeException>.MemberGeneric<? extends §|Throwable|§> qgen_run;@1148] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG2_Parameterized() throws CoreException { >+ // TODO The JavaSearch15/src/g2/f/s/def/R3.java should be updated as it contains compilation errors! >+ IType type = getCompilationUnit("JavaSearch15/src/g2/f/s/def/R3.java").getType("R3"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, scope); >+ assertSearchResults( >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<§|Object|§>.MemberGeneric<Object> member = new Generic<Object>().new MemberGeneric<Object>();@177] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<Object>.MemberGeneric<§|Object|§> member = new Generic<Object>().new MemberGeneric<Object>();@199] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<Object>.MemberGeneric<Object> member = new Generic<§|Object|§>().new MemberGeneric<Object>();@228] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<Object>.MemberGeneric<Object> member = new Generic<Object>().new MemberGeneric<§|Object|§>();@256] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<§|Exception|§>.MemberGeneric<Exception> member = new Generic<Exception>().new MemberGeneric<Exception>();@306] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<Exception>.MemberGeneric<§|Exception|§> member = new Generic<Exception>().new MemberGeneric<Exception>();@331] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<Exception>.MemberGeneric<Exception> member = new Generic<§|Exception|§>().new MemberGeneric<Exception>();@363] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<Exception>.MemberGeneric<Exception> member = new Generic<Exception>().new MemberGeneric<§|Exception|§>();@394] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<§|Exception|§>().new MemberGeneric<Exception>();@633] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<Exception>().new MemberGeneric<§|Exception|§>();@664] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<§|Exception|§>().new MemberGeneric<? extends Throwable>();@794] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<? extends Throwable>().new MemberGeneric<§|Exception|§>();@1006] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<§|Exception|§>().new MemberGeneric<Exception>();@1327] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<Exception>().new MemberGeneric<§|Exception|§>();@1358] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<§|Exception|§>().new MemberGeneric<? super RuntimeException>();@1498] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<? super RuntimeException>().new MemberGeneric<§|Exception|§>();@1730] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG2_WildcardBounds() throws CoreException { >+ // TODO The JavaSearch15/src/g2/f/s/def/R3.java should be updated as it contains compilation errors! >+ IType type = getCompilationUnit("JavaSearch15/src/g2/f/s/def/R3.java").getType("R3"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, scope); >+ assertSearchResults( >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends §|Throwable|§>.MemberGeneric<? extends Throwable> member = new Generic<Exception>().new MemberGeneric<Exception>();@566] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends §|Throwable|§> member = new Generic<Exception>().new MemberGeneric<Exception>();@601] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends §|Throwable|§>.MemberGeneric<? extends Throwable> member = new Generic<Exception>().new MemberGeneric<? extends Throwable>();@727] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends §|Throwable|§> member = new Generic<Exception>().new MemberGeneric<? extends Throwable>();@762] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<Exception>().new MemberGeneric<? extends §|Throwable|§>();@835] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends §|Throwable|§>.MemberGeneric<? extends Throwable> member = new Generic<? extends Throwable>().new MemberGeneric<Exception>();@898] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends §|Throwable|§> member = new Generic<? extends Throwable>().new MemberGeneric<Exception>();@933] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<? extends §|Throwable|§>().new MemberGeneric<Exception>();@975] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends §|Throwable|§>.MemberGeneric<? extends Throwable> member = new Generic<? extends Throwable>().new MemberGeneric<? extends Throwable>();@1069] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends §|Throwable|§> member = new Generic<? extends Throwable>().new MemberGeneric<? extends Throwable>();@1104] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<? extends §|Throwable|§>().new MemberGeneric<? extends Throwable>();@1146] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? extends Throwable>.MemberGeneric<? extends Throwable> member = new Generic<? extends Throwable>().new MemberGeneric<? extends §|Throwable|§>();@1187] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super §|RuntimeException|§>.MemberGeneric<? super RuntimeException> member = new Generic<Exception>().new MemberGeneric<Exception>();@1248] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super §|RuntimeException|§> member = new Generic<Exception>().new MemberGeneric<Exception>();@1288] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super §|RuntimeException|§>.MemberGeneric<? super RuntimeException> member = new Generic<Exception>().new MemberGeneric<? super RuntimeException>();@1419] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super §|RuntimeException|§> member = new Generic<Exception>().new MemberGeneric<? super RuntimeException>();@1459] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<Exception>().new MemberGeneric<? super §|RuntimeException|§>();@1537] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super §|RuntimeException|§>.MemberGeneric<? super RuntimeException> member = new Generic<? super RuntimeException>().new MemberGeneric<Exception>();@1605] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super §|RuntimeException|§> member = new Generic<? super RuntimeException>().new MemberGeneric<Exception>();@1645] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<? super §|RuntimeException|§>().new MemberGeneric<Exception>();@1692] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super §|RuntimeException|§>.MemberGeneric<? super RuntimeException> member = new Generic<? super RuntimeException>().new MemberGeneric<? super RuntimeException>();@1791] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super §|RuntimeException|§> member = new Generic<? super RuntimeException>().new MemberGeneric<? super RuntimeException>();@1831] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<? super §|RuntimeException|§>().new MemberGeneric<? super RuntimeException>();@1878] EXACT_MATCH\n" + >+ "src/g2/f/s/def/R3.java g2.f.s.def.R3.{} [ Generic<? super RuntimeException>.MemberGeneric<? super RuntimeException> member = new Generic<? super RuntimeException>().new MemberGeneric<? super §|RuntimeException|§>();@1924] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG3R1_Parameterized() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g3/t/ref/R1.java").getType("R1"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults( >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_wld [ public GS<§|GM|§<?, ?, ?>> sgsm_wld;@321] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [ public GS<§|GM|§<GM<?, ?, ?>,GM<?, ?, ?>,GM<?, ?, ?>>> sgsm_www;@355] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [ public GS<GM<§|GM|§<?, ?, ?>,GM<?, ?, ?>,GM<?, ?, ?>>> sgsm_www;@358] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [ public GS<GM<GM<?, ?, ?>,§|GM|§<?, ?, ?>,GM<?, ?, ?>>> sgsm_www;@370] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [ public GS<GM<GM<?, ?, ?>,GM<?, ?, ?>,§|GM|§<?, ?, ?>>> sgsm_www;@382] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [ public GS<§|GM|§<Object, Exception, RuntimeException>> sgsm_obj;@417] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [ public GS<GM<§|Object|§, Exception, RuntimeException>> sgsm_obj;@420] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [ public GS<GM<Object, §|Exception|§, RuntimeException>> sgsm_obj;@428] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [ public GS<GM<Object, Exception, §|RuntimeException|§>> sgsm_obj;@439] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_wld [ public GM<§|GS|§<?>, GS<?>, GS<?>> sgms_wld;@479] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_wld [ public GM<GS<?>, §|GS|§<?>, GS<?>> sgms_wld;@486] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_wld [ public GM<GS<?>, GS<?>, §|GS|§<?>> sgms_wld;@493] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_www [ public GM<§|GS|§<?>, GS<GS<?>>, GS<GS<GS<?>>>> sgms_www;@521] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_www [ public GM<GS<?>, §|GS|§<GS<?>>, GS<GS<GS<?>>>> sgms_www;@528] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_www [ public GM<GS<?>, GS<§|GS|§<?>>, GS<GS<GS<?>>>> sgms_www;@531] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_www [ public GM<GS<?>, GS<GS<?>>, §|GS|§<GS<GS<?>>>> sgms_www;@539] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_www [ public GM<GS<?>, GS<GS<?>>, GS<§|GS|§<GS<?>>>> sgms_www;@542] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_www [ public GM<GS<?>, GS<GS<?>>, GS<GS<§|GS|§<?>>>> sgms_www;@545] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_obj [ public GM<§|GS|§<Object>, GS<? extends Throwable>, GS<? super RuntimeException>> sgms_obj;@575] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_obj [ public GM<GS<§|Object|§>, GS<? extends Throwable>, GS<? super RuntimeException>> sgms_obj;@578] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_obj [ public GM<GS<Object>, §|GS|§<? extends Throwable>, GS<? super RuntimeException>> sgms_obj;@587] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_obj [ public GM<GS<Object>, GS<? extends Throwable>, §|GS|§<? super RuntimeException>> sgms_obj;@612] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_wld [ public g3.t.def.GS<§|g3.t.def.GM|§<?, ?, ?>> qgsm_wld;@691] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_www [ public g3.t.def.GS<§|g3.t.def.GM|§<g3.t.def.GM<?, ?, ?>, g3.t.def.GM<?, ?, ?>, g3.t.def.GM<?, ?, ?>>> qgsm_www;@743] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_www [ public g3.t.def.GS<g3.t.def.GM<§|g3.t.def.GM|§<?, ?, ?>, g3.t.def.GM<?, ?, ?>, g3.t.def.GM<?, ?, ?>>> qgsm_www;@755] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_www [ public g3.t.def.GS<g3.t.def.GM<g3.t.def.GM<?, ?, ?>, §|g3.t.def.GM|§<?, ?, ?>, g3.t.def.GM<?, ?, ?>>> qgsm_www;@777] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_www [ public g3.t.def.GS<g3.t.def.GM<g3.t.def.GM<?, ?, ?>, g3.t.def.GM<?, ?, ?>, §|g3.t.def.GM|§<?, ?, ?>>> qgsm_www;@799] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_obj [ public g3.t.def.GS<§|g3.t.def.GM|§<java.lang.Object, java.lang.Exception, java.lang.RuntimeException>> qgsm_obj;@852] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_obj [ public g3.t.def.GS<g3.t.def.GM<§|java.lang.Object|§, java.lang.Exception, java.lang.RuntimeException>> qgsm_obj;@864] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_obj [ public g3.t.def.GS<g3.t.def.GM<java.lang.Object, §|java.lang.Exception|§, java.lang.RuntimeException>> qgsm_obj;@882] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgsm_obj [ public g3.t.def.GS<g3.t.def.GM<java.lang.Object, java.lang.Exception, §|java.lang.RuntimeException|§>> qgsm_obj;@903] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_wld [ public g3.t.def.GM<§|g3.t.def.GS|§<?>, g3.t.def.GS<?>, g3.t.def.GS<?>> qgms_wld;@962] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_wld [ public g3.t.def.GM<g3.t.def.GS<?>, §|g3.t.def.GS|§<?>, g3.t.def.GS<?>> qgms_wld;@978] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_wld [ public g3.t.def.GM<g3.t.def.GS<?>, g3.t.def.GS<?>, §|g3.t.def.GS|§<?>> qgms_wld;@994] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_www [ public g3.t.def.GM<§|g3.t.def.GS|§<?>, g3.t.def.GS<g3.t.def.GS<?>>, g3.t.def.GS<g3.t.def.GS<g3.t.def.GS<?>>>> qgms_www;@1040] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_www [ public g3.t.def.GM<g3.t.def.GS<?>, §|g3.t.def.GS|§<g3.t.def.GS<?>>, g3.t.def.GS<g3.t.def.GS<g3.t.def.GS<?>>>> qgms_www;@1056] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_www [ public g3.t.def.GM<g3.t.def.GS<?>, g3.t.def.GS<§|g3.t.def.GS|§<?>>, g3.t.def.GS<g3.t.def.GS<g3.t.def.GS<?>>>> qgms_www;@1068] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_www [ public g3.t.def.GM<g3.t.def.GS<?>, g3.t.def.GS<g3.t.def.GS<?>>, §|g3.t.def.GS|§<g3.t.def.GS<g3.t.def.GS<?>>>> qgms_www;@1085] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_www [ public g3.t.def.GM<g3.t.def.GS<?>, g3.t.def.GS<g3.t.def.GS<?>>, g3.t.def.GS<§|g3.t.def.GS|§<g3.t.def.GS<?>>>> qgms_www;@1097] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_www [ public g3.t.def.GM<g3.t.def.GS<?>, g3.t.def.GS<g3.t.def.GS<?>>, g3.t.def.GS<g3.t.def.GS<§|g3.t.def.GS|§<?>>>> qgms_www;@1109] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_obj [ public g3.t.def.GM<§|g3.t.def.GS|§<java.lang.Object>, g3.t.def.GS<? extends java.lang.Throwable>, g3.t.def.GS<? super java.lang.RuntimeException>> qgms_obj;@1157] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_obj [ public g3.t.def.GM<g3.t.def.GS<§|java.lang.Object|§>, g3.t.def.GS<? extends java.lang.Throwable>, g3.t.def.GS<? super java.lang.RuntimeException>> qgms_obj;@1169] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_obj [ public g3.t.def.GM<g3.t.def.GS<java.lang.Object>, §|g3.t.def.GS|§<? extends java.lang.Throwable>, g3.t.def.GS<? super java.lang.RuntimeException>> qgms_obj;@1188] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_obj [ public g3.t.def.GM<g3.t.def.GS<java.lang.Object>, g3.t.def.GS<? extends java.lang.Throwable>, §|g3.t.def.GS|§<? super java.lang.RuntimeException>> qgms_obj;@1232] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG3R1_WildcardBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g3/t/ref/R1.java").getType("R1"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults( >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_obj [ public GM<GS<Object>, GS<? extends §|Throwable|§>, GS<? super RuntimeException>> sgms_obj;@600] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.sgms_obj [ public GM<GS<Object>, GS<? extends Throwable>, GS<? super §|RuntimeException|§>> sgms_obj;@623] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_obj [ public g3.t.def.GM<g3.t.def.GS<java.lang.Object>, g3.t.def.GS<? extends §|java.lang.Throwable|§>, g3.t.def.GS<? super java.lang.RuntimeException>> qgms_obj;@1210] EXACT_MATCH\n" + >+ "src/g3/t/ref/R1.java g3.t.ref.R1.qgms_obj [ public g3.t.def.GM<g3.t.def.GS<java.lang.Object>, g3.t.def.GS<? extends java.lang.Throwable>, g3.t.def.GS<? super §|java.lang.RuntimeException|§>> qgms_obj;@1252] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG3R1_TypeVariableBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g3/t/ref/R1.java").getType("R1"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults(""); >+} >+public void testTypeRefGenericAllG5_Parameterized() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g5/m/ref/RefMultiple.java").getType("RefMultiple"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults( >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ Multiple<§|Object|§, Exception, RuntimeException> gm = new Multiple<Object, Exception, RuntimeException>();@115] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ Multiple<Object, §|Exception|§, RuntimeException> gm = new Multiple<Object, Exception, RuntimeException>();@123] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ Multiple<Object, Exception, §|RuntimeException|§> gm = new Multiple<Object, Exception, RuntimeException>();@134] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ Multiple<Object, Exception, RuntimeException> gm = new Multiple<§|Object|§, Exception, RuntimeException>();@170] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ Multiple<Object, Exception, RuntimeException> gm = new Multiple<Object, §|Exception|§, RuntimeException>();@178] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ Multiple<Object, Exception, RuntimeException> gm = new Multiple<Object, Exception, §|RuntimeException|§>();@189] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm.<§|Object|§, Exception, RuntimeException>generic(new Object(), new Exception(), new RuntimeException());@367] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm.<Object, §|Exception|§, RuntimeException>generic(new Object(), new Exception(), new RuntimeException());@375] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm.<Object, Exception, §|RuntimeException|§>generic(new Object(), new Exception(), new RuntimeException());@386] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm.paramTypesArgs(new Single<§|Object|§>(), new Single<Exception>(), new Single<RuntimeException>(), gm);@656] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm.paramTypesArgs(new Single<Object>(), new Single<§|Exception|§>(), new Single<RuntimeException>(), gm);@678] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm.paramTypesArgs(new Single<Object>(), new Single<Exception>(), new Single<§|RuntimeException|§>(), gm);@703] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm = gm.<§|Object|§, Exception, RuntimeException>complete(new Object(), new Exception(), new RuntimeException(), gm);@838] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm = gm.<Object, §|Exception|§, RuntimeException>complete(new Object(), new Exception(), new RuntimeException(), gm);@846] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.test() [ gm = gm.<Object, Exception, §|RuntimeException|§>complete(new Object(), new Exception(), new RuntimeException(), gm);@857] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testUnbound() [ gm.paramTypesArgs(new Single<§|Object|§>(), new Single<Object>(), new Single<Object>(), gm);@1095] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testUnbound() [ gm.paramTypesArgs(new Single<Object>(), new Single<§|Object|§>(), new Single<Object>(), gm);@1117] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testUnbound() [ gm.paramTypesArgs(new Single<Object>(), new Single<Object>(), new Single<§|Object|§>(), gm);@1139] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ Multiple<§|Object|§, ? extends Throwable, ? extends Exception> gm = new Multiple<Object, Exception, RuntimeException>();@1295] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ Multiple<Object, ? extends Throwable, ? extends Exception> gm = new Multiple<§|Object|§, Exception, RuntimeException>();@1363] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ Multiple<Object, ? extends Throwable, ? extends Exception> gm = new Multiple<Object, §|Exception|§, RuntimeException>();@1371] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ Multiple<Object, ? extends Throwable, ? extends Exception> gm = new Multiple<Object, Exception, §|RuntimeException|§>();@1382] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm.<§|Object|§, RuntimeException, RuntimeException>generic(new Object(), new RuntimeException(), new RuntimeException());@1409] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm.<Object, §|RuntimeException|§, RuntimeException>generic(new Object(), new RuntimeException(), new RuntimeException());@1417] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm.<Object, RuntimeException, §|RuntimeException|§>generic(new Object(), new RuntimeException(), new RuntimeException());@1435] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm.paramTypesArgs(new Single<§|Object|§>(), new Single<Throwable>(), new Single<Exception>(), gm);@1554] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm.paramTypesArgs(new Single<Object>(), new Single<§|Throwable|§>(), new Single<Exception>(), gm);@1576] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm.paramTypesArgs(new Single<Object>(), new Single<Throwable>(), new Single<§|Exception|§>(), gm);@1601] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm = gm.<§|Object|§, RuntimeException, RuntimeException>complete(new Object(), new RuntimeException(), new RuntimeException(), gm);@1660] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm = gm.<Object, §|RuntimeException|§, RuntimeException>complete(new Object(), new RuntimeException(), new RuntimeException(), gm);@1668] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ gm = gm.<Object, RuntimeException, §|RuntimeException|§>complete(new Object(), new RuntimeException(), new RuntimeException(), gm);@1686] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ Multiple<§|Object|§, ? super RuntimeException, ? super IllegalMonitorStateException> gm = new Multiple<Object, Exception, RuntimeException>();@1893] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ Multiple<Object, ? super RuntimeException, ? super IllegalMonitorStateException> gm = new Multiple<§|Object|§, Exception, RuntimeException>();@1983] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ Multiple<Object, ? super RuntimeException, ? super IllegalMonitorStateException> gm = new Multiple<Object, §|Exception|§, RuntimeException>();@1991] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ Multiple<Object, ? super RuntimeException, ? super IllegalMonitorStateException> gm = new Multiple<Object, Exception, §|RuntimeException|§>();@2002] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm.<§|Object|§, RuntimeException, IllegalMonitorStateException>generic(new Object(), new RuntimeException(), new IllegalMonitorStateException());@2029] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm.<Object, §|RuntimeException|§, IllegalMonitorStateException>generic(new Object(), new RuntimeException(), new IllegalMonitorStateException());@2037] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm.<Object, RuntimeException, §|IllegalMonitorStateException|§>generic(new Object(), new RuntimeException(), new IllegalMonitorStateException());@2055] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm.paramTypesArgs(new Single<§|Object|§>(), new Single<RuntimeException>(), new Single<RuntimeException>(), gm);@2198] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm.paramTypesArgs(new Single<Object>(), new Single<§|RuntimeException|§>(), new Single<RuntimeException>(), gm);@2220] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm.paramTypesArgs(new Single<Object>(), new Single<RuntimeException>(), new Single<§|RuntimeException|§>(), gm);@2252] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm = gm.<§|Object|§, RuntimeException, IllegalMonitorStateException>complete(new Object(), new RuntimeException(), new IllegalMonitorStateException(), gm);@2318] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm = gm.<Object, §|RuntimeException|§, IllegalMonitorStateException>complete(new Object(), new RuntimeException(), new IllegalMonitorStateException(), gm);@2326] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ gm = gm.<Object, RuntimeException, §|IllegalMonitorStateException|§>complete(new Object(), new RuntimeException(), new IllegalMonitorStateException(), gm);@2344] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG5_WildcardBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g5/m/ref/RefMultiple.java").getType("RefMultiple"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults( >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ Multiple<Object, ? extends §|Throwable|§, ? extends Exception> gm = new Multiple<Object, Exception, RuntimeException>();@1313] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testExtends() [ Multiple<Object, ? extends Throwable, ? extends §|Exception|§> gm = new Multiple<Object, Exception, RuntimeException>();@1334] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ Multiple<Object, ? super §|RuntimeException|§, ? super IllegalMonitorStateException> gm = new Multiple<Object, Exception, RuntimeException>();@1909] EXACT_MATCH\n" + >+ "src/g5/m/ref/RefMultiple.java void g5.m.ref.RefMultiple.testSuper() [ Multiple<Object, ? super RuntimeException, ? super §|IllegalMonitorStateException|§> gm = new Multiple<Object, Exception, RuntimeException>();@1935] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG5_TypeVariableBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g5/m/ref/RefMultiple.java").getType("RefMultiple"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults(""); >+} >+public void testTypeRefGenericAllG6_Parameterized() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g6/t/ref/QualifMultiple.java").getType("QualifMultiple"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults( >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryException [ g6.t.def.Table<§|String|§, Exception>.Entry<String, Exception> entryException;@64] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryException [ g6.t.def.Table<String, §|Exception|§>.Entry<String, Exception> entryException;@72] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryException [ g6.t.def.Table<String, Exception>.Entry<§|String|§, Exception> entryException;@89] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryException [ g6.t.def.Table<String, Exception>.Entry<String, §|Exception|§> entryException;@97] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryExceptionArray [ g6.t.def.Table<§|String|§, Exception>.Entry<String, Exception>[] entryExceptionArray;@140] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryExceptionArray [ g6.t.def.Table<String, §|Exception|§>.Entry<String, Exception>[] entryExceptionArray;@148] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryExceptionArray [ g6.t.def.Table<String, Exception>.Entry<§|String|§, Exception>[] entryExceptionArray;@165] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryExceptionArray [ g6.t.def.Table<String, Exception>.Entry<String, §|Exception|§>[] entryExceptionArray;@173] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<§|String|§, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@223] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, §|g6.t.def.Table<String, Exception>.Entry<String, Exception>[]|§>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@231] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<§|String|§, Exception>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@246] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, §|Exception|§>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@254] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<§|String|§, Exception>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@271] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, §|Exception|§>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@279] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<§|String|§, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@299] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<String, §|g6.t.def.Table<String, Exception>.Entry<String, Exception>[]|§> tableOfEntryExceptionArray;@307] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<§|String|§, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@322] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<String, §|Exception|§>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@330] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<§|String|§, Exception>[]> tableOfEntryExceptionArray;@347] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry<String, g6.t.def.Table<String, Exception>.Entry<String, §|Exception|§>[]> tableOfEntryExceptionArray;@355] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG6_WildcardBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g6/t/ref/QualifMultiple.java").getType("QualifMultiple"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, FIELD_TYPE_DECLARATION_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults( >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryException [ §|g6.t.def.Table<String, Exception>.Entry|§<String, Exception> entryException;@49] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.entryExceptionArray [ §|g6.t.def.Table<String, Exception>.Entry<String, Exception>[]|§ entryExceptionArray;@125] EXACT_MATCH\n" + >+ "src/g6/t/ref/QualifMultiple.java g6.t.ref.QualifMultiple.tableOfEntryExceptionArray [ §|g6.t.def.Table<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]>.Entry|§<String, g6.t.def.Table<String, Exception>.Entry<String, Exception>[]> tableOfEntryExceptionArray;@208] EXACT_MATCH" >+ ); >+} >+public void testTypeRefGenericAllG6_TypeVariableBounds() throws CoreException { >+ IType type = getCompilationUnit("JavaSearch15/src/g6/t/ref/QualifMultiple.java").getType("QualifMultiple"); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type }); >+ search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE | WILDCARD_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope); >+ assertSearchResults(""); >+} >+} >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java,v >retrieving revision 1.79 >diff -u -r1.79 TypeReferencePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java 2 Oct 2007 17:12:01 -0000 1.79 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java 27 Nov 2007 15:09:21 -0000 >@@ -12,10 +12,11 @@ > > import org.eclipse.jdt.core.IType; > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.core.search.SearchPattern; > import org.eclipse.jdt.internal.core.util.Util; > >- public class TypeReferencePattern extends IntersectingPattern { >+public class TypeReferencePattern extends IntersectingPattern { > > protected char[] qualification; > protected char[] simpleName; >@@ -26,8 +27,11 @@ > public int segmentsSize; > protected char[][] segments; > protected int currentSegment; >- >- protected static char[][] CATEGORIES = { REF }; >+ >+ private final static char[][] >+ CATEGORIES = { REF, ANNOTATION_REF }, >+ CATEGORIES_ANNOT_REF = { ANNOTATION_REF }; >+ private char[][] categories; > > public TypeReferencePattern(char[] qualification, char[] simpleName, int matchRule) { > this(matchRule); >@@ -54,6 +58,13 @@ > * Instantiate a type reference pattern with additional information for generics search > */ > public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int matchRule) { >+ this(qualification, simpleName, typeSignature, 0, matchRule); >+ } >+ >+ /* >+ * Instanciate a type reference pattern with additional information for generics search and fine grain information >+ */ >+ public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int limitTo, int matchRule) { > this(qualification, simpleName,matchRule); > if (typeSignature != null) { > // store type signatures and arguments >@@ -63,16 +74,31 @@ > this.segmentsSize = getTypeArguments().length + CharOperation.occurencesOf('/', this.typeSignatures[0]) - 1; > } > } >+ this.fineGrain = limitTo & 0xFFFFFFF0; >+ if (this.fineGrain == IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) { >+ categories =CATEGORIES_ANNOT_REF; >+ } > } >+ > /* > * Instantiate a type reference pattern with additional information for generics search > */ > public TypeReferencePattern(char[] qualification, char[] simpleName, IType type, int matchRule) { >+ this(qualification, simpleName, type, 0, matchRule); >+ } >+ >+ /* >+ * Instanciate a type reference pattern with additional information for generics search >+ */ >+ public TypeReferencePattern(char[] qualification, char[] simpleName, IType type, int limitTo, int matchRule) { > this(qualification, simpleName,matchRule); > storeTypeSignaturesAndArguments(type); >+ this.fineGrain = limitTo & 0xFFFFFFF0; > } >+ > TypeReferencePattern(int matchRule) { > super(TYPE_REF_PATTERN, matchRule); >+ this.categories = CATEGORIES; > } > public void decodeIndexKey(char[] key) { > this.simpleName = key; >@@ -90,7 +116,7 @@ > return null; > } > public char[][] getIndexCategories() { >- return CATEGORIES; >+ return this.categories; > } > protected boolean hasNextQuery() { > if (this.segments == null) return false; >@@ -105,13 +131,22 @@ > return true; // index key is not encoded so query results all match > } > >+ protected void setFineGrain(int limitTo) { >+ this.fineGrain = limitTo & 0xFFFFFFF0; >+// if (this.fineGrain == IJavaSearchConstants.ONLY_ANNOTATION_TYPE_REFERENCE) { >+// this.categories = new char[][] { ANNOTATION_REF }; >+// } >+ } >+ > protected void resetQuery() { > /* walk the segments from end to start as it will find less potential references using 'lang' than 'java' */ > if (this.segments != null) > this.currentSegment = this.segments.length - 1; > } > protected StringBuffer print(StringBuffer output) { >- output.append("TypeReferencePattern: qualification<"); //$NON-NLS-1$ >+ String patternClassName = getClass().getName(); >+ output.append(patternClassName.substring(patternClassName.lastIndexOf('.')+1)); >+ output.append(": qualification<"); //$NON-NLS-1$ > if (qualification != null) > output.append(qualification); > else >Index: search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java,v >retrieving revision 1.79 >diff -u -r1.79 MethodLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 14 Nov 2007 10:03:40 -0000 1.79 >+++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 27 Nov 2007 15:09:20 -0000 >@@ -47,6 +47,9 @@ > protected void clear() { > this.methodDeclarationsWithInvalidParam = new HashMap(); > } >+protected int fineGrain() { >+ return this.pattern.fineGrain; >+} > public void initializePolymorphicSearch(MatchLocator locator) { > long start = 0; > if (BasicSearchEngine.VERBOSE) { >Index: search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.java,v >retrieving revision 1.23 >diff -u -r1.23 DeclarationOfAccessedFieldsPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.java 10 May 2006 18:03:42 -0000 1.23 >+++ search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.java 27 Nov 2007 15:09:19 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.internal.core.search.matching; > > import org.eclipse.jdt.core.IJavaElement; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.internal.compiler.util.SimpleSet; > > public class DeclarationOfAccessedFieldsPattern extends FieldPattern { >@@ -19,7 +20,7 @@ > protected SimpleSet knownFields; > > public DeclarationOfAccessedFieldsPattern(IJavaElement enclosingElement) { >- super(false, true, true, null, null, null, null, null, R_PATTERN_MATCH); >+ super(null, null, null, null, null, IJavaSearchConstants.REFERENCES, R_PATTERN_MATCH); > > this.enclosingElement = enclosingElement; > this.knownFields = new SimpleSet(); >Index: search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java,v >retrieving revision 1.12 >diff -u -r1.12 VariablePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java 24 Aug 2007 05:59:05 -0000 1.12 >+++ search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java 27 Nov 2007 15:09:21 -0000 >@@ -11,23 +11,50 @@ > package org.eclipse.jdt.internal.core.search.matching; > > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > > public abstract class VariablePattern extends JavaSearchPattern { > >-protected boolean findDeclarations; >-protected boolean findReferences; >-protected boolean readAccess; >-protected boolean writeAccess; >+protected boolean findDeclarations = false; >+protected boolean findReferences = false; >+protected boolean readAccess = false; >+protected boolean writeAccess = false; > > protected char[] name; > >-public VariablePattern(int patternKind, boolean findDeclarations, boolean readAccess, boolean writeAccess, char[] name, int matchRule) { >+public final static int FINE_GRAIN_FIELD_MASK = >+ IJavaSearchConstants.SUPER_REFERENCE | >+ IJavaSearchConstants.QUALIFIED_REFERENCE | >+ IJavaSearchConstants.THIS_REFERENCE | >+ IJavaSearchConstants.IMPLICIT_THIS_REFERENCE; >+ >+public VariablePattern(int patternKind, char[] name, int limitTo, int matchRule) { > super(patternKind, matchRule); > >- this.findDeclarations = findDeclarations; // set to find declarations & all occurrences >- this.readAccess = readAccess; // set to find any reference, read only references & all occurrences >- this.writeAccess = writeAccess; // set to find any reference, write only references & all occurrences >- this.findReferences = readAccess || writeAccess; >+ this.fineGrain = limitTo & FINE_GRAIN_FIELD_MASK; >+ if (this.fineGrain == 0) { >+ switch (limitTo & 0xF) { >+ case IJavaSearchConstants.DECLARATIONS : >+ this.findDeclarations = true; >+ break; >+ case IJavaSearchConstants.REFERENCES : >+ this.readAccess = true; >+ this.writeAccess = true; >+ break; >+ case IJavaSearchConstants.READ_ACCESSES : >+ this.readAccess = true; >+ break; >+ case IJavaSearchConstants.WRITE_ACCESSES : >+ this.writeAccess = true; >+ break; >+ case IJavaSearchConstants.ALL_OCCURRENCES : >+ this.findDeclarations = true; >+ this.readAccess = true; >+ this.writeAccess = true; >+ break; >+ } >+ this.findReferences = this.readAccess || this.writeAccess; >+ } > > this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name); > } >@@ -37,6 +64,6 @@ > */ > protected boolean mustResolve() { > // would like to change this so that we only do it if generic references are found >- return this.findReferences; // always resolve (in case of a simple name reference being a potential match) >+ return this.findReferences || this.fineGrain != 0; // always resolve (in case of a simple name reference being a potential match) > } > } >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java,v >retrieving revision 1.59 >diff -u -r1.59 TypeReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 23 Nov 2007 08:48:54 -0000 1.59 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 27 Nov 2007 15:09:21 -0000 >@@ -26,11 +26,14 @@ > protected TypeReferencePattern pattern; > protected boolean isDeclarationOfReferencedTypesPattern; > >+private final int fineGrain; >+ > public TypeReferenceLocator(TypeReferencePattern pattern) { > > super(pattern); > > this.pattern = pattern; >+ this.fineGrain = pattern == null ? 0 : pattern.fineGrain; > this.isDeclarationOfReferencedTypesPattern = this.pattern instanceof DeclarationOfReferencedTypesPattern; > } > protected IJavaElement findElement(IJavaElement element, int accuracy) { >@@ -43,6 +46,9 @@ > element = element.getParent(); > return element; > } >+protected int fineGrain() { >+ return this.fineGrain; >+} > public int match(Annotation node, MatchingNodeSet nodeSet) { > return match(node.type, nodeSet); > } >@@ -201,6 +207,11 @@ > return; > } > >+ // Return if fine grain is on and does not concern import reference >+ if ((this.pattern.fineGrain != 0 && (this.pattern.fineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) == 0)) { >+ return; >+ } >+ > // Create search match > match = locator.newTypeReferenceMatch(element, binding, accuracy, importRef); > >@@ -539,6 +550,10 @@ > } > } > } >+ if (this.pattern.simpleName == null) { >+ match.setOffset(expr.sourceStart); >+ match.setLength(expr.sourceEnd-expr.sourceStart+1); >+ } > locator.report(match); > } > protected int referenceType() { >Index: search/org/eclipse/jdt/internal/core/search/matching/VariableLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariableLocator.java,v >retrieving revision 1.7 >diff -u -r1.7 VariableLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/VariableLocator.java 10 May 2006 18:03:43 -0000 1.7 >+++ search/org/eclipse/jdt/internal/core/search/matching/VariableLocator.java 27 Nov 2007 15:09:21 -0000 >@@ -30,7 +30,7 @@ > if (lhs instanceof Reference) > return matchReference((Reference) lhs, nodeSet, true); > } >- } else if (this.pattern.readAccess) { >+ } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { > if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { > // the lhs of a simple assignment may be added in match(Reference...) before we reach here > // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess >@@ -42,7 +42,7 @@ > return IMPOSSIBLE_MATCH; > } > public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes >- return this.pattern.readAccess >+ return (this.pattern.readAccess || this.pattern.fineGrain != 0) > ? matchReference(node, nodeSet, false) > : IMPOSSIBLE_MATCH; > } >Index: search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java,v >retrieving revision 1.26 >diff -u -r1.26 JavaSearchPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java 15 Nov 2007 16:58:53 -0000 1.26 >+++ search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java 27 Nov 2007 15:09:19 -0000 >@@ -53,6 +53,11 @@ > int matchCompatibility; > > /** >+ * Fine grain limitation >+ */ >+ public int fineGrain = 0; >+ >+ /** > * Mask used on match rule for match mode. > */ > public static final int MATCH_MODE_MASK = R_EXACT_MATCH >@@ -289,6 +294,7 @@ > } > return output; > } >+ > /** > * @param typeArguments The typeArguments to set. > */ >Index: search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java,v >retrieving revision 1.68 >diff -u -r1.68 PatternLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 2 Oct 2007 17:12:01 -0000 1.68 >+++ search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java 27 Nov 2007 15:09:21 -0000 >@@ -238,6 +238,9 @@ > // override if the pattern can be more specific > return ALL_CONTAINER; > } >+protected int fineGrain() { >+ return 0; >+} > /** > * Returns whether the given name matches the given pattern. > */ >@@ -814,136 +817,141 @@ > } > // TODO (frederic) do we need to verify each parameter? > return level; // we can't do better >- } else if (type.isRawType()) { >- return level; // raw type always match >- } else { >- TypeBinding leafType = type.leafComponentType(); >- if (!leafType.isParameterizedType()) { >- // Standard types (ie. neither generic nor parameterized nor raw types) >- // cannot match pattern with type parameters or arguments >- return (patternTypeArguments[depth]==null || patternTypeArguments[depth].length==0) ? level : IMPOSSIBLE_MATCH; >- } >- ParameterizedTypeBinding paramTypeBinding = (ParameterizedTypeBinding) leafType; >+ } > >- // Compare arguments only if there ones on both sides >- if (patternTypeArguments[depth] != null && patternTypeArguments[depth].length > 0 && >- paramTypeBinding.arguments != null && paramTypeBinding.arguments.length > 0) { >+ // raw type always match >+ if (type.isRawType()) { >+ return level; >+ } > >- // type parameters length must match at least specified type names length >- int length = patternTypeArguments[depth].length; >- if (paramTypeBinding.arguments.length != length) return IMPOSSIBLE_MATCH; >- >- // verify each pattern type parameter >- nextTypeArgument: for (int i= 0; i<length; i++) { >- char[] patternTypeArgument = patternTypeArguments[depth][i]; >- TypeBinding argTypeBinding = paramTypeBinding.arguments[i]; >- // get corresponding pattern wildcard >- switch (patternTypeArgument[0]) { >- case Signature.C_STAR : // unbound parameter always match >- case Signature.C_SUPER : // needs pattern type parameter binding >- // skip to next type argument as it will be resolved later >- continue nextTypeArgument; >- case Signature.C_EXTENDS : >- // remove wildcard from patter type argument >- patternTypeArgument = CharOperation.subarray(patternTypeArgument, 1, patternTypeArgument.length); >- default : >- // no wildcard >- break; >- } >- // get pattern type argument from its signature >- patternTypeArgument = Signature.toCharArray(patternTypeArgument); >- if (!this.isCaseSensitive) patternTypeArgument = CharOperation.toLowerCase(patternTypeArgument); >- boolean patternTypeArgHasAnyChars = CharOperation.contains(new char[] {'*', '?'}, patternTypeArgument); >- >- // Verify that names match... >- // ...special case for wildcard >- if (argTypeBinding instanceof CaptureBinding) { >- WildcardBinding capturedWildcard = ((CaptureBinding)argTypeBinding).wildcard; >- if (capturedWildcard != null) argTypeBinding = capturedWildcard; >- } >- if (argTypeBinding.isWildcard()) { >- WildcardBinding wildcardBinding = (WildcardBinding) argTypeBinding; >- switch (wildcardBinding.boundKind) { >- case Wildcard.EXTENDS: >- // Invalid if type argument is not exact >- if (patternTypeArgHasAnyChars) return impossible; >- case Wildcard.UNBOUND: >- // there's no bound name to match => valid >- continue nextTypeArgument; >- } >- // Look if bound name match pattern type argument >- ReferenceBinding boundBinding = (ReferenceBinding) wildcardBinding.bound; >- if (CharOperation.match(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) || >- CharOperation.match(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) { >- // found name in hierarchy => match >+ // Standard types (ie. neither generic nor parameterized nor raw types) >+ // cannot match pattern with type parameters or arguments >+ TypeBinding leafType = type.leafComponentType(); >+ if (!leafType.isParameterizedType()) { >+ return (patternTypeArguments[depth]==null || patternTypeArguments[depth].length==0) ? level : IMPOSSIBLE_MATCH; >+ } >+ >+ // Parameterized type >+ ParameterizedTypeBinding paramTypeBinding = (ParameterizedTypeBinding) leafType; >+ >+ // Compare arguments only if there ones on both sides >+ if (patternTypeArguments[depth] != null && patternTypeArguments[depth].length > 0 && >+ paramTypeBinding.arguments != null && paramTypeBinding.arguments.length > 0) { >+ >+ // type parameters length must match at least specified type names length >+ int length = patternTypeArguments[depth].length; >+ if (paramTypeBinding.arguments.length != length) return IMPOSSIBLE_MATCH; >+ >+ // verify each pattern type parameter >+ nextTypeArgument: for (int i= 0; i<length; i++) { >+ char[] patternTypeArgument = patternTypeArguments[depth][i]; >+ TypeBinding argTypeBinding = paramTypeBinding.arguments[i]; >+ // get corresponding pattern wildcard >+ switch (patternTypeArgument[0]) { >+ case Signature.C_STAR : // unbound parameter always match >+ case Signature.C_SUPER : // needs pattern type parameter binding >+ // skip to next type argument as it will be resolved later >+ continue nextTypeArgument; >+ case Signature.C_EXTENDS : >+ // remove wildcard from patter type argument >+ patternTypeArgument = CharOperation.subarray(patternTypeArgument, 1, patternTypeArgument.length); >+ default : >+ // no wildcard >+ break; >+ } >+ // get pattern type argument from its signature >+ patternTypeArgument = Signature.toCharArray(patternTypeArgument); >+ if (!this.isCaseSensitive) patternTypeArgument = CharOperation.toLowerCase(patternTypeArgument); >+ boolean patternTypeArgHasAnyChars = CharOperation.contains(new char[] {'*', '?'}, patternTypeArgument); >+ >+ // Verify that names match... >+ // ...special case for wildcard >+ if (argTypeBinding instanceof CaptureBinding) { >+ WildcardBinding capturedWildcard = ((CaptureBinding)argTypeBinding).wildcard; >+ if (capturedWildcard != null) argTypeBinding = capturedWildcard; >+ } >+ if (argTypeBinding.isWildcard()) { >+ WildcardBinding wildcardBinding = (WildcardBinding) argTypeBinding; >+ switch (wildcardBinding.boundKind) { >+ case Wildcard.EXTENDS: >+ // Invalid if type argument is not exact >+ if (patternTypeArgHasAnyChars) return impossible; >+ case Wildcard.UNBOUND: >+ // there's no bound name to match => valid > continue nextTypeArgument; >- } >- >- // If pattern is not exact then match fails >- if (patternTypeArgHasAnyChars) return impossible; >- >- // Look for bound name in type argument superclasses >- boundBinding = boundBinding.superclass(); >- while (boundBinding != null) { >- if (CharOperation.equals(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) || >- CharOperation.equals(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) { >- // found name in hierarchy => match >- continue nextTypeArgument; >- } else if (boundBinding.isLocalType() || boundBinding.isMemberType()) { >- // for local or member type, verify also source name (bug 81084) >- if (CharOperation.match(patternTypeArgument, boundBinding.sourceName(), this.isCaseSensitive)) >- continue nextTypeArgument; >- } >- boundBinding = boundBinding.superclass(); >- } >- return impossible; > } >- >- // See if names match >- if (CharOperation.match(patternTypeArgument, argTypeBinding.shortReadableName(), this.isCaseSensitive) || >- CharOperation.match(patternTypeArgument, argTypeBinding.readableName(), this.isCaseSensitive)) { >+ // Look if bound name match pattern type argument >+ ReferenceBinding boundBinding = (ReferenceBinding) wildcardBinding.bound; >+ if (CharOperation.match(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) || >+ CharOperation.match(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) { >+ // found name in hierarchy => match > continue nextTypeArgument; >- } else if (argTypeBinding.isLocalType() || argTypeBinding.isMemberType()) { >- // for local or member type, verify also source name (bug 81084) >- if (CharOperation.match(patternTypeArgument, argTypeBinding.sourceName(), this.isCaseSensitive)) >- continue nextTypeArgument; > } > > // If pattern is not exact then match fails > if (patternTypeArgHasAnyChars) return impossible; >- >- // Scan hierarchy >- TypeBinding leafTypeBinding = argTypeBinding.leafComponentType(); >- if (leafTypeBinding.isBaseType()) return impossible; >- ReferenceBinding refBinding = ((ReferenceBinding) leafTypeBinding).superclass(); >- while (refBinding != null) { >- if (CharOperation.equals(patternTypeArgument, refBinding.shortReadableName(), this.isCaseSensitive) || >- CharOperation.equals(patternTypeArgument, refBinding.readableName(), this.isCaseSensitive)) { >+ >+ // Look for bound name in type argument superclasses >+ boundBinding = boundBinding.superclass(); >+ while (boundBinding != null) { >+ if (CharOperation.equals(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) || >+ CharOperation.equals(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) { > // found name in hierarchy => match > continue nextTypeArgument; >- } else if (refBinding.isLocalType() || refBinding.isMemberType()) { >+ } else if (boundBinding.isLocalType() || boundBinding.isMemberType()) { > // for local or member type, verify also source name (bug 81084) >- if (CharOperation.match(patternTypeArgument, refBinding.sourceName(), this.isCaseSensitive)) >+ if (CharOperation.match(patternTypeArgument, boundBinding.sourceName(), this.isCaseSensitive)) > continue nextTypeArgument; > } >- refBinding = refBinding.superclass(); >+ boundBinding = boundBinding.superclass(); > } > return impossible; > } >+ >+ // See if names match >+ if (CharOperation.match(patternTypeArgument, argTypeBinding.shortReadableName(), this.isCaseSensitive) || >+ CharOperation.match(patternTypeArgument, argTypeBinding.readableName(), this.isCaseSensitive)) { >+ continue nextTypeArgument; >+ } else if (argTypeBinding.isLocalType() || argTypeBinding.isMemberType()) { >+ // for local or member type, verify also source name (bug 81084) >+ if (CharOperation.match(patternTypeArgument, argTypeBinding.sourceName(), this.isCaseSensitive)) >+ continue nextTypeArgument; >+ } >+ >+ // If pattern is not exact then match fails >+ if (patternTypeArgHasAnyChars) return impossible; >+ >+ // Scan hierarchy >+ TypeBinding leafTypeBinding = argTypeBinding.leafComponentType(); >+ if (leafTypeBinding.isBaseType()) return impossible; >+ ReferenceBinding refBinding = ((ReferenceBinding) leafTypeBinding).superclass(); >+ while (refBinding != null) { >+ if (CharOperation.equals(patternTypeArgument, refBinding.shortReadableName(), this.isCaseSensitive) || >+ CharOperation.equals(patternTypeArgument, refBinding.readableName(), this.isCaseSensitive)) { >+ // found name in hierarchy => match >+ continue nextTypeArgument; >+ } else if (refBinding.isLocalType() || refBinding.isMemberType()) { >+ // for local or member type, verify also source name (bug 81084) >+ if (CharOperation.match(patternTypeArgument, refBinding.sourceName(), this.isCaseSensitive)) >+ continue nextTypeArgument; >+ } >+ refBinding = refBinding.superclass(); >+ } >+ return impossible; > } >- >- // Recurse on enclosing type >- TypeBinding enclosingType = paramTypeBinding.enclosingType(); >- if (enclosingType != null && enclosingType.isParameterizedType() && depth < patternTypeArguments.length && qualificationPattern != null) { >- int lastDot = CharOperation.lastIndexOf('.', qualificationPattern); >- char[] enclosingQualificationPattern = lastDot==-1 ? null : CharOperation.subarray(qualificationPattern, 0, lastDot); >- char[] enclosingSimpleNamePattern = lastDot==-1 ? qualificationPattern : CharOperation.subarray(qualificationPattern, lastDot+1, qualificationPattern.length); >- int enclosingLevel = resolveLevelForType(enclosingSimpleNamePattern, enclosingQualificationPattern, patternTypeArguments, depth+1, enclosingType); >- if (enclosingLevel == impossible) return impossible; >- if (enclosingLevel == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; >- } >- return level; > } >+ >+ // Recurse on enclosing type >+ TypeBinding enclosingType = paramTypeBinding.enclosingType(); >+ if (enclosingType != null && enclosingType.isParameterizedType() && depth < patternTypeArguments.length && qualificationPattern != null) { >+ int lastDot = CharOperation.lastIndexOf('.', qualificationPattern); >+ char[] enclosingQualificationPattern = lastDot==-1 ? null : CharOperation.subarray(qualificationPattern, 0, lastDot); >+ char[] enclosingSimpleNamePattern = lastDot==-1 ? qualificationPattern : CharOperation.subarray(qualificationPattern, lastDot+1, qualificationPattern.length); >+ int enclosingLevel = resolveLevelForType(enclosingSimpleNamePattern, enclosingQualificationPattern, patternTypeArguments, depth+1, enclosingType); >+ if (enclosingLevel == impossible) return impossible; >+ if (enclosingLevel == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; >+ } >+ return level; > } > public String toString(){ > return "SearchPattern"; //$NON-NLS-1$ >Index: search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java,v >retrieving revision 1.47 >diff -u -r1.47 FieldLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java 25 Apr 2007 16:59:23 -0000 1.47 >+++ search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java 27 Nov 2007 15:09:19 -0000 >@@ -30,6 +30,9 @@ > > this.isDeclarationOfAccessedFieldsPattern = this.pattern instanceof DeclarationOfAccessedFieldsPattern; > } >+protected int fineGrain() { >+ return this.pattern.fineGrain; >+} > public int match(ASTNode node, MatchingNodeSet nodeSet) { > int declarationsLevel = IMPOSSIBLE_MATCH; > if (this.pattern.findReferences) { >@@ -78,7 +81,7 @@ > //public int match(TypeReference node, MatchingNodeSet nodeSet) - SKIP IT > > protected int matchContainer() { >- if (this.pattern.findReferences) { >+ if (this.pattern.findReferences || this.pattern.fineGrain != 0) { > // need to look everywhere to find in javadocs and static import > return ALL_CONTAINER; > } >@@ -290,7 +293,7 @@ > return IJavaElement.FIELD; > } > public int resolveLevel(ASTNode possiblelMatchingNode) { >- if (this.pattern.findReferences) { >+ if (this.pattern.findReferences || this.pattern.fineGrain != 0) { > if (possiblelMatchingNode instanceof FieldReference) > return matchField(((FieldReference) possiblelMatchingNode).binding, true); > else if (possiblelMatchingNode instanceof NameReference) >Index: search/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.java,v >retrieving revision 1.19 >diff -u -r1.19 LocalVariableLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.java 25 Oct 2007 17:22:54 -0000 1.19 >+++ search/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.java 27 Nov 2007 15:09:19 -0000 >@@ -82,7 +82,7 @@ > return IJavaElement.LOCAL_VARIABLE; > } > public int resolveLevel(ASTNode possiblelMatchingNode) { >- if (this.pattern.findReferences) >+ if (this.pattern.findReferences || this.pattern.fineGrain != 0) > if (possiblelMatchingNode instanceof NameReference) > return resolveLevel((NameReference) possiblelMatchingNode); > if (possiblelMatchingNode instanceof LocalDeclaration) >Index: search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java,v >retrieving revision 1.42 >diff -u -r1.42 OrPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java 27 Feb 2005 23:00:11 -0000 1.42 >+++ search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java 27 Nov 2007 15:09:20 -0000 >@@ -22,11 +22,6 @@ > > protected SearchPattern[] patterns; > >- /* >- * Whether this pattern is erasure match. >- */ >-// boolean isErasureMatch; >- > /** > * One of {@link #R_ERASURE_MATCH}, {@link #R_EQUIVALENT_MATCH}, {@link #R_FULL_MATCH}. > */ >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.300 >diff -u -r1.300 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 27 Nov 2007 08:42:08 -0000 1.300 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 27 Nov 2007 15:09:20 -0000 >@@ -144,6 +144,8 @@ > // Cache for method handles > HashSet methodHandles; > >+private final int patternFineGrain; >+ > /** > * An ast visitor that visits local type declarations. > */ >@@ -184,7 +186,6 @@ > } > } > } >- > public static class WorkingCopyDocument extends JavaSearchDocument { > public org.eclipse.jdt.core.ICompilationUnit workingCopy; > WorkingCopyDocument(org.eclipse.jdt.core.ICompilationUnit workingCopy, SearchParticipant participant) { >@@ -328,6 +329,7 @@ > this.pattern = pattern; > this.patternLocator = PatternLocator.patternLocator(this.pattern); > this.matchContainer = this.patternLocator == null ? 0 : this.patternLocator.matchContainer(); >+ this.patternFineGrain = this.patternLocator == null ? 0 : this.patternLocator.fineGrain(); > this.requestor = requestor; > this.scope = scope; > this.progressMonitor = progressMonitor; >@@ -1980,8 +1982,10 @@ > * search pattern (ie. the ones in the matching nodes set) > * Note that the method declaration has already been checked. > */ >-protected void reportMatching(TypeDeclaration type, AbstractMethodDeclaration method, IJavaElement parent, int accuracy, boolean typeInHierarchy, MatchingNodeSet nodeSet) throws CoreException { >+protected void reportMatching(AbstractMethodDeclaration method, TypeDeclaration type, IJavaElement parent, int accuracy, boolean typeInHierarchy, MatchingNodeSet nodeSet) throws CoreException { > IJavaElement enclosingElement = null; >+ >+ // report method declaration itself > if (accuracy > -1) { > enclosingElement = createHandle(method, parent); > if (enclosingElement != null) { // skip if unable to find method >@@ -2049,16 +2053,29 @@ > if (enclosingElement == null) > enclosingElement = createHandle(method, parent); > if (encloses(enclosingElement)) { >- for (int i = 0, l = nodes.length; i < l; i++) { >- ASTNode node = nodes[i]; >- Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >- this.patternLocator.matchReportReference(node, enclosingElement, method.binding, method.scope, level.intValue(), this); >+ // standard reporting >+ if (this.patternFineGrain == 0) { >+ for (int i = 0, l = nodes.length; i < l; i++) { >+ ASTNode node = nodes[i]; >+ Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >+ this.patternLocator.matchReportReference(node, enclosingElement, method.binding, method.scope, level.intValue(), this); >+ } >+ return; >+ } >+ // finegrain reporting >+ FineGrainVisitor visitor = new FineGrainVisitor(enclosingElement, method.binding, nodeSet, nodes, this.patternLocator, this); >+ try { >+ ClassScope classScope = method.scope == null ? null : method.scope.classScope(); >+ method.traverse(visitor, classScope); >+ } catch (WrappedCoreException e) { >+ throw e.coreException; > } >- return; > } > } >- for (int i = 0, l = nodes.length; i < l; i++) >+ // Remove all remaining nodes >+ for (int i = 0, l = nodes.length; i < l; i++) { > nodeSet.matchingNodes.removeKey(nodes[i]); >+ } > } > } > } >@@ -2072,7 +2089,7 @@ > // Look for annotation type ref > TypeReference typeRef = annotationType.type; > Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeRef); >- if (level != null && matchedContainer) { >+ if (level != null && matchedContainer && (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0)) { > this.patternLocator.matchReportReference(typeRef, enclosingElement, elementBinding, level.intValue(), this); > } > >@@ -2081,7 +2098,7 @@ > for (int j = 0, pl = pairs.length; j < pl; j++) { > MemberValuePair pair = pairs[j]; > level = (Integer) nodeSet.matchingNodes.removeKey(pair); >- if (level != null && enclosesElement) { >+ if (level != null && enclosesElement && this.patternFineGrain == 0) { > ASTNode reference = (annotationType instanceof SingleMemberAnnotation) ? (ASTNode) annotationType: pair; > this.patternLocator.matchReportReference(reference, enclosingElement, pair.binding, level.intValue(), this); > } >@@ -2094,7 +2111,7 @@ > for (int j = 0, nl = nodes.length; j < nl; j++) { > nodeSet.matchingNodes.removeKey(nodes[j]); > } >- } else { >+ } else if (this.patternFineGrain == 0) { > for (int j = 0, nl = nodes.length; j < nl; j++) { > ASTNode node = nodes[j]; > level = (Integer) nodeSet.matchingNodes.removeKey(node); >@@ -2135,11 +2152,13 @@ > // import ref cannot be in the hierarchy of a type > if (this.hierarchyResolver != null) continue; > >- ImportReference importRef = (ImportReference) node; >- Binding binding = (importRef.bits & ASTNode.OnDemand) != 0 >- ? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic()) >- : unitScope.getImport(importRef.tokens, false, importRef.isStatic()); >- this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this); >+ if (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) { >+ ImportReference importRef = (ImportReference) node; >+ Binding binding = (importRef.bits & ASTNode.OnDemand) != 0 >+ ? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic()) >+ : unitScope.getImport(importRef.tokens, false, importRef.isStatic()); >+ this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this); >+ } > } else { > nodeSet.addMatch(node, this.patternLocator.resolveLevel(node)); > } >@@ -2161,7 +2180,7 @@ > boolean matchedUnitContainer = (this.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0; > > // report references in javadoc >- if (unit.javadoc != null) { >+ if (unit.javadoc != null && this.patternFineGrain == 0) { > ASTNode[] nodes = nodeSet.matchingNodes(unit.javadoc.sourceStart, unit.javadoc.sourceEnd); > if (nodes != null) { > if (!matchedUnitContainer) { >@@ -2172,8 +2191,9 @@ > for (int i = 0, l = nodes.length; i < l; i++) { > ASTNode node = nodes[i]; > Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >- if (encloses(element)) >+ if (encloses(element) && this.patternFineGrain == 0) { > this.patternLocator.matchReportReference(node, element, null/*no binding*/, level.intValue(), this); >+ } > } > } > } >@@ -2193,11 +2213,8 @@ > for (int i = 0, l = imports.length; i < l; i++) { > ImportReference importRef = imports[i]; > Integer level = (Integer) nodeSet.matchingNodes.removeKey(importRef); >- if (level != null) { >- Binding binding = (importRef.bits & ASTNode.OnDemand) != 0 >- ? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic()) >- : unitScope.getImport(importRef.tokens, false, importRef.isStatic()); >- this.patternLocator.matchReportImportRef(importRef, binding, createImportHandle(importRef), level.intValue(), this); >+ if (level != null && (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0)) { >+ this.patternLocator.matchReportImportRef(importRef, null /*no binding*/, createImportHandle(importRef), level.intValue(), this); > } > } > } >@@ -2270,22 +2287,37 @@ > if (enclosingElement == null) > enclosingElement = createHandle(field, type, parent); > if (encloses(enclosingElement)) { >- for (int i = 0, l = nodes.length; i < l; i++) { >- ASTNode node = nodes[i]; >- Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >- IJavaElement[] otherElements = null; >- if (otherFields != null) { >- int length = otherFields.length; >- int size = 0; >- while (size<length && otherFields[size] != null) { >- size++; >- } >- otherElements = new IJavaElement[size]; >- for (int j=0; j<size; j++) { >- otherElements[j] = createHandle(otherFields[j], type, parent); >+ // standard reporting >+ if (this.patternFineGrain == 0) { >+ for (int i = 0, l = nodes.length; i < l; i++) { >+ ASTNode node = nodes[i]; >+ Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >+ IJavaElement[] otherElements = null; >+ if (otherFields != null) { >+ int length = otherFields.length; >+ int size = 0; >+ while (size<length && otherFields[size] != null) { >+ size++; >+ } >+ otherElements = new IJavaElement[size]; >+ for (int j=0; j<size; j++) { >+ otherElements[j] = createHandle(otherFields[j], type, parent); >+ } > } >+ this.patternLocator.matchReportReference(node, enclosingElement, null, otherElements, field.binding, level.intValue(), this); >+ } >+ } else { >+ // finegrain reporting >+ FineGrainVisitor visitor = new FineGrainVisitor(enclosingElement, field.binding, nodeSet, nodes, this.patternLocator, this); >+ try { >+ field.traverse(visitor, null); >+ } catch (WrappedCoreException e) { >+ throw e.coreException; >+ } >+ // Remove all remaining nodes >+ for (int i = 0, l = nodes.length; i < l; i++) { >+ nodeSet.matchingNodes.removeKey(nodes[i]); > } >- this.patternLocator.matchReportReference(node, enclosingElement, null, otherElements, field.binding, level.intValue(), this); > } > } > } >@@ -2304,23 +2336,38 @@ > enclosingElement = createHandle(field, type, parent); > } > if (encloses(enclosingElement)) { >- for (int i = 0, l = nodes.length; i < l; i++) { >- ASTNode node = nodes[i]; >- Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >- if (node instanceof TypeDeclaration) { >- // use field declaration to report match (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174) >- AllocationExpression allocation = ((TypeDeclaration)node).allocation; >- if (allocation != null && allocation.enumConstant != null) { >- node = field; >+ // standard reporting >+ if (this.patternFineGrain == 0) { >+ for (int i = 0, l = nodes.length; i < l; i++) { >+ ASTNode node = nodes[i]; >+ Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >+ if (node instanceof TypeDeclaration) { >+ // use field declaration to report match (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174) >+ AllocationExpression allocation = ((TypeDeclaration)node).allocation; >+ if (allocation != null && allocation.enumConstant != null) { >+ node = field; >+ } > } >+ // Set block scope for initializer in case there would have other local and other elements to report >+ BlockScope blockScope = null; >+ if (field.getKind() == AbstractVariableDeclaration.INITIALIZER) { >+ Block block = ((Initializer)field).block; >+ if (block != null) blockScope = block.scope; >+ } >+ this.patternLocator.matchReportReference(node, enclosingElement, field.binding, blockScope, level.intValue(), this); > } >- // Set block scope for initializer in case there would have other local and other elements to report >- BlockScope blockScope = null; >- if (field.getKind() == AbstractVariableDeclaration.INITIALIZER) { >- Block block = ((Initializer)field).block; >- if (block != null) blockScope = block.scope; >- } >- this.patternLocator.matchReportReference(node, enclosingElement, field.binding, blockScope, level.intValue(), this); >+ return; >+ } >+ // finegrain reporting >+ FineGrainVisitor visitor = new FineGrainVisitor(enclosingElement, field.binding, nodeSet, nodes, this.patternLocator, this); >+ try { >+ field.traverse(visitor, field.isStatic() ? type.staticInitializerScope : type.initializerScope); >+ } catch (WrappedCoreException e) { >+ throw e.coreException; >+ } >+ // Remove all remaining nodes >+ for (int i = 0, l = nodes.length; i < l; i++) { >+ nodeSet.matchingNodes.removeKey(nodes[i]); > } > } > } >@@ -2369,7 +2416,7 @@ > } > > // report references in javadoc >- if (type.javadoc != null) { >+ if (type.javadoc != null && this.patternFineGrain == 0) { > ASTNode[] nodes = nodeSet.matchingNodes(type.declarationSourceStart, type.sourceStart); > if (nodes != null) { > if (!matchedClassContainer) { >@@ -2389,8 +2436,8 @@ > > // super types > if ((type.bits & ASTNode.IsAnonymousType) != 0) { >- TypeReference superType =type.allocation.type; >- if (superType != null) { >+ TypeReference superType = type.allocation.type; >+ if (superType != null && (this.patternFineGrain == 0 || (this.patternFineGrain & (IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE | IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE)) != 0)) { > Integer level = (Integer) nodeSet.matchingNodes.removeKey(superType); > if (level != null && matchedClassContainer) > this.patternLocator.matchReportReference(superType, enclosingElement, type.binding, level.intValue(), this); >@@ -2398,12 +2445,14 @@ > } else { > TypeReference superClass = type.superclass; > if (superClass != null) { >- reportMatchingSuper(superClass, enclosingElement, type.binding, nodeSet, matchedClassContainer); >+ boolean shouldReportSuper = (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE) != 0); >+ reportMatchingSuper(superClass, enclosingElement, type.binding, nodeSet, matchedClassContainer, shouldReportSuper); > } > TypeReference[] superInterfaces = type.superInterfaces; > if (superInterfaces != null) { >+ boolean shouldReportSuper = (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE) != 0); > for (int i = 0, l = superInterfaces.length; i < l; i++) { >- reportMatchingSuper(superInterfaces[i], enclosingElement, type.binding, nodeSet, matchedClassContainer); >+ reportMatchingSuper(superInterfaces[i], enclosingElement, type.binding, nodeSet, matchedClassContainer, shouldReportSuper); > } > } > } >@@ -2463,7 +2512,7 @@ > AbstractMethodDeclaration method = methods[i]; > Integer level = (Integer) nodeSet.matchingNodes.removeKey(method); > int value = (level != null && matchedClassContainer) ? level.intValue() : -1; >- reportMatching(type, method, enclosingElement, value, typeInHierarchy, nodeSet); >+ reportMatching(method, type, enclosingElement, value, typeInHierarchy, nodeSet); > } > } > >@@ -2484,11 +2533,20 @@ > */ > protected void reportMatching(TypeParameter[] typeParameters, IJavaElement enclosingElement, IJavaElement parent, Binding binding, MatchingNodeSet nodeSet) throws CoreException { > if (typeParameters == null) return; >+ boolean typeParameterBoundShouldBeReported = this.patternFineGrain == 0 || >+ (this.patternFineGrain & IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE) != 0; >+ boolean parameterizedTypeShouldBeReported = this.patternFineGrain == 0 || >+ (this.patternFineGrain & IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE) != 0; >+ boolean wildcardBoundShouldBeReported = this.patternFineGrain == 0 || >+ (this.patternFineGrain & IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE) != 0; >+ if (!typeParameterBoundShouldBeReported && !parameterizedTypeShouldBeReported && !wildcardBoundShouldBeReported) { >+ return; >+ } > for (int i=0, l=typeParameters.length; i<l; i++) { > TypeParameter typeParameter = typeParameters[i]; > if (typeParameter != null) { > Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter); >- if (level != null) { >+ if (level != null && this.patternFineGrain == 0) { > if (level.intValue() > -1 && encloses(enclosingElement)) { > int offset = typeParameter.sourceStart; > SearchMatch match = this.patternLocator.newDeclarationMatch(typeParameter, enclosingElement, binding, level.intValue(), typeParameter.sourceEnd-offset+1, this); >@@ -2497,7 +2555,7 @@ > } > if (typeParameter.type != null) { > level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.type); >- if (level != null) { >+ if (level != null && typeParameterBoundShouldBeReported) { > IJavaElement localElement = createHandle(typeParameter, enclosingElement); > this.patternLocator.matchReportReference(typeParameter.type, enclosingElement, localElement, null, binding, level.intValue(), this); > } >@@ -2508,11 +2566,11 @@ > for (int k=0; k<length; k++) { > TypeReference typeArgument = paramSTR.typeArguments[k]; > level = (Integer) nodeSet.matchingNodes.removeKey(typeArgument); >- if (level != null) { >+ if (level != null && parameterizedTypeShouldBeReported) { > IJavaElement localElement = createHandle(typeParameter, enclosingElement); > this.patternLocator.matchReportReference(typeArgument, enclosingElement, localElement, null, binding, level.intValue(), this); > } >- if (typeArgument instanceof Wildcard) { >+ if (wildcardBoundShouldBeReported && typeArgument instanceof Wildcard) { > TypeReference wildcardBound = ((Wildcard) typeArgument).bound; > level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound); > if (level != null) { >@@ -2528,7 +2586,7 @@ > for (int j=0, b=typeParameter.bounds.length; j<b; j++) { > TypeReference typeParameterBound = typeParameter.bounds[j]; > level = (Integer) nodeSet.matchingNodes.removeKey(typeParameterBound); >- if (level != null) { >+ if (level != null && typeParameterBoundShouldBeReported) { > IJavaElement localElement = createHandle(typeParameter, enclosingElement); > this.patternLocator.matchReportReference(typeParameterBound, enclosingElement, localElement, null, binding, level.intValue(), this); > } >@@ -2539,11 +2597,11 @@ > for (int k=0; k<length; k++) { > TypeReference typeArgument = paramSTR.typeArguments[k]; > level = (Integer) nodeSet.matchingNodes.removeKey(typeArgument); >- if (level != null) { >+ if (level != null && parameterizedTypeShouldBeReported) { > IJavaElement localElement = createHandle(typeParameter, enclosingElement); > this.patternLocator.matchReportReference(typeArgument, enclosingElement, localElement, null, binding, level.intValue(), this); > } >- if (typeArgument instanceof Wildcard) { >+ if (wildcardBoundShouldBeReported && typeArgument instanceof Wildcard) { > TypeReference wildcardBound = ((Wildcard) typeArgument).bound; > level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound); > if (level != null) { >@@ -2559,7 +2617,59 @@ > } > } > } >-protected void reportMatchingSuper(TypeReference superReference, IJavaElement enclosingElement, Binding elementBinding, MatchingNodeSet nodeSet, boolean matchedClassContainer) throws CoreException { >+protected boolean shouldReportParameterizedSingleTypeReference(ParameterizedSingleTypeReference typeReference, ASTNode node) { >+ TypeReference[] typeArguments = typeReference.typeArguments; >+ if (typeArguments != null) { >+ int length = typeArguments.length; >+ for (int i=0; i<length; i++) { >+ TypeReference typeArgument = typeArguments[i]; >+ if (typeArgument == node) return true; >+ if (typeArgument instanceof ParameterizedSingleTypeReference) { >+ ParameterizedSingleTypeReference paramSTR = (ParameterizedSingleTypeReference) typeArgument; >+ if (shouldReportParameterizedSingleTypeReference(paramSTR, node)) { >+ return true; >+ } >+ } >+ if (typeArguments[i] instanceof ParameterizedQualifiedTypeReference) { >+ ParameterizedQualifiedTypeReference paramQTR = (ParameterizedQualifiedTypeReference) typeArguments[i]; >+ if (shouldReportParameterizedQualifiedTypeReference(paramQTR, node)) { >+ return true; >+ } >+ } >+ } >+ } >+ return true; >+} >+protected boolean shouldReportParameterizedQualifiedTypeReference(ParameterizedQualifiedTypeReference typeReference, ASTNode node) { >+ TypeReference[][] allTypeArguments = typeReference.typeArguments; >+ if (allTypeArguments != null) { >+ int allLength = allTypeArguments.length; >+ for (int i=0; i<allLength; i++) { >+ TypeReference[] typeArguments = allTypeArguments[i]; >+ if (typeArguments != null) { >+ int length = typeArguments.length; >+ for (int j=0; j<length; j++) { >+ TypeReference typeArgument = typeArguments[j]; >+ if (typeArgument == node) return true; >+ if (typeArgument instanceof ParameterizedSingleTypeReference) { >+ ParameterizedSingleTypeReference paramSTR = (ParameterizedSingleTypeReference) typeArgument; >+ if (shouldReportParameterizedSingleTypeReference(paramSTR, node)) { >+ return true; >+ } >+ } >+ if (typeArgument instanceof ParameterizedQualifiedTypeReference) { >+ ParameterizedQualifiedTypeReference paramQTR = (ParameterizedQualifiedTypeReference) typeArgument; >+ if (shouldReportParameterizedQualifiedTypeReference(paramQTR, node)) { >+ return true; >+ } >+ } >+ } >+ } >+ } >+ } >+ return true; >+} >+protected void reportMatchingSuper(TypeReference superReference, IJavaElement enclosingElement, Binding elementBinding, MatchingNodeSet nodeSet, boolean matchedClassContainer, boolean shouldReportSuper) throws CoreException { > ASTNode[] nodes = null; > if (superReference instanceof ParameterizedSingleTypeReference || superReference instanceof ParameterizedQualifiedTypeReference) { > long lastTypeArgumentInfo = findLastTypeArgumentInfo(superReference); >@@ -2574,12 +2684,14 @@ > for (int i = 0, l = nodes.length; i < l; i++) { > ASTNode node = nodes[i]; > Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >- this.patternLocator.matchReportReference(node, enclosingElement, elementBinding, level.intValue(), this); >+ if (this.patternFineGrain == 0 || ((this.patternFineGrain & IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE) != 0)) { >+ this.patternLocator.matchReportReference(node, enclosingElement, elementBinding, level.intValue(), this); >+ } > } > } >- } else { >+ } else if (encloses(enclosingElement)) { > Integer level = (Integer) nodeSet.matchingNodes.removeKey(superReference); >- if (level != null && matchedClassContainer) >+ if (level != null && matchedClassContainer&& shouldReportSuper) > this.patternLocator.matchReportReference(superReference, enclosingElement, elementBinding, level.intValue(), this); > } > } >Index: search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java,v >retrieving revision 1.29 >diff -u -r1.29 FieldPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java 24 Aug 2007 05:59:05 -0000 1.29 >+++ search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java 27 Nov 2007 15:09:19 -0000 >@@ -34,17 +34,15 @@ > } > > public FieldPattern( >- boolean findDeclarations, >- boolean readAccess, >- boolean writeAccess, > char[] name, > char[] declaringQualification, > char[] declaringSimpleName, > char[] typeQualification, > char[] typeSimpleName, >+ int limitTo, > int matchRule) { > >- super(FIELD_PATTERN, findDeclarations, readAccess, writeAccess, name, matchRule); >+ super(FIELD_PATTERN, name, limitTo, matchRule); > > this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification); > this.declaringSimpleName = this.isCaseSensitive ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >@@ -57,18 +55,16 @@ > * Instantiate a field pattern with additional information for generic search > */ > public FieldPattern( >- boolean findDeclarations, >- boolean readAccess, >- boolean writeAccess, > char[] name, > char[] declaringQualification, > char[] declaringSimpleName, > char[] typeQualification, > char[] typeSimpleName, > String typeSignature, >+ int limitTo, > int matchRule) { > >- this(findDeclarations, readAccess, writeAccess, name, declaringQualification, declaringSimpleName, typeQualification, typeSimpleName, matchRule); >+ this(name, declaringQualification, declaringSimpleName, typeQualification, typeSimpleName, limitTo, matchRule); > > // store type signatures and arguments > if (typeSignature != null) { >@@ -80,13 +76,13 @@ > this.name = key; > } > public SearchPattern getBlankPattern() { >- return new FieldPattern(false, false, false, null, null, null, null, null, R_EXACT_MATCH | R_CASE_SENSITIVE); >+ return new FieldPattern(null, null, null, null, null, 0, R_EXACT_MATCH | R_CASE_SENSITIVE); > } > public char[] getIndexKey() { > return this.name; > } > public char[][] getIndexCategories() { >- if (this.findReferences) >+ if (this.findReferences || this.fineGrain != 0) > return this.findDeclarations || this.writeAccess ? REF_AND_DECL_CATEGORIES : REF_CATEGORIES; > if (this.findDeclarations) > return DECL_CATEGORIES; >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java,v >retrieving revision 1.77 >diff -u -r1.77 MatchLocatorParser.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java 21 Nov 2007 11:20:37 -0000 1.77 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java 27 Nov 2007 15:09:20 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core.search.matching; > >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.ast.*; > import org.eclipse.jdt.internal.compiler.lookup.*; >@@ -21,13 +22,28 @@ > */ > public class MatchLocatorParser extends Parser { > >-MatchingNodeSet nodeSet; >-PatternLocator patternLocator; >-private ASTVisitor localDeclarationVisitor; >+ static final int UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK = >+ IJavaSearchConstants.CAST_TYPE_REFERENCE | >+ IJavaSearchConstants.QUALIFIED_REFERENCE | >+ IJavaSearchConstants.IMPLICIT_THIS_REFERENCE | >+ IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE | >+ IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ static final int FORMAL_PARAMETER_FINE_GRAIN_MASK = >+ IJavaSearchConstants.PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE | >+ IJavaSearchConstants.CATCH_TYPE_REFERENCE; >+ static final int GENERIC_FINE_GRAIN_MASK = >+ IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE | >+ IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE | >+ IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ MatchingNodeSet nodeSet; >+ PatternLocator patternLocator; >+ private ASTVisitor localDeclarationVisitor; >+ int typeRefFineGrain; > > public static MatchLocatorParser createParser(ProblemReporter problemReporter, MatchLocator locator) { >- if ((locator.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0) >+ if ((locator.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0) { > return new ImportMatchLocatorParser(problemReporter, locator); >+ } > return new MatchLocatorParser(problemReporter, locator); > } > >@@ -60,7 +76,10 @@ > return (constructorDeclaration.bits & ASTNode.HasLocalType) != 0; // continue only if it has local type > } > public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) { >- patternLocator.match(fieldDeclaration, nodeSet); >+ int patternFineGrain = patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.FIELD_TYPE_DECLARATION_TYPE_REFERENCE) != 0) { >+ patternLocator.match(fieldDeclaration, nodeSet); >+ } > return (fieldDeclaration.bits & ASTNode.HasLocalType) != 0; // continue only if it has local type; > } > public boolean visit(Initializer initializer, MethodScope scope) { >@@ -183,6 +202,12 @@ > super.classInstanceCreation(alwaysQualified); > this.patternLocator.match(this.expressionStack[this.expressionPtr], this.nodeSet); > } >+protected void consumeAnnotationAsModifier() { >+ super.consumeAnnotationAsModifier(); >+} >+protected void consumeAnnotationName() { >+ super.consumeAnnotationName(); >+} > protected void consumeAssignment() { > super.consumeAssignment(); > this.patternLocator.match(this.expressionStack[this.expressionPtr], this.nodeSet); >@@ -206,15 +231,20 @@ > protected void consumeFieldAccess(boolean isSuperAccess) { > super.consumeFieldAccess(isSuperAccess); > >- // this is always a Reference >- this.patternLocator.match((Reference) this.expressionStack[this.expressionPtr], this.nodeSet); >+ int fineGrain = isSuperAccess ? IJavaSearchConstants.SUPER_REFERENCE : IJavaSearchConstants.THIS_REFERENCE; >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & fineGrain) != 0) { >+ // this is always a Reference >+ this.patternLocator.match((Reference) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeFormalParameter(boolean isVarArgs) { >+ this.typeRefFineGrain |= FORMAL_PARAMETER_FINE_GRAIN_MASK; > super.consumeFormalParameter(isVarArgs); >- >- // this is always a LocalDeclaration > this.patternLocator.match((LocalDeclaration) this.astStack[this.astPtr], this.nodeSet); >+ this.typeRefFineGrain &= ~FORMAL_PARAMETER_FINE_GRAIN_MASK; > } >+ > protected void consumeLocalVariableDeclaration() { > super.consumeLocalVariableDeclaration(); > >@@ -223,57 +253,83 @@ > } > protected void consumeMarkerAnnotation() { > super.consumeMarkerAnnotation(); >- // this is always an Annotation >- Annotation annotation = (Annotation) expressionStack[expressionPtr]; >- this.patternLocator.match(annotation, nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) { >+ // this is always an Annotation >+ Annotation annotation = (Annotation) expressionStack[expressionPtr]; >+ this.patternLocator.match(annotation, nodeSet); >+ } > } > protected void consumeMemberValuePair() { >+// this.validFineGrain |= IJavaSearchConstants.MEMBER_PAIR_VALUE_REFERENCE; > super.consumeMemberValuePair(); > > // this is always a MemberValuePair > this.patternLocator.match((MemberValuePair) this.astStack[this.astPtr], this.nodeSet); >+// this.validFineGrain &= ~IJavaSearchConstants.MEMBER_PAIR_VALUE_REFERENCE; > } > protected void consumeMethodInvocationName() { > super.consumeMethodInvocationName(); >- >- // this is always a MessageSend >- this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & (IJavaSearchConstants.IMPLICIT_THIS_REFERENCE | IJavaSearchConstants.QUALIFIED_REFERENCE)) != 0) { >+ // this is always a MessageSend >+ this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeMethodInvocationNameWithTypeArguments() { > super.consumeMethodInvocationNameWithTypeArguments(); > >- // this is always a MessageSend >- this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & (IJavaSearchConstants.IMPLICIT_THIS_REFERENCE | IJavaSearchConstants.QUALIFIED_REFERENCE)) != 0) { >+ // this is always a MessageSend >+ this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeMethodInvocationPrimary() { > super.consumeMethodInvocationPrimary(); > >- // this is always a MessageSend >- this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.THIS_REFERENCE) != 0) { >+ // this is always a MessageSend >+ this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeMethodInvocationPrimaryWithTypeArguments() { > super.consumeMethodInvocationPrimaryWithTypeArguments(); > >- // this is always a MessageSend >- this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.THIS_REFERENCE) != 0) { >+ // this is always a MessageSend >+ this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeMethodInvocationSuper() { > super.consumeMethodInvocationSuper(); > >- // this is always a MessageSend >- this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.SUPER_REFERENCE) != 0) { >+ // this is always a MessageSend >+ this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeMethodInvocationSuperWithTypeArguments() { > super.consumeMethodInvocationSuperWithTypeArguments(); > >- // this is always a MessageSend >- this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.SUPER_REFERENCE) != 0) { >+ // this is always a MessageSend >+ this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet); >+ } > } > protected void consumeNormalAnnotation() { > super.consumeNormalAnnotation(); >- // this is always an Annotation >- Annotation annotation = (Annotation) expressionStack[expressionPtr]; >- this.patternLocator.match(annotation, nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) { >+ // this is always an Annotation >+ Annotation annotation = (Annotation) expressionStack[expressionPtr]; >+ this.patternLocator.match(annotation, nodeSet); >+ } > } > protected void consumePrimaryNoNewArray() { > // pop parenthesis positions (and don't update expression positions >@@ -297,8 +353,22 @@ > this.patternLocator.match(annotation, nodeSet); > } > protected void consumeTypeArgument() { >+ this.typeRefFineGrain |= IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE; > super.consumeTypeArgument(); > patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE; >+} >+protected void consumeTypeArgumentReferenceType1() { >+ this.typeRefFineGrain |= IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE; >+ super.consumeTypeArgumentReferenceType1(); >+ patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE; >+} >+protected void consumeTypeArgumentReferenceType2() { >+ this.typeRefFineGrain |= IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE; >+ super.consumeTypeArgumentReferenceType2(); >+ patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE; > } > protected void consumeTypeParameterHeader() { > super.consumeTypeParameterHeader(); >@@ -318,17 +388,26 @@ > } > protected TypeReference getTypeReference(int dim) { > TypeReference typeRef = super.getTypeReference(dim); >- this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (this.typeRefFineGrain & patternFineGrain) != 0) { >+ this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere >+ } > return typeRef; > } > protected NameReference getUnspecifiedReference() { > NameReference nameRef = super.getUnspecifiedReference(); >- this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK) != 0) { >+ this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere >+ } > return nameRef; > } > protected NameReference getUnspecifiedReferenceOptimized() { > NameReference nameRef = super.getUnspecifiedReferenceOptimized(); >- this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK) != 0) { >+ this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere >+ } > return nameRef; > } > /** >@@ -390,5 +469,139 @@ > } > } > } >+ >+protected void consumeClassHeaderExtends() { >+ this.typeRefFineGrain |= IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE; >+ super.consumeClassHeaderExtends(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE; >+} >+ >+protected void consumeInterfaceType() { >+ this.typeRefFineGrain |= IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE; >+ super.consumeInterfaceType(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE; >+} >+ >+protected void consumeClassTypeElt() { >+ this.typeRefFineGrain |= IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE; >+ super.consumeClassTypeElt(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE; >+} >+ >+protected void consumeClassInstanceCreationExpression() { >+ this.typeRefFineGrain |= IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE; >+ super.consumeClassInstanceCreationExpression(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE; >+} >+ >+protected void consumeMethodHeaderName(boolean isAnnotationMethod) { >+ this.typeRefFineGrain |= IJavaSearchConstants.RETURN_TYPE_REFERENCE; >+ super.consumeMethodHeaderName(isAnnotationMethod); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.RETURN_TYPE_REFERENCE; >+} >+ >+protected void consumeEnterVariable() { >+ int grain = IJavaSearchConstants.FIELD_TYPE_DECLARATION_TYPE_REFERENCE | IJavaSearchConstants.LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE; >+ this.typeRefFineGrain |= grain; >+ super.consumeEnterVariable(); >+ this.typeRefFineGrain &= ~grain; >+} >+ >+protected void consumeAllocationHeader() { >+ this.typeRefFineGrain |= IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE; >+ super.consumeAllocationHeader(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE; >+} >+ >+protected void consumeStatementCatch() { >+ this.typeRefFineGrain |= IJavaSearchConstants.CATCH_TYPE_REFERENCE; >+ super.consumeStatementCatch(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.CATCH_TYPE_REFERENCE; >+} >+ >+protected void consumeTypeParameterWithExtends() { >+ this.typeRefFineGrain |= IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE; >+ super.consumeTypeParameterWithExtends(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE; >+} >+ >+protected void consumeReferenceType1() { >+ this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK; >+ super.consumeReferenceType1(); >+ this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK; >+} >+ >+protected void consumeReferenceType2() { >+ this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK; >+ super.consumeReferenceType2(); >+ this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK; >+} >+ >+protected void consumeReferenceType3() { >+ this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK; >+ super.consumeReferenceType3(); >+ this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK; >+} >+ >+protected void consumeAdditionalBound() { >+ this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK; >+ super.consumeAdditionalBound(); >+ this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK; >+} >+ >+protected void consumeTypeParameter1WithExtendsAndBounds() { >+ this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK; >+ super.consumeTypeParameter1WithExtendsAndBounds(); >+ this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK; >+} >+ >+protected void consumeTypeParameterWithExtendsAndBounds() { >+ this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK; >+ super.consumeTypeParameterWithExtendsAndBounds(); >+ this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK; >+} >+ >+protected void consumeWildcardBoundsExtends() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBoundsExtends(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+ >+protected void consumeWildcardBoundsSuper() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBoundsSuper(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+protected void consumeWildcardBounds1Extends() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBounds1Extends(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+protected void consumeWildcardBounds1Super() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBounds1Super(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+protected void consumeWildcardBounds2Extends() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBounds2Extends(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+protected void consumeWildcardBounds2Super() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBounds2Super(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+protected void consumeWildcardBounds3Extends() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBounds3Extends(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+protected void consumeWildcardBounds3Super() { >+ this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+ super.consumeWildcardBounds3Super(); >+ this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE; >+} >+ > } > >Index: search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java,v >retrieving revision 1.39 >diff -u -r1.39 ConstructorPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java 15 Nov 2007 16:58:53 -0000 1.39 >+++ search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java 27 Nov 2007 15:09:19 -0000 >@@ -17,6 +17,7 @@ > import org.eclipse.jdt.core.IMethod; > import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.core.search.SearchPattern; > import org.eclipse.jdt.internal.core.index.EntryResult; > import org.eclipse.jdt.internal.core.index.Index; >@@ -24,8 +25,8 @@ > > public class ConstructorPattern extends JavaSearchPattern { > >-protected boolean findDeclarations; >-protected boolean findReferences; >+protected boolean findDeclarations = true; >+protected boolean findReferences = true; > > public char[] declaringQualification; > public char[] declaringSimpleName; >@@ -45,6 +46,12 @@ > protected static char[][] REF_AND_DECL_CATEGORIES = { CONSTRUCTOR_REF, CONSTRUCTOR_DECL }; > protected static char[][] DECL_CATEGORIES = { CONSTRUCTOR_DECL }; > >+public final static int FINE_GRAIN_MASK = >+ IJavaSearchConstants.SUPER_REFERENCE | >+ IJavaSearchConstants.QUALIFIED_REFERENCE | >+ IJavaSearchConstants.THIS_REFERENCE | >+ IJavaSearchConstants.IMPLICIT_THIS_REFERENCE; >+ > /** > * Constructor entries are encoded as TypeName '/' Arity: > * e.g. 'X/0' >@@ -60,18 +67,30 @@ > super(CONSTRUCTOR_PATTERN, matchRule); > } > public ConstructorPattern( >- boolean findDeclarations, >- boolean findReferences, > char[] declaringSimpleName, > char[] declaringQualification, > char[][] parameterQualifications, > char[][] parameterSimpleNames, >+ int limitTo, > int matchRule) { > > this(matchRule); > >- this.findDeclarations = findDeclarations; >- this.findReferences = findReferences; >+ this.fineGrain = limitTo & FINE_GRAIN_MASK; >+ if (this.fineGrain == 0) { >+ switch (limitTo) { >+ case IJavaSearchConstants.DECLARATIONS : >+ this.findReferences = false; >+ break; >+ case IJavaSearchConstants.REFERENCES : >+ this.findDeclarations = false; >+ break; >+ case IJavaSearchConstants.ALL_OCCURRENCES : >+ break; >+ } >+ } else { >+ this.findDeclarations = false; >+ } > > this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification); > this.declaringSimpleName = (this.isCaseSensitive || this.isCamelCase) ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName); >@@ -99,23 +118,20 @@ > * Instanciate a method pattern with signatures for generics search > */ > public ConstructorPattern( >- boolean findDeclarations, >- boolean findReferences, > char[] declaringSimpleName, > char[] declaringQualification, > char[][] parameterQualifications, > char[][] parameterSimpleNames, > String[] parameterSignatures, > IMethod method, >-// boolean varargs, >+ int limitTo, > int matchRule) { > >- this(findDeclarations, >- findReferences, >- declaringSimpleName, >+ this(declaringSimpleName, > declaringQualification, > parameterQualifications, > parameterSimpleNames, >+ limitTo, > matchRule); > > // Set flags >@@ -164,8 +180,6 @@ > * Instanciate a method pattern with signatures for generics search > */ > public ConstructorPattern( >- boolean findDeclarations, >- boolean findReferences, > char[] declaringSimpleName, > char[] declaringQualification, > String declaringSignature, >@@ -173,14 +187,14 @@ > char[][] parameterSimpleNames, > String[] parameterSignatures, > char[][] arguments, >+ int limitTo, > int matchRule) { > >- this(findDeclarations, >- findReferences, >- declaringSimpleName, >+ this(declaringSimpleName, > declaringQualification, > parameterQualifications, > parameterSimpleNames, >+ limitTo, > matchRule); > > // Store type signature and arguments for declaring type >Index: search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java,v >retrieving revision 1.62 >diff -u -r1.62 MethodPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java 15 Nov 2007 16:58:53 -0000 1.62 >+++ search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java 27 Nov 2007 15:09:20 -0000 >@@ -14,14 +14,15 @@ > > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.core.search.SearchPattern; > import org.eclipse.jdt.internal.core.index.*; > import org.eclipse.jdt.internal.core.util.Util; > > public class MethodPattern extends JavaSearchPattern { > >-protected boolean findDeclarations; >-protected boolean findReferences; >+protected boolean findDeclarations = true; >+protected boolean findReferences = true; > > public char[] selector; > >@@ -51,6 +52,12 @@ > protected static char[][] REF_AND_DECL_CATEGORIES = { METHOD_REF, METHOD_DECL }; > protected static char[][] DECL_CATEGORIES = { METHOD_DECL }; > >+public final static int FINE_GRAIN_MASK = >+ IJavaSearchConstants.SUPER_REFERENCE | >+ IJavaSearchConstants.QUALIFIED_REFERENCE | >+ IJavaSearchConstants.THIS_REFERENCE | >+ IJavaSearchConstants.IMPLICIT_THIS_REFERENCE; >+ > /** > * Method entries are encoded as selector '/' Arity: > * e.g. 'foo/0' >@@ -66,8 +73,6 @@ > super(METHOD_PATTERN, matchRule); > } > public MethodPattern( >- boolean findDeclarations, >- boolean findReferences, > char[] selector, > char[] declaringQualification, > char[] declaringSimpleName, >@@ -76,12 +81,26 @@ > char[][] parameterQualifications, > char[][] parameterSimpleNames, > IType declaringType, >+ int limitTo, > int matchRule) { > > this(matchRule); > >- this.findDeclarations = findDeclarations; >- this.findReferences = findReferences; >+ this.fineGrain = limitTo & FINE_GRAIN_MASK; >+ if (this.fineGrain == 0) { >+ switch (limitTo) { >+ case IJavaSearchConstants.DECLARATIONS : >+ this.findReferences = false; >+ break; >+ case IJavaSearchConstants.REFERENCES : >+ this.findDeclarations = false; >+ break; >+ case IJavaSearchConstants.ALL_OCCURRENCES : >+ break; >+ } >+ } else { >+ this.findDeclarations = false; >+ } > > this.selector = (this.isCaseSensitive || this.isCamelCase) ? selector : CharOperation.toLowerCase(selector); > this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification); >@@ -106,8 +125,6 @@ > * Instanciate a method pattern with signatures for generics search > */ > public MethodPattern( >- boolean findDeclarations, >- boolean findReferences, > char[] selector, > char[] declaringQualification, > char[] declaringSimpleName, >@@ -118,11 +135,10 @@ > char[][] parameterSimpleNames, > String[] parameterSignatures, > IMethod method, >+ int limitTo, > int matchRule) { > >- this(findDeclarations, >- findReferences, >- selector, >+ this(selector, > declaringQualification, > declaringSimpleName, > returnQualification, >@@ -130,6 +146,7 @@ > parameterQualifications, > parameterSimpleNames, > method.getDeclaringType(), >+ limitTo, > matchRule); > > // Set flags >@@ -184,8 +201,6 @@ > * Instanciate a method pattern with signatures for generics search > */ > public MethodPattern( >- boolean findDeclarations, >- boolean findReferences, > char[] selector, > char[] declaringQualification, > char[] declaringSimpleName, >@@ -197,11 +212,10 @@ > char[][] parameterSimpleNames, > String[] parameterSignatures, > char[][] arguments, >+ int limitTo, > int matchRule) { > >- this(findDeclarations, >- findReferences, >- selector, >+ this(selector, > declaringQualification, > declaringSimpleName, > returnQualification, >@@ -209,6 +223,7 @@ > parameterQualifications, > parameterSimpleNames, > null, >+ limitTo, > matchRule); > > // Store type signature and arguments for declaring type >Index: search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.java,v >retrieving revision 1.24 >diff -u -r1.24 DeclarationOfReferencedMethodsPattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.java 10 May 2006 18:03:43 -0000 1.24 >+++ search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.java 27 Nov 2007 15:09:19 -0000 >@@ -13,6 +13,7 @@ > //import java.util.HashSet; > > import org.eclipse.jdt.core.IJavaElement; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.internal.compiler.util.SimpleSet; > > public class DeclarationOfReferencedMethodsPattern extends MethodPattern { >@@ -21,7 +22,7 @@ > protected SimpleSet knownMethods; > > public DeclarationOfReferencedMethodsPattern(IJavaElement enclosingElement) { >- super(false, true, null, null, null, null, null, null, null, null, R_PATTERN_MATCH); >+ super(null, null, null, null, null, null, null, null, IJavaSearchConstants.REFERENCES, R_PATTERN_MATCH); > > this.enclosingElement = enclosingElement; > this.knownMethods = new SimpleSet(); >Index: search/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.java,v >retrieving revision 1.2 >diff -u -r1.2 ImportMatchLocatorParser.java >--- search/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.java 30 Sep 2005 13:19:40 -0000 1.2 >+++ search/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.java 27 Nov 2007 15:09:19 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core.search.matching; > >+import org.eclipse.jdt.core.search.IJavaSearchConstants; > import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; > > class ImportMatchLocatorParser extends MatchLocatorParser { >@@ -19,19 +20,31 @@ > } > protected void consumeStaticImportOnDemandDeclarationName() { > super.consumeStaticImportOnDemandDeclarationName(); >- this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) { >+ this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ } > } > protected void consumeSingleStaticImportDeclarationName() { > super.consumeSingleStaticImportDeclarationName(); >- this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) { >+ this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ } > } > protected void consumeSingleTypeImportDeclarationName() { > super.consumeSingleTypeImportDeclarationName(); >- this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) { >+ this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ } > } > protected void consumeTypeImportOnDemandDeclarationName() { > super.consumeTypeImportOnDemandDeclarationName(); >- this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ int patternFineGrain = this.patternLocator.fineGrain(); >+ if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) { >+ this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet); >+ } > } > > } >Index: search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java,v >retrieving revision 1.23 >diff -u -r1.23 LocalVariablePattern.java >--- search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java 6 Mar 2007 02:38:49 -0000 1.23 >+++ search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java 27 Nov 2007 15:09:19 -0000 >@@ -27,8 +27,8 @@ > > LocalVariable localVariable; > >-public LocalVariablePattern(boolean findDeclarations, boolean readAccess, boolean writeAccess, LocalVariable localVariable, int matchRule) { >- super(LOCAL_VAR_PATTERN, findDeclarations, readAccess, writeAccess, localVariable.getElementName().toCharArray(), matchRule); >+public LocalVariablePattern(LocalVariable localVariable, int limitTo, int matchRule) { >+ super(LOCAL_VAR_PATTERN, localVariable.getElementName().toCharArray(), limitTo, matchRule); > this.localVariable = localVariable; > } > public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) { >Index: model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java,v >retrieving revision 1.17 >diff -u -r1.17 SourceElementRequestorAdapter.java >--- model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java 22 Nov 2007 11:51:58 -0000 1.17 >+++ model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java 27 Nov 2007 15:09:17 -0000 >@@ -17,6 +17,23 @@ > public class SourceElementRequestorAdapter implements ISourceElementRequestor { > > /** >+ * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[][], int, int) >+ */ >+ public void acceptAnnotationTypeReference( >+ char[][] typeName, >+ int sourceStart, >+ int sourceEnd) { >+ // default implementation: do nothing >+ } >+ >+ /** >+ * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[], int) >+ */ >+ public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) { >+ // default implementation: do nothing >+ } >+ >+ /** > * @see ISourceElementRequestor#acceptConstructorReference(char[], int, int) > */ > public void acceptConstructorReference( >Index: model/org/eclipse/jdt/internal/compiler/SourceElementParser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java,v >retrieving revision 1.78 >diff -u -r1.78 SourceElementParser.java >--- model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 22 Nov 2007 11:51:58 -0000 1.78 >+++ model/org/eclipse/jdt/internal/compiler/SourceElementParser.java 27 Nov 2007 15:09:17 -0000 >@@ -263,7 +263,7 @@ > super.consumeAnnotationAsModifier(); > Annotation annotation = (Annotation)expressionStack[expressionPtr]; > if (reportReferenceInfo) { // accept annotation type reference >- this.requestor.acceptTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd); >+ this.requestor.acceptAnnotationTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd); > } > } > protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() { >@@ -424,7 +424,7 @@ > super.consumeMarkerAnnotation(); > Annotation annotation = (Annotation)expressionStack[expressionPtr]; > if (reportReferenceInfo) { // accept annotation type reference >- this.requestor.acceptTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd); >+ this.requestor.acceptAnnotationTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd); > } > } > protected void consumeMethodHeaderName(boolean isAnnotationMethod) { >@@ -541,7 +541,7 @@ > super.consumeNormalAnnotation(); > Annotation annotation = (Annotation)expressionStack[expressionPtr]; > if (reportReferenceInfo) { // accept annotation type reference >- this.requestor.acceptTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd); >+ this.requestor.acceptAnnotationTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd); > } > } > protected void consumeSingleMemberAnnotation() { >Index: model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java,v >retrieving revision 1.19 >diff -u -r1.19 ISourceElementRequestor.java >--- model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java 22 Nov 2007 11:51:58 -0000 1.19 >+++ model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java 27 Nov 2007 15:09:17 -0000 >@@ -92,6 +92,10 @@ > public char[][] categories; > public Annotation[] annotations; > } >+ >+ void acceptAnnotationTypeReference(char[][] annotation, int sourceStart, int sourceEnd); >+ >+ void acceptAnnotationTypeReference(char[] annotation, int sourcePosition); > > void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition); > >Index: search/org/eclipse/jdt/core/search/SearchPattern.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchPattern.java,v >retrieving revision 1.73 >diff -u -r1.73 SearchPattern.java >--- search/org/eclipse/jdt/core/search/SearchPattern.java 2 Oct 2007 17:12:01 -0000 1.73 >+++ search/org/eclipse/jdt/core/search/SearchPattern.java 27 Nov 2007 15:09:17 -0000 >@@ -857,6 +857,7 @@ > typeSimpleName = null; > } > // Create field pattern >+ /* > boolean findDeclarations = false; > boolean readAccess = false; > boolean writeAccess = false; >@@ -890,6 +891,15 @@ > typeQualification, > typeSimpleName, > matchRule); >+ */ >+ return new FieldPattern( >+ fieldNameChars, >+ declaringTypeQualification, >+ declaringTypeSimpleName, >+ typeQualification, >+ typeSimpleName, >+ limitTo, >+ matchRule); > } > > /** >@@ -1248,6 +1258,7 @@ > returnTypeSimpleName = null; > } > // Create method/constructor pattern >+ /* > boolean findDeclarations = true; > boolean findReferences = true; > switch (limitTo) { >@@ -1260,10 +1271,9 @@ > case IJavaSearchConstants.ALL_OCCURRENCES : > break; > } >+ */ > if (isConstructor) { > return new ConstructorPattern( >- findDeclarations, >- findReferences, > declaringTypeSimpleName, > declaringTypeQualification, > declaringTypeSignature, >@@ -1271,11 +1281,10 @@ > parameterTypeSimpleNames, > parameterTypeSignatures, > typeArguments, >+ limitTo, > matchRule); > } else { > return new MethodPattern( >- findDeclarations, >- findReferences, > selectorChars, > declaringTypeQualification, > declaringTypeSimpleName, >@@ -1287,6 +1296,7 @@ > parameterTypeSimpleNames, > parameterTypeSignatures, > typeArguments, >+ limitTo, > matchRule); > } > } >@@ -1612,6 +1622,7 @@ > } > } > // Create field pattern >+ /* > boolean findDeclarations = false; > boolean readAccess = false; > boolean writeAccess = false; >@@ -1647,6 +1658,17 @@ > typeSimpleName, > typeSignature, > matchRule); >+ */ >+ searchPattern = >+ new FieldPattern( >+ name, >+ declaringQualification, >+ declaringSimpleName, >+ typeQualification, >+ typeSimpleName, >+ typeSignature, >+ limitTo, >+ matchRule); > break; > case IJavaElement.IMPORT_DECLARATION : > String elementName = element.getElementName(); >@@ -1669,6 +1691,7 @@ > break; > case IJavaElement.LOCAL_VARIABLE : > LocalVariable localVar = (LocalVariable) element; >+ /* > boolean findVarDeclarations = false; > boolean findVarReadAccess = false; > boolean findVarWriteAccess = false; >@@ -1699,6 +1722,8 @@ > findVarWriteAccess, > localVar, > matchRule); >+ */ >+ searchPattern = new LocalVariablePattern(localVar, limitTo, matchRule); > break; > case IJavaElement.TYPE_PARAMETER: > ITypeParameter typeParam = (ITypeParameter) element; >@@ -1786,6 +1811,7 @@ > } > > // Create method/constructor pattern >+ /* > boolean findMethodDeclarations = true; > boolean findMethodReferences = true; > switch (maskedLimitTo) { >@@ -1798,23 +1824,21 @@ > case IJavaSearchConstants.ALL_OCCURRENCES : > break; > } >+ */ > if (isConstructor) { > searchPattern = > new ConstructorPattern( >- findMethodDeclarations, >- findMethodReferences, > declaringSimpleName, > declaringQualification, > parameterQualifications, > parameterSimpleNames, > parameterSignatures, > method, >+ limitTo, > matchRule); > } else { > searchPattern = > new MethodPattern( >- findMethodDeclarations, >- findMethodReferences, > selector, > declaringQualification, > declaringSimpleName, >@@ -1825,6 +1849,7 @@ > parameterSimpleNames, > parameterSignatures, > method, >+ limitTo, > matchRule); > } > break; >@@ -1897,6 +1922,15 @@ > typeSignature, > matchRule) > ); >+ default: >+ if (type != null) { >+ return new TypeReferencePattern( >+ CharOperation.concatWith(packageName, enclosingTypeNames, '.'), >+ simpleName, >+ type, >+ limitTo, >+ matchRule); >+ } > } > return null; > } >@@ -2001,9 +2035,11 @@ > case IJavaSearchConstants.ALL_OCCURRENCES : > return new OrPattern( > new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, indexSuffix, matchRule),// cannot search for explicit member types >- new TypeReferencePattern(qualificationChars, typeChars, matchRule)); >+ new TypeReferencePattern(qualificationChars, typeChars, typeSignature, matchRule)); >+ default: >+ return new TypeReferencePattern(qualificationChars, typeChars, typeSignature, limitTo, matchRule); > } >- return null; >+// return null; > } > /** > * Returns the enclosing type names of the given type. >Index: search/org/eclipse/jdt/core/search/IJavaSearchConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchConstants.java,v >retrieving revision 1.27 >diff -u -r1.27 IJavaSearchConstants.java >--- search/org/eclipse/jdt/core/search/IJavaSearchConstants.java 21 Mar 2007 17:44:51 -0000 1.27 >+++ search/org/eclipse/jdt/core/search/IJavaSearchConstants.java 27 Nov 2007 15:09:17 -0000 >@@ -34,66 +34,88 @@ > /** > * The searched element is a type, which may include classes, interfaces, > * enums, and annotation types. >+ * >+ * @category searchFor > */ > int TYPE= 0; > > /** > * The searched element is a method. >+ * >+ * @category searchFor > */ > int METHOD= 1; > > /** > * The searched element is a package. >+ * >+ * @category searchFor > */ > int PACKAGE= 2; > > /** > * The searched element is a constructor. >+ * >+ * @category searchFor > */ > int CONSTRUCTOR= 3; > > /** > * The searched element is a field. >+ * >+ * @category searchFor > */ > int FIELD= 4; > > /** > * The searched element is a class. > * More selective than using {@link #TYPE}. >+ * >+ * @category searchFor > */ > int CLASS= 5; > > /** > * The searched element is an interface. > * More selective than using {@link #TYPE}. >+ * >+ * @category searchFor > */ > int INTERFACE= 6; > > /** > * The searched element is an enum. > * More selective than using {@link #TYPE}. >+ * > * @since 3.1 >+ * @category searchFor > */ > int ENUM= 7; > > /** > * The searched element is an annotation type. > * More selective than using {@link #TYPE}. >+ * > * @since 3.1 >+ * @category searchFor > */ > int ANNOTATION_TYPE= 8; > > /** > * The searched element is a class or enum type. > * More selective than using {@link #TYPE}. >+ * > * @since 3.1 >+ * @category searchFor > */ > int CLASS_AND_ENUM= 9; > > /** > * The searched element is a class or interface type. > * More selective than using {@link #TYPE}. >+ * > * @since 3.1 >+ * @category searchFor > */ > int CLASS_AND_INTERFACE= 10; > >@@ -101,6 +123,7 @@ > * The searched element is an interface or annotation type. > * More selective than using {@link #TYPE}. > * @since 3.3 >+ * @category searchFor > */ > int INTERFACE_AND_ANNOTATION= 11; > >@@ -110,6 +133,8 @@ > * The search result is a declaration. > * Can be used in conjunction with any of the nature of searched elements > * so as to better narrow down the search. >+ * >+ * @category limitTo > */ > int DECLARATIONS= 0; > >@@ -119,6 +144,8 @@ > * respectively search for any type implementing/extending a type, > * or rather exclusively search for classes implementing/extending the type, or > * interfaces extending the type. >+ * >+ * @category limitTo > */ > int IMPLEMENTORS= 1; > >@@ -128,6 +155,8 @@ > * so as to better narrow down the search. > * References can contain implementers since they are more generic kind > * of matches. >+ * >+ * @category limitTo > */ > int REFERENCES= 2; > >@@ -136,6 +165,8 @@ > * of an interface. > * Can be used in conjunction with any of the nature of searched elements > * so as to better narrow down the search. >+ * >+ * @category limitTo > */ > int ALL_OCCURRENCES= 3; > >@@ -145,6 +176,7 @@ > * as field read/write accesses: for example, x++; x+= 1; > * > * @since 2.0 >+ * @category limitTo > */ > int READ_ACCESSES = 4; > >@@ -154,45 +186,383 @@ > * as field read/write accesses: for example, x++; x+= 1; > * > * @since 2.0 >+ * @category limitTo > */ > int WRITE_ACCESSES = 5; > > /** > * Ignore declaring type while searching result. > * Can be used in conjunction with any of the nature of match. >+ * > * @since 3.1 >+ * @category limitTo > */ > int IGNORE_DECLARING_TYPE = 0x10; > > /** > * Ignore return type while searching result. >- * Can be used in conjunction with any of the nature of match. >+ * Can be used in conjunction with any other nature of match. > * Note that: > * <ul> > * <li>for fields search, pattern will ignore field type</li> > * <li>this flag will have no effect for types search</li> > * </ul> >+ * > * @since 3.1 >+ * @category limitTo > */ > int IGNORE_RETURN_TYPE = 0x20; > >+ /** >+ * Return only references to type used in field type declaration. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int FIELD_TYPE_DECLARATION_TYPE_REFERENCE = 0x40; >+ >+ /** >+ * Return only references to type used in local variable declaration. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE = 0x80; >+ >+ /** >+ * Return only references to type used in method parameter declaration. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE = 0x100; >+ >+ /** >+ * Return only references to type used as super type. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int SUPERTYPE_TYPE_REFERENCE = 0x200; >+ >+ /** >+ * Return only references to type used as super interface. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int SUPERINTERFACE_TYPE_REFERENCE = 0x400; >+ >+ /** >+ * Return only references to types used in throws clause. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int THROWS_CLAUSE_TYPE_REFERENCE = 0x800; >+ >+ /** >+ * Return only reference to types used in a cast expression. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int CAST_TYPE_REFERENCE = 0x1000; >+ >+ /** >+ * Return only reference to types used in a catch header. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int CATCH_TYPE_REFERENCE = 0x2000; >+ >+ /** >+ * Return only reference to types used in an allocation expression. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int ALLOCATION_EXPRESSION_TYPE_REFERENCE = 0x4000; >+ >+ /** >+ * Return only reference to types used as method return type. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int RETURN_TYPE_REFERENCE = 0x8000; >+ >+ /** >+ * Return only reference to types used in import declaration. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int IMPORT_DECLARATION_TYPE_REFERENCE = 0x10000; >+ >+ /** >+ * Return only reference to types used as annotation. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int ANNOTATION_TYPE_REFERENCE = 0x20000; >+ >+ /** >+ * Return only reference to types used as type variable bound. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int TYPE_VARIABLE_BOUND_TYPE_REFERENCE = 0x40000; >+ >+ /** >+ * Return only reference to types used as parameterized type. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int PARAMETERIZED_TYPE_REFERENCE = 0x80000; >+ >+ /** >+ * Return only reference to types used as wildcard bound. >+ * <p> >+ * When this flag is used, only {@link TypeReferenceMatch} matches will be >+ * returned. >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int WILDCARD_BOUND_TYPE_REFERENCE = 0x100000; >+ >+ /** >+ * Return only super field accesses or method invocations (e.g. using >+ * <code>super</code> qualifier). >+ * <p> >+ * When this flag is used, the kind of returned matches will depend on the >+ * specified nature of searched element: >+ * <ul> >+ * <li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches >+ * will be accepted,</li> >+ * <li>for {@link #METHOD} nature, only {@link MethodReferenceMatch} >+ * matches will be returned</li> >+ * </ul> >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int SUPER_REFERENCE = 0x1000000; >+ >+ /** >+ * Return only qualified field accesses or method invocations. >+ * <p> >+ * When this flag is used, the kind of returned matches will depend on the >+ * specified nature of searched element: >+ * <ul> >+ * <li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches >+ * will be accepted,</li> >+ * <li>for {@link #METHOD} nature, only {@link MethodReferenceMatch} >+ * matches will be returned</li> >+ * </ul> >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int QUALIFIED_REFERENCE = 0x2000000; >+ >+ /** >+ * Return only primary field accesses or method invocations (e.g. using >+ * <code>this</code> qualifier). >+ * <p> >+ * When this flag is used, the kind of returned matches will depend on the >+ * specified nature of searched element: >+ * <ul> >+ * <li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches >+ * will be accepted,</li> >+ * <li>for {@link #METHOD} nature, only {@link MethodReferenceMatch} >+ * matches will be returned</li> >+ * </ul> >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int THIS_REFERENCE = 0x4000000; >+ >+ /** >+ * Return only field accesses or method invocations without any qualification. >+ * <p> >+ * When this flag is used, the kind of returned matches will depend on the >+ * specified nature of searched element: >+ * <ul> >+ * <li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches >+ * will be accepted,</li> >+ * <li>for {@link #METHOD} nature, only {@link MethodReferenceMatch} >+ * matches will be returned</li> >+ * </ul> >+ *</p> >+ * @since 3.4 >+ * @category limitTo >+ */ >+ int IMPLICIT_THIS_REFERENCE = 0x8000000; >+// >+// /** >+// * Return only super field accesses (e.g. using <code>super</code> >+// * qualifier). >+// * <p> >+// * When this flag is used, only {@link FieldReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int SUPER_FIELD_REFERENCE = 0x1000000; >+// >+// /** >+// * Return only qualified field accesses. >+// * <p> >+// * When this flag is used, only {@link FieldReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int QUALIFIED_FIELD_REFERENCE = 0x2000000; >+// >+// /** >+// * Return only primary field accesses (e.g. using <code>this</code> >+// * qualifier). >+// * <p> >+// * When this flag is used, only {@link FieldReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int THIS_FIELD_REFERENCE = 0x4000000; >+// >+// /** >+// * Return only field accesses without any qualification. >+// * <p> >+// * When this flag is used, only {@link FieldReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int SIMPLE_FIELD_REFERENCE = 0x8000000; >+// >+// /** >+// * Return only super method invocations (e.g. using <code>super</code> >+// * qualifier). >+// * <p> >+// * When this flag is used, only {@link MethodReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int SUPER_METHOD_REFERENCE = 0x10000000; >+// >+// /** >+// * Return only qualified method invocations. >+// * <p> >+// * When this flag is used, only {@link MethodReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int QUALIFIED_METHOD_REFERENCE = 0x20000000; >+// >+// /** >+// * Return only primary method invocations (e.g. using <code>this</code> >+// * qualifier). >+// * <p> >+// * When this flag is used, only {@link MethodReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int THIS_METHOD_REFERENCE = 0x40000000; >+// >+// /** >+// * Return only method invocations without any qualification. >+// * <p> >+// * When this flag is used, only {@link MethodReferenceMatch type reference >+// * matches} will be returned. >+// *</p> >+// * @since 3.4 >+// * @category limitTo >+// */ >+// int SIMPLE_METHOD_REFERENCE = 0x80000000; >+ > /* Syntactic match modes */ > > /** > * The search pattern matches exactly the search result, > * that is, the source of the search result equals the search pattern. >+ * > * @deprecated Use {@link SearchPattern#R_EXACT_MATCH} instead. >+ * @category matchRule > */ > int EXACT_MATCH = 0; > /** > * The search pattern is a prefix of the search result. >+ * > * @deprecated Use {@link SearchPattern#R_PREFIX_MATCH} instead. >+ * @category matchRule > */ > int PREFIX_MATCH = 1; > /** > * The search pattern contains one or more wild cards ('*') where a > * wild-card can replace 0 or more characters in the search result. >+ * > * @deprecated Use {@link SearchPattern#R_PATTERN_MATCH} instead. >+ * @category matchRule > */ > int PATTERN_MATCH = 2; > >@@ -202,14 +572,18 @@ > /** > * The search pattern matches the search result only > * if cases are the same. >+ * > * @deprecated Use the methods that take the matchMode > * with {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead. >+ * @category matchRule > */ > boolean CASE_SENSITIVE = true; > /** > * The search pattern ignores cases in the search result. >+ * > * @deprecated Use the methods that take the matchMode > * without {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead. >+ * @category matchRule > */ > boolean CASE_INSENSITIVE = false; > >Index: search/org/eclipse/jdt/internal/core/index/DiskIndex.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/DiskIndex.java,v >retrieving revision 1.65 >diff -u -r1.65 DiskIndex.java >--- search/org/eclipse/jdt/internal/core/index/DiskIndex.java 16 Aug 2007 10:42:20 -0000 1.65 >+++ search/org/eclipse/jdt/internal/core/index/DiskIndex.java 27 Nov 2007 15:09:18 -0000 >@@ -46,7 +46,7 @@ > private int streamEnd; // used when writing data from the streamBuffer to the file > char separator = Index.DEFAULT_SEPARATOR; > >-public static final String SIGNATURE= "INDEX VERSION 1.124"; //$NON-NLS-1$ >+public static final String SIGNATURE= "INDEX VERSION 1.125.3"; //$NON-NLS-1$ > private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray(); > public static boolean DEBUG = false; > >Index: search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java,v >retrieving revision 1.38 >diff -u -r1.38 AbstractIndexer.java >--- search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java 6 Mar 2007 02:38:49 -0000 1.38 >+++ search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java 27 Nov 2007 15:09:18 -0000 >@@ -31,7 +31,10 @@ > SUPER_REF, > SuperTypeReferencePattern.createIndexKey( > modifiers, packageName, name, enclosingTypeNames, null, ANNOTATION_TYPE_SUFFIX, CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_ANNOTATION, '.'), ANNOTATION_TYPE_SUFFIX)); >- } >+ } >+ public void addAnnotationTypeReference(char[] typeName) { >+ addIndexEntry(ANNOTATION_REF, CharOperation.lastSegment(typeName, '.')); >+ } > public void addClassDeclaration( > int modifiers, > char[] packageName, >Index: search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java,v >retrieving revision 1.65 >diff -u -r1.65 BinaryIndexer.java >--- search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java 15 Oct 2007 17:20:14 -0000 1.65 >+++ search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java 27 Nov 2007 15:09:18 -0000 >@@ -47,33 +47,33 @@ > private void addBinaryStandardAnnotations(long annotationTagBits) { > if ((annotationTagBits & TagBits.AnnotationTargetMASK) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > addBinaryTargetAnnotation(annotationTagBits); > } > if ((annotationTagBits & TagBits.AnnotationRetentionMASK) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_RETENTION; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > addBinaryRetentionAnnotation(annotationTagBits); > } > if ((annotationTagBits & TagBits.AnnotationDeprecated) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_DEPRECATED; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > } > if ((annotationTagBits & TagBits.AnnotationDocumented) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > } > if ((annotationTagBits & TagBits.AnnotationInherited) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_INHERITED; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > } > if ((annotationTagBits & TagBits.AnnotationOverride) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_OVERRIDE; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > } > if ((annotationTagBits & TagBits.AnnotationSuppressWarnings) != 0) { > char[][] compoundName = TypeConstants.JAVA_LANG_SUPPRESSWARNINGS; >- addTypeReference(compoundName[compoundName.length-1]); >+ addAnnotationTypeReference(compoundName[compoundName.length-1]); > } > } > private void addBinaryTargetAnnotation(long bits) { >@@ -147,7 +147,7 @@ > } > } > private void addBinaryAnnotation(IBinaryAnnotation annotation) { >- addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName()))); >+ addAnnotationTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName()))); > IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs(); > if (valuePairs != null) { > for (int j=0, vpLength=valuePairs.length; j<vpLength; j++) { >Index: search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java,v >retrieving revision 1.44 >diff -u -r1.44 SourceIndexerRequestor.java >--- search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java 22 Nov 2007 11:51:58 -0000 1.44 >+++ search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java 27 Nov 2007 15:09:18 -0000 >@@ -21,7 +21,7 @@ > > /** > * This class is used by the JavaParserIndexer. When parsing the java file, the requestor >- * recognises the java elements (methods, fields, ...) and add them to an index. >+ * recognizes the java elements (methods, fields, ...) and add them to an index. > */ > public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants { > SourceIndexer indexer; >@@ -35,6 +35,21 @@ > this.indexer = indexer; > } > /** >+ * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[][], int, int) >+ */ >+public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) { >+ int length = typeName.length; >+ for (int i = 0; i < length - 1; i++) >+ acceptUnknownReference(typeName[i], 0); >+ acceptAnnotationTypeReference(typeName[length - 1], 0); >+} >+/** >+ * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[], int) >+ */ >+public void acceptAnnotationTypeReference(char[] simpleTypeName, int sourcePosition) { >+ this.indexer.addAnnotationTypeReference(simpleTypeName); >+} >+/** > * @see ISourceElementRequestor#acceptConstructorReference(char[], int, int) > */ > public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) { >Index: search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java,v >retrieving revision 1.34 >diff -u -r1.34 IIndexConstants.java >--- search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java 4 Jul 2007 13:59:58 -0000 1.34 >+++ search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java 27 Nov 2007 15:09:18 -0000 >@@ -16,6 +16,7 @@ > > /* index encoding */ > char[] REF= "ref".toCharArray(); //$NON-NLS-1$ >+ char[] ANNOTATION_REF= "annotationRef".toCharArray(); //$NON-NLS-1$ > char[] METHOD_REF= "methodRef".toCharArray(); //$NON-NLS-1$ > char[] CONSTRUCTOR_REF= "constructorRef".toCharArray(); //$NON-NLS-1$ > char[] SUPER_REF = "superRef".toCharArray(); //$NON-NLS-1$ >@@ -59,4 +60,5 @@ > int LOCAL_VAR_PATTERN = 0x0200; > int TYPE_PARAM_PATTERN = 0x0400; > int AND_PATTERN = 0x0800; >+ int ANNOT_REF_PATTERN = 0x1000; > } >Index: model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java,v >retrieving revision 1.12 >diff -u -r1.12 ReferenceInfoAdapter.java >--- model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java 10 May 2006 18:03:49 -0000 1.12 >+++ model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java 27 Nov 2007 15:09:17 -0000 >@@ -18,6 +18,18 @@ > /** > * Does nothing. > */ >+public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) { >+ // Does nothing >+} >+/** >+ * Does nothing. >+ */ >+public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) { >+ // Does nothing >+} >+/** >+ * Does nothing. >+ */ > public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) { > // Does nothing > } >Index: search/org/eclipse/jdt/internal/core/search/matching/FineGrainVisitor.java >=================================================================== >RCS file: search/org/eclipse/jdt/internal/core/search/matching/FineGrainVisitor.java >diff -N search/org/eclipse/jdt/internal/core/search/matching/FineGrainVisitor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ search/org/eclipse/jdt/internal/core/search/matching/FineGrainVisitor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,718 @@ >+package org.eclipse.jdt.internal.core.search.matching; >+ >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.jdt.core.*; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; >+import org.eclipse.jdt.internal.compiler.ASTVisitor; >+import org.eclipse.jdt.internal.compiler.ast.*; >+import org.eclipse.jdt.internal.compiler.lookup.*; >+ >+/** >+ * An ast visitor that visits.... >+ */ >+class FineGrainVisitor extends ASTVisitor implements IJavaSearchConstants { >+ >+ final static int FINE_GRAIN_MASK = >+ MatchLocatorParser.UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK | >+ MatchLocatorParser.FORMAL_PARAMETER_FINE_GRAIN_MASK | >+ MatchLocatorParser.GENERIC_FINE_GRAIN_MASK | >+ ALLOCATION_EXPRESSION_TYPE_REFERENCE | >+ FIELD_TYPE_DECLARATION_TYPE_REFERENCE | >+ LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE | >+ IMPORT_DECLARATION_TYPE_REFERENCE | >+ THROWS_CLAUSE_TYPE_REFERENCE | >+ RETURN_TYPE_REFERENCE; >+ >+ final MatchLocator matchLocator; >+ >+ IJavaElement element; >+ Binding binding; >+ MatchingNodeSet nodeSet; >+ ASTNode[] matchingNodes; >+ PatternLocator locator; >+ int length; >+ final int fineGrain; >+ boolean completed = false; >+ >+ int parameterizedTypeRef = 0; >+ int wildcardTypeRef = 0; >+ >+FineGrainVisitor(IJavaElement enclosingElement, Binding binding, MatchingNodeSet set, ASTNode[] nodes, PatternLocator patternLocator, MatchLocator matchLocator) { >+ this.matchLocator = matchLocator; >+ this.element = enclosingElement; >+ this.binding = binding; >+ this.nodeSet = set; >+ this.matchingNodes = nodes; >+ this.locator = patternLocator; >+ this.length = nodes.length; >+ this.fineGrain = patternLocator.fineGrain(); >+} >+ >+protected void report(ASTNode node, Scope scope) { >+ for (int i = 0; i < this.length; i++) { >+ if (this.matchingNodes[i] == node) { >+ Integer level = (Integer) this.nodeSet.matchingNodes.removeKey(node); >+ if (level != null) { >+ try { >+ this.locator.matchReportReference(node, this.element, this.binding, scope, level.intValue(), this.matchLocator); >+ } catch (CoreException e) { >+ // skip >+ } >+ this.completed = this.nodeSet.matchingNodes.elementSize == 0; >+ } >+ return; >+ } >+ } >+} >+ >+public boolean visit(AllocationExpression allocationExpression, BlockScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & ALLOCATION_EXPRESSION_TYPE_REFERENCE) != 0) { >+ report(allocationExpression.type, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(CastExpression castExpression, BlockScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & CAST_TYPE_REFERENCE) != 0) { >+ if (castExpression.type instanceof TypeReference) { >+ report(castExpression.type, scope); >+ } >+ else if (castExpression.type instanceof NameReference) { >+ report(castExpression.type, scope); >+ } >+ } >+ return !this.completed; >+} >+ >+public boolean visit(ImportReference importRef, CompilationUnitScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & IMPORT_DECLARATION_TYPE_REFERENCE) != 0) { >+ report(importRef, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE) != 0) { >+ report(localDeclaration.type, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(SingleNameReference singleNameReference, BlockScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & IMPLICIT_THIS_REFERENCE) != 0) { >+ report(singleNameReference, scope); >+ } >+ return !completed; >+} >+ >+public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE) != 0) { >+ Argument[] arguments = methodDeclaration.arguments; >+ if (arguments != null) { >+ int argLength = arguments.length; >+ for (int i=0; i<argLength; i++) { >+ report(arguments[i].type, scope); >+ } >+ } >+ } >+ if ((this.fineGrain & THROWS_CLAUSE_TYPE_REFERENCE) != 0) { >+ TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions; >+ if (thrownExceptions != null) { >+ int thrownLength = thrownExceptions.length; >+ for (int i=0; i<thrownLength; i++) { >+ report(thrownExceptions[i], scope); >+ if (this.completed) return false; >+ } >+ } >+ } >+ if ((this.fineGrain & RETURN_TYPE_REFERENCE) != 0) { >+ report(methodDeclaration.returnType, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE) != 0) { >+ Argument[] arguments = constructorDeclaration.arguments; >+ if (arguments != null) { >+ int argLength = arguments.length; >+ for (int i=0; i<argLength; i++) { >+ report(arguments[i].type, scope); >+ if (this.completed) return false; >+ } >+ } >+ } >+ if ((this.fineGrain & THROWS_CLAUSE_TYPE_REFERENCE) != 0) { >+ TypeReference[] thrownExceptions = constructorDeclaration.thrownExceptions; >+ if (thrownExceptions != null) { >+ int thrownLength = thrownExceptions.length; >+ for (int i=0; i<thrownLength; i++) { >+ report(thrownExceptions[i], scope); >+ if (this.completed) return false; >+ } >+ } >+ } >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedNameReference qualifiedNameReference, BlockScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & QUALIFIED_REFERENCE) != 0) { >+ report(qualifiedNameReference, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(MessageSend messageSend, BlockScope scope) { >+ if (this.completed) return false; >+ if (messageSend.isSuperAccess()) { >+ if ((this.fineGrain & SUPER_REFERENCE) != 0) { >+ report(messageSend, scope); >+ } >+ } else if (messageSend.receiver.isImplicitThis()) { >+ if ((this.fineGrain & IMPLICIT_THIS_REFERENCE) != 0) { >+ report(messageSend, scope); >+ } >+ } else if (messageSend.receiver.isThis()) { >+ if ((this.fineGrain & THIS_REFERENCE) != 0) { >+ report(messageSend, scope); >+ } >+ } else { >+ if ((this.fineGrain & QUALIFIED_REFERENCE) != 0) { >+ report(messageSend, scope); >+ } >+ } >+ if (messageSend.typeArguments != null && messageSend.typeArguments.length > 0) { >+ this.parameterizedTypeRef++; >+ } >+ return !this.completed; >+} >+ >+public void endVisit(MessageSend messageSend, BlockScope scope) { >+ if (messageSend.typeArguments != null && messageSend.typeArguments.length > 0) { >+ this.parameterizedTypeRef--; >+ } >+ super.endVisit(messageSend, scope); >+} >+ >+public boolean visit(TryStatement tryStatement, BlockScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & CATCH_TYPE_REFERENCE) != 0) { >+ Argument[] catchArguments = tryStatement.catchArguments; >+ if (catchArguments != null) { >+ int argLength = catchArguments.length; >+ for (int i=0; i<argLength; i++) { >+ report(catchArguments[i].type, scope); >+ if (this.completed) return false; >+ } >+ } >+ } >+ return !this.completed; >+} >+ >+public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) { >+ if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) { >+ report(parameterizedQualifiedTypeReference, scope); >+ } >+ this.parameterizedTypeRef++; >+ return !this.completed; >+} >+ >+public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) { >+ if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) { >+ report(parameterizedQualifiedTypeReference, scope); >+ } >+ this.parameterizedTypeRef++; >+ return !this.completed; >+} >+ >+public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) { >+ if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) { >+ report(parameterizedSingleTypeReference, scope); >+ } >+ this.parameterizedTypeRef++; >+ return !this.completed; >+} >+ >+public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) { >+ if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) { >+ report(parameterizedSingleTypeReference, scope); >+ } >+ this.parameterizedTypeRef++; >+ return !this.completed; >+} >+ >+public void endVisit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) { >+ this.parameterizedTypeRef--; >+} >+ >+public void endVisit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) { >+ this.parameterizedTypeRef--; >+} >+ >+public void endVisit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) { >+ this.parameterizedTypeRef--; >+} >+ >+public void endVisit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) { >+ this.parameterizedTypeRef--; >+} >+ >+public boolean visit(SingleTypeReference singleTypeReference, BlockScope scope) { >+ if (((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0 && this.parameterizedTypeRef > 0 && this.wildcardTypeRef == 0) || >+ ((this.fineGrain & WILDCARD_BOUND_TYPE_REFERENCE) != 0 && this.wildcardTypeRef > 0)) { >+ report(singleTypeReference, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(Wildcard wildcard, BlockScope scope) { >+ this.wildcardTypeRef++; >+ return !this.completed; >+} >+ >+public boolean visit(Wildcard wildcard, ClassScope scope) { >+ this.wildcardTypeRef++; >+ return !this.completed; >+} >+ >+public void endVisit(Wildcard wildcard, BlockScope scope) { >+ this.wildcardTypeRef--; >+} >+ >+public void endVisit(Wildcard wildcard, ClassScope scope) { >+ this.wildcardTypeRef--; >+} >+ >+public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) { >+ if (this.completed) return false; >+ if ((this.fineGrain & FIELD_TYPE_DECLARATION_TYPE_REFERENCE) != 0) { >+ report(fieldDeclaration.type, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(FieldReference fieldReference, BlockScope scope) { >+ if (fieldReference.isSuperAccess() && (this.fineGrain & SUPER_REFERENCE) != 0) { >+ report(fieldReference, scope); >+ } >+ else if (fieldReference.receiver.isThis() && (this.fineGrain & THIS_REFERENCE) != 0) { >+ report(fieldReference, scope); >+ } >+ // Qualified and Implicit This reference are not field reference AST node >+ // They are respectively caught in visit(QualifiedNameReference) and visit(SingleNameReference) methods >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope) { >+ if (((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0 && this.parameterizedTypeRef > 0 && this.wildcardTypeRef == 0) || >+ ((this.fineGrain & WILDCARD_BOUND_TYPE_REFERENCE) != 0 && this.wildcardTypeRef > 0)) { >+ report(qualifiedTypeReference, scope); >+ } >+ return !this.completed; >+} >+ >+public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(AnnotationMethodDeclaration annotationTypeDeclaration, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Argument argument, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Argument argument, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayAllocationExpression arrayAllocationExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayReference arrayReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(AssertStatement assertStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Assignment assignment, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(BinaryExpression binaryExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Block block, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(BreakStatement breakStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(CaseStatement caseStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(CharLiteral charLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Clinit clinit, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(CompilationUnitDeclaration compilationUnitDeclaration, CompilationUnitScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ConditionalExpression conditionalExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ContinueStatement continueStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(DoStatement doStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(EmptyStatement emptyStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(EqualExpression equalExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ExtendedStringLiteral extendedStringLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(FalseLiteral falseLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(FieldReference fieldReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(FloatLiteral floatLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ForeachStatement forStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ForStatement forStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(IfStatement ifStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Initializer initializer, MethodScope methodScope) { >+ return !this.completed; >+} >+ >+public boolean visit(InstanceOfExpression instanceOfExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(IntLiteral intLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Javadoc javadoc, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(Javadoc javadoc, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocAllocationExpression expression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocAllocationExpression expression, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocArgumentExpression expression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocArgumentExpression expression, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocArrayQualifiedTypeReference typeRef, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocArraySingleTypeReference typeRef, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocArraySingleTypeReference typeRef, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocFieldReference fieldRef, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocFieldReference fieldRef, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocImplicitTypeReference implicitTypeReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocImplicitTypeReference implicitTypeReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocMessageSend messageSend, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocMessageSend messageSend, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocQualifiedTypeReference typeRef, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocQualifiedTypeReference typeRef, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocReturnStatement statement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocReturnStatement statement, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocSingleNameReference argument, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocSingleNameReference argument, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(JavadocSingleTypeReference typeRef, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(LabeledStatement labeledStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(LongLiteral longLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(MarkerAnnotation annotation, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(MemberValuePair pair, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(NormalAnnotation annotation, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(NullLiteral nullLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(PostfixExpression postfixExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(PrefixExpression prefixExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedAllocationExpression qualifiedAllocationExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedNameReference qualifiedNameReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedSuperReference qualifiedSuperReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedSuperReference qualifiedSuperReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedThisReference qualifiedThisReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedThisReference qualifiedThisReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ReturnStatement returnStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(SingleNameReference singleNameReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(SingleTypeReference singleTypeReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(StringLiteral stringLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(StringLiteralConcatenation literal, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(SuperReference superReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(SwitchStatement switchStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(SynchronizedStatement synchronizedStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ThisReference thisReference, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ThisReference thisReference, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(ThrowStatement throwStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(TrueLiteral trueLiteral, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(TypeParameter typeParameter, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(TypeParameter typeParameter, ClassScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(UnaryExpression unaryExpression, BlockScope scope) { >+ return !this.completed; >+} >+ >+public boolean visit(WhileStatement whileStatement, BlockScope scope) { >+ return !this.completed; >+} >+ >+} >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java,v >retrieving revision 1.39 >diff -u -r1.39 SourceElementParserTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java 22 Nov 2007 11:51:54 -0000 1.39 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java 27 Nov 2007 15:09:24 -0000 >@@ -50,6 +50,14 @@ > return buildAllCompliancesTestSuite(SourceElementParserTest.class); > } > /** >+ * acceptAnnotationTypeReference method comment. >+ */ >+public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {} >+/** >+ * acceptAnnotationTypeReference method comment. >+ */ >+public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) {} >+/** > * acceptConstructorReference method comment. > */ > public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) { >Index: src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java,v >retrieving revision 1.20 >diff -u -r1.20 TestSourceElementRequestor.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java 22 Nov 2007 11:51:53 -0000 1.20 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java 27 Nov 2007 15:09:24 -0000 >@@ -23,6 +23,14 @@ > super(); > } > /** >+ * acceptAnnotationTypeReference method comment. >+ */ >+public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {} >+/** >+ * acceptAnnotationTypeReference method comment. >+ */ >+public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) {} >+/** > * acceptConstructorReference method comment. > */ > public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 155013
:
83867
|
83868
|
83882