View | Details | Raw Unified | Return to bug 155013 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java (-3 / +4 lines)
Lines 9216-9223 Link Here
9216
	this.resultCollector.showSelection = true;
9216
	this.resultCollector.showSelection = true;
9217
	search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector);
9217
	search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector);
9218
	assertSearchResults(
9218
	assertSearchResults(
9219
		"src/generics/Generic.java [import java.io.§|Serializable|§;] EXACT_MATCH\n" + 
9219
		"src/generics/Generic.java [import §|java.io.Serializable|§;] EXACT_MATCH\n" + 
9220
		"src/generics/Generic.java [import type.def.§|Types|§;] EXACT_MATCH\n" + 
9220
		"src/generics/Generic.java [import §|type.def.Types|§;] EXACT_MATCH\n" + 
9221
		"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" + 
9221
		"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" + 
9222
		"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" + 
9222
		"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" + 
9223
		"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" + 
9223
		"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" + 
Lines 9255-9262 Link Here
9255
	this.resultCollector.showSelection = true;
9255
	this.resultCollector.showSelection = true;
9256
	search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector);
9256
	search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope(), this.resultCollector);
9257
	assertSearchResults(
9257
	assertSearchResults(
9258
		"src/test/Ref.java [import pack.§|Test|§;] EXACT_MATCH\n" + 
9258
		"src/test/Ref.java [import §|pack.Test|§;] EXACT_MATCH\n" + 
9259
		"src/test/Ref.java test.Ref.test [	§|Test|§ test;] EXACT_MATCH"
9259
		"src/test/Ref.java test.Ref.test [	§|Test|§ test;] EXACT_MATCH"
9260
	);
9260
	);
9261
}
9261
}
9262
9262
}
9263
}
(-)src/org/eclipse/jdt/core/tests/model/RunJavaSearchTests.java (+3 lines)
Lines 23-28 Link Here
23
23
24
	public final static List TEST_CLASSES = new ArrayList();
24
	public final static List TEST_CLASSES = new ArrayList();
25
	static {
25
	static {
26
		// All test suites put in this list should use the same tests projects
27
		// (eg. JavaSearch and JavaSearch15)
26
		TEST_CLASSES.add(JavaSearchTests.class);
28
		TEST_CLASSES.add(JavaSearchTests.class);
27
		TEST_CLASSES.add(JavaSearchGenericTypeTests.class);
29
		TEST_CLASSES.add(JavaSearchGenericTypeTests.class);
28
		TEST_CLASSES.add(JavaSearchGenericTypeEquivalentTests.class);
30
		TEST_CLASSES.add(JavaSearchGenericTypeEquivalentTests.class);
Lines 36-41 Link Here
36
		TEST_CLASSES.add(JavaSearchGenericConstructorEquivalentTests.class);
38
		TEST_CLASSES.add(JavaSearchGenericConstructorEquivalentTests.class);
37
		TEST_CLASSES.add(WorkingCopySearchTests.class);
39
		TEST_CLASSES.add(WorkingCopySearchTests.class);
38
		TEST_CLASSES.add(JavaSearchJavadocTests.class);
40
		TEST_CLASSES.add(JavaSearchJavadocTests.class);
41
		TEST_CLASSES.add(JavaSearchFineGrainTests.class);
39
	}
42
	}
40
43
41
	public static Class[] getTestClasses() {
44
	public static Class[] getTestClasses() {
(-)src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java (+5 lines)
Lines 59-64 Link Here
59
		public boolean showPotential = true;
59
		public boolean showPotential = true;
60
		public boolean showProject;
60
		public boolean showProject;
61
		public boolean showSynthetic;
61
		public boolean showSynthetic;
62
		public boolean showOffset = false;
62
		public int showFlavors = 0;
63
		public int showFlavors = 0;
63
		public int count = 0;
64
		public int count = 0;
64
		List lines = new ArrayList();
65
		List lines = new ArrayList();
Lines 177-182 Link Here
177
								if (lineEnd == -1) lineEnd = contents.length;
178
								if (lineEnd == -1) lineEnd = contents.length;
178
								line.append(CharOperation.subarray(contents, end, lineEnd));
179
								line.append(CharOperation.subarray(contents, end, lineEnd));
179
							}
180
							}
181
							if (this.showOffset) {
182
								line.append('@');
183
								line.append(start);
184
							}
180
						} else {
185
						} else {
181
							line.append("No source");
186
							line.append("No source");
182
						}
187
						}
(-)src/org/eclipse/jdt/core/tests/model/JavaSearchFineGrainTests.java (+1628 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.model;
12
13
import junit.framework.Test;
14
15
import org.eclipse.core.runtime.*;
16
import org.eclipse.jdt.core.*;
17
import org.eclipse.jdt.core.search.IJavaSearchScope;
18
import org.eclipse.jdt.core.search.SearchEngine;
19
import org.eclipse.jdt.core.search.SearchPattern;
20
21
22
/**
23
 * Specific test suite for fine grained search.
24
 * 
25
 * @bug 155013: [search] [DCR] More finegrained options for Java search
26
 * @test Several tests sets trying to cover as many cases as possible.
27
 * <p>
28
 * Each set is organize the same way:
29
 * <ul>
30
 * 	<li>specific method defining the test case called by all the tests of the set,</li>
31
 * 	<li>first test performs a search request without any fine grain flag defined
32
 * 		to have a precise idea of what are the entire expected references,</li>
33
 * 	<li>second test performs a search request with all fine grain flags
34
 * 		defined to  verify that flags combination works well</li>
35
 * 	<li>each following test each defines one of the possible fine grain flag
36
 * 		to verify that it works properly with the given test case,</li>
37
 * </ul>
38
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=155013"
39
 */
40
public class JavaSearchFineGrainTests extends JavaSearchTests {
41
42
public JavaSearchFineGrainTests(String name) {
43
	super(name);
44
}
45
public static Test suite() {
46
	return buildModelTestSuite(JavaSearchFineGrainTests.class);
47
}
48
static {
49
//	org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true;
50
}
51
52
IJavaSearchScope getJavaSearchScope() {
53
	return super.getJavaSearchScope15();
54
}
55
public ICompilationUnit getWorkingCopy(String path, String source) throws JavaModelException {
56
	if (this.wcOwner == null) {
57
		this.wcOwner = new WorkingCopyOwner() {};
58
	}
59
	return getWorkingCopy(path, source, this.wcOwner);
60
}
61
62
protected void setUp () throws Exception {
63
	super.setUp();
64
	this.resultCollector = new JavaSearchResultCollector();
65
	resultCollector.showInsideDoc = false;
66
	resultCollector.showAccuracy = true;
67
	this.resultCollector.showSelection = true;
68
	this.resultCollector.showOffset = true;
69
}
70
71
static {
72
//	TESTS_PREFIX = "testMethodRef";
73
}
74
75
/*
76
 * References to a specific IField
77
 */
78
private final static int ALL_FIELD_METHOD_FINE_GRAIN_FLAGS =
79
	SUPER_REFERENCE |
80
	QUALIFIED_REFERENCE |
81
	THIS_REFERENCE |
82
	IMPLICIT_THIS_REFERENCE;
83
private IField setUpFieldRef() throws JavaModelException {
84
	final ProblemRequestor problemRequestor = new ProblemRequestor();
85
	this.wcOwner = new WorkingCopyOwner() {
86
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
87
			return problemRequestor;
88
		}
89
	};
90
	workingCopies = new ICompilationUnit[2];
91
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/field/def/Fields.java",
92
		"package field.def;\n" + 
93
		"public class Fields {\n" + 
94
		"	public Object field;\n" + 
95
		"}\n"
96
	);
97
	workingCopies[1] = getWorkingCopy("/JavaSearch15/src/field/ref/TestFields.java",
98
		"package field.ref;\n" + 
99
		"import field.def.Fields;\n" + 
100
		"public class TestFields extends Fields {\n" + 
101
		"	boolean foo(Fields param) {\n" + 
102
		"		return super.field == null ||\n" + 
103
		"			param.field == null ||\n" + 
104
		"			this.field == null ||\n" + 
105
		"			field == null;\n" + 
106
		"	}\n" + 
107
		"}\n"
108
	);
109
	assertEquals("CU Should not have any problem!",
110
		"----------\n" +
111
		"----------\n",
112
		problemRequestor.problems.toString()
113
	);
114
	this.resultCollector.showSelection = true;
115
	this.resultCollector.showOffset = true;
116
	return workingCopies[0].getType("Fields").getField("field");
117
}
118
public void testFieldRef() throws CoreException {
119
	search(setUpFieldRef(), REFERENCES);
120
	assertSearchResults(
121
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [		return super.§|field|§ == null ||@129] EXACT_MATCH\n" + 
122
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			param.§|field|§ == null ||@155] EXACT_MATCH\n" + 
123
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			this.§|field|§ == null ||@180] EXACT_MATCH\n" + 
124
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			§|field|§ == null;@200] EXACT_MATCH"
125
	);
126
}
127
public void testFieldRef_AllFlags() throws CoreException {
128
	search(setUpFieldRef(), ALL_FIELD_METHOD_FINE_GRAIN_FLAGS);
129
	assertSearchResults(
130
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [		return super.§|field|§ == null ||@129] EXACT_MATCH\n" + 
131
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			param.§|field|§ == null ||@155] EXACT_MATCH\n" + 
132
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			this.§|field|§ == null ||@180] EXACT_MATCH\n" + 
133
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			§|field|§ == null;@200] EXACT_MATCH"
134
	);
135
}
136
public void testFieldRef_Qualified() throws CoreException {
137
	search(setUpFieldRef(), QUALIFIED_REFERENCE);
138
	assertSearchResults(
139
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			param.§|field|§ == null ||@155] EXACT_MATCH"
140
	);
141
}
142
public void testFieldRef_Simple() throws CoreException {
143
	search(setUpFieldRef(), IMPLICIT_THIS_REFERENCE);
144
	assertSearchResults(
145
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			§|field|§ == null;@200] EXACT_MATCH"
146
	);
147
}
148
public void testFieldRef_Super() throws CoreException {
149
	search(setUpFieldRef(), SUPER_REFERENCE);
150
	assertSearchResults(
151
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [		return super.§|field|§ == null ||@129] EXACT_MATCH"
152
	);
153
}
154
public void testFieldRef_This() throws CoreException {
155
	search(setUpFieldRef(), THIS_REFERENCE);
156
	assertSearchResults(
157
		"src/field/ref/TestFields.java boolean field.ref.TestFields.foo(Fields) [			this.§|field|§ == null ||@180] EXACT_MATCH"
158
	);
159
}
160
161
/*
162
 * References to a specific IMethod
163
 */
164
private IMethod setUpMethodRef() throws JavaModelException {
165
	final ProblemRequestor problemRequestor = new ProblemRequestor();
166
	this.wcOwner = new WorkingCopyOwner() {
167
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
168
			return problemRequestor;
169
		}
170
	};
171
	workingCopies = new ICompilationUnit[2];
172
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/meth/def/Methods.java",
173
		"package meth.def;\n" + 
174
		"public class Methods {\n" + 
175
		"	public void method() {}\n" + 
176
		"}\n"
177
	);
178
	workingCopies[1] = getWorkingCopy("/JavaSearch15/src/meth/ref/TestMethods.java",
179
		"package meth.ref;\n" + 
180
		"import meth.def.Methods;\n" + 
181
		"public class TestMethods extends Methods {\n" + 
182
		"	void foo(Methods param) {\n" + 
183
		"		super.method();\n" + 
184
		"		param.method();\n" + 
185
		"		this.method();\n" + 
186
		"		method();\n" + 
187
		"	}\n" + 
188
		"}\n"
189
	);
190
	assertEquals("CU Should not have any problem!",
191
		"----------\n" +
192
		"----------\n",
193
		problemRequestor.problems.toString()
194
	);
195
	this.resultCollector.showSelection = true;
196
	this.resultCollector.showOffset = true;
197
	return workingCopies[0].getType("Methods").getMethod("method", new String[0]);
198
}
199
public void testMethodRef() throws CoreException {
200
	search(setUpMethodRef(), REFERENCES);
201
	assertSearchResults(
202
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		super.§|method()|§;@121] EXACT_MATCH\n" + 
203
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		param.§|method()|§;@139] EXACT_MATCH\n" + 
204
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		this.§|method()|§;@156] EXACT_MATCH\n" + 
205
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		§|method()|§;@168] EXACT_MATCH"
206
	);
207
}
208
public void testMethodRef_AllFlags() throws CoreException {
209
	search(setUpMethodRef(), ALL_FIELD_METHOD_FINE_GRAIN_FLAGS);
210
	assertSearchResults(
211
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		super.§|method()|§;@121] EXACT_MATCH\n" + 
212
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		param.§|method()|§;@139] EXACT_MATCH\n" + 
213
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		this.§|method()|§;@156] EXACT_MATCH\n" + 
214
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		§|method()|§;@168] EXACT_MATCH"
215
	);
216
}
217
public void testMethodRef_Qualified() throws CoreException {
218
	search(setUpMethodRef(), QUALIFIED_REFERENCE);
219
	assertSearchResults(
220
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		param.§|method()|§;@139] EXACT_MATCH"
221
	);
222
}
223
public void testMethodRef_Simple() throws CoreException {
224
	search(setUpMethodRef(), IMPLICIT_THIS_REFERENCE);
225
	assertSearchResults(
226
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		§|method()|§;@168] EXACT_MATCH"
227
	);
228
}
229
public void testMethodRef_Super() throws CoreException {
230
	search(setUpMethodRef(), SUPER_REFERENCE);
231
	assertSearchResults(
232
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		super.§|method()|§;@121] EXACT_MATCH"
233
	);
234
}
235
public void testMethodRef_This() throws CoreException {
236
	search(setUpMethodRef(), THIS_REFERENCE);
237
	assertSearchResults(
238
		"src/meth/ref/TestMethods.java void meth.ref.TestMethods.foo(Methods) [		this.§|method()|§;@156] EXACT_MATCH"
239
	);
240
}
241
242
private final static int ALL_TYPE_FINE_GRAIN_FLAGS =
243
	FIELD_TYPE_DECLARATION_TYPE_REFERENCE |
244
	LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE |
245
	PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE |
246
	SUPERTYPE_TYPE_REFERENCE |
247
	SUPERINTERFACE_TYPE_REFERENCE |
248
	THROWS_CLAUSE_TYPE_REFERENCE |
249
	CAST_TYPE_REFERENCE |
250
	CATCH_TYPE_REFERENCE |
251
	ALLOCATION_EXPRESSION_TYPE_REFERENCE |
252
	RETURN_TYPE_REFERENCE |
253
	IMPORT_DECLARATION_TYPE_REFERENCE |
254
	ANNOTATION_TYPE_REFERENCE |
255
	TYPE_VARIABLE_BOUND_TYPE_REFERENCE |
256
	PARAMETERIZED_TYPE_REFERENCE |
257
	WILDCARD_BOUND_TYPE_REFERENCE;
258
259
/*
260
 * References to a specific IType
261
 */
262
private IType setUpTypeRef(int typeIndex) throws JavaModelException {
263
	final ProblemRequestor problemRequestor = new ProblemRequestor();
264
	this.wcOwner = new WorkingCopyOwner() {
265
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
266
			return problemRequestor;
267
		}
268
	};
269
	workingCopies = new ICompilationUnit[3];
270
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java",
271
		"package type.def;\n" + 
272
		"@Bug\n" + 
273
		"@ATest\n" + 
274
		"public class Types extends Exception implements ITest1, ITest2 {\n" +
275
		"	ITest1 test1;\n" +
276
		"	ITest2 test2;\n" +
277
		"}\n" + 
278
		"@Bug\n" + 
279
		"interface ITest1 {}\n" + 
280
		"@ATest\n" + 
281
		"interface ITest2 extends ITest1 {}\n" + 
282
		"@Bug\n" + 
283
		"@ATest\n" + 
284
		"enum ETest {}\n" + 
285
		"@Bug\n" + 
286
		"@interface ATest {}\n"
287
	);
288
	workingCopies[1] = getWorkingCopy("/JavaSearch15/src/type/def/Bug.java",
289
		"package type.def;\n" + 
290
		"public @interface Bug {\n" + 
291
		"	int num() default 0;\n" + 
292
		"	String comment() default \"\";\n" + 
293
		"}\n"
294
	);
295
	workingCopies[2] = getWorkingCopy("/JavaSearch15/src/type/ref/TestTypes.java",
296
		"package type.ref;\n" + 
297
		"import type.def.Types;\n" + 
298
		"import type.def.Bug;\n" + 
299
		"\n" + 
300
		"@Bug(num=155013)\n" + 
301
		"public class TestTypes extends Types {\n" + 
302
		"	@Bug(comment=\"field\")\n" + 
303
		"	Types field;\n" + 
304
		"	@Bug(comment=\"method\", num=155013)\n" + 
305
		"	Types method(Types param) throws Types {\n" + 
306
		"		Object obj = new Types();\n" + 
307
		"		Types local = (Types) obj;\n" + 
308
		"		return local;\n" + 
309
		"	}\n" + 
310
		"	Bug bar(Bug bug) {\n" + 
311
		"		try {\n" + 
312
		"			method(this);\n" + 
313
		"		} catch (Types ex) {\n" + 
314
		"		}\n" +
315
		"		return bug;\n" + 
316
		"	}\n" + 
317
		"}\n"
318
	);
319
	assertEquals("CU Should not have any problem!",
320
		"----------\n" +
321
		"----------\n",
322
		problemRequestor.problems.toString()
323
	);
324
	ICompilationUnit cu = workingCopies[typeIndex];
325
	String cuName = cu.getElementName();
326
	return cu.getType(cuName.substring(0, cuName.indexOf('.')));
327
}
328
public void testTypeRef() throws CoreException {
329
	search(setUpTypeRef(0), REFERENCES);
330
	assertSearchResults(
331
		"src/type/ref/TestTypes.java [import §|type.def.Types|§;@25] EXACT_MATCH\n" + 
332
		"src/type/ref/TestTypes.java type.ref.TestTypes [public class TestTypes extends §|Types|§ {@111] EXACT_MATCH\n" + 
333
		"src/type/ref/TestTypes.java type.ref.TestTypes.field [	§|Types|§ field;@143] EXACT_MATCH\n" + 
334
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	§|Types|§ method(Types param) throws Types {@193] EXACT_MATCH\n" + 
335
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	Types method(§|Types|§ param) throws Types {@206] EXACT_MATCH\n" + 
336
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	Types method(Types param) throws §|Types|§ {@226] EXACT_MATCH\n" + 
337
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		Object obj = new §|Types|§();@253] EXACT_MATCH\n" + 
338
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		§|Types|§ local = (Types) obj;@264] EXACT_MATCH\n" + 
339
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		Types local = (§|Types|§) obj;@279] EXACT_MATCH\n" + 
340
		"src/type/ref/TestTypes.java Bug type.ref.TestTypes.bar(Bug) [		} catch (§|Types|§ ex) {@366] EXACT_MATCH"
341
	);
342
}
343
public void testTypeRef_AllFlags() throws CoreException {
344
	search(setUpTypeRef(0), ALL_TYPE_FINE_GRAIN_FLAGS);
345
	assertSearchResults(
346
		"src/type/ref/TestTypes.java [import §|type.def.Types|§;@25] EXACT_MATCH\n" + 
347
		"src/type/ref/TestTypes.java type.ref.TestTypes [public class TestTypes extends §|Types|§ {@111] EXACT_MATCH\n" + 
348
		"src/type/ref/TestTypes.java type.ref.TestTypes.field [	§|Types|§ field;@143] EXACT_MATCH\n" + 
349
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	Types method(§|Types|§ param) throws Types {@206] EXACT_MATCH\n" + 
350
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	Types method(Types param) throws §|Types|§ {@226] EXACT_MATCH\n" + 
351
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	§|Types|§ method(Types param) throws Types {@193] EXACT_MATCH\n" + 
352
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		Object obj = new §|Types|§();@253] EXACT_MATCH\n" + 
353
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		§|Types|§ local = (Types) obj;@264] EXACT_MATCH\n" + 
354
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		Types local = (§|Types|§) obj;@279] EXACT_MATCH\n" + 
355
		"src/type/ref/TestTypes.java Bug type.ref.TestTypes.bar(Bug) [		} catch (§|Types|§ ex) {@366] EXACT_MATCH"
356
	);
357
}
358
public void testTypeRef_Allocation() throws CoreException {
359
	search(setUpTypeRef(0), ALLOCATION_EXPRESSION_TYPE_REFERENCE);
360
	assertSearchResults(
361
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		Object obj = new §|Types|§();@253] EXACT_MATCH"
362
	);
363
}
364
public void testTypeRef_Annotation() throws CoreException {
365
	search(setUpTypeRef(1), ANNOTATION_TYPE_REFERENCE);
366
	assertSearchResults(
367
		"src/type/def/Types.java type.def.Types [@§|Bug|§@19] EXACT_MATCH\n" + 
368
		"src/type/def/Types.java type.def.ITest1 [@§|Bug|§@128] EXACT_MATCH\n" + 
369
		"src/type/def/Types.java type.def.ETest [@§|Bug|§@195] EXACT_MATCH\n" + 
370
		"src/type/def/Types.java type.def.ATest [@§|Bug|§@221] EXACT_MATCH\n" + 
371
		"src/type/ref/TestTypes.java type.ref.TestTypes [@§|Bug|§(num=155013)@64] EXACT_MATCH\n" + 
372
		"src/type/ref/TestTypes.java type.ref.TestTypes.field [	@§|Bug|§(comment=\"field\")@121] EXACT_MATCH\n" + 
373
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	@§|Bug|§(comment=\"method\", num=155013)@158] EXACT_MATCH"
374
	);
375
}
376
public void testTypeRef_Cast() throws CoreException {
377
	search(setUpTypeRef(0), CAST_TYPE_REFERENCE);
378
	assertSearchResults(
379
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		Types local = (§|Types|§) obj;@279] EXACT_MATCH"
380
	);
381
}
382
public void testTypeRef_Catch() throws CoreException {
383
	search(setUpTypeRef(0), CATCH_TYPE_REFERENCE);
384
	assertSearchResults(
385
		"src/type/ref/TestTypes.java Bug type.ref.TestTypes.bar(Bug) [		} catch (§|Types|§ ex) {@366] EXACT_MATCH"
386
	);
387
}
388
public void testTypeRef_Field() throws CoreException {
389
	search(setUpTypeRef(0), FIELD_TYPE_DECLARATION_TYPE_REFERENCE);
390
	assertSearchResults(
391
		"src/type/ref/TestTypes.java type.ref.TestTypes.field [	§|Types|§ field;@143] EXACT_MATCH"
392
	);
393
}
394
public void testTypeRef_Import() throws CoreException {
395
	search(setUpTypeRef(0), IMPORT_DECLARATION_TYPE_REFERENCE);
396
	assertSearchResults(
397
		"src/type/ref/TestTypes.java [import §|type.def.Types|§;@25] EXACT_MATCH"
398
	);
399
}
400
public void testTypeRef_MethodParameter() throws CoreException {
401
	search(setUpTypeRef(0), PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE);
402
	assertSearchResults(
403
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	Types method(§|Types|§ param) throws Types {@206] EXACT_MATCH"
404
	);
405
}
406
public void testTypeRef_Return() throws CoreException {
407
	search(setUpTypeRef(0), RETURN_TYPE_REFERENCE);
408
	assertSearchResults(
409
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	§|Types|§ method(Types param) throws Types {@193] EXACT_MATCH"
410
	);
411
}
412
public void testTypeRef_Superinterface() throws CoreException {
413
	IType type = setUpTypeRef(0);
414
	search(((ICompilationUnit) type.getParent()).getType("ITest1"), SUPERINTERFACE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
415
	assertSearchResults(
416
		"src/type/def/Types.java type.def.Types [public class Types extends Exception implements §|ITest1|§, ITest2 {@78] EXACT_MATCH\n" + 
417
		"src/type/def/Types.java type.def.ITest2 [interface ITest2 extends §|ITest1|§ {}@184] EXACT_MATCH"
418
	);
419
}
420
public void testTypeRef_Supertype() throws CoreException {
421
	search(setUpTypeRef(0), SUPERTYPE_TYPE_REFERENCE);
422
	assertSearchResults(
423
		"src/type/ref/TestTypes.java type.ref.TestTypes [public class TestTypes extends §|Types|§ {@111] EXACT_MATCH"
424
	);
425
}
426
public void testTypeRef_Throws() throws CoreException {
427
	search(setUpTypeRef(0), THROWS_CLAUSE_TYPE_REFERENCE);
428
	assertSearchResults(
429
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [	Types method(Types param) throws §|Types|§ {@226] EXACT_MATCH"
430
	);
431
}
432
public void testTypeRef_Variable() throws CoreException {
433
	search(setUpTypeRef(0), LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE);
434
	assertSearchResults(
435
		"src/type/ref/TestTypes.java Types type.ref.TestTypes.method(Types) [		§|Types|§ local = (Types) obj;@264] EXACT_MATCH"
436
	);
437
}
438
439
/*
440
 * References to a all types (using '*' string pattern)
441
 */
442
private void setUpTypeRefAll() throws JavaModelException {
443
	final ProblemRequestor problemRequestor = new ProblemRequestor();
444
	this.wcOwner = new WorkingCopyOwner() {
445
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
446
			return problemRequestor;
447
		}
448
	};
449
	workingCopies = new ICompilationUnit[3];
450
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java",
451
		"package type.def;\n" + 
452
		"@Bug\n" + 
453
		"@ATest\n" + 
454
		"public class Types extends Exception implements ITest1, ITest2 {\n" +
455
		"	ITest1 test1;\n" +
456
		"	ITest2 test2;\n" +
457
		"}\n" + 
458
		"@Bug\n" + 
459
		"interface ITest1 {}\n" + 
460
		"@ATest\n" + 
461
		"interface ITest2 extends ITest1 {}\n" + 
462
		"@Bug\n" + 
463
		"@ATest\n" + 
464
		"enum ETest {}\n" + 
465
		"@Bug\n" + 
466
		"@interface ATest {}\n"
467
	);
468
	workingCopies[1] = getWorkingCopy("/JavaSearch15/src/type/def/Bug.java",
469
		"package type.def;\n" + 
470
		"public @interface Bug {\n" + 
471
		"	int num() default 0;\n" + 
472
		"	String comment() default \"\";\n" + 
473
		"}\n"
474
	);
475
	workingCopies[2] = getWorkingCopy("/JavaSearch15/src/all/types/ref/TestTypes.java",
476
		"package all.types.ref;\n" + 
477
		"\n" + 
478
		"import type.def.Bug;\n" + 
479
		"import type.def.Types;\n" + 
480
		"\n" + 
481
		"@Bug(num=155013)\n" + 
482
		"public class TestTypes extends Types {\n" + 
483
		"	@Bug(comment=\"field\")\n" + 
484
		"	Types field = new Types(), local, other = new Types();\n" + 
485
		"	{\n" + 
486
		"		Object o;\n" + 
487
		"		Types t;\n" + 
488
		"		if (this.field == null) {\n" + 
489
		"			try {\n" + 
490
		"				t = new TestTypes();\n" + 
491
		"			} catch (RuntimeException e) {\n" + 
492
		"				t = new Types();\n" + 
493
		"			} \n" + 
494
		"		} else {\n" + 
495
		"			o = this.field;\n" + 
496
		"			t = (Types) o;\n" + 
497
		"		}\n" + 
498
		"		local = t;\n" + 
499
		"	};\n" + 
500
		"	@Bug(comment=\"method\", num=155013)\n" + 
501
		"	Types method(Types param) throws Types {\n" + 
502
		"		Object obj = new Types();\n" + 
503
		"		Types local = (Types) obj;\n" + 
504
		"		return local;\n" + 
505
		"	}\n" + 
506
		"	Bug bar(Bug bug) {\n" + 
507
		"		try {\n" + 
508
		"			method(this);\n" + 
509
		"		}\n" + 
510
		"		catch (Types ex) {}\n" + 
511
		"		catch (Exception ex) {}\n" + 
512
		"		return bug; \n" + 
513
		"	}\n" + 
514
		"	// Other types references\n" + 
515
		"	Object object;\n" + 
516
		"	String str;\n" + 
517
		"	TestTypes() throws Types, RuntimeException {\n" + 
518
		"		if (this.object instanceof String) {\n" + 
519
		"			this.str = (String) this.object;\n" + 
520
		"		} else {\n" + 
521
		"			this.str = new String();\n" + 
522
		"			this.object = new Object();\n" + 
523
		"		}\n" + 
524
		"	}\n" + 
525
		"}\n"
526
	);
527
	assertEquals("CU Should not have any problem!",
528
		"----------\n" +
529
		"----------\n",
530
		problemRequestor.problems.toString()
531
	);
532
	this.resultCollector.showSelection = true;
533
	this.resultCollector.showOffset = true;
534
}
535
public void testTypeRefAll_Allocation() throws CoreException {
536
	setUpTypeRefAll();
537
	search("*", TYPE, ALLOCATION_EXPRESSION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
538
	assertSearchResults(
539
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [	Types field = new §|Types|§(), local, other = new Types();@167] EXACT_MATCH\n" + 
540
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.other [	Types field = new Types(), local, other = new §|Types|§();@195] EXACT_MATCH\n" + 
541
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [				t = new §|TestTypes|§();@279] EXACT_MATCH\n" + 
542
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [				t = new §|Types|§();@338] EXACT_MATCH\n" + 
543
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [		Object obj = new §|Types|§();@519] EXACT_MATCH\n" + 
544
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [			this.str = new §|String|§();@897] EXACT_MATCH\n" + 
545
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [			this.object = new §|Object|§();@928] EXACT_MATCH"
546
	);
547
}
548
public void testTypeRefAll_Annotation() throws CoreException {
549
	setUpTypeRefAll();
550
	search("*", TYPE, ANNOTATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
551
	assertSearchResults(
552
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes [@§|Bug|§(num=155013)@70] EXACT_MATCH\n" + 
553
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [	@§|Bug|§(comment=\"field\")@127] EXACT_MATCH\n" + 
554
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [	@§|Bug|§(comment=\"method\", num=155013)@424] EXACT_MATCH\n" + 
555
		"src/type/def/Types.java type.def.Types [@§|Bug|§@19] EXACT_MATCH\n" + 
556
		"src/type/def/Types.java type.def.Types [@§|ATest|§@24] EXACT_MATCH\n" + 
557
		"src/type/def/Types.java type.def.ITest1 [@§|Bug|§@128] EXACT_MATCH\n" + 
558
		"src/type/def/Types.java type.def.ITest2 [@§|ATest|§@153] EXACT_MATCH\n" + 
559
		"src/type/def/Types.java type.def.ETest [@§|Bug|§@195] EXACT_MATCH\n" + 
560
		"src/type/def/Types.java type.def.ETest [@§|ATest|§@200] EXACT_MATCH\n" + 
561
		"src/type/def/Types.java type.def.ATest [@§|Bug|§@221] EXACT_MATCH"
562
	);
563
}
564
public void testTypeRefAll_Cast() throws CoreException {
565
	setUpTypeRefAll();
566
	search("*", TYPE, CAST_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
567
	assertSearchResults(
568
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [			t = (§|Types|§) o;@391] EXACT_MATCH\n" + 
569
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [		Types local = (§|Types|§) obj;@545] EXACT_MATCH\n" + 
570
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [			this.str = (§|String|§) this.object;@847] EXACT_MATCH"
571
	);
572
}
573
public void testTypeRefAll_Catch() throws CoreException {
574
	setUpTypeRefAll();
575
	search("*", TYPE, CATCH_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
576
	assertSearchResults(
577
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [			} catch (§|RuntimeException|§ e) {@304] EXACT_MATCH\n" + 
578
		"src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [		catch (§|Types|§ ex) {}@634] EXACT_MATCH\n" + 
579
		"src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [		catch (§|Exception|§ ex) {}@656] EXACT_MATCH"
580
	);
581
}
582
public void testTypeRefAll_Field() throws CoreException {
583
	setUpTypeRefAll();
584
	search("*", TYPE, FIELD_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
585
	assertSearchResults(
586
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [	§|Types|§ field = new Types(), local, other = new Types();@149] EXACT_MATCH\n" + 
587
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.object [	§|Object|§ object;@719] EXACT_MATCH\n" + 
588
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.str [	§|String|§ str;@735] EXACT_MATCH\n" + 
589
		"src/type/def/Types.java type.def.Types.test1 [	§|ITest1|§ test1;@96] EXACT_MATCH\n" + 
590
		"src/type/def/Types.java type.def.Types.test2 [	§|ITest2|§ test2;@111] EXACT_MATCH"
591
	);
592
}
593
public void testTypeRefAll_Import() throws CoreException {
594
	setUpTypeRefAll();
595
	search("*", TYPE, IMPORT_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
596
	assertSearchResults(
597
		"src/all/types/ref/TestTypes.java [import §|type.def.Bug|§;@31] EXACT_MATCH\n" + 
598
		"src/all/types/ref/TestTypes.java [import §|type.def.Types|§;@52] EXACT_MATCH"
599
	);
600
}
601
public void testTypeRefAll_MethodParameter() throws CoreException {
602
	setUpTypeRefAll();
603
	search("*", TYPE, PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
604
	assertSearchResults(
605
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [	Types method(§|Types|§ param) throws Types {@472] EXACT_MATCH\n" + 
606
		"src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [	Bug bar(§|Bug|§ bug) {@585] EXACT_MATCH"
607
	);
608
}
609
public void testTypeRefAll_Return() throws CoreException {
610
	setUpTypeRefAll();
611
	search("*", TYPE, RETURN_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
612
	assertSearchResults(
613
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [	§|Types|§ method(Types param) throws Types {@459] EXACT_MATCH\n" + 
614
		"src/all/types/ref/TestTypes.java Bug all.types.ref.TestTypes.bar(Bug) [	§|Bug|§ bar(Bug bug) {@577] EXACT_MATCH"
615
	);
616
}
617
public void testTypeRefAll_Superinterface() throws CoreException {
618
	setUpTypeRefAll();
619
	search("*", TYPE, SUPERINTERFACE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
620
	assertSearchResults(
621
		"src/type/def/Types.java type.def.Types [public class Types extends Exception implements §|ITest1|§, ITest2 {@78] EXACT_MATCH\n" + 
622
		"src/type/def/Types.java type.def.Types [public class Types extends Exception implements ITest1, §|ITest2|§ {@86] EXACT_MATCH\n" + 
623
		"src/type/def/Types.java type.def.ITest2 [interface ITest2 extends §|ITest1|§ {}@184] EXACT_MATCH"
624
	);
625
}
626
public void testTypeRefAll_Supertype() throws CoreException {
627
	setUpTypeRefAll();
628
	search("*", TYPE, SUPERTYPE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
629
	assertSearchResults(
630
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes [public class TestTypes extends §|Types|§ {@117] EXACT_MATCH\n" + 
631
		"src/type/def/Types.java type.def.Types [public class Types extends §|Exception|§ implements ITest1, ITest2 {@57] EXACT_MATCH"
632
	);
633
}
634
public void testTypeRefAll_Throws() throws CoreException {
635
	setUpTypeRefAll();
636
	search("*", TYPE, THROWS_CLAUSE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
637
	assertSearchResults(
638
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [	Types method(Types param) throws §|Types|§ {@492] EXACT_MATCH\n" + 
639
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [	TestTypes() throws §|Types|§, RuntimeException {@767] EXACT_MATCH\n" + 
640
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [	TestTypes() throws Types, §|RuntimeException|§ {@774] EXACT_MATCH"
641
	);
642
}
643
public void testTypeRefAll_Variable() throws CoreException {
644
	setUpTypeRefAll();
645
	search("*", TYPE, LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
646
	assertSearchResults(
647
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [		§|Object|§ o;@209] EXACT_MATCH\n" + 
648
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [		§|Types|§ t;@221] EXACT_MATCH\n" + 
649
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [		§|Object|§ obj = new Types();@502] EXACT_MATCH\n" + 
650
		"src/all/types/ref/TestTypes.java Types all.types.ref.TestTypes.method(Types) [		§|Types|§ local = (Types) obj;@530] EXACT_MATCH"
651
	);
652
}
653
654
private final static int ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS =
655
	TYPE_VARIABLE_BOUND_TYPE_REFERENCE |
656
	PARAMETERIZED_TYPE_REFERENCE |
657
	WILDCARD_BOUND_TYPE_REFERENCE;
658
659
/*
660
 * References to a specific generic IType and all types.
661
 */
662
private IType setUpTypeRefGeneric01() throws JavaModelException {
663
	final ProblemRequestor problemRequestor = new ProblemRequestor();
664
	this.wcOwner = new WorkingCopyOwner() {
665
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
666
			return problemRequestor;
667
		}
668
	};
669
	workingCopies = new ICompilationUnit[3];
670
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java",
671
		"package type.def;\n" + 
672
		"public class Types {}\n"
673
	);
674
	workingCopies[1] = getWorkingCopy("/JavaSearch15/src/test01/Generic.java",
675
		"package test01;\n" + 
676
		"import java.io.Serializable;\n" + 
677
		"import type.def.Types;\n" + 
678
		"public class Generic<T extends Types, U extends Types & Comparable<Types> & Serializable, V extends A<? super Types>> {\n" + 
679
		"	Generic<? extends Types, ?, ?> field;\n" + 
680
		"	Comparable<String> comp;\n" + 
681
		"	Class<? extends Exception> clazz;\n" + 
682
		"}\n" + 
683
		"class A<R> {}\n"
684
	);
685
	workingCopies[2] = getWorkingCopy("/JavaSearch15/src/test01/TestGeneric.java",
686
		"package test01;\n" + 
687
		"import java.io.Serializable;\n" + 
688
		"import type.def.Types;\n" + 
689
		"public class TestGeneric<T> extends Generic<Types, UClass, VClass> {\n" + 
690
		"	TestGeneric<Types> test;\n" + 
691
		"	TestGeneric<String> foo(TestGeneric<Types> param1, Comparable<String> param2) {\n" + 
692
		"		return  null;\n" + 
693
		"	}\n" + 
694
		"	Comparable<TestGeneric<Types>> bar() {\n" + 
695
		"		return null;\n" + 
696
		"	} \n" + 
697
		"}\n" + 
698
		"class UClass extends Types implements Comparable<Types>, Serializable {\n" + 
699
		"	private static final long serialVersionUID = 1L;\n" + 
700
		"	public int compareTo(Types o) {\n" + 
701
		"		return 0;\n" + 
702
		"	}\n" + 
703
		"}\n" + 
704
		"class VClass extends A<Types> {}\n"
705
	);
706
	assertEquals("CU Should not have any problem!",
707
		"----------\n" +
708
		"----------\n",
709
		problemRequestor.problems.toString()
710
	);
711
	this.resultCollector.showSelection = true;
712
	this.resultCollector.showOffset = true;
713
	return workingCopies[0].getType("Types");
714
}
715
public void testTypeRefGeneric01() throws CoreException {
716
	search(setUpTypeRefGeneric01(), REFERENCES);
717
	assertSearchResults(
718
		"src/test01/Generic.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + 
719
		"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" + 
720
		"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" + 
721
		"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" + 
722
		"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" + 
723
		"src/test01/Generic.java test01.Generic.field [	Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + 
724
		"src/test01/TestGeneric.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + 
725
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + 
726
		"src/test01/TestGeneric.java test01.TestGeneric.test [	TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + 
727
		"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" + 
728
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + 
729
		"src/test01/TestGeneric.java test01.UClass [class UClass extends §|Types|§ implements Comparable<Types>, Serializable {@345] EXACT_MATCH\n" + 
730
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + 
731
		"src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [	public int compareTo(§|Types|§ o) {@468] EXACT_MATCH\n" + 
732
		"src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH"
733
	);
734
}
735
public void testTypeRefGeneric01_AllFlags() throws CoreException {
736
	search(setUpTypeRefGeneric01(), ALL_TYPE_FINE_GRAIN_FLAGS);
737
	assertSearchResults(
738
		"src/test01/Generic.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + 
739
		"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" + 
740
		"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" + 
741
		"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" + 
742
		"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" + 
743
		"src/test01/Generic.java test01.Generic.field [	Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + 
744
		"src/test01/TestGeneric.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + 
745
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + 
746
		"src/test01/TestGeneric.java test01.TestGeneric.test [	TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + 
747
		"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" + 
748
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + 
749
		"src/test01/TestGeneric.java test01.UClass [class UClass extends §|Types|§ implements Comparable<Types>, Serializable {@345] EXACT_MATCH\n" + 
750
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + 
751
		"src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [	public int compareTo(§|Types|§ o) {@468] EXACT_MATCH\n" + 
752
		"src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH"
753
	);
754
}
755
public void testTypeRefGeneric01_Parameterized() throws CoreException {
756
	search(setUpTypeRefGeneric01(), PARAMETERIZED_TYPE_REFERENCE);
757
	assertSearchResults(
758
		"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" + 
759
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + 
760
		"src/test01/TestGeneric.java test01.TestGeneric.test [	TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + 
761
		"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" + 
762
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + 
763
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + 
764
		"src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH"
765
	);
766
}
767
public void testTypeRefGeneric01_TypeVariableBound() throws CoreException {
768
	search(setUpTypeRefGeneric01(), TYPE_VARIABLE_BOUND_TYPE_REFERENCE);
769
	assertSearchResults(
770
		"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" + 
771
		"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"
772
	);
773
}
774
public void testTypeRefGeneric01_WildcardBound() throws CoreException {
775
	search(setUpTypeRefGeneric01(), WILDCARD_BOUND_TYPE_REFERENCE);
776
	assertSearchResults(
777
		"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" + 
778
		"src/test01/Generic.java test01.Generic.field [	Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH"
779
	);
780
}
781
public void testTypeRefGenericAll01() throws CoreException {
782
	setUpTypeRefGeneric01();
783
	search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope());
784
	assertSearchResults(
785
		"src/test01/Generic.java [import §|java.io.Serializable|§;@23] EXACT_MATCH\n" + 
786
		"src/test01/Generic.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + 
787
		"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" + 
788
		"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" + 
789
		"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" + 
790
		"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" + 
791
		"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" + 
792
		"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" + 
793
		"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" + 
794
		"src/test01/Generic.java test01.Generic.field [	§|Generic|§<? extends Types, ?, ?> field;@189] EXACT_MATCH\n" + 
795
		"src/test01/Generic.java test01.Generic.field [	Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + 
796
		"src/test01/Generic.java test01.Generic.comp [	§|Comparable|§<String> comp;@228] EXACT_MATCH\n" + 
797
		"src/test01/Generic.java test01.Generic.comp [	Comparable<§|String|§> comp;@239] EXACT_MATCH\n" + 
798
		"src/test01/Generic.java test01.Generic.clazz [	§|Class|§<? extends Exception> clazz;@254] EXACT_MATCH\n" + 
799
		"src/test01/Generic.java test01.Generic.clazz [	Class<? extends §|Exception|§> clazz;@270] EXACT_MATCH\n" + 
800
		"src/test01/TestGeneric.java [import §|java.io.Serializable|§;@23] EXACT_MATCH\n" + 
801
		"src/test01/TestGeneric.java [import §|type.def.Types|§;@52] EXACT_MATCH\n" + 
802
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends §|Generic|§<Types, UClass, VClass> {@104] EXACT_MATCH\n" + 
803
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + 
804
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, §|UClass|§, VClass> {@119] EXACT_MATCH\n" + 
805
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, UClass, §|VClass|§> {@127] EXACT_MATCH\n" + 
806
		"src/test01/TestGeneric.java test01.TestGeneric.test [	§|TestGeneric|§<Types> test;@138] EXACT_MATCH\n" + 
807
		"src/test01/TestGeneric.java test01.TestGeneric.test [	TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + 
808
		"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" + 
809
		"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" + 
810
		"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" + 
811
		"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" + 
812
		"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" + 
813
		"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" + 
814
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	§|Comparable|§<TestGeneric<Types>> bar() {@264] EXACT_MATCH\n" + 
815
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<§|TestGeneric|§<Types>> bar() {@275] EXACT_MATCH\n" + 
816
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + 
817
		"src/test01/TestGeneric.java test01.UClass [class UClass extends §|Types|§ implements Comparable<Types>, Serializable {@345] EXACT_MATCH\n" + 
818
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements §|Comparable|§<Types>, Serializable {@362] EXACT_MATCH\n" + 
819
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + 
820
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<Types>, §|Serializable|§ {@381] EXACT_MATCH\n" + 
821
		"src/test01/TestGeneric.java test01.UClass.serialVersionUID [	private static final §|long|§ serialVersionUID = 1L;@418] EXACT_MATCH\n" + 
822
		"src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [	public §|int|§ compareTo(Types o) {@454] EXACT_MATCH\n" + 
823
		"src/test01/TestGeneric.java int test01.UClass.compareTo(Types) [	public int compareTo(§|Types|§ o) {@468] EXACT_MATCH\n" + 
824
		"src/test01/TestGeneric.java test01.VClass [class VClass extends §|A|§<Types> {}@517] EXACT_MATCH\n" + 
825
		"src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH"
826
	);
827
}
828
public void testTypeRefGenericAll01_AllGenericFlags() throws CoreException {
829
	setUpTypeRefGeneric01();
830
	search("*", TYPE, ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS, getJavaSearchWorkingCopiesScope());
831
	assertSearchResults(
832
		"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" + 
833
		"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" + 
834
		"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" + 
835
		"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" + 
836
		"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" + 
837
		"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" + 
838
		"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" + 
839
		"src/test01/Generic.java test01.Generic.field [	Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + 
840
		"src/test01/Generic.java test01.Generic.comp [	Comparable<§|String|§> comp;@239] EXACT_MATCH\n" + 
841
		"src/test01/Generic.java test01.Generic.clazz [	Class<? extends §|Exception|§> clazz;@270] EXACT_MATCH\n" + 
842
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + 
843
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, §|UClass|§, VClass> {@119] EXACT_MATCH\n" + 
844
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, UClass, §|VClass|§> {@127] EXACT_MATCH\n" + 
845
		"src/test01/TestGeneric.java test01.TestGeneric.test [	TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + 
846
		"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" + 
847
		"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" + 
848
		"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" + 
849
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<§|TestGeneric|§<Types>> bar() {@275] EXACT_MATCH\n" + 
850
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + 
851
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + 
852
		"src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH"
853
	);
854
}
855
public void testTypeRefGenericAll01_Parameterized() throws CoreException {
856
	setUpTypeRefGeneric01();
857
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
858
	assertSearchResults(
859
		"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" + 
860
		"src/test01/Generic.java test01.Generic.comp [	Comparable<§|String|§> comp;@239] EXACT_MATCH\n" + 
861
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<§|Types|§, UClass, VClass> {@112] EXACT_MATCH\n" + 
862
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, §|UClass|§, VClass> {@119] EXACT_MATCH\n" + 
863
		"src/test01/TestGeneric.java test01.TestGeneric [public class TestGeneric<T> extends Generic<Types, UClass, §|VClass|§> {@127] EXACT_MATCH\n" + 
864
		"src/test01/TestGeneric.java test01.TestGeneric.test [	TestGeneric<§|Types|§> test;@150] EXACT_MATCH\n" + 
865
		"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" + 
866
		"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" + 
867
		"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" + 
868
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<§|TestGeneric|§<Types>> bar() {@275] EXACT_MATCH\n" + 
869
		"src/test01/TestGeneric.java Comparable<TestGeneric<Types>> test01.TestGeneric.bar() [	Comparable<TestGeneric<§|Types|§>> bar() {@287] EXACT_MATCH\n" + 
870
		"src/test01/TestGeneric.java test01.UClass [class UClass extends Types implements Comparable<§|Types|§>, Serializable {@373] EXACT_MATCH\n" + 
871
		"src/test01/TestGeneric.java test01.VClass [class VClass extends A<§|Types|§> {}@519] EXACT_MATCH"
872
	);
873
}
874
public void testTypeRefGenericAll01_TypeVariableBound() throws CoreException {
875
	setUpTypeRefGeneric01();
876
	search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
877
	assertSearchResults(
878
		"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" + 
879
		"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" + 
880
		"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" + 
881
		"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" + 
882
		"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"
883
	);
884
}
885
public void testTypeRefGenericAll01_WildcardBound() throws CoreException {
886
	setUpTypeRefGeneric01();
887
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
888
	assertSearchResults(
889
		"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" + 
890
		"src/test01/Generic.java test01.Generic.field [	Generic<? extends §|Types|§, ?, ?> field;@207] EXACT_MATCH\n" + 
891
		"src/test01/Generic.java test01.Generic.clazz [	Class<? extends §|Exception|§> clazz;@270] EXACT_MATCH"
892
	);
893
}
894
/*
895
 * Same test than previous ones with another example
896
 */
897
private IType setUpTypeRefGeneric02() throws JavaModelException {
898
	final ProblemRequestor problemRequestor = new ProblemRequestor();
899
	this.wcOwner = new WorkingCopyOwner() {
900
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
901
			return problemRequestor;
902
		}
903
	};
904
	workingCopies = new ICompilationUnit[1];
905
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/test02/Test.java",
906
		"package test02;\n" + 
907
		"public class Test <T, U, V> {\n" + 
908
		"	Test<A, ? extends B, ? super C> field = new Test<A, Z<String>, X<String>> () {\n" + 
909
		"		X<String> x;\n" + 
910
		"		Test<A, B, C> t;\n" + 
911
		"		Test<X<Y<Z<String>>>, Y<Z<String>>, Z<String>> bar() {\n" + 
912
		"			return new Test<X<Y<Z<String>>>, Y<Z<String>>, Z<String>>();\n" + 
913
		"		}\n" + 
914
		"	};\n" + 
915
		"	Test<? super A, B, ? extends C> foo(Test<? extends A, ? super B, C> param) {\n" + 
916
		"		return null;\n" + 
917
		"	};\n" + 
918
		"}\n" + 
919
		"class A {}\n" + 
920
		"class B {}\n" + 
921
		"class C extends X<String> {}\n" + 
922
		"class X<R> {}\n" + 
923
		"class Y<S> extends A {}\n" + 
924
		"class Z<P> extends B {}\n" + 
925
		"\n"
926
	);
927
	assertEquals("CU Should not have any problem!",
928
		"----------\n" +
929
		"----------\n",
930
		problemRequestor.problems.toString()
931
	);
932
	this.resultCollector.showSelection = true;
933
	this.resultCollector.showOffset = true;
934
	return workingCopies[0].getType("Types");
935
}
936
public void testTypeRefGenericAll02() throws CoreException {
937
	setUpTypeRefGeneric02();
938
	search("*", TYPE, REFERENCES, getJavaSearchWorkingCopiesScope());
939
	assertSearchResults(
940
		"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" + 
941
		"src/test02/Test.java test02.Test.field:<anonymous>#1.x [		§|X|§<String> x;@128] EXACT_MATCH\n" + 
942
		"src/test02/Test.java test02.Test.field:<anonymous>#1.x [		X<§|String|§> x;@130] EXACT_MATCH\n" + 
943
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		§|Test|§<A, B, C> t;@143] EXACT_MATCH\n" + 
944
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<§|A|§, B, C> t;@148] EXACT_MATCH\n" + 
945
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<A, §|B|§, C> t;@151] EXACT_MATCH\n" + 
946
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<A, B, §|C|§> t;@154] EXACT_MATCH\n" + 
947
		"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" + 
948
		"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" + 
949
		"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" + 
950
		"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" + 
951
		"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" + 
952
		"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" + 
953
		"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" + 
954
		"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" + 
955
		"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" + 
956
		"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" + 
957
		"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" + 
958
		"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" + 
959
		"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" + 
960
		"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" + 
961
		"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" + 
962
		"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" + 
963
		"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" + 
964
		"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" + 
965
		"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" + 
966
		"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" + 
967
		"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" + 
968
		"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" + 
969
		"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" + 
970
		"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" + 
971
		"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" + 
972
		"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" + 
973
		"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" + 
974
		"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" + 
975
		"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" + 
976
		"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" + 
977
		"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" + 
978
		"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" + 
979
		"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" + 
980
		"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" + 
981
		"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" + 
982
		"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" + 
983
		"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" + 
984
		"src/test02/Test.java test02.C [class C extends §|X|§<String> {}@426] EXACT_MATCH\n" + 
985
		"src/test02/Test.java test02.C [class C extends X<§|String|§> {}@428] EXACT_MATCH\n" + 
986
		"src/test02/Test.java test02.Y [class Y<S> extends §|A|§ {}@472] EXACT_MATCH\n" + 
987
		"src/test02/Test.java test02.Z [class Z<P> extends §|B|§ {}@496] EXACT_MATCH"
988
	);
989
}
990
public void testTypeRefGenericAll02_AllGenericFlags() throws CoreException {
991
	setUpTypeRefGeneric02();
992
	search("*", TYPE, ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS, getJavaSearchWorkingCopiesScope());
993
	assertSearchResults(
994
		"src/test02/Test.java test02.Test.field:<anonymous>#1.x [		X<§|String|§> x;@130] EXACT_MATCH\n" + 
995
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<§|A|§, B, C> t;@148] EXACT_MATCH\n" + 
996
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<A, §|B|§, C> t;@151] EXACT_MATCH\n" + 
997
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<A, B, §|C|§> t;@154] EXACT_MATCH\n" + 
998
		"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" + 
999
		"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" + 
1000
		"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" + 
1001
		"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" + 
1002
		"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" + 
1003
		"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" + 
1004
		"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" + 
1005
		"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" + 
1006
		"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" + 
1007
		"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" + 
1008
		"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" + 
1009
		"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" + 
1010
		"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" + 
1011
		"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" + 
1012
		"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" + 
1013
		"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" + 
1014
		"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" + 
1015
		"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" + 
1016
		"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" + 
1017
		"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" + 
1018
		"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" + 
1019
		"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" + 
1020
		"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" + 
1021
		"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" + 
1022
		"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" + 
1023
		"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" + 
1024
		"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" + 
1025
		"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" + 
1026
		"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" + 
1027
		"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" + 
1028
		"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" + 
1029
		"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" + 
1030
		"src/test02/Test.java test02.C [class C extends X<§|String|§> {}@428] EXACT_MATCH"
1031
	);
1032
}
1033
public void testTypeRefGenericAll02_Parameterizedl() throws CoreException {
1034
	setUpTypeRefGeneric02();
1035
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1036
	assertSearchResults(
1037
		"src/test02/Test.java test02.Test.field:<anonymous>#1.x [		X<§|String|§> x;@130] EXACT_MATCH\n" + 
1038
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<§|A|§, B, C> t;@148] EXACT_MATCH\n" + 
1039
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<A, §|B|§, C> t;@151] EXACT_MATCH\n" + 
1040
		"src/test02/Test.java test02.Test.field:<anonymous>#1.t [		Test<A, B, §|C|§> t;@154] EXACT_MATCH\n" + 
1041
		"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" + 
1042
		"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" + 
1043
		"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" + 
1044
		"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" + 
1045
		"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" + 
1046
		"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" + 
1047
		"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" + 
1048
		"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" + 
1049
		"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" + 
1050
		"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" + 
1051
		"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" + 
1052
		"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" + 
1053
		"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" + 
1054
		"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" + 
1055
		"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" + 
1056
		"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" + 
1057
		"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" + 
1058
		"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" + 
1059
		"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" + 
1060
		"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" + 
1061
		"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" + 
1062
		"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" + 
1063
		"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" + 
1064
		"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" + 
1065
		"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" + 
1066
		"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" + 
1067
		"src/test02/Test.java test02.C [class C extends X<§|String|§> {}@428] EXACT_MATCH"
1068
	);
1069
}
1070
public void testTypeRefGenericAll02_TypeVariableBound() throws CoreException {
1071
	setUpTypeRefGeneric02();
1072
	search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1073
	assertSearchResults("");
1074
}
1075
public void testTypeRefGenericAll02_WildcardBound() throws CoreException {
1076
	setUpTypeRefGeneric02();
1077
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1078
	assertSearchResults(
1079
		"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" + 
1080
		"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" + 
1081
		"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" + 
1082
		"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" + 
1083
		"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" + 
1084
		"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"
1085
	);
1086
}
1087
1088
/*
1089
 * References to all qualified types (using '*' string pattern)
1090
 */
1091
private void setUpTypeRefGenericMethod() throws JavaModelException {
1092
	final ProblemRequestor problemRequestor = new ProblemRequestor();
1093
	this.wcOwner = new WorkingCopyOwner() {
1094
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
1095
			return problemRequestor;
1096
		}
1097
	};
1098
	workingCopies = new ICompilationUnit[1];
1099
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/test/Test.java",
1100
		"package test;\n" + 
1101
		"public class Test {\n" + 
1102
		"	void foo(A<String> a) {\n" + 
1103
		"		a.<String>foo();\n" + 
1104
		"		a.<A<? extends Exception>>foo();\n" + 
1105
		"	}\n" + 
1106
		"}\n" + 
1107
		"class A<T> {\n" + 
1108
		"	<U> void foo() {}\n" + 
1109
		"}\n"
1110
	);
1111
	assertEquals("CU Should not have any problem!",
1112
		"----------\n" +
1113
		"----------\n",
1114
		problemRequestor.problems.toString()
1115
	);
1116
	this.resultCollector.showSelection = true;
1117
	this.resultCollector.showOffset = true;
1118
}
1119
public void testTypeRefGenericMethod_AllGenericFlags() throws CoreException {
1120
	setUpTypeRefGenericMethod();
1121
	search("*", TYPE, ALL_GENERIC_TYPE_FINE_GRAIN_FLAGS, getJavaSearchWorkingCopiesScope());
1122
	assertSearchResults(
1123
		"src/test/Test.java void test.Test.foo(A<String>) [	void foo(A<§|String|§> a) {@46] EXACT_MATCH\n" + 
1124
		"src/test/Test.java void test.Test.foo(A<String>) [		a.<§|String|§>foo();@64] EXACT_MATCH\n" + 
1125
		"src/test/Test.java void test.Test.foo(A<String>) [		a.<§|A|§<? extends Exception>>foo();@83] EXACT_MATCH\n" + 
1126
		"src/test/Test.java void test.Test.foo(A<String>) [		a.<A<? extends §|Exception|§>>foo();@95] EXACT_MATCH"
1127
	);
1128
}
1129
public void testTypeRefGenericMethod_Parameterized() throws CoreException {
1130
	setUpTypeRefGenericMethod();
1131
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1132
	assertSearchResults(
1133
		"src/test/Test.java void test.Test.foo(A<String>) [	void foo(A<§|String|§> a) {@46] EXACT_MATCH\n" + 
1134
		"src/test/Test.java void test.Test.foo(A<String>) [		a.<§|String|§>foo();@64] EXACT_MATCH\n" + 
1135
		"src/test/Test.java void test.Test.foo(A<String>) [		a.<§|A|§<? extends Exception>>foo();@83] EXACT_MATCH"
1136
	);
1137
}
1138
public void testTypeRefGenericMethod_TypeVariableBound() throws CoreException {
1139
	setUpTypeRefGenericMethod();
1140
	search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1141
	assertSearchResults("");
1142
}
1143
public void testTypeRefGenericMethod_WildcardBound() throws CoreException {
1144
	setUpTypeRefGenericMethod();
1145
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1146
	assertSearchResults(
1147
		"src/test/Test.java void test.Test.foo(A<String>) [		a.<A<? extends §|Exception|§>>foo();@95] EXACT_MATCH"
1148
	);
1149
}
1150
1151
/*
1152
 * References to all qualified types (using '*' string pattern)
1153
 */
1154
private void setUpTypeRefQualifiedAll() throws JavaModelException {
1155
	final ProblemRequestor problemRequestor = new ProblemRequestor();
1156
	this.wcOwner = new WorkingCopyOwner() {
1157
		public IProblemRequestor getProblemRequestor(ICompilationUnit workingCopy) {
1158
			return problemRequestor;
1159
		}
1160
	};
1161
	workingCopies = new ICompilationUnit[3];
1162
	workingCopies[0] = getWorkingCopy("/JavaSearch15/src/type/def/Types.java",
1163
		"package type.def;\n" + 
1164
		"@Bug\n" + 
1165
		"@ATest\n" + 
1166
		"public class Types extends Exception implements ITest1, ITest2 {\n" +
1167
		"	ITest1 test1;\n" +
1168
		"	ITest2 test2;\n" +
1169
		"}\n" + 
1170
		"@Bug\n" + 
1171
		"interface ITest1 {}\n" + 
1172
		"@ATest\n" + 
1173
		"interface ITest2 extends ITest1 {}\n" + 
1174
		"@Bug\n" + 
1175
		"@ATest\n" + 
1176
		"enum ETest {}\n" + 
1177
		"@Bug\n" + 
1178
		"@interface ATest {}\n"
1179
	);
1180
	workingCopies[1] = getWorkingCopy("/JavaSearch15/src/type/def/Bug.java",
1181
		"package type.def;\n" + 
1182
		"public @interface Bug {\n" + 
1183
		"	int num() default 0;\n" + 
1184
		"	String comment() default \"\";\n" + 
1185
		"}\n"
1186
	);
1187
	workingCopies[2] = getWorkingCopy("/JavaSearch15/src/all/types/ref/TestTypes.java",
1188
		"package all.types.ref;\n" + 
1189
		"\n" + 
1190
		"@type.def.Bug(num=155013)\n" + 
1191
		"public class TestTypes extends type.def.Types {\n" + 
1192
		"	@type.def.Bug(comment=\"field\")\n" + 
1193
		"	type.def.Types field = new type.def.Types(), local, other = new type.def.Types();\n" + 
1194
		"	{\n" + 
1195
		"		Object o;\n" + 
1196
		"		type.def.Types t;\n" + 
1197
		"		if (this.field == null) {\n" + 
1198
		"			try {\n" + 
1199
		"				t = new TestTypes();\n" + 
1200
		"			} catch (RuntimeException e) {\n" + 
1201
		"				t = new type.def.Types();\n" + 
1202
		"			} \n" + 
1203
		"		} else {\n" + 
1204
		"			o = this.field;\n" + 
1205
		"			t = (type.def.Types) o;\n" + 
1206
		"		}\n" + 
1207
		"		local = t;\n" + 
1208
		"	};\n" + 
1209
		"	@type.def.Bug(comment=\"method\", num=155013)\n" + 
1210
		"	type.def.Types method(type.def.Types param) throws type.def.Types {\n" + 
1211
		"		Object obj = new type.def.Types();\n" + 
1212
		"		type.def.Types local = (type.def.Types) obj;\n" + 
1213
		"		return local;\n" + 
1214
		"	}\n" + 
1215
		"	type.def.Bug bar(type.def.Bug bug) {\n" + 
1216
		"		try {\n" + 
1217
		"			method(this);\n" + 
1218
		"		}\n" + 
1219
		"		catch (type.def.Types ex) {}\n" + 
1220
		"		catch (Exception ex) {}\n" + 
1221
		"		return bug; \n" + 
1222
		"	}\n" + 
1223
		"	// Other types references\n" + 
1224
		"	Object object;\n" + 
1225
		"	String str;\n" + 
1226
		"	TestTypes() throws type.def.Types, RuntimeException {\n" + 
1227
		"		if (this.object instanceof String) {\n" + 
1228
		"			this.str = (String) this.object;\n" + 
1229
		"		} else {\n" + 
1230
		"			this.str = new String();\n" + 
1231
		"			this.object = new Object();\n" + 
1232
		"		}\n" + 
1233
		"	}\n" + 
1234
		"}\n"
1235
	);
1236
	assertEquals("CU Should not have any problem!",
1237
		"----------\n" +
1238
		"----------\n",
1239
		problemRequestor.problems.toString()
1240
	);
1241
	this.resultCollector.showSelection = true;
1242
	this.resultCollector.showOffset = true;
1243
}
1244
public void testTypeRefQualifiedAll_Allocation() throws CoreException {
1245
	setUpTypeRefQualifiedAll();
1246
	search("*", TYPE, ALLOCATION_EXPRESSION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1247
	assertSearchResults(
1248
		"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" + 
1249
		"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" + 
1250
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [				t = new §|TestTypes|§();@297] EXACT_MATCH\n" + 
1251
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [				t = new §|type.def.Types|§();@356] EXACT_MATCH\n" + 
1252
		"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" + 
1253
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [			this.str = new §|String|§();@1032] EXACT_MATCH\n" + 
1254
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [			this.object = new §|Object|§();@1063] EXACT_MATCH"
1255
	);
1256
}
1257
public void testTypeRefQualifiedAll_Annotation() throws CoreException {
1258
	setUpTypeRefQualifiedAll();
1259
	search("*", TYPE, ANNOTATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1260
	assertSearchResults(
1261
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes [@§|type.def.Bug|§(num=155013)@25] EXACT_MATCH\n" + 
1262
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.field [	@§|type.def.Bug|§(comment=\"field\")@100] EXACT_MATCH\n" + 
1263
		"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" + 
1264
		"src/type/def/Types.java type.def.Types [@§|Bug|§@19] EXACT_MATCH\n" + 
1265
		"src/type/def/Types.java type.def.Types [@§|ATest|§@24] EXACT_MATCH\n" + 
1266
		"src/type/def/Types.java type.def.ITest1 [@§|Bug|§@128] EXACT_MATCH\n" + 
1267
		"src/type/def/Types.java type.def.ITest2 [@§|ATest|§@153] EXACT_MATCH\n" + 
1268
		"src/type/def/Types.java type.def.ETest [@§|Bug|§@195] EXACT_MATCH\n" + 
1269
		"src/type/def/Types.java type.def.ETest [@§|ATest|§@200] EXACT_MATCH\n" + 
1270
		"src/type/def/Types.java type.def.ATest [@§|Bug|§@221] EXACT_MATCH"
1271
	);
1272
}
1273
public void testTypeRefQualifiedAll_Cast() throws CoreException {
1274
	setUpTypeRefQualifiedAll();
1275
	search("*", TYPE, CAST_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1276
	assertSearchResults(
1277
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [			t = (§|type.def.Types|§) o;@418] EXACT_MATCH\n" + 
1278
		"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" + 
1279
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [			this.str = (§|String|§) this.object;@982] EXACT_MATCH"
1280
	);
1281
}
1282
public void testTypeRefQualifiedAll_Catch() throws CoreException {
1283
	setUpTypeRefQualifiedAll();
1284
	search("*", TYPE, CATCH_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1285
	assertSearchResults(
1286
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [			} catch (§|RuntimeException|§ e) {@322] EXACT_MATCH\n" + 
1287
		"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" + 
1288
		"src/all/types/ref/TestTypes.java type.def.Bug all.types.ref.TestTypes.bar(type.def.Bug) [		catch (§|Exception|§ ex) {}@782] EXACT_MATCH"
1289
	);
1290
}
1291
public void testTypeRefQualifiedAll_Field() throws CoreException {
1292
	setUpTypeRefQualifiedAll();
1293
	search("*", TYPE, FIELD_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1294
	assertSearchResults(
1295
		"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" + 
1296
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.object [	§|Object|§ object;@845] EXACT_MATCH\n" + 
1297
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.str [	§|String|§ str;@861] EXACT_MATCH\n" + 
1298
		"src/type/def/Types.java type.def.Types.test1 [	§|ITest1|§ test1;@96] EXACT_MATCH\n" + 
1299
		"src/type/def/Types.java type.def.Types.test2 [	§|ITest2|§ test2;@111] EXACT_MATCH"
1300
	);
1301
}
1302
public void testTypeRefQualifiedAll_Import() throws CoreException {
1303
	setUpTypeRefQualifiedAll();
1304
	search("*", TYPE, IMPORT_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1305
	assertSearchResults("");
1306
}
1307
public void testTypeRefQualifiedAll_MethodParameter() throws CoreException {
1308
	setUpTypeRefQualifiedAll();
1309
	search("*", TYPE, PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1310
	assertSearchResults(
1311
		"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" + 
1312
		"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"
1313
	);
1314
}
1315
public void testTypeRefQualifiedAll_Return() throws CoreException {
1316
	setUpTypeRefQualifiedAll();
1317
	search("*", TYPE, RETURN_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1318
	assertSearchResults(
1319
		"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" + 
1320
		"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"
1321
	);
1322
}
1323
public void testTypeRefQualifiedAll_Superinterface() throws CoreException {
1324
	setUpTypeRefQualifiedAll();
1325
	search("*", TYPE, SUPERINTERFACE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1326
	assertSearchResults(
1327
		"src/type/def/Types.java type.def.Types [public class Types extends Exception implements §|ITest1|§, ITest2 {@78] EXACT_MATCH\n" + 
1328
		"src/type/def/Types.java type.def.Types [public class Types extends Exception implements ITest1, §|ITest2|§ {@86] EXACT_MATCH\n" + 
1329
		"src/type/def/Types.java type.def.ITest2 [interface ITest2 extends §|ITest1|§ {}@184] EXACT_MATCH"
1330
	);
1331
}
1332
public void testTypeRefQualifiedAll_Supertype() throws CoreException {
1333
	setUpTypeRefQualifiedAll();
1334
	search("*", TYPE, SUPERTYPE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1335
	assertSearchResults(
1336
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes [public class TestTypes extends §|type.def.Types|§ {@81] EXACT_MATCH\n" + 
1337
		"src/type/def/Types.java type.def.Types [public class Types extends §|Exception|§ implements ITest1, ITest2 {@57] EXACT_MATCH"
1338
	);
1339
}
1340
public void testTypeRefQualifiedAll_Throws() throws CoreException {
1341
	setUpTypeRefQualifiedAll();
1342
	search("*", TYPE, THROWS_CLAUSE_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1343
	assertSearchResults(
1344
		"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" + 
1345
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [	TestTypes() throws §|type.def.Types|§, RuntimeException {@893] EXACT_MATCH\n" + 
1346
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes() [	TestTypes() throws type.def.Types, §|RuntimeException|§ {@909] EXACT_MATCH"
1347
	);
1348
}
1349
public void testTypeRefQualifiedAll_Variable() throws CoreException {
1350
	setUpTypeRefQualifiedAll();
1351
	search("*", TYPE, LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE, getJavaSearchWorkingCopiesScope());
1352
	assertSearchResults(
1353
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [		§|Object|§ o;@218] EXACT_MATCH\n" + 
1354
		"src/all/types/ref/TestTypes.java all.types.ref.TestTypes.{} [		§|type.def.Types|§ t;@230] EXACT_MATCH\n" + 
1355
		"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" + 
1356
		"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"
1357
	);
1358
}
1359
1360
/*
1361
 * Tests using classes defined in JavaSearch15 project
1362
 */
1363
public void testTypeRefGenericAllG1_Parameterized() throws CoreException {
1364
	IType type = getCompilationUnit("JavaSearch15/src/g1/t/s/ref/R3.java").getType("R3");
1365
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1366
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, scope);
1367
	assertSearchResults(
1368
		"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" + 
1369
		"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" + 
1370
		"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" + 
1371
		"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" + 
1372
		"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" + 
1373
		"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" + 
1374
		"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" + 
1375
		"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"
1376
	);
1377
}
1378
public void testTypeRefGenericAllG1_WildcardBounds() throws CoreException {
1379
	IType type = getCompilationUnit("JavaSearch15/src/g1/t/s/ref/R3.java").getType("R3");
1380
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1381
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, scope);
1382
	assertSearchResults(
1383
		"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" + 
1384
		"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" + 
1385
		"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" + 
1386
		"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" + 
1387
		"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" + 
1388
		"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" + 
1389
		"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" + 
1390
		"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"
1391
	);
1392
}
1393
public void testTypeRefGenericAllG2_Parameterized() throws CoreException {
1394
	// TODO The JavaSearch15/src/g2/f/s/def/R3.java should be updated as it contains compilation errors!
1395
	IType type = getCompilationUnit("JavaSearch15/src/g2/f/s/def/R3.java").getType("R3");
1396
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1397
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, scope);
1398
	assertSearchResults(
1399
		"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" + 
1400
		"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" + 
1401
		"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" + 
1402
		"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" + 
1403
		"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" + 
1404
		"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" + 
1405
		"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" + 
1406
		"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" + 
1407
		"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" + 
1408
		"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" + 
1409
		"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" + 
1410
		"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" + 
1411
		"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" + 
1412
		"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" + 
1413
		"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" + 
1414
		"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"
1415
	);
1416
}
1417
public void testTypeRefGenericAllG2_WildcardBounds() throws CoreException {
1418
	// TODO The JavaSearch15/src/g2/f/s/def/R3.java should be updated as it contains compilation errors!
1419
	IType type = getCompilationUnit("JavaSearch15/src/g2/f/s/def/R3.java").getType("R3");
1420
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1421
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, scope);
1422
	assertSearchResults(
1423
		"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" + 
1424
		"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" + 
1425
		"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" + 
1426
		"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" + 
1427
		"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" + 
1428
		"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" + 
1429
		"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" + 
1430
		"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" + 
1431
		"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" + 
1432
		"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" + 
1433
		"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" + 
1434
		"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" + 
1435
		"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" + 
1436
		"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" + 
1437
		"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" + 
1438
		"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" + 
1439
		"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" + 
1440
		"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" + 
1441
		"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" + 
1442
		"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" + 
1443
		"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" + 
1444
		"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" + 
1445
		"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" + 
1446
		"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"
1447
	);
1448
}
1449
public void testTypeRefGenericAllG3R1_Parameterized() throws CoreException {
1450
	IType type = getCompilationUnit("JavaSearch15/src/g3/t/ref/R1.java").getType("R1");
1451
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1452
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1453
	assertSearchResults(
1454
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_wld [	public GS<§|GM|§<?, ?, ?>> sgsm_wld;@321] EXACT_MATCH\n" + 
1455
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [	public GS<§|GM|§<GM<?, ?, ?>,GM<?, ?, ?>,GM<?, ?, ?>>> sgsm_www;@355] EXACT_MATCH\n" + 
1456
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [	public GS<GM<§|GM|§<?, ?, ?>,GM<?, ?, ?>,GM<?, ?, ?>>> sgsm_www;@358] EXACT_MATCH\n" + 
1457
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [	public GS<GM<GM<?, ?, ?>,§|GM|§<?, ?, ?>,GM<?, ?, ?>>> sgsm_www;@370] EXACT_MATCH\n" + 
1458
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_www [	public GS<GM<GM<?, ?, ?>,GM<?, ?, ?>,§|GM|§<?, ?, ?>>> sgsm_www;@382] EXACT_MATCH\n" + 
1459
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [	public GS<§|GM|§<Object, Exception, RuntimeException>> sgsm_obj;@417] EXACT_MATCH\n" + 
1460
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [	public GS<GM<§|Object|§, Exception, RuntimeException>> sgsm_obj;@420] EXACT_MATCH\n" + 
1461
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [	public GS<GM<Object, §|Exception|§, RuntimeException>> sgsm_obj;@428] EXACT_MATCH\n" + 
1462
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgsm_obj [	public GS<GM<Object, Exception, §|RuntimeException|§>> sgsm_obj;@439] EXACT_MATCH\n" + 
1463
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgms_wld [	public GM<§|GS|§<?>, GS<?>, GS<?>> sgms_wld;@479] EXACT_MATCH\n" + 
1464
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgms_wld [	public GM<GS<?>, §|GS|§<?>, GS<?>> sgms_wld;@486] EXACT_MATCH\n" + 
1465
		"src/g3/t/ref/R1.java g3.t.ref.R1.sgms_wld [	public GM<GS<?>, GS<?>, §|GS|§<?>> sgms_wld;@493] EXACT_MATCH\n" + 
1466
		"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" + 
1467
		"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" + 
1468
		"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" + 
1469
		"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" + 
1470
		"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" + 
1471
		"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" + 
1472
		"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" + 
1473
		"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" + 
1474
		"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" + 
1475
		"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" + 
1476
		"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" + 
1477
		"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" + 
1478
		"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" + 
1479
		"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" + 
1480
		"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" + 
1481
		"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" + 
1482
		"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" + 
1483
		"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" + 
1484
		"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" + 
1485
		"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" + 
1486
		"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" + 
1487
		"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" + 
1488
		"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" + 
1489
		"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" + 
1490
		"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" + 
1491
		"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" + 
1492
		"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" + 
1493
		"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" + 
1494
		"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" + 
1495
		"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" + 
1496
		"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" + 
1497
		"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"
1498
	);
1499
}
1500
public void testTypeRefGenericAllG3R1_WildcardBounds() throws CoreException {
1501
	IType type = getCompilationUnit("JavaSearch15/src/g3/t/ref/R1.java").getType("R1");
1502
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1503
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1504
	assertSearchResults(
1505
		"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" + 
1506
		"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" + 
1507
		"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" + 
1508
		"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"
1509
	);
1510
}
1511
public void testTypeRefGenericAllG3R1_TypeVariableBounds() throws CoreException {
1512
	IType type = getCompilationUnit("JavaSearch15/src/g3/t/ref/R1.java").getType("R1");
1513
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1514
	search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1515
	assertSearchResults("");
1516
}
1517
public void testTypeRefGenericAllG5_Parameterized() throws CoreException {
1518
	IType type = getCompilationUnit("JavaSearch15/src/g5/m/ref/RefMultiple.java").getType("RefMultiple");
1519
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1520
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1521
	assertSearchResults(
1522
		"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" + 
1523
		"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" + 
1524
		"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" + 
1525
		"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" + 
1526
		"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" + 
1527
		"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" + 
1528
		"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" + 
1529
		"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" + 
1530
		"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" + 
1531
		"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" + 
1532
		"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" + 
1533
		"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" + 
1534
		"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" + 
1535
		"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" + 
1536
		"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" + 
1537
		"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" + 
1538
		"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" + 
1539
		"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" + 
1540
		"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" + 
1541
		"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" + 
1542
		"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" + 
1543
		"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" + 
1544
		"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" + 
1545
		"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" + 
1546
		"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" + 
1547
		"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" + 
1548
		"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" + 
1549
		"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" + 
1550
		"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" + 
1551
		"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" + 
1552
		"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" + 
1553
		"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" + 
1554
		"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" + 
1555
		"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" + 
1556
		"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" + 
1557
		"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" + 
1558
		"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" + 
1559
		"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" + 
1560
		"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" + 
1561
		"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" + 
1562
		"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" + 
1563
		"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" + 
1564
		"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" + 
1565
		"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"
1566
	);
1567
}
1568
public void testTypeRefGenericAllG5_WildcardBounds() throws CoreException {
1569
	IType type = getCompilationUnit("JavaSearch15/src/g5/m/ref/RefMultiple.java").getType("RefMultiple");
1570
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1571
	search("*", TYPE, WILDCARD_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1572
	assertSearchResults(
1573
		"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" + 
1574
		"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" + 
1575
		"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" + 
1576
		"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"
1577
	);
1578
}
1579
public void testTypeRefGenericAllG5_TypeVariableBounds() throws CoreException {
1580
	IType type = getCompilationUnit("JavaSearch15/src/g5/m/ref/RefMultiple.java").getType("RefMultiple");
1581
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1582
	search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1583
	assertSearchResults("");
1584
}
1585
public void testTypeRefGenericAllG6_Parameterized() throws CoreException {
1586
	IType type = getCompilationUnit("JavaSearch15/src/g6/t/ref/QualifMultiple.java").getType("QualifMultiple");
1587
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1588
	search("*", TYPE, PARAMETERIZED_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1589
	assertSearchResults(
1590
		"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" + 
1591
		"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" + 
1592
		"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" + 
1593
		"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" + 
1594
		"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" + 
1595
		"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" + 
1596
		"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" + 
1597
		"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" + 
1598
		"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" + 
1599
		"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" + 
1600
		"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" + 
1601
		"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" + 
1602
		"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" + 
1603
		"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" + 
1604
		"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" + 
1605
		"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" + 
1606
		"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" + 
1607
		"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" + 
1608
		"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" + 
1609
		"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"
1610
	);
1611
}
1612
public void testTypeRefGenericAllG6_WildcardBounds() throws CoreException {
1613
	IType type = getCompilationUnit("JavaSearch15/src/g6/t/ref/QualifMultiple.java").getType("QualifMultiple");
1614
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1615
	search("*", TYPE, FIELD_TYPE_DECLARATION_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1616
	assertSearchResults(
1617
		"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" + 
1618
		"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" + 
1619
		"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"
1620
	);
1621
}
1622
public void testTypeRefGenericAllG6_TypeVariableBounds() throws CoreException {
1623
	IType type = getCompilationUnit("JavaSearch15/src/g6/t/ref/QualifMultiple.java").getType("QualifMultiple");
1624
	IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] { type });
1625
	search("*", TYPE, TYPE_VARIABLE_BOUND_TYPE_REFERENCE | WILDCARD_BOUND_TYPE_REFERENCE, SearchPattern.R_ERASURE_MATCH, scope);
1626
	assertSearchResults("");
1627
}
1628
}
(-)search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java (-5 / +40 lines)
Lines 12-21 Link Here
12
12
13
import org.eclipse.jdt.core.IType;
13
import org.eclipse.jdt.core.IType;
14
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.core.compiler.CharOperation;
15
import org.eclipse.jdt.core.search.IJavaSearchConstants;
15
import org.eclipse.jdt.core.search.SearchPattern;
16
import org.eclipse.jdt.core.search.SearchPattern;
16
import org.eclipse.jdt.internal.core.util.Util;
17
import org.eclipse.jdt.internal.core.util.Util;
17
18
18
	public class TypeReferencePattern extends IntersectingPattern {
19
public class TypeReferencePattern extends IntersectingPattern {
19
	
20
	
20
	protected char[] qualification;
21
	protected char[] qualification;
21
	protected char[] simpleName;
22
	protected char[] simpleName;
Lines 26-33 Link Here
26
	public int segmentsSize;
27
	public int segmentsSize;
27
	protected char[][] segments;
28
	protected char[][] segments;
28
	protected int currentSegment;
29
	protected int currentSegment;
29
30
	
30
	protected static char[][] CATEGORIES = { REF };
31
	private final static char[][]
32
		CATEGORIES = { REF, ANNOTATION_REF },
33
		CATEGORIES_ANNOT_REF = { ANNOTATION_REF };
34
	private char[][] categories;
31
	
35
	
32
	public TypeReferencePattern(char[] qualification, char[] simpleName, int matchRule) {
36
	public TypeReferencePattern(char[] qualification, char[] simpleName, int matchRule) {
33
		this(matchRule);
37
		this(matchRule);
Lines 54-59 Link Here
54
	 * Instantiate a type reference pattern with additional information for generics search
58
	 * Instantiate a type reference pattern with additional information for generics search
55
	 */
59
	 */
56
	public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int matchRule) {
60
	public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int matchRule) {
61
		this(qualification, simpleName, typeSignature, 0, matchRule);
62
	}
63
64
	/*
65
	 * Instanciate a type reference pattern with additional information for generics search and fine grain information
66
	 */
67
	public TypeReferencePattern(char[] qualification, char[] simpleName, String typeSignature, int limitTo, int matchRule) {
57
		this(qualification, simpleName,matchRule);
68
		this(qualification, simpleName,matchRule);
58
		if (typeSignature != null) {
69
		if (typeSignature != null) {
59
			// store type signatures and arguments
70
			// store type signatures and arguments
Lines 63-78 Link Here
63
				this.segmentsSize = getTypeArguments().length + CharOperation.occurencesOf('/', this.typeSignatures[0]) - 1;
74
				this.segmentsSize = getTypeArguments().length + CharOperation.occurencesOf('/', this.typeSignatures[0]) - 1;
64
			}
75
			}
65
		}
76
		}
77
	    this.fineGrain = limitTo & 0xFFFFFFF0;
78
	    if (this.fineGrain == IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) {
79
	    	categories =CATEGORIES_ANNOT_REF;
80
	    }
66
	}
81
	}
82
67
	/*
83
	/*
68
	 * Instantiate a type reference pattern with additional information for generics search
84
	 * Instantiate a type reference pattern with additional information for generics search
69
	 */
85
	 */
70
	public TypeReferencePattern(char[] qualification, char[] simpleName, IType type, int matchRule) {
86
	public TypeReferencePattern(char[] qualification, char[] simpleName, IType type, int matchRule) {
87
		this(qualification, simpleName, type, 0, matchRule);
88
	}
89
90
	/*
91
	 * Instanciate a type reference pattern with additional information for generics search
92
	 */
93
	public TypeReferencePattern(char[] qualification, char[] simpleName, IType type, int limitTo, int matchRule) {
71
		this(qualification, simpleName,matchRule);
94
		this(qualification, simpleName,matchRule);
72
		storeTypeSignaturesAndArguments(type);
95
		storeTypeSignaturesAndArguments(type);
96
	    this.fineGrain = limitTo & 0xFFFFFFF0;
73
	}
97
	}
98
74
	TypeReferencePattern(int matchRule) {
99
	TypeReferencePattern(int matchRule) {
75
		super(TYPE_REF_PATTERN, matchRule);
100
		super(TYPE_REF_PATTERN, matchRule);
101
		this.categories = CATEGORIES;
76
	}
102
	}
77
	public void decodeIndexKey(char[] key) {
103
	public void decodeIndexKey(char[] key) {
78
		this.simpleName = key;
104
		this.simpleName = key;
Lines 90-96 Link Here
90
		return null;
116
		return null;
91
	}
117
	}
92
	public char[][] getIndexCategories() {
118
	public char[][] getIndexCategories() {
93
		return CATEGORIES;
119
		return this.categories;
94
	}
120
	}
95
	protected boolean hasNextQuery() {
121
	protected boolean hasNextQuery() {
96
		if (this.segments == null) return false;
122
		if (this.segments == null) return false;
Lines 105-117 Link Here
105
		return true; // index key is not encoded so query results all match
131
		return true; // index key is not encoded so query results all match
106
	}
132
	}
107
133
134
	protected void setFineGrain(int limitTo) {
135
	    this.fineGrain = limitTo & 0xFFFFFFF0;
136
//		if (this.fineGrain == IJavaSearchConstants.ONLY_ANNOTATION_TYPE_REFERENCE) {
137
//			this.categories = new char[][] { ANNOTATION_REF };
138
//		}
139
    }
140
108
	protected void resetQuery() {
141
	protected void resetQuery() {
109
		/* walk the segments from end to start as it will find less potential references using 'lang' than 'java' */
142
		/* walk the segments from end to start as it will find less potential references using 'lang' than 'java' */
110
		if (this.segments != null)
143
		if (this.segments != null)
111
			this.currentSegment = this.segments.length - 1;
144
			this.currentSegment = this.segments.length - 1;
112
	}
145
	}
113
	protected StringBuffer print(StringBuffer output) {
146
	protected StringBuffer print(StringBuffer output) {
114
		output.append("TypeReferencePattern: qualification<"); //$NON-NLS-1$
147
		String patternClassName = getClass().getName();
148
		output.append(patternClassName.substring(patternClassName.lastIndexOf('.')+1));
149
		output.append(": qualification<"); //$NON-NLS-1$
115
		if (qualification != null) 
150
		if (qualification != null) 
116
			output.append(qualification);
151
			output.append(qualification);
117
		else
152
		else
(-)search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java (+3 lines)
Lines 47-52 Link Here
47
protected void clear() {
47
protected void clear() {
48
	this.methodDeclarationsWithInvalidParam = new HashMap();
48
	this.methodDeclarationsWithInvalidParam = new HashMap();
49
}
49
}
50
protected int fineGrain() {
51
	return this.pattern.fineGrain;
52
}
50
public void initializePolymorphicSearch(MatchLocator locator) {
53
public void initializePolymorphicSearch(MatchLocator locator) {
51
	long start = 0;
54
	long start = 0;
52
	if (BasicSearchEngine.VERBOSE) {
55
	if (BasicSearchEngine.VERBOSE) {
(-)search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfAccessedFieldsPattern.java (-1 / +2 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.internal.core.search.matching;
11
package org.eclipse.jdt.internal.core.search.matching;
12
12
13
import org.eclipse.jdt.core.IJavaElement;
13
import org.eclipse.jdt.core.IJavaElement;
14
import org.eclipse.jdt.core.search.IJavaSearchConstants;
14
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
15
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
15
16
16
public class DeclarationOfAccessedFieldsPattern extends FieldPattern {
17
public class DeclarationOfAccessedFieldsPattern extends FieldPattern {
Lines 19-25 Link Here
19
protected SimpleSet knownFields;
20
protected SimpleSet knownFields;
20
21
21
public DeclarationOfAccessedFieldsPattern(IJavaElement enclosingElement) {
22
public DeclarationOfAccessedFieldsPattern(IJavaElement enclosingElement) {
22
	super(false, true, true, null, null, null, null, null, R_PATTERN_MATCH);
23
	super(null, null, null, null, null, IJavaSearchConstants.REFERENCES, R_PATTERN_MATCH);
23
24
24
	this.enclosingElement = enclosingElement;
25
	this.enclosingElement = enclosingElement;
25
	this.knownFields = new SimpleSet();
26
	this.knownFields = new SimpleSet();
(-)search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java (-10 / +37 lines)
Lines 11-33 Link Here
11
package org.eclipse.jdt.internal.core.search.matching;
11
package org.eclipse.jdt.internal.core.search.matching;
12
12
13
import org.eclipse.jdt.core.compiler.CharOperation;
13
import org.eclipse.jdt.core.compiler.CharOperation;
14
import org.eclipse.jdt.core.search.IJavaSearchConstants;
14
15
15
public abstract class VariablePattern extends JavaSearchPattern {
16
public abstract class VariablePattern extends JavaSearchPattern {
16
17
17
protected boolean findDeclarations;
18
protected boolean findDeclarations = false;
18
protected boolean findReferences;
19
protected boolean findReferences = false;
19
protected boolean readAccess;
20
protected boolean readAccess = false;
20
protected boolean writeAccess;
21
protected boolean writeAccess = false;
21
22
22
protected char[] name;
23
protected char[] name;
23
24
24
public VariablePattern(int patternKind, boolean findDeclarations, boolean readAccess, boolean writeAccess, char[] name, int matchRule) {
25
public final static int FINE_GRAIN_MASK =
26
	IJavaSearchConstants.SUPER_REFERENCE |
27
	IJavaSearchConstants.QUALIFIED_REFERENCE |
28
	IJavaSearchConstants.THIS_REFERENCE |
29
	IJavaSearchConstants.IMPLICIT_THIS_REFERENCE;
30
31
public VariablePattern(int patternKind, char[] name, int limitTo, int matchRule) {
25
	super(patternKind, matchRule);
32
	super(patternKind, matchRule);
26
33
27
	this.findDeclarations = findDeclarations; // set to find declarations & all occurrences
34
    this.fineGrain = limitTo & FINE_GRAIN_MASK;
28
	this.readAccess = readAccess; // set to find any reference, read only references & all occurrences
35
    if (this.fineGrain == 0) {
29
	this.writeAccess = writeAccess; // set to find any reference, write only references & all occurrences
36
		switch (limitTo & 0xF) {
30
	this.findReferences = readAccess || writeAccess;
37
			case IJavaSearchConstants.DECLARATIONS :
38
				this.findDeclarations = true;
39
				break;
40
			case IJavaSearchConstants.REFERENCES :
41
				this.readAccess = true;
42
				this.writeAccess = true;
43
				break;
44
			case IJavaSearchConstants.READ_ACCESSES :
45
				this.readAccess = true;
46
				break;
47
			case IJavaSearchConstants.WRITE_ACCESSES :
48
				this.writeAccess = true;
49
				break;
50
			case IJavaSearchConstants.ALL_OCCURRENCES :
51
				this.findDeclarations = true;
52
				this.readAccess = true;
53
				this.writeAccess = true;
54
				break;
55
		}
56
		this.findReferences = this.readAccess || this.writeAccess;
57
    }
31
58
32
	this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name);
59
	this.name = (this.isCaseSensitive || this.isCamelCase) ? name : CharOperation.toLowerCase(name);
33
}
60
}
Lines 37-42 Link Here
37
 */
64
 */
38
protected boolean mustResolve() {
65
protected boolean mustResolve() {
39
	// would like to change this so that we only do it if generic references are found
66
	// would like to change this so that we only do it if generic references are found
40
	return this.findReferences; // always resolve (in case of a simple name reference being a potential match)
67
	return this.findReferences || this.fineGrain != 0; // always resolve (in case of a simple name reference being a potential match)
41
}	
68
}	
42
}
69
}
(-)search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java (+15 lines)
Lines 26-36 Link Here
26
protected TypeReferencePattern pattern;
26
protected TypeReferencePattern pattern;
27
protected boolean isDeclarationOfReferencedTypesPattern;
27
protected boolean isDeclarationOfReferencedTypesPattern;
28
28
29
private final int fineGrain;
30
29
public TypeReferenceLocator(TypeReferencePattern pattern) {
31
public TypeReferenceLocator(TypeReferencePattern pattern) {
30
32
31
	super(pattern);
33
	super(pattern);
32
34
33
	this.pattern = pattern;
35
	this.pattern = pattern;
36
	this.fineGrain = pattern == null ? 0 : pattern.fineGrain;
34
	this.isDeclarationOfReferencedTypesPattern = this.pattern instanceof DeclarationOfReferencedTypesPattern;
37
	this.isDeclarationOfReferencedTypesPattern = this.pattern instanceof DeclarationOfReferencedTypesPattern;
35
}
38
}
36
protected IJavaElement findElement(IJavaElement element, int accuracy) {
39
protected IJavaElement findElement(IJavaElement element, int accuracy) {
Lines 43-48 Link Here
43
		element = element.getParent();
46
		element = element.getParent();
44
	return element;
47
	return element;
45
}
48
}
49
protected int fineGrain() {
50
	return this.fineGrain;
51
}
46
public int match(Annotation node, MatchingNodeSet nodeSet) {
52
public int match(Annotation node, MatchingNodeSet nodeSet) {
47
	return match(node.type, nodeSet);
53
	return match(node.type, nodeSet);
48
}
54
}
Lines 201-206 Link Here
201
		return;
207
		return;
202
	}
208
	}
203
	
209
	
210
	// Return if fine grain is on and does not concern import reference
211
	if ((this.pattern.fineGrain != 0 && (this.pattern.fineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) == 0)) {
212
		return;
213
	}
214
204
	// Create search match
215
	// Create search match
205
	match = locator.newTypeReferenceMatch(element, binding, accuracy, importRef);
216
	match = locator.newTypeReferenceMatch(element, binding, accuracy, importRef);
206
217
Lines 539-544 Link Here
539
			}
550
			}
540
		}
551
		}
541
	}
552
	}
553
	if (this.pattern.simpleName == null) {
554
		match.setOffset(expr.sourceStart);
555
		match.setLength(expr.sourceEnd-expr.sourceStart+1);
556
	}
542
	locator.report(match);
557
	locator.report(match);
543
}
558
}
544
protected int referenceType() {
559
protected int referenceType() {
(-)search/org/eclipse/jdt/internal/core/search/matching/VariableLocator.java (-2 / +2 lines)
Lines 30-36 Link Here
30
			if (lhs instanceof Reference)
30
			if (lhs instanceof Reference)
31
				return matchReference((Reference) lhs, nodeSet, true);
31
				return matchReference((Reference) lhs, nodeSet, true);
32
		}
32
		}
33
	} else if (this.pattern.readAccess) {
33
	} else if (this.pattern.readAccess || this.pattern.fineGrain != 0) {
34
		if (node instanceof Assignment && !(node instanceof CompoundAssignment)) {
34
		if (node instanceof Assignment && !(node instanceof CompoundAssignment)) {
35
			// the lhs of a simple assignment may be added in match(Reference...) before we reach here
35
			// the lhs of a simple assignment may be added in match(Reference...) before we reach here
36
			// for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess
36
			// for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess
Lines 42-48 Link Here
42
	return IMPOSSIBLE_MATCH;
42
	return IMPOSSIBLE_MATCH;
43
}
43
}
44
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes
44
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes
45
	return this.pattern.readAccess
45
	return (this.pattern.readAccess || this.pattern.fineGrain != 0)
46
		? matchReference(node, nodeSet, false)
46
		? matchReference(node, nodeSet, false)
47
		: IMPOSSIBLE_MATCH;
47
		: IMPOSSIBLE_MATCH;
48
}
48
}
(-)search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java (+6 lines)
Lines 53-58 Link Here
53
	int matchCompatibility;
53
	int matchCompatibility;
54
54
55
	/**
55
	/**
56
	 * Fine grain limitation
57
	 */
58
	public int fineGrain = 0;
59
	
60
	/**
56
	 * Mask used on match rule for match mode.
61
	 * Mask used on match rule for match mode.
57
	 */
62
	 */
58
	public static final int MATCH_MODE_MASK = R_EXACT_MATCH
63
	public static final int MATCH_MODE_MASK = R_EXACT_MATCH
Lines 289-294 Link Here
289
		}
294
		}
290
		return output;
295
		return output;
291
	}
296
	}
297
292
	/**
298
	/**
293
	 * @param typeArguments The typeArguments to set.
299
	 * @param typeArguments The typeArguments to set.
294
	 */
300
	 */
(-)search/org/eclipse/jdt/internal/core/search/matching/FieldLocator.java (-2 / +5 lines)
Lines 30-35 Link Here
30
30
31
	this.isDeclarationOfAccessedFieldsPattern = this.pattern instanceof DeclarationOfAccessedFieldsPattern;
31
	this.isDeclarationOfAccessedFieldsPattern = this.pattern instanceof DeclarationOfAccessedFieldsPattern;
32
}
32
}
33
protected int fineGrain() {
34
	return this.pattern.fineGrain;
35
}
33
public int match(ASTNode node, MatchingNodeSet nodeSet) {
36
public int match(ASTNode node, MatchingNodeSet nodeSet) {
34
	int declarationsLevel = IMPOSSIBLE_MATCH;
37
	int declarationsLevel = IMPOSSIBLE_MATCH;
35
	if (this.pattern.findReferences) {
38
	if (this.pattern.findReferences) {
Lines 78-84 Link Here
78
//public int match(TypeReference node, MatchingNodeSet nodeSet) - SKIP IT
81
//public int match(TypeReference node, MatchingNodeSet nodeSet) - SKIP IT
79
82
80
protected int matchContainer() {
83
protected int matchContainer() {
81
	if (this.pattern.findReferences) {
84
	if (this.pattern.findReferences || this.pattern.fineGrain != 0) {
82
		// need to look everywhere to find in javadocs and static import
85
		// need to look everywhere to find in javadocs and static import
83
		return ALL_CONTAINER;
86
		return ALL_CONTAINER;
84
	}
87
	}
Lines 290-296 Link Here
290
	return IJavaElement.FIELD;
293
	return IJavaElement.FIELD;
291
}
294
}
292
public int resolveLevel(ASTNode possiblelMatchingNode) {
295
public int resolveLevel(ASTNode possiblelMatchingNode) {
293
	if (this.pattern.findReferences) {
296
	if (this.pattern.findReferences || this.pattern.fineGrain != 0) {
294
		if (possiblelMatchingNode instanceof FieldReference)
297
		if (possiblelMatchingNode instanceof FieldReference)
295
			return matchField(((FieldReference) possiblelMatchingNode).binding, true);
298
			return matchField(((FieldReference) possiblelMatchingNode).binding, true);
296
		else if (possiblelMatchingNode instanceof NameReference)
299
		else if (possiblelMatchingNode instanceof NameReference)
(-)search/org/eclipse/jdt/internal/core/search/matching/PatternLocator.java (-111 / +119 lines)
Lines 238-243 Link Here
238
	// override if the pattern can be more specific
238
	// override if the pattern can be more specific
239
	return ALL_CONTAINER;
239
	return ALL_CONTAINER;
240
}
240
}
241
protected int fineGrain() {
242
	return 0;
243
}
241
/**
244
/**
242
 * Returns whether the given name matches the given pattern.
245
 * Returns whether the given name matches the given pattern.
243
 */
246
 */
Lines 814-949 Link Here
814
		}
817
		}
815
		// TODO (frederic) do we need to verify each parameter?
818
		// TODO (frederic) do we need to verify each parameter?
816
		return level; // we can't do better
819
		return level; // we can't do better
817
	} else if (type.isRawType()) {
820
	}
818
		return level; // raw type always match
819
	} else {
820
		TypeBinding leafType = type.leafComponentType();
821
		if (!leafType.isParameterizedType()) {
822
			// Standard types (ie. neither generic nor parameterized nor raw types)
823
			// cannot match pattern with type parameters or arguments
824
			return (patternTypeArguments[depth]==null || patternTypeArguments[depth].length==0) ? level : IMPOSSIBLE_MATCH;
825
		}
826
		ParameterizedTypeBinding paramTypeBinding = (ParameterizedTypeBinding) leafType;
827
821
828
		// Compare arguments only if there ones on both sides
822
	// raw type always match
829
		if (patternTypeArguments[depth] != null && patternTypeArguments[depth].length > 0 &&
823
	if (type.isRawType()) {
830
			paramTypeBinding.arguments != null && paramTypeBinding.arguments.length > 0) {
824
		return level;
825
	} 
831
826
832
			// type parameters length must match at least specified type names length
827
	// Standard types (ie. neither generic nor parameterized nor raw types)
833
			int length = patternTypeArguments[depth].length;
828
	// cannot match pattern with type parameters or arguments
834
			if (paramTypeBinding.arguments.length != length) return IMPOSSIBLE_MATCH;
829
	TypeBinding leafType = type.leafComponentType();
835
	
830
	if (!leafType.isParameterizedType()) {
836
			// verify each pattern type parameter
831
		return (patternTypeArguments[depth]==null || patternTypeArguments[depth].length==0) ? level : IMPOSSIBLE_MATCH;
837
			nextTypeArgument: for (int i= 0; i<length; i++) {
832
	}
838
				char[] patternTypeArgument = patternTypeArguments[depth][i];
833
839
				TypeBinding argTypeBinding = paramTypeBinding.arguments[i];
834
	// Parameterized type
840
				// get corresponding pattern wildcard
835
	ParameterizedTypeBinding paramTypeBinding = (ParameterizedTypeBinding) leafType;
841
				switch (patternTypeArgument[0]) {
836
842
					case Signature.C_STAR : // unbound parameter always match
837
	// Compare arguments only if there ones on both sides
843
					case Signature.C_SUPER : // needs pattern type parameter binding
838
	if (patternTypeArguments[depth] != null && patternTypeArguments[depth].length > 0 &&
844
						// skip to next type argument as it will be resolved later
839
		paramTypeBinding.arguments != null && paramTypeBinding.arguments.length > 0) {
845
						continue nextTypeArgument;
840
846
					case Signature.C_EXTENDS :
841
		// type parameters length must match at least specified type names length
847
						// remove wildcard from patter type argument
842
		int length = patternTypeArguments[depth].length;
848
						patternTypeArgument = CharOperation.subarray(patternTypeArgument, 1, patternTypeArgument.length);
843
		if (paramTypeBinding.arguments.length != length) return IMPOSSIBLE_MATCH;
849
					default :
844
850
						// no wildcard
845
		// verify each pattern type parameter
851
						break;
846
		nextTypeArgument: for (int i= 0; i<length; i++) {
852
				}
847
			char[] patternTypeArgument = patternTypeArguments[depth][i];
853
				// get pattern type argument from its signature
848
			TypeBinding argTypeBinding = paramTypeBinding.arguments[i];
854
				patternTypeArgument = Signature.toCharArray(patternTypeArgument);
849
			// get corresponding pattern wildcard
855
				if (!this.isCaseSensitive) patternTypeArgument = CharOperation.toLowerCase(patternTypeArgument);
850
			switch (patternTypeArgument[0]) {
856
				boolean patternTypeArgHasAnyChars = CharOperation.contains(new char[] {'*', '?'}, patternTypeArgument);
851
				case Signature.C_STAR : // unbound parameter always match
857
	
852
				case Signature.C_SUPER : // needs pattern type parameter binding
858
				// Verify that names match...
853
					// skip to next type argument as it will be resolved later
859
				// ...special case for wildcard
854
					continue nextTypeArgument;
860
				if (argTypeBinding instanceof CaptureBinding) {
855
				case Signature.C_EXTENDS :
861
					WildcardBinding capturedWildcard = ((CaptureBinding)argTypeBinding).wildcard;
856
					// remove wildcard from patter type argument
862
					if (capturedWildcard != null) argTypeBinding = capturedWildcard;
857
					patternTypeArgument = CharOperation.subarray(patternTypeArgument, 1, patternTypeArgument.length);
863
				}
858
				default :
864
				if (argTypeBinding.isWildcard()) {
859
					// no wildcard
865
					WildcardBinding wildcardBinding = (WildcardBinding) argTypeBinding;
860
					break;
866
					switch (wildcardBinding.boundKind) {
861
			}
867
						case Wildcard.EXTENDS:
862
			// get pattern type argument from its signature
868
							// Invalid if type argument is not exact
863
			patternTypeArgument = Signature.toCharArray(patternTypeArgument);
869
							if (patternTypeArgHasAnyChars) return impossible;
864
			if (!this.isCaseSensitive) patternTypeArgument = CharOperation.toLowerCase(patternTypeArgument);
870
						case Wildcard.UNBOUND:
865
			boolean patternTypeArgHasAnyChars = CharOperation.contains(new char[] {'*', '?'}, patternTypeArgument);
871
							// there's no bound name to match => valid
866
872
							continue nextTypeArgument;
867
			// Verify that names match...
873
					}
868
			// ...special case for wildcard
874
					// Look if bound name match pattern type argument
869
			if (argTypeBinding instanceof CaptureBinding) {
875
					ReferenceBinding boundBinding = (ReferenceBinding) wildcardBinding.bound;
870
				WildcardBinding capturedWildcard = ((CaptureBinding)argTypeBinding).wildcard;
876
					if (CharOperation.match(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) ||
871
				if (capturedWildcard != null) argTypeBinding = capturedWildcard;
877
						CharOperation.match(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) {
872
			}
878
						// found name in hierarchy => match
873
			if (argTypeBinding.isWildcard()) {
874
				WildcardBinding wildcardBinding = (WildcardBinding) argTypeBinding;
875
				switch (wildcardBinding.boundKind) {
876
					case Wildcard.EXTENDS:
877
						// Invalid if type argument is not exact
878
						if (patternTypeArgHasAnyChars) return impossible;
879
					case Wildcard.UNBOUND:
880
						// there's no bound name to match => valid
879
						continue nextTypeArgument;
881
						continue nextTypeArgument;
880
					}
881
882
					// If pattern is not exact then match fails
883
					if (patternTypeArgHasAnyChars) return impossible;
884
						
885
					// Look for bound name in type argument superclasses
886
					boundBinding = boundBinding.superclass();
887
					while (boundBinding != null) {
888
						if (CharOperation.equals(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) ||
889
							CharOperation.equals(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) {
890
							// found name in hierarchy => match
891
							continue nextTypeArgument;
892
						} else if (boundBinding.isLocalType() || boundBinding.isMemberType()) {
893
							// for local or member type, verify also source name (bug 81084)
894
							if (CharOperation.match(patternTypeArgument, boundBinding.sourceName(), this.isCaseSensitive))
895
								continue nextTypeArgument;
896
						}
897
						boundBinding = boundBinding.superclass();
898
					}
899
					return impossible;
900
				}
882
				}
901
				
883
				// Look if bound name match pattern type argument
902
				// See if names match
884
				ReferenceBinding boundBinding = (ReferenceBinding) wildcardBinding.bound;
903
				if (CharOperation.match(patternTypeArgument, argTypeBinding.shortReadableName(), this.isCaseSensitive) ||
885
				if (CharOperation.match(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) ||
904
					CharOperation.match(patternTypeArgument, argTypeBinding.readableName(), this.isCaseSensitive)) {
886
					CharOperation.match(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) {
887
					// found name in hierarchy => match
905
					continue nextTypeArgument;
888
					continue nextTypeArgument;
906
				} else if (argTypeBinding.isLocalType() || argTypeBinding.isMemberType()) {
907
					// for local or member type, verify also source name (bug 81084)
908
					if (CharOperation.match(patternTypeArgument, argTypeBinding.sourceName(), this.isCaseSensitive))
909
						continue nextTypeArgument;
910
				}
889
				}
911
890
912
				// If pattern is not exact then match fails
891
				// If pattern is not exact then match fails
913
				if (patternTypeArgHasAnyChars) return impossible;
892
				if (patternTypeArgHasAnyChars) return impossible;
914
893
					
915
				// Scan hierarchy
894
				// Look for bound name in type argument superclasses
916
				TypeBinding leafTypeBinding = argTypeBinding.leafComponentType();
895
				boundBinding = boundBinding.superclass();
917
				if (leafTypeBinding.isBaseType()) return impossible;
896
				while (boundBinding != null) {
918
				ReferenceBinding refBinding = ((ReferenceBinding) leafTypeBinding).superclass();
897
					if (CharOperation.equals(patternTypeArgument, boundBinding.shortReadableName(), this.isCaseSensitive) ||
919
				while (refBinding != null) {
898
						CharOperation.equals(patternTypeArgument, boundBinding.readableName(), this.isCaseSensitive)) {
920
					if (CharOperation.equals(patternTypeArgument, refBinding.shortReadableName(), this.isCaseSensitive) ||
921
						CharOperation.equals(patternTypeArgument, refBinding.readableName(), this.isCaseSensitive)) {
922
						// found name in hierarchy => match
899
						// found name in hierarchy => match
923
						continue nextTypeArgument;
900
						continue nextTypeArgument;
924
					} else if (refBinding.isLocalType() || refBinding.isMemberType()) {
901
					} else if (boundBinding.isLocalType() || boundBinding.isMemberType()) {
925
						// for local or member type, verify also source name (bug 81084)
902
						// for local or member type, verify also source name (bug 81084)
926
						if (CharOperation.match(patternTypeArgument, refBinding.sourceName(), this.isCaseSensitive))
903
						if (CharOperation.match(patternTypeArgument, boundBinding.sourceName(), this.isCaseSensitive))
927
							continue nextTypeArgument;
904
							continue nextTypeArgument;
928
					}
905
					}
929
					refBinding = refBinding.superclass();
906
					boundBinding = boundBinding.superclass();
930
				}
907
				}
931
				return impossible;
908
				return impossible;
932
			}
909
			}
910
			
911
			// See if names match
912
			if (CharOperation.match(patternTypeArgument, argTypeBinding.shortReadableName(), this.isCaseSensitive) ||
913
				CharOperation.match(patternTypeArgument, argTypeBinding.readableName(), this.isCaseSensitive)) {
914
				continue nextTypeArgument;
915
			} else if (argTypeBinding.isLocalType() || argTypeBinding.isMemberType()) {
916
				// for local or member type, verify also source name (bug 81084)
917
				if (CharOperation.match(patternTypeArgument, argTypeBinding.sourceName(), this.isCaseSensitive))
918
					continue nextTypeArgument;
919
			}
920
921
			// If pattern is not exact then match fails
922
			if (patternTypeArgHasAnyChars) return impossible;
923
924
			// Scan hierarchy
925
			TypeBinding leafTypeBinding = argTypeBinding.leafComponentType();
926
			if (leafTypeBinding.isBaseType()) return impossible;
927
			ReferenceBinding refBinding = ((ReferenceBinding) leafTypeBinding).superclass();
928
			while (refBinding != null) {
929
				if (CharOperation.equals(patternTypeArgument, refBinding.shortReadableName(), this.isCaseSensitive) ||
930
					CharOperation.equals(patternTypeArgument, refBinding.readableName(), this.isCaseSensitive)) {
931
					// found name in hierarchy => match
932
					continue nextTypeArgument;
933
				} else if (refBinding.isLocalType() || refBinding.isMemberType()) {
934
					// for local or member type, verify also source name (bug 81084)
935
					if (CharOperation.match(patternTypeArgument, refBinding.sourceName(), this.isCaseSensitive))
936
						continue nextTypeArgument;
937
				}
938
				refBinding = refBinding.superclass();
939
			}
940
			return impossible;
933
		}
941
		}
934
		
935
		// Recurse on enclosing type
936
		TypeBinding enclosingType = paramTypeBinding.enclosingType();
937
		if (enclosingType != null && enclosingType.isParameterizedType() && depth < patternTypeArguments.length && qualificationPattern != null) {
938
			int lastDot = CharOperation.lastIndexOf('.', qualificationPattern);
939
			char[] enclosingQualificationPattern = lastDot==-1 ? null : CharOperation.subarray(qualificationPattern, 0, lastDot);
940
			char[] enclosingSimpleNamePattern = lastDot==-1 ? qualificationPattern : CharOperation.subarray(qualificationPattern, lastDot+1, qualificationPattern.length);
941
			int enclosingLevel = resolveLevelForType(enclosingSimpleNamePattern, enclosingQualificationPattern, patternTypeArguments, depth+1, enclosingType);
942
			if (enclosingLevel == impossible) return impossible;
943
			if (enclosingLevel == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH;
944
		}
945
		return level;
946
	}
942
	}
943
	
944
	// Recurse on enclosing type
945
	TypeBinding enclosingType = paramTypeBinding.enclosingType();
946
	if (enclosingType != null && enclosingType.isParameterizedType() && depth < patternTypeArguments.length && qualificationPattern != null) {
947
		int lastDot = CharOperation.lastIndexOf('.', qualificationPattern);
948
		char[] enclosingQualificationPattern = lastDot==-1 ? null : CharOperation.subarray(qualificationPattern, 0, lastDot);
949
		char[] enclosingSimpleNamePattern = lastDot==-1 ? qualificationPattern : CharOperation.subarray(qualificationPattern, lastDot+1, qualificationPattern.length);
950
		int enclosingLevel = resolveLevelForType(enclosingSimpleNamePattern, enclosingQualificationPattern, patternTypeArguments, depth+1, enclosingType);
951
		if (enclosingLevel == impossible) return impossible;
952
		if (enclosingLevel == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH;
953
	}
954
	return level;
947
}
955
}
948
public String toString(){
956
public String toString(){
949
	return "SearchPattern"; //$NON-NLS-1$
957
	return "SearchPattern"; //$NON-NLS-1$
(-)search/org/eclipse/jdt/internal/core/search/matching/LocalVariableLocator.java (-1 / +1 lines)
Lines 82-88 Link Here
82
	return IJavaElement.LOCAL_VARIABLE;
82
	return IJavaElement.LOCAL_VARIABLE;
83
}
83
}
84
public int resolveLevel(ASTNode possiblelMatchingNode) {
84
public int resolveLevel(ASTNode possiblelMatchingNode) {
85
	if (this.pattern.findReferences)
85
	if (this.pattern.findReferences || this.pattern.fineGrain != 0)
86
		if (possiblelMatchingNode instanceof NameReference)
86
		if (possiblelMatchingNode instanceof NameReference)
87
			return resolveLevel((NameReference) possiblelMatchingNode);
87
			return resolveLevel((NameReference) possiblelMatchingNode);
88
	if (possiblelMatchingNode instanceof LocalDeclaration)
88
	if (possiblelMatchingNode instanceof LocalDeclaration)
(-)search/org/eclipse/jdt/internal/core/search/matching/OrPattern.java (-5 lines)
Lines 22-32 Link Here
22
22
23
	protected SearchPattern[] patterns;
23
	protected SearchPattern[] patterns;
24
24
25
	/*
26
	 * Whether this pattern is erasure match.
27
	 */
28
//	boolean isErasureMatch;
29
30
	/**
25
	/**
31
	 * One of {@link #R_ERASURE_MATCH}, {@link #R_EQUIVALENT_MATCH}, {@link #R_FULL_MATCH}.
26
	 * One of {@link #R_ERASURE_MATCH}, {@link #R_EQUIVALENT_MATCH}, {@link #R_FULL_MATCH}.
32
	 */
27
	 */
(-)search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java (-10 / +6 lines)
Lines 34-50 Link Here
34
}
34
}
35
35
36
public FieldPattern(
36
public FieldPattern(
37
	boolean findDeclarations,
38
	boolean readAccess,
39
	boolean writeAccess,
40
	char[] name, 
37
	char[] name, 
41
	char[] declaringQualification,
38
	char[] declaringQualification,
42
	char[] declaringSimpleName,	
39
	char[] declaringSimpleName,	
43
	char[] typeQualification, 
40
	char[] typeQualification, 
44
	char[] typeSimpleName,
41
	char[] typeSimpleName,
42
	int limitTo,
45
	int matchRule) {
43
	int matchRule) {
46
44
47
	super(FIELD_PATTERN, findDeclarations, readAccess, writeAccess, name, matchRule);
45
	super(FIELD_PATTERN, name, limitTo, matchRule);
48
46
49
	this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
47
	this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
50
	this.declaringSimpleName = this.isCaseSensitive ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName);
48
	this.declaringSimpleName = this.isCaseSensitive ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName);
Lines 57-74 Link Here
57
 * Instantiate a field pattern with additional information for generic search
55
 * Instantiate a field pattern with additional information for generic search
58
 */
56
 */
59
public FieldPattern(
57
public FieldPattern(
60
	boolean findDeclarations,
61
	boolean readAccess,
62
	boolean writeAccess,
63
	char[] name, 
58
	char[] name, 
64
	char[] declaringQualification,
59
	char[] declaringQualification,
65
	char[] declaringSimpleName,	
60
	char[] declaringSimpleName,	
66
	char[] typeQualification, 
61
	char[] typeQualification, 
67
	char[] typeSimpleName,
62
	char[] typeSimpleName,
68
	String typeSignature,
63
	String typeSignature,
64
	int limitTo,
69
	int matchRule) {
65
	int matchRule) {
70
66
71
	this(findDeclarations, readAccess, writeAccess, name, declaringQualification, declaringSimpleName, typeQualification, typeSimpleName, matchRule);
67
	this(name, declaringQualification, declaringSimpleName, typeQualification, typeSimpleName, limitTo, matchRule);
72
68
73
	// store type signatures and arguments
69
	// store type signatures and arguments
74
	if (typeSignature != null) {
70
	if (typeSignature != null) {
Lines 80-92 Link Here
80
	this.name = key;
76
	this.name = key;
81
}
77
}
82
public SearchPattern getBlankPattern() {
78
public SearchPattern getBlankPattern() {
83
	return new FieldPattern(false, false, false, null, null, null, null, null, R_EXACT_MATCH | R_CASE_SENSITIVE);
79
	return new FieldPattern(null, null, null, null, null, 0, R_EXACT_MATCH | R_CASE_SENSITIVE);
84
}
80
}
85
public char[] getIndexKey() {
81
public char[] getIndexKey() {
86
	return this.name;
82
	return this.name;
87
}
83
}
88
public char[][] getIndexCategories() {
84
public char[][] getIndexCategories() {
89
	if (this.findReferences)
85
	if (this.findReferences || this.fineGrain != 0)
90
		return this.findDeclarations || this.writeAccess ? REF_AND_DECL_CATEGORIES : REF_CATEGORIES;
86
		return this.findDeclarations || this.writeAccess ? REF_AND_DECL_CATEGORIES : REF_CATEGORIES;
91
	if (this.findDeclarations)
87
	if (this.findDeclarations)
92
		return DECL_CATEGORIES;
88
		return DECL_CATEGORIES;
(-)search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java (-69 / +181 lines)
Lines 144-149 Link Here
144
// Cache for method handles
144
// Cache for method handles
145
HashSet methodHandles;
145
HashSet methodHandles;
146
146
147
private final int patternFineGrain;
148
147
/**
149
/**
148
 * An ast visitor that visits local type declarations.
150
 * An ast visitor that visits local type declarations.
149
 */
151
 */
Lines 184-190 Link Here
184
		}
186
		}
185
	}
187
	}
186
}
188
}
187
188
public static class WorkingCopyDocument extends JavaSearchDocument {
189
public static class WorkingCopyDocument extends JavaSearchDocument {
189
	public org.eclipse.jdt.core.ICompilationUnit workingCopy;
190
	public org.eclipse.jdt.core.ICompilationUnit workingCopy;
190
	WorkingCopyDocument(org.eclipse.jdt.core.ICompilationUnit workingCopy, SearchParticipant participant) {
191
	WorkingCopyDocument(org.eclipse.jdt.core.ICompilationUnit workingCopy, SearchParticipant participant) {
Lines 328-333 Link Here
328
	this.pattern = pattern;
329
	this.pattern = pattern;
329
	this.patternLocator = PatternLocator.patternLocator(this.pattern);
330
	this.patternLocator = PatternLocator.patternLocator(this.pattern);
330
	this.matchContainer = this.patternLocator == null ? 0 : this.patternLocator.matchContainer();
331
	this.matchContainer = this.patternLocator == null ? 0 : this.patternLocator.matchContainer();
332
	this.patternFineGrain = this.patternLocator == null ? 0 : this.patternLocator.fineGrain();
331
	this.requestor = requestor;
333
	this.requestor = requestor;
332
	this.scope = scope;
334
	this.scope = scope;
333
	this.progressMonitor = progressMonitor;
335
	this.progressMonitor = progressMonitor;
Lines 1980-1987 Link Here
1980
 * search pattern (ie. the ones in the matching nodes set)
1982
 * search pattern (ie. the ones in the matching nodes set)
1981
 * Note that the method declaration has already been checked.
1983
 * Note that the method declaration has already been checked.
1982
 */
1984
 */
1983
protected void reportMatching(TypeDeclaration type, AbstractMethodDeclaration method, IJavaElement parent, int accuracy, boolean typeInHierarchy, MatchingNodeSet nodeSet) throws CoreException {
1985
protected void reportMatching(AbstractMethodDeclaration method, TypeDeclaration type, IJavaElement parent, int accuracy, boolean typeInHierarchy, MatchingNodeSet nodeSet) throws CoreException {
1984
	IJavaElement enclosingElement = null;
1986
	IJavaElement enclosingElement = null;
1987
1988
	// report method declaration itself
1985
	if (accuracy > -1) {
1989
	if (accuracy > -1) {
1986
		enclosingElement = createHandle(method, parent);
1990
		enclosingElement = createHandle(method, parent);
1987
		if (enclosingElement != null) { // skip if unable to find method
1991
		if (enclosingElement != null) { // skip if unable to find method
Lines 2049-2064 Link Here
2049
				if (enclosingElement == null)
2053
				if (enclosingElement == null)
2050
					enclosingElement = createHandle(method, parent);
2054
					enclosingElement = createHandle(method, parent);
2051
				if (encloses(enclosingElement)) {
2055
				if (encloses(enclosingElement)) {
2052
					for (int i = 0, l = nodes.length; i < l; i++) {
2056
					// standard reporting
2053
						ASTNode node = nodes[i];
2057
					if (this.patternFineGrain == 0) {
2054
						Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2058
						for (int i = 0, l = nodes.length; i < l; i++) {
2055
						this.patternLocator.matchReportReference(node, enclosingElement, method.binding, method.scope, level.intValue(), this);
2059
							ASTNode node = nodes[i];
2060
							Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2061
							this.patternLocator.matchReportReference(node, enclosingElement, method.binding, method.scope, level.intValue(), this);
2062
						}
2063
						return;
2064
					}
2065
					// finegrain reporting
2066
					FineGrainVisitor visitor = new FineGrainVisitor(enclosingElement, method.binding, nodeSet, nodes, this.patternLocator, this);
2067
					try {
2068
						ClassScope classScope = method.scope == null ? null : method.scope.classScope();
2069
						method.traverse(visitor, classScope);
2070
					} catch (WrappedCoreException e) {
2071
						throw e.coreException;
2056
					}
2072
					}
2057
					return;
2058
				}
2073
				}
2059
			}
2074
			}
2060
			for (int i = 0, l = nodes.length; i < l; i++)
2075
			// Remove all remaining nodes
2076
			for (int i = 0, l = nodes.length; i < l; i++) {
2061
				nodeSet.matchingNodes.removeKey(nodes[i]);
2077
				nodeSet.matchingNodes.removeKey(nodes[i]);
2078
			}
2062
		}
2079
		}
2063
	}
2080
	}
2064
}
2081
}
Lines 2072-2078 Link Here
2072
		// Look for annotation type ref
2089
		// Look for annotation type ref
2073
		TypeReference typeRef = annotationType.type;
2090
		TypeReference typeRef = annotationType.type;
2074
		Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeRef);
2091
		Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeRef);
2075
		if (level != null && matchedContainer) {
2092
		if (level != null && matchedContainer && (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0)) {
2076
			this.patternLocator.matchReportReference(typeRef, enclosingElement, elementBinding, level.intValue(), this);
2093
			this.patternLocator.matchReportReference(typeRef, enclosingElement, elementBinding, level.intValue(), this);
2077
		}
2094
		}
2078
		
2095
		
Lines 2081-2087 Link Here
2081
		for (int j = 0, pl = pairs.length; j < pl; j++) {
2098
		for (int j = 0, pl = pairs.length; j < pl; j++) {
2082
			MemberValuePair pair = pairs[j];
2099
			MemberValuePair pair = pairs[j];
2083
			level = (Integer) nodeSet.matchingNodes.removeKey(pair);
2100
			level = (Integer) nodeSet.matchingNodes.removeKey(pair);
2084
			if (level != null && enclosesElement) {
2101
			if (level != null && enclosesElement && this.patternFineGrain == 0) {
2085
				ASTNode reference = (annotationType instanceof SingleMemberAnnotation) ? (ASTNode) annotationType: pair;
2102
				ASTNode reference = (annotationType instanceof SingleMemberAnnotation) ? (ASTNode) annotationType: pair;
2086
				this.patternLocator.matchReportReference(reference, enclosingElement, pair.binding, level.intValue(), this);
2103
				this.patternLocator.matchReportReference(reference, enclosingElement, pair.binding, level.intValue(), this);
2087
			}
2104
			}
Lines 2094-2100 Link Here
2094
				for (int j = 0, nl = nodes.length; j < nl; j++) {
2111
				for (int j = 0, nl = nodes.length; j < nl; j++) {
2095
					nodeSet.matchingNodes.removeKey(nodes[j]);
2112
					nodeSet.matchingNodes.removeKey(nodes[j]);
2096
				}
2113
				}
2097
			} else {
2114
			} else if (this.patternFineGrain == 0) {
2098
				for (int j = 0, nl = nodes.length; j < nl; j++) {
2115
				for (int j = 0, nl = nodes.length; j < nl; j++) {
2099
					ASTNode node = nodes[j];
2116
					ASTNode node = nodes[j];
2100
					level = (Integer) nodeSet.matchingNodes.removeKey(node);
2117
					level = (Integer) nodeSet.matchingNodes.removeKey(node);
Lines 2135-2145 Link Here
2135
				// import ref cannot be in the hierarchy of a type
2152
				// import ref cannot be in the hierarchy of a type
2136
				if (this.hierarchyResolver != null) continue;
2153
				if (this.hierarchyResolver != null) continue;
2137
2154
2138
				ImportReference importRef = (ImportReference) node;
2155
				if (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) {
2139
				Binding binding = (importRef.bits & ASTNode.OnDemand) != 0
2156
					ImportReference importRef = (ImportReference) node;
2140
					? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic())
2157
					Binding binding = (importRef.bits & ASTNode.OnDemand) != 0
2141
					: unitScope.getImport(importRef.tokens, false, importRef.isStatic());
2158
						? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic())
2142
				this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this);
2159
						: unitScope.getImport(importRef.tokens, false, importRef.isStatic());
2160
					this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this);
2161
				}
2143
			} else {
2162
			} else {
2144
				nodeSet.addMatch(node, this.patternLocator.resolveLevel(node));
2163
				nodeSet.addMatch(node, this.patternLocator.resolveLevel(node));
2145
			}
2164
			}
Lines 2161-2167 Link Here
2161
	boolean matchedUnitContainer = (this.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0;
2180
	boolean matchedUnitContainer = (this.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0;
2162
2181
2163
	// report references in javadoc
2182
	// report references in javadoc
2164
	if (unit.javadoc != null) {
2183
	if (unit.javadoc != null && this.patternFineGrain == 0) {
2165
		ASTNode[] nodes = nodeSet.matchingNodes(unit.javadoc.sourceStart, unit.javadoc.sourceEnd);
2184
		ASTNode[] nodes = nodeSet.matchingNodes(unit.javadoc.sourceStart, unit.javadoc.sourceEnd);
2166
		if (nodes != null) {
2185
		if (nodes != null) {
2167
			if (!matchedUnitContainer) {
2186
			if (!matchedUnitContainer) {
Lines 2172-2179 Link Here
2172
				for (int i = 0, l = nodes.length; i < l; i++) {
2191
				for (int i = 0, l = nodes.length; i < l; i++) {
2173
					ASTNode node = nodes[i];
2192
					ASTNode node = nodes[i];
2174
					Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2193
					Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2175
					if (encloses(element))
2194
					if (encloses(element) && this.patternFineGrain == 0) {
2176
						this.patternLocator.matchReportReference(node, element, null/*no binding*/, level.intValue(), this);
2195
						this.patternLocator.matchReportReference(node, element, null/*no binding*/, level.intValue(), this);
2196
					}
2177
				}
2197
				}
2178
			}
2198
			}
2179
		}
2199
		}
Lines 2193-2203 Link Here
2193
			for (int i = 0, l = imports.length; i < l; i++) {
2213
			for (int i = 0, l = imports.length; i < l; i++) {
2194
				ImportReference importRef = imports[i];
2214
				ImportReference importRef = imports[i];
2195
				Integer level = (Integer) nodeSet.matchingNodes.removeKey(importRef);
2215
				Integer level = (Integer) nodeSet.matchingNodes.removeKey(importRef);
2196
				if (level != null) {
2216
				if (level != null && (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0)) {
2197
					Binding binding = (importRef.bits & ASTNode.OnDemand) != 0
2217
					this.patternLocator.matchReportImportRef(importRef, null /*no binding*/, createImportHandle(importRef), level.intValue(), this);
2198
						? unitScope.getImport(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length), true, importRef.isStatic())
2199
						: unitScope.getImport(importRef.tokens, false, importRef.isStatic());
2200
					this.patternLocator.matchReportImportRef(importRef, binding, createImportHandle(importRef), level.intValue(), this);
2201
				}
2218
				}
2202
			}
2219
			}
2203
		}
2220
		}
Lines 2270-2291 Link Here
2270
					if (enclosingElement == null)
2287
					if (enclosingElement == null)
2271
						enclosingElement = createHandle(field, type, parent);
2288
						enclosingElement = createHandle(field, type, parent);
2272
					if (encloses(enclosingElement)) {
2289
					if (encloses(enclosingElement)) {
2273
						for (int i = 0, l = nodes.length; i < l; i++) {
2290
						// standard reporting
2274
							ASTNode node = nodes[i];
2291
						if (this.patternFineGrain == 0) {
2275
							Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2292
							for (int i = 0, l = nodes.length; i < l; i++) {
2276
							IJavaElement[] otherElements = null;
2293
								ASTNode node = nodes[i];
2277
							if (otherFields != null) {
2294
								Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2278
								int length = otherFields.length;
2295
								IJavaElement[] otherElements = null;
2279
								int size = 0;
2296
								if (otherFields != null) {
2280
								while (size<length && otherFields[size] != null) {
2297
									int length = otherFields.length;
2281
									size++;
2298
									int size = 0;
2282
								}
2299
									while (size<length && otherFields[size] != null) {
2283
								otherElements = new IJavaElement[size];
2300
										size++;
2284
								for (int j=0; j<size; j++) {
2301
									}
2285
									otherElements[j] = createHandle(otherFields[j], type, parent);
2302
									otherElements = new IJavaElement[size];
2303
									for (int j=0; j<size; j++) {
2304
										otherElements[j] = createHandle(otherFields[j], type, parent);
2305
									}
2286
								}
2306
								}
2307
								this.patternLocator.matchReportReference(node, enclosingElement, null, otherElements, field.binding, level.intValue(), this);
2308
							}
2309
						 } else {
2310
							// finegrain reporting
2311
							FineGrainVisitor visitor = new FineGrainVisitor(enclosingElement, field.binding, nodeSet, nodes, this.patternLocator, this);
2312
							try {
2313
								field.traverse(visitor, null);
2314
							} catch (WrappedCoreException e) {
2315
								throw e.coreException;
2316
							}
2317
							// Remove all remaining nodes
2318
							for (int i = 0, l = nodes.length; i < l; i++) {
2319
								nodeSet.matchingNodes.removeKey(nodes[i]);
2287
							}
2320
							}
2288
							this.patternLocator.matchReportReference(node, enclosingElement, null, otherElements, field.binding, level.intValue(), this);
2289
						}
2321
						}
2290
					}
2322
					}
2291
				}
2323
				}
Lines 2304-2326 Link Here
2304
					enclosingElement = createHandle(field, type, parent);
2336
					enclosingElement = createHandle(field, type, parent);
2305
				}
2337
				}
2306
				if (encloses(enclosingElement)) {
2338
				if (encloses(enclosingElement)) {
2307
					for (int i = 0, l = nodes.length; i < l; i++) {
2339
					// standard reporting
2308
						ASTNode node = nodes[i];
2340
					if (this.patternFineGrain == 0) {
2309
						Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2341
						for (int i = 0, l = nodes.length; i < l; i++) {
2310
						if (node instanceof TypeDeclaration) {
2342
							ASTNode node = nodes[i];
2311
							// use field declaration to report match (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174)
2343
							Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2312
							AllocationExpression allocation = ((TypeDeclaration)node).allocation;
2344
							if (node instanceof TypeDeclaration) {
2313
							if (allocation != null && allocation.enumConstant != null) {
2345
								// use field declaration to report match (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174)
2314
								node = field;
2346
								AllocationExpression allocation = ((TypeDeclaration)node).allocation;
2347
								if (allocation != null && allocation.enumConstant != null) {
2348
									node = field;
2349
								}
2315
							}
2350
							}
2351
							// Set block scope for initializer in case there would have other local and other elements to report
2352
							BlockScope blockScope = null;
2353
							if (field.getKind() == AbstractVariableDeclaration.INITIALIZER) {
2354
								Block block = ((Initializer)field).block;
2355
								if (block != null) blockScope = block.scope;
2356
							}
2357
							this.patternLocator.matchReportReference(node, enclosingElement, field.binding, blockScope, level.intValue(), this);
2316
						}
2358
						}
2317
						// Set block scope for initializer in case there would have other local and other elements to report
2359
						return;
2318
						BlockScope blockScope = null;
2360
					}
2319
						if (field.getKind() == AbstractVariableDeclaration.INITIALIZER) {
2361
					// finegrain reporting
2320
							Block block = ((Initializer)field).block;
2362
					FineGrainVisitor visitor = new FineGrainVisitor(enclosingElement, field.binding, nodeSet, nodes, this.patternLocator, this);
2321
							if (block != null) blockScope = block.scope;
2363
					try {
2322
						}
2364
						field.traverse(visitor, field.isStatic() ? type.staticInitializerScope : type.initializerScope);
2323
						this.patternLocator.matchReportReference(node, enclosingElement, field.binding, blockScope, level.intValue(), this);
2365
					} catch (WrappedCoreException e) {
2366
						throw e.coreException;
2367
					}
2368
					// Remove all remaining nodes
2369
					for (int i = 0, l = nodes.length; i < l; i++) {
2370
						nodeSet.matchingNodes.removeKey(nodes[i]);
2324
					}
2371
					}
2325
				}
2372
				}
2326
			}
2373
			}
Lines 2369-2375 Link Here
2369
	}
2416
	}
2370
2417
2371
	// report references in javadoc
2418
	// report references in javadoc
2372
	if (type.javadoc != null) {
2419
	if (type.javadoc != null && this.patternFineGrain == 0) {
2373
		ASTNode[] nodes = nodeSet.matchingNodes(type.declarationSourceStart, type.sourceStart);
2420
		ASTNode[] nodes = nodeSet.matchingNodes(type.declarationSourceStart, type.sourceStart);
2374
		if (nodes != null) {
2421
		if (nodes != null) {
2375
			if (!matchedClassContainer) {
2422
			if (!matchedClassContainer) {
Lines 2389-2396 Link Here
2389
	
2436
	
2390
	// super types
2437
	// super types
2391
	if ((type.bits & ASTNode.IsAnonymousType) != 0) {
2438
	if ((type.bits & ASTNode.IsAnonymousType) != 0) {
2392
		TypeReference superType =type.allocation.type;
2439
		TypeReference superType = type.allocation.type;
2393
		if (superType != null) {
2440
		if (superType != null && (this.patternFineGrain == 0 || (this.patternFineGrain & (IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE | IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE)) != 0)) {
2394
			Integer level = (Integer) nodeSet.matchingNodes.removeKey(superType);
2441
			Integer level = (Integer) nodeSet.matchingNodes.removeKey(superType);
2395
			if (level != null && matchedClassContainer)
2442
			if (level != null && matchedClassContainer)
2396
				this.patternLocator.matchReportReference(superType, enclosingElement, type.binding, level.intValue(), this);
2443
				this.patternLocator.matchReportReference(superType, enclosingElement, type.binding, level.intValue(), this);
Lines 2398-2409 Link Here
2398
	} else {
2445
	} else {
2399
		TypeReference superClass = type.superclass;
2446
		TypeReference superClass = type.superclass;
2400
		if (superClass != null) {
2447
		if (superClass != null) {
2401
			reportMatchingSuper(superClass, enclosingElement, type.binding, nodeSet, matchedClassContainer);
2448
			boolean shouldReportSuper = (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE) != 0);
2449
			reportMatchingSuper(superClass, enclosingElement, type.binding, nodeSet, matchedClassContainer, shouldReportSuper);
2402
		}
2450
		}
2403
		TypeReference[] superInterfaces = type.superInterfaces;
2451
		TypeReference[] superInterfaces = type.superInterfaces;
2404
		if (superInterfaces != null) {
2452
		if (superInterfaces != null) {
2453
			boolean shouldReportSuper = (this.patternFineGrain == 0 || (this.patternFineGrain & IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE) != 0);
2405
			for (int i = 0, l = superInterfaces.length; i < l; i++) {
2454
			for (int i = 0, l = superInterfaces.length; i < l; i++) {
2406
				reportMatchingSuper(superInterfaces[i], enclosingElement, type.binding, nodeSet, matchedClassContainer);
2455
				reportMatchingSuper(superInterfaces[i], enclosingElement, type.binding, nodeSet, matchedClassContainer, shouldReportSuper);
2407
			}
2456
			}
2408
		}
2457
		}
2409
	}
2458
	}
Lines 2463-2469 Link Here
2463
			AbstractMethodDeclaration method = methods[i];
2512
			AbstractMethodDeclaration method = methods[i];
2464
			Integer level = (Integer) nodeSet.matchingNodes.removeKey(method);
2513
			Integer level = (Integer) nodeSet.matchingNodes.removeKey(method);
2465
			int value = (level != null && matchedClassContainer) ? level.intValue() : -1;
2514
			int value = (level != null && matchedClassContainer) ? level.intValue() : -1;
2466
			reportMatching(type, method, enclosingElement, value, typeInHierarchy, nodeSet);
2515
			reportMatching(method, type, enclosingElement, value, typeInHierarchy, nodeSet);
2467
		}
2516
		}
2468
	}
2517
	}
2469
2518
Lines 2484-2494 Link Here
2484
 */
2533
 */
2485
protected void reportMatching(TypeParameter[] typeParameters, IJavaElement enclosingElement, IJavaElement parent, Binding binding, MatchingNodeSet nodeSet) throws CoreException {
2534
protected void reportMatching(TypeParameter[] typeParameters, IJavaElement enclosingElement, IJavaElement parent, Binding binding, MatchingNodeSet nodeSet) throws CoreException {
2486
	if (typeParameters == null) return;
2535
	if (typeParameters == null) return;
2536
	boolean typeParameterBoundShouldBeReported = this.patternFineGrain == 0 ||
2537
		(this.patternFineGrain & IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE) != 0;
2538
	boolean parameterizedTypeShouldBeReported = this.patternFineGrain == 0 ||
2539
		(this.patternFineGrain & IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE) != 0;
2540
	boolean wildcardBoundShouldBeReported = this.patternFineGrain == 0 ||
2541
		(this.patternFineGrain & IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE) != 0;
2542
	if (!typeParameterBoundShouldBeReported && !parameterizedTypeShouldBeReported && !wildcardBoundShouldBeReported) {
2543
		return;
2544
	}
2487
	for (int i=0, l=typeParameters.length; i<l; i++) {
2545
	for (int i=0, l=typeParameters.length; i<l; i++) {
2488
		TypeParameter typeParameter = typeParameters[i];
2546
		TypeParameter typeParameter = typeParameters[i];
2489
		if (typeParameter != null) {
2547
		if (typeParameter != null) {
2490
			Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter);
2548
			Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter);
2491
			if (level != null) {
2549
			if (level != null && this.patternFineGrain == 0) {
2492
				if (level.intValue() > -1 && encloses(enclosingElement)) {
2550
				if (level.intValue() > -1 && encloses(enclosingElement)) {
2493
					int offset = typeParameter.sourceStart;
2551
					int offset = typeParameter.sourceStart;
2494
					SearchMatch match = this.patternLocator.newDeclarationMatch(typeParameter, enclosingElement, binding, level.intValue(), typeParameter.sourceEnd-offset+1, this);
2552
					SearchMatch match = this.patternLocator.newDeclarationMatch(typeParameter, enclosingElement, binding, level.intValue(), typeParameter.sourceEnd-offset+1, this);
Lines 2497-2503 Link Here
2497
			}
2555
			}
2498
			if (typeParameter.type != null) {
2556
			if (typeParameter.type != null) {
2499
				level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.type);
2557
				level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.type);
2500
				if (level != null) {
2558
				if (level != null && typeParameterBoundShouldBeReported) {
2501
					IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2559
					IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2502
					this.patternLocator.matchReportReference(typeParameter.type, enclosingElement, localElement, null, binding, level.intValue(), this);
2560
					this.patternLocator.matchReportReference(typeParameter.type, enclosingElement, localElement, null, binding, level.intValue(), this);
2503
				}
2561
				}
Lines 2508-2518 Link Here
2508
                    	for (int k=0; k<length; k++) {
2566
                    	for (int k=0; k<length; k++) {
2509
							TypeReference typeArgument = paramSTR.typeArguments[k];
2567
							TypeReference typeArgument = paramSTR.typeArguments[k];
2510
							level = (Integer) nodeSet.matchingNodes.removeKey(typeArgument);
2568
							level = (Integer) nodeSet.matchingNodes.removeKey(typeArgument);
2511
							if (level != null) {
2569
							if (level != null && parameterizedTypeShouldBeReported) {
2512
								IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2570
								IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2513
								this.patternLocator.matchReportReference(typeArgument, enclosingElement, localElement, null, binding, level.intValue(), this);
2571
								this.patternLocator.matchReportReference(typeArgument, enclosingElement, localElement, null, binding, level.intValue(), this);
2514
							}
2572
							}
2515
							if (typeArgument instanceof Wildcard) {
2573
							if (wildcardBoundShouldBeReported && typeArgument instanceof Wildcard) {
2516
	                            TypeReference wildcardBound = ((Wildcard) typeArgument).bound;
2574
	                            TypeReference wildcardBound = ((Wildcard) typeArgument).bound;
2517
								level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound);
2575
								level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound);
2518
								if (level != null) {
2576
								if (level != null) {
Lines 2528-2534 Link Here
2528
				for (int j=0, b=typeParameter.bounds.length; j<b; j++) {
2586
				for (int j=0, b=typeParameter.bounds.length; j<b; j++) {
2529
					TypeReference typeParameterBound = typeParameter.bounds[j];
2587
					TypeReference typeParameterBound = typeParameter.bounds[j];
2530
					level = (Integer) nodeSet.matchingNodes.removeKey(typeParameterBound);
2588
					level = (Integer) nodeSet.matchingNodes.removeKey(typeParameterBound);
2531
					if (level != null) {
2589
					if (level != null && typeParameterBoundShouldBeReported) {
2532
						IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2590
						IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2533
						this.patternLocator.matchReportReference(typeParameterBound, enclosingElement, localElement, null, binding, level.intValue(), this);
2591
						this.patternLocator.matchReportReference(typeParameterBound, enclosingElement, localElement, null, binding, level.intValue(), this);
2534
					}
2592
					}
Lines 2539-2549 Link Here
2539
	                    	for (int k=0; k<length; k++) {
2597
	                    	for (int k=0; k<length; k++) {
2540
								TypeReference typeArgument = paramSTR.typeArguments[k];
2598
								TypeReference typeArgument = paramSTR.typeArguments[k];
2541
								level = (Integer) nodeSet.matchingNodes.removeKey(typeArgument);
2599
								level = (Integer) nodeSet.matchingNodes.removeKey(typeArgument);
2542
								if (level != null) {
2600
								if (level != null && parameterizedTypeShouldBeReported) {
2543
									IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2601
									IJavaElement localElement = createHandle(typeParameter, enclosingElement);
2544
									this.patternLocator.matchReportReference(typeArgument, enclosingElement, localElement, null, binding, level.intValue(), this);
2602
									this.patternLocator.matchReportReference(typeArgument, enclosingElement, localElement, null, binding, level.intValue(), this);
2545
								}
2603
								}
2546
								if (typeArgument instanceof Wildcard) {
2604
								if (wildcardBoundShouldBeReported && typeArgument instanceof Wildcard) {
2547
		                            TypeReference wildcardBound = ((Wildcard) typeArgument).bound;
2605
		                            TypeReference wildcardBound = ((Wildcard) typeArgument).bound;
2548
									level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound);
2606
									level = (Integer) nodeSet.matchingNodes.removeKey(wildcardBound);
2549
									if (level != null) {
2607
									if (level != null) {
Lines 2559-2565 Link Here
2559
		}
2617
		}
2560
	}
2618
	}
2561
}
2619
}
2562
protected void reportMatchingSuper(TypeReference superReference, IJavaElement enclosingElement, Binding elementBinding, MatchingNodeSet nodeSet, boolean matchedClassContainer) throws CoreException {
2620
protected boolean shouldReportParameterizedSingleTypeReference(ParameterizedSingleTypeReference typeReference, ASTNode node) {
2621
	TypeReference[] typeArguments = typeReference.typeArguments;
2622
	if (typeArguments != null) {
2623
		int length = typeArguments.length;
2624
		for (int i=0; i<length; i++) {
2625
			TypeReference typeArgument = typeArguments[i];
2626
			if (typeArgument == node) return true;
2627
			if (typeArgument instanceof ParameterizedSingleTypeReference) {
2628
				ParameterizedSingleTypeReference paramSTR = (ParameterizedSingleTypeReference) typeArgument;
2629
				if (shouldReportParameterizedSingleTypeReference(paramSTR, node)) {
2630
					return true;
2631
				}
2632
			}
2633
			if (typeArguments[i] instanceof ParameterizedQualifiedTypeReference) {
2634
				ParameterizedQualifiedTypeReference paramQTR = (ParameterizedQualifiedTypeReference) typeArguments[i];
2635
				if (shouldReportParameterizedQualifiedTypeReference(paramQTR, node)) {
2636
					return true;
2637
				}
2638
			}
2639
		}
2640
	}
2641
	return true;
2642
}
2643
protected boolean shouldReportParameterizedQualifiedTypeReference(ParameterizedQualifiedTypeReference typeReference, ASTNode node) {
2644
	TypeReference[][] allTypeArguments = typeReference.typeArguments;
2645
	if (allTypeArguments != null) {
2646
		int allLength = allTypeArguments.length;
2647
		for (int i=0; i<allLength; i++) {
2648
			TypeReference[] typeArguments = allTypeArguments[i];
2649
			if (typeArguments != null) {
2650
				int length = typeArguments.length;
2651
				for (int j=0; j<length; j++) {
2652
					TypeReference typeArgument = typeArguments[j];
2653
					if (typeArgument == node) return true;
2654
					if (typeArgument instanceof ParameterizedSingleTypeReference) {
2655
						ParameterizedSingleTypeReference paramSTR = (ParameterizedSingleTypeReference) typeArgument;
2656
						if (shouldReportParameterizedSingleTypeReference(paramSTR, node)) {
2657
							return true;
2658
						}
2659
					}
2660
					if (typeArgument instanceof ParameterizedQualifiedTypeReference) {
2661
						ParameterizedQualifiedTypeReference paramQTR = (ParameterizedQualifiedTypeReference) typeArgument;
2662
						if (shouldReportParameterizedQualifiedTypeReference(paramQTR, node)) {
2663
							return true;
2664
						}
2665
					}
2666
				}
2667
			}
2668
		}
2669
	}
2670
	return true;
2671
}
2672
protected void reportMatchingSuper(TypeReference superReference, IJavaElement enclosingElement, Binding elementBinding, MatchingNodeSet nodeSet, boolean matchedClassContainer, boolean shouldReportSuper) throws CoreException {
2563
	ASTNode[] nodes = null;
2673
	ASTNode[] nodes = null;
2564
	if (superReference instanceof ParameterizedSingleTypeReference || superReference instanceof ParameterizedQualifiedTypeReference) {
2674
	if (superReference instanceof ParameterizedSingleTypeReference || superReference instanceof ParameterizedQualifiedTypeReference) {
2565
		long lastTypeArgumentInfo = findLastTypeArgumentInfo(superReference);
2675
		long lastTypeArgumentInfo = findLastTypeArgumentInfo(superReference);
Lines 2574-2585 Link Here
2574
				for (int i = 0, l = nodes.length; i < l; i++) {
2684
				for (int i = 0, l = nodes.length; i < l; i++) {
2575
					ASTNode node = nodes[i];
2685
					ASTNode node = nodes[i];
2576
					Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2686
					Integer level = (Integer) nodeSet.matchingNodes.removeKey(node);
2577
					this.patternLocator.matchReportReference(node, enclosingElement, elementBinding, level.intValue(), this);
2687
					if (this.patternFineGrain == 0 || ((this.patternFineGrain & IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE) != 0)) {
2688
						this.patternLocator.matchReportReference(node, enclosingElement, elementBinding, level.intValue(), this);
2689
					}
2578
				}
2690
				}
2579
		}
2691
		}
2580
	} else {
2692
	} else if (encloses(enclosingElement)) {
2581
		Integer level = (Integer) nodeSet.matchingNodes.removeKey(superReference);
2693
		Integer level = (Integer) nodeSet.matchingNodes.removeKey(superReference);
2582
		if (level != null && matchedClassContainer)
2694
		if (level != null && matchedClassContainer&& shouldReportSuper)
2583
			this.patternLocator.matchReportReference(superReference, enclosingElement, elementBinding, level.intValue(), this);
2695
			this.patternLocator.matchReportReference(superReference, enclosingElement, elementBinding, level.intValue(), this);
2584
	}
2696
	}
2585
}
2697
}
(-)search/org/eclipse/jdt/internal/core/search/matching/MatchLocatorParser.java (-31 / +244 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core.search.matching;
11
package org.eclipse.jdt.internal.core.search.matching;
12
12
13
import org.eclipse.jdt.core.search.IJavaSearchConstants;
13
import org.eclipse.jdt.internal.compiler.ASTVisitor;
14
import org.eclipse.jdt.internal.compiler.ASTVisitor;
14
import org.eclipse.jdt.internal.compiler.ast.*;
15
import org.eclipse.jdt.internal.compiler.ast.*;
15
import org.eclipse.jdt.internal.compiler.lookup.*;
16
import org.eclipse.jdt.internal.compiler.lookup.*;
Lines 21-33 Link Here
21
 */
22
 */
22
public class MatchLocatorParser extends Parser {
23
public class MatchLocatorParser extends Parser {
23
24
24
MatchingNodeSet nodeSet;
25
	static final int UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK =
25
PatternLocator patternLocator;
26
		IJavaSearchConstants.CAST_TYPE_REFERENCE |
26
private ASTVisitor localDeclarationVisitor;
27
		IJavaSearchConstants.QUALIFIED_REFERENCE |
28
		IJavaSearchConstants.IMPLICIT_THIS_REFERENCE |
29
		IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE |
30
		IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
31
	static final int FORMAL_PARAMETER_FINE_GRAIN_MASK = 
32
		IJavaSearchConstants.PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE |
33
		IJavaSearchConstants.CATCH_TYPE_REFERENCE;
34
	static final int GENERIC_FINE_GRAIN_MASK = 
35
		IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE |
36
		IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE |
37
		IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
38
	MatchingNodeSet nodeSet;
39
	PatternLocator patternLocator;
40
	private ASTVisitor localDeclarationVisitor;
41
	int typeRefFineGrain;
27
42
28
public static MatchLocatorParser createParser(ProblemReporter problemReporter, MatchLocator locator) {
43
public static MatchLocatorParser createParser(ProblemReporter problemReporter, MatchLocator locator) {
29
	if ((locator.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0)
44
	if ((locator.matchContainer & PatternLocator.COMPILATION_UNIT_CONTAINER) != 0) {
30
		return new ImportMatchLocatorParser(problemReporter, locator);
45
		return new ImportMatchLocatorParser(problemReporter, locator);
46
	}
31
	return new MatchLocatorParser(problemReporter, locator);
47
	return new MatchLocatorParser(problemReporter, locator);
32
}
48
}
33
49
Lines 60-66 Link Here
60
		return (constructorDeclaration.bits & ASTNode.HasLocalType) != 0; // continue only if it has local type
76
		return (constructorDeclaration.bits & ASTNode.HasLocalType) != 0; // continue only if it has local type
61
	}
77
	}
62
	public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
78
	public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
63
		patternLocator.match(fieldDeclaration, nodeSet);
79
		int patternFineGrain = patternLocator.fineGrain();
80
		if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.FIELD_TYPE_DECLARATION_TYPE_REFERENCE) != 0) {
81
			patternLocator.match(fieldDeclaration, nodeSet);
82
		}
64
		return (fieldDeclaration.bits & ASTNode.HasLocalType) != 0; // continue only if it has local type;
83
		return (fieldDeclaration.bits & ASTNode.HasLocalType) != 0; // continue only if it has local type;
65
	}
84
	}
66
	public boolean visit(Initializer initializer, MethodScope scope) {
85
	public boolean visit(Initializer initializer, MethodScope scope) {
Lines 183-188 Link Here
183
	super.classInstanceCreation(alwaysQualified);
202
	super.classInstanceCreation(alwaysQualified);
184
	this.patternLocator.match(this.expressionStack[this.expressionPtr], this.nodeSet);
203
	this.patternLocator.match(this.expressionStack[this.expressionPtr], this.nodeSet);
185
}
204
}
205
protected void consumeAnnotationAsModifier() {
206
	super.consumeAnnotationAsModifier();
207
}
208
protected void consumeAnnotationName() {
209
	super.consumeAnnotationName();
210
}
186
protected void consumeAssignment() {
211
protected void consumeAssignment() {
187
	super.consumeAssignment();
212
	super.consumeAssignment();
188
	this.patternLocator.match(this.expressionStack[this.expressionPtr], this.nodeSet);
213
	this.patternLocator.match(this.expressionStack[this.expressionPtr], this.nodeSet);
Lines 206-220 Link Here
206
protected void consumeFieldAccess(boolean isSuperAccess) {
231
protected void consumeFieldAccess(boolean isSuperAccess) {
207
	super.consumeFieldAccess(isSuperAccess);
232
	super.consumeFieldAccess(isSuperAccess);
208
233
209
	// this is always a Reference
234
	int fineGrain = isSuperAccess ? IJavaSearchConstants.SUPER_REFERENCE : IJavaSearchConstants.THIS_REFERENCE;
210
	this.patternLocator.match((Reference) this.expressionStack[this.expressionPtr], this.nodeSet);
235
	int patternFineGrain = this.patternLocator.fineGrain();
236
	if (patternFineGrain == 0 || (patternFineGrain & fineGrain) != 0) {
237
		// this is always a Reference
238
		this.patternLocator.match((Reference) this.expressionStack[this.expressionPtr], this.nodeSet);
239
	}
211
}
240
}
212
protected void consumeFormalParameter(boolean isVarArgs) {
241
protected void consumeFormalParameter(boolean isVarArgs) {
242
	this.typeRefFineGrain |= FORMAL_PARAMETER_FINE_GRAIN_MASK;
213
	super.consumeFormalParameter(isVarArgs);
243
	super.consumeFormalParameter(isVarArgs);
214
215
	// this is always a LocalDeclaration
216
	this.patternLocator.match((LocalDeclaration) this.astStack[this.astPtr], this.nodeSet);
244
	this.patternLocator.match((LocalDeclaration) this.astStack[this.astPtr], this.nodeSet);
245
	this.typeRefFineGrain &= ~FORMAL_PARAMETER_FINE_GRAIN_MASK;
217
}
246
}
247
218
protected void consumeLocalVariableDeclaration() {
248
protected void consumeLocalVariableDeclaration() {
219
	super.consumeLocalVariableDeclaration();
249
	super.consumeLocalVariableDeclaration();
220
250
Lines 223-279 Link Here
223
}
253
}
224
protected void consumeMarkerAnnotation() {
254
protected void consumeMarkerAnnotation() {
225
	super.consumeMarkerAnnotation();
255
	super.consumeMarkerAnnotation();
226
	// this is always an Annotation
256
	int patternFineGrain = this.patternLocator.fineGrain();
227
	Annotation annotation = (Annotation) expressionStack[expressionPtr];
257
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) {
228
	this.patternLocator.match(annotation, nodeSet);
258
		// this is always an Annotation
259
		Annotation annotation = (Annotation) expressionStack[expressionPtr];
260
		this.patternLocator.match(annotation, nodeSet);
261
	}
229
}
262
}
230
protected void consumeMemberValuePair() {
263
protected void consumeMemberValuePair() {
264
//	this.validFineGrain |= IJavaSearchConstants.MEMBER_PAIR_VALUE_REFERENCE;
231
	super.consumeMemberValuePair();
265
	super.consumeMemberValuePair();
232
266
233
	// this is always a MemberValuePair
267
	// this is always a MemberValuePair
234
	this.patternLocator.match((MemberValuePair) this.astStack[this.astPtr], this.nodeSet);
268
	this.patternLocator.match((MemberValuePair) this.astStack[this.astPtr], this.nodeSet);
269
//	this.validFineGrain &= ~IJavaSearchConstants.MEMBER_PAIR_VALUE_REFERENCE;
235
}
270
}
236
protected void consumeMethodInvocationName() {
271
protected void consumeMethodInvocationName() {
237
	super.consumeMethodInvocationName();
272
	super.consumeMethodInvocationName();
238
273
	
239
	// this is always a MessageSend
274
	int patternFineGrain = this.patternLocator.fineGrain();
240
	this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
275
	if (patternFineGrain == 0 || (patternFineGrain & (IJavaSearchConstants.IMPLICIT_THIS_REFERENCE | IJavaSearchConstants.QUALIFIED_REFERENCE)) != 0) {
276
		// this is always a MessageSend
277
		this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
278
	}
241
}
279
}
242
protected void consumeMethodInvocationNameWithTypeArguments() {
280
protected void consumeMethodInvocationNameWithTypeArguments() {
243
	super.consumeMethodInvocationNameWithTypeArguments();
281
	super.consumeMethodInvocationNameWithTypeArguments();
244
282
245
	// this is always a MessageSend
283
	int patternFineGrain = this.patternLocator.fineGrain();
246
	this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
284
	if (patternFineGrain == 0 || (patternFineGrain & (IJavaSearchConstants.IMPLICIT_THIS_REFERENCE | IJavaSearchConstants.QUALIFIED_REFERENCE)) != 0) {
285
		// this is always a MessageSend
286
		this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
287
	}
247
}
288
}
248
protected void consumeMethodInvocationPrimary() {
289
protected void consumeMethodInvocationPrimary() {
249
	super.consumeMethodInvocationPrimary(); 
290
	super.consumeMethodInvocationPrimary(); 
250
291
251
	// this is always a MessageSend
292
	int patternFineGrain = this.patternLocator.fineGrain();
252
	this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
293
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.THIS_REFERENCE) != 0) {
294
		// this is always a MessageSend
295
		this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
296
	}
253
}
297
}
254
protected void consumeMethodInvocationPrimaryWithTypeArguments() {
298
protected void consumeMethodInvocationPrimaryWithTypeArguments() {
255
	super.consumeMethodInvocationPrimaryWithTypeArguments();
299
	super.consumeMethodInvocationPrimaryWithTypeArguments();
256
300
257
	// this is always a MessageSend
301
	int patternFineGrain = this.patternLocator.fineGrain();
258
	this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
302
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.THIS_REFERENCE) != 0) {
303
		// this is always a MessageSend
304
		this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
305
	}
259
}
306
}
260
protected void consumeMethodInvocationSuper() {
307
protected void consumeMethodInvocationSuper() {
261
	super.consumeMethodInvocationSuper();
308
	super.consumeMethodInvocationSuper();
262
309
263
	// this is always a MessageSend
310
	int patternFineGrain = this.patternLocator.fineGrain();
264
	this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
311
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.SUPER_REFERENCE) != 0) {
312
		// this is always a MessageSend
313
		this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
314
	}
265
}
315
}
266
protected void consumeMethodInvocationSuperWithTypeArguments() {
316
protected void consumeMethodInvocationSuperWithTypeArguments() {
267
	super.consumeMethodInvocationSuperWithTypeArguments();
317
	super.consumeMethodInvocationSuperWithTypeArguments();
268
318
269
	// this is always a MessageSend
319
	int patternFineGrain = this.patternLocator.fineGrain();
270
	this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
320
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.SUPER_REFERENCE) != 0) {
321
		// this is always a MessageSend
322
		this.patternLocator.match((MessageSend) this.expressionStack[this.expressionPtr], this.nodeSet);
323
	}
271
}
324
}
272
protected void consumeNormalAnnotation() {
325
protected void consumeNormalAnnotation() {
273
	super.consumeNormalAnnotation();
326
	super.consumeNormalAnnotation();
274
	// this is always an Annotation
327
	int patternFineGrain = this.patternLocator.fineGrain();
275
	Annotation annotation = (Annotation) expressionStack[expressionPtr];
328
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE) != 0) {
276
	this.patternLocator.match(annotation, nodeSet);
329
		// this is always an Annotation
330
		Annotation annotation = (Annotation) expressionStack[expressionPtr];
331
		this.patternLocator.match(annotation, nodeSet);
332
	}
277
}
333
}
278
protected void consumePrimaryNoNewArray() {
334
protected void consumePrimaryNoNewArray() {
279
	// pop parenthesis positions (and don't update expression positions
335
	// pop parenthesis positions (and don't update expression positions
Lines 297-304 Link Here
297
	this.patternLocator.match(annotation, nodeSet);
353
	this.patternLocator.match(annotation, nodeSet);
298
}
354
}
299
protected void consumeTypeArgument() {
355
protected void consumeTypeArgument() {
356
	this.typeRefFineGrain |= IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE;
300
	super.consumeTypeArgument();
357
	super.consumeTypeArgument();
301
	patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet);
358
	patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet);
359
	this.typeRefFineGrain &= ~IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE;
360
}
361
protected void consumeTypeArgumentReferenceType1() {
362
	this.typeRefFineGrain |= IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE;
363
	super.consumeTypeArgumentReferenceType1();
364
	patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet);
365
	this.typeRefFineGrain &= ~IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE;
366
}
367
protected void consumeTypeArgumentReferenceType2() {
368
	this.typeRefFineGrain |= IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE;
369
	super.consumeTypeArgumentReferenceType2();
370
	patternLocator.match((TypeReference)genericsStack[genericsPtr], nodeSet);
371
	this.typeRefFineGrain &= ~IJavaSearchConstants.PARAMETERIZED_TYPE_REFERENCE;
302
}
372
}
303
protected void consumeTypeParameterHeader() {
373
protected void consumeTypeParameterHeader() {
304
	super.consumeTypeParameterHeader();
374
	super.consumeTypeParameterHeader();
Lines 318-334 Link Here
318
}
388
}
319
protected TypeReference getTypeReference(int dim) {
389
protected TypeReference getTypeReference(int dim) {
320
	TypeReference typeRef = super.getTypeReference(dim);
390
	TypeReference typeRef = super.getTypeReference(dim);
321
	this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere
391
	int patternFineGrain = this.patternLocator.fineGrain();
392
	if (patternFineGrain == 0 || (this.typeRefFineGrain & patternFineGrain) != 0) {
393
		this.patternLocator.match(typeRef, this.nodeSet); // NB: Don't check container since type reference can happen anywhere
394
	}
322
	return typeRef;
395
	return typeRef;
323
}
396
}
324
protected NameReference getUnspecifiedReference() {
397
protected NameReference getUnspecifiedReference() {
325
	NameReference nameRef = super.getUnspecifiedReference();
398
	NameReference nameRef = super.getUnspecifiedReference();
326
	this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
399
	int patternFineGrain = this.patternLocator.fineGrain();
400
	if (patternFineGrain == 0 || (patternFineGrain & UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK) != 0) {
401
		this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
402
	}
327
	return nameRef;
403
	return nameRef;
328
}
404
}
329
protected NameReference getUnspecifiedReferenceOptimized() {
405
protected NameReference getUnspecifiedReferenceOptimized() {
330
	NameReference nameRef = super.getUnspecifiedReferenceOptimized();
406
	NameReference nameRef = super.getUnspecifiedReferenceOptimized();
331
	this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
407
	int patternFineGrain = this.patternLocator.fineGrain();
408
	if (patternFineGrain == 0 || (patternFineGrain & UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK) != 0) {
409
		this.patternLocator.match(nameRef, this.nodeSet); // NB: Don't check container since unspecified reference can happen anywhere
410
	}
332
	return nameRef;
411
	return nameRef;
333
}
412
}
334
/**
413
/**
Lines 390-394 Link Here
390
		}
469
		}
391
	}
470
	}
392
}
471
}
472
473
protected void consumeClassHeaderExtends() {
474
	this.typeRefFineGrain |= IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE;
475
	super.consumeClassHeaderExtends();
476
	this.typeRefFineGrain &= ~IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE;
477
}
478
479
protected void consumeInterfaceType() {
480
	this.typeRefFineGrain |= IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE;
481
	super.consumeInterfaceType();
482
	this.typeRefFineGrain &= ~IJavaSearchConstants.SUPERINTERFACE_TYPE_REFERENCE;
483
}
484
485
protected void consumeClassTypeElt() {
486
	this.typeRefFineGrain |= IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE;
487
	super.consumeClassTypeElt();
488
	this.typeRefFineGrain  &= ~IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE;
489
}
490
491
protected void consumeClassInstanceCreationExpression() {
492
	this.typeRefFineGrain |= IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE;
493
	super.consumeClassInstanceCreationExpression();
494
	this.typeRefFineGrain &= ~IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE;
495
}
496
497
protected void consumeMethodHeaderName(boolean isAnnotationMethod) {
498
	this.typeRefFineGrain |= IJavaSearchConstants.RETURN_TYPE_REFERENCE;
499
	super.consumeMethodHeaderName(isAnnotationMethod);
500
	this.typeRefFineGrain &= ~IJavaSearchConstants.RETURN_TYPE_REFERENCE;
501
}
502
503
protected void consumeEnterVariable() {
504
	int grain = IJavaSearchConstants.FIELD_TYPE_DECLARATION_TYPE_REFERENCE | IJavaSearchConstants.LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE;
505
	this.typeRefFineGrain |= grain;
506
	super.consumeEnterVariable();
507
	this.typeRefFineGrain &= ~grain;
508
}
509
510
protected void consumeAllocationHeader() {
511
	this.typeRefFineGrain |= IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE;
512
	super.consumeAllocationHeader();
513
	this.typeRefFineGrain &= ~IJavaSearchConstants.ALLOCATION_EXPRESSION_TYPE_REFERENCE;
514
}
515
516
protected void consumeStatementCatch() {
517
	this.typeRefFineGrain |= IJavaSearchConstants.CATCH_TYPE_REFERENCE;
518
	super.consumeStatementCatch();
519
	this.typeRefFineGrain &= ~IJavaSearchConstants.CATCH_TYPE_REFERENCE;
520
}
521
522
protected void consumeTypeParameterWithExtends() {
523
	this.typeRefFineGrain |= IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE;
524
	super.consumeTypeParameterWithExtends();
525
	this.typeRefFineGrain &= ~IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE;
526
}
527
528
protected void consumeReferenceType1() {
529
	this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK;
530
	super.consumeReferenceType1();
531
	this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK;
532
}
533
534
protected void consumeReferenceType2() {
535
	this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK;
536
	super.consumeReferenceType2();
537
	this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK;
538
}
539
540
protected void consumeReferenceType3() {
541
	this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK;
542
	super.consumeReferenceType3();
543
	this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK;
544
}
545
546
protected void consumeAdditionalBound() {
547
	this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK;
548
	super.consumeAdditionalBound();
549
	this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK;
550
}
551
552
protected void consumeTypeParameter1WithExtendsAndBounds() {
553
	this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK;
554
	super.consumeTypeParameter1WithExtendsAndBounds();
555
	this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK;
556
}
557
558
protected void consumeTypeParameterWithExtendsAndBounds() {
559
	this.typeRefFineGrain |= GENERIC_FINE_GRAIN_MASK;
560
	super.consumeTypeParameterWithExtendsAndBounds();
561
	this.typeRefFineGrain &= ~GENERIC_FINE_GRAIN_MASK;
562
}
563
564
protected void consumeWildcardBoundsExtends() {
565
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
566
	super.consumeWildcardBoundsExtends();
567
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
568
}
569
570
protected void consumeWildcardBoundsSuper() {
571
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
572
	super.consumeWildcardBoundsSuper();
573
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
574
}
575
protected void consumeWildcardBounds1Extends() {
576
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
577
	super.consumeWildcardBounds1Extends();
578
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
579
}
580
protected void consumeWildcardBounds1Super() {
581
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
582
	super.consumeWildcardBounds1Super();
583
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
584
}
585
protected void consumeWildcardBounds2Extends() {
586
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
587
	super.consumeWildcardBounds2Extends();
588
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
589
}
590
protected void consumeWildcardBounds2Super() {
591
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
592
	super.consumeWildcardBounds2Super();
593
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
594
}
595
protected void consumeWildcardBounds3Extends() {
596
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
597
	super.consumeWildcardBounds3Extends();
598
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
599
}
600
protected void consumeWildcardBounds3Super() {
601
	this.typeRefFineGrain |= IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
602
	super.consumeWildcardBounds3Super();
603
	this.typeRefFineGrain &= ~IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE;
604
}
605
393
}
606
}
394
607
(-)search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java (-17 / +31 lines)
Lines 17-22 Link Here
17
import org.eclipse.jdt.core.IMethod;
17
import org.eclipse.jdt.core.IMethod;
18
import org.eclipse.jdt.core.JavaModelException;
18
import org.eclipse.jdt.core.JavaModelException;
19
import org.eclipse.jdt.core.compiler.CharOperation;
19
import org.eclipse.jdt.core.compiler.CharOperation;
20
import org.eclipse.jdt.core.search.IJavaSearchConstants;
20
import org.eclipse.jdt.core.search.SearchPattern;
21
import org.eclipse.jdt.core.search.SearchPattern;
21
import org.eclipse.jdt.internal.core.index.EntryResult;
22
import org.eclipse.jdt.internal.core.index.EntryResult;
22
import org.eclipse.jdt.internal.core.index.Index;
23
import org.eclipse.jdt.internal.core.index.Index;
Lines 24-31 Link Here
24
25
25
public class ConstructorPattern extends JavaSearchPattern {
26
public class ConstructorPattern extends JavaSearchPattern {
26
27
27
protected boolean findDeclarations;
28
protected boolean findDeclarations = true;
28
protected boolean findReferences;
29
protected boolean findReferences = true;
29
30
30
public char[] declaringQualification;
31
public char[] declaringQualification;
31
public char[] declaringSimpleName;
32
public char[] declaringSimpleName;
Lines 45-50 Link Here
45
protected static char[][] REF_AND_DECL_CATEGORIES = { CONSTRUCTOR_REF, CONSTRUCTOR_DECL };
46
protected static char[][] REF_AND_DECL_CATEGORIES = { CONSTRUCTOR_REF, CONSTRUCTOR_DECL };
46
protected static char[][] DECL_CATEGORIES = { CONSTRUCTOR_DECL };
47
protected static char[][] DECL_CATEGORIES = { CONSTRUCTOR_DECL };
47
48
49
public final static int FINE_GRAIN_MASK =
50
	IJavaSearchConstants.SUPER_REFERENCE |
51
	IJavaSearchConstants.QUALIFIED_REFERENCE |
52
	IJavaSearchConstants.THIS_REFERENCE |
53
	IJavaSearchConstants.IMPLICIT_THIS_REFERENCE;
54
48
/**
55
/**
49
 * Constructor entries are encoded as TypeName '/' Arity:
56
 * Constructor entries are encoded as TypeName '/' Arity:
50
 * e.g. 'X/0'
57
 * e.g. 'X/0'
Lines 60-77 Link Here
60
	super(CONSTRUCTOR_PATTERN, matchRule);
67
	super(CONSTRUCTOR_PATTERN, matchRule);
61
}
68
}
62
public ConstructorPattern(
69
public ConstructorPattern(
63
	boolean findDeclarations,
64
	boolean findReferences,
65
	char[] declaringSimpleName,
70
	char[] declaringSimpleName,
66
	char[] declaringQualification,
71
	char[] declaringQualification,
67
	char[][] parameterQualifications,
72
	char[][] parameterQualifications,
68
	char[][] parameterSimpleNames,
73
	char[][] parameterSimpleNames,
74
	int limitTo,
69
	int matchRule) {
75
	int matchRule) {
70
76
71
	this(matchRule);
77
	this(matchRule);
72
78
73
	this.findDeclarations = findDeclarations;
79
	this.fineGrain = limitTo & FINE_GRAIN_MASK;
74
	this.findReferences = findReferences;
80
    if (this.fineGrain == 0) {
81
		switch (limitTo) {
82
			case IJavaSearchConstants.DECLARATIONS :
83
				this.findReferences = false;
84
				break;
85
			case IJavaSearchConstants.REFERENCES :
86
				this.findDeclarations = false;
87
				break;
88
			case IJavaSearchConstants.ALL_OCCURRENCES :
89
				break;
90
		}
91
    } else {
92
		this.findDeclarations = false;
93
    }
75
94
76
	this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
95
	this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
77
	this.declaringSimpleName = (this.isCaseSensitive || this.isCamelCase) ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName);
96
	this.declaringSimpleName = (this.isCaseSensitive || this.isCamelCase) ? declaringSimpleName : CharOperation.toLowerCase(declaringSimpleName);
Lines 99-121 Link Here
99
 * Instanciate a method pattern with signatures for generics search
118
 * Instanciate a method pattern with signatures for generics search
100
 */
119
 */
101
public ConstructorPattern(
120
public ConstructorPattern(
102
	boolean findDeclarations,
103
	boolean findReferences,
104
	char[] declaringSimpleName,	
121
	char[] declaringSimpleName,	
105
	char[] declaringQualification,
122
	char[] declaringQualification,
106
	char[][] parameterQualifications, 
123
	char[][] parameterQualifications, 
107
	char[][] parameterSimpleNames,
124
	char[][] parameterSimpleNames,
108
	String[] parameterSignatures,
125
	String[] parameterSignatures,
109
	IMethod method,
126
	IMethod method,
110
//	boolean varargs,
127
	int limitTo,
111
	int matchRule) {
128
	int matchRule) {
112
129
113
	this(findDeclarations,
130
	this(declaringSimpleName,	
114
		findReferences,
115
		declaringSimpleName,	
116
		declaringQualification,
131
		declaringQualification,
117
		parameterQualifications, 
132
		parameterQualifications, 
118
		parameterSimpleNames,
133
		parameterSimpleNames,
134
		limitTo,
119
		matchRule);
135
		matchRule);
120
136
121
	// Set flags
137
	// Set flags
Lines 164-171 Link Here
164
 * Instanciate a method pattern with signatures for generics search
180
 * Instanciate a method pattern with signatures for generics search
165
 */
181
 */
166
public ConstructorPattern(
182
public ConstructorPattern(
167
	boolean findDeclarations,
168
	boolean findReferences,
169
	char[] declaringSimpleName,	
183
	char[] declaringSimpleName,	
170
	char[] declaringQualification,
184
	char[] declaringQualification,
171
	String declaringSignature,
185
	String declaringSignature,
Lines 173-186 Link Here
173
	char[][] parameterSimpleNames,
187
	char[][] parameterSimpleNames,
174
	String[] parameterSignatures,
188
	String[] parameterSignatures,
175
	char[][] arguments,
189
	char[][] arguments,
190
	int limitTo,
176
	int matchRule) {
191
	int matchRule) {
177
192
178
	this(findDeclarations,
193
	this(declaringSimpleName,	
179
		findReferences,
180
		declaringSimpleName,	
181
		declaringQualification,
194
		declaringQualification,
182
		parameterQualifications, 
195
		parameterQualifications, 
183
		parameterSimpleNames,
196
		parameterSimpleNames,
197
		limitTo,
184
		matchRule);
198
		matchRule);
185
199
186
	// Store type signature and arguments for declaring type
200
	// Store type signature and arguments for declaring type
(-)search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java (-16 / +31 lines)
Lines 14-27 Link Here
14
14
15
import org.eclipse.jdt.core.*;
15
import org.eclipse.jdt.core.*;
16
import org.eclipse.jdt.core.compiler.CharOperation;
16
import org.eclipse.jdt.core.compiler.CharOperation;
17
import org.eclipse.jdt.core.search.IJavaSearchConstants;
17
import org.eclipse.jdt.core.search.SearchPattern;
18
import org.eclipse.jdt.core.search.SearchPattern;
18
import org.eclipse.jdt.internal.core.index.*;
19
import org.eclipse.jdt.internal.core.index.*;
19
import org.eclipse.jdt.internal.core.util.Util;
20
import org.eclipse.jdt.internal.core.util.Util;
20
21
21
public class MethodPattern extends JavaSearchPattern {
22
public class MethodPattern extends JavaSearchPattern {
22
23
23
protected boolean findDeclarations;
24
protected boolean findDeclarations = true;
24
protected boolean findReferences;
25
protected boolean findReferences = true;
25
26
26
public char[] selector;
27
public char[] selector;
27
28
Lines 51-56 Link Here
51
protected static char[][] REF_AND_DECL_CATEGORIES = { METHOD_REF, METHOD_DECL };
52
protected static char[][] REF_AND_DECL_CATEGORIES = { METHOD_REF, METHOD_DECL };
52
protected static char[][] DECL_CATEGORIES = { METHOD_DECL };
53
protected static char[][] DECL_CATEGORIES = { METHOD_DECL };
53
54
55
public final static int FINE_GRAIN_MASK =
56
	IJavaSearchConstants.SUPER_REFERENCE |
57
	IJavaSearchConstants.QUALIFIED_REFERENCE |
58
	IJavaSearchConstants.THIS_REFERENCE |
59
	IJavaSearchConstants.IMPLICIT_THIS_REFERENCE;
60
54
/**
61
/**
55
 * Method entries are encoded as selector '/' Arity:
62
 * Method entries are encoded as selector '/' Arity:
56
 * e.g. 'foo/0'
63
 * e.g. 'foo/0'
Lines 66-73 Link Here
66
	super(METHOD_PATTERN, matchRule);
73
	super(METHOD_PATTERN, matchRule);
67
}
74
}
68
public MethodPattern(
75
public MethodPattern(
69
	boolean findDeclarations,
70
	boolean findReferences,
71
	char[] selector, 
76
	char[] selector, 
72
	char[] declaringQualification,
77
	char[] declaringQualification,
73
	char[] declaringSimpleName,	
78
	char[] declaringSimpleName,	
Lines 76-87 Link Here
76
	char[][] parameterQualifications, 
81
	char[][] parameterQualifications, 
77
	char[][] parameterSimpleNames,
82
	char[][] parameterSimpleNames,
78
	IType declaringType,
83
	IType declaringType,
84
	int limitTo,
79
	int matchRule) {
85
	int matchRule) {
80
86
81
	this(matchRule);
87
	this(matchRule);
82
88
83
	this.findDeclarations = findDeclarations;
89
	this.fineGrain = limitTo & FINE_GRAIN_MASK;
84
	this.findReferences = findReferences;
90
    if (this.fineGrain == 0) {
91
		switch (limitTo & 0xF) {
92
			case IJavaSearchConstants.DECLARATIONS :
93
				this.findReferences = false;
94
				break;
95
			case IJavaSearchConstants.REFERENCES :
96
				this.findDeclarations = false;
97
				break;
98
			case IJavaSearchConstants.ALL_OCCURRENCES :
99
				break;
100
		}
101
    } else {
102
		this.findDeclarations = false;
103
    }
85
104
86
	this.selector = (this.isCaseSensitive || this.isCamelCase) ? selector : CharOperation.toLowerCase(selector);
105
	this.selector = (this.isCaseSensitive || this.isCamelCase) ? selector : CharOperation.toLowerCase(selector);
87
	this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
106
	this.declaringQualification = this.isCaseSensitive ? declaringQualification : CharOperation.toLowerCase(declaringQualification);
Lines 106-113 Link Here
106
 * Instanciate a method pattern with signatures for generics search
125
 * Instanciate a method pattern with signatures for generics search
107
 */
126
 */
108
public MethodPattern(
127
public MethodPattern(
109
	boolean findDeclarations,
110
	boolean findReferences,
111
	char[] selector, 
128
	char[] selector, 
112
	char[] declaringQualification,
129
	char[] declaringQualification,
113
	char[] declaringSimpleName,	
130
	char[] declaringSimpleName,	
Lines 118-128 Link Here
118
	char[][] parameterSimpleNames,
135
	char[][] parameterSimpleNames,
119
	String[] parameterSignatures,
136
	String[] parameterSignatures,
120
	IMethod method,
137
	IMethod method,
138
	int limitTo,
121
	int matchRule) {
139
	int matchRule) {
122
140
123
	this(findDeclarations,
141
	this(selector, 
124
		findReferences,
125
		selector, 
126
		declaringQualification,
142
		declaringQualification,
127
		declaringSimpleName,	
143
		declaringSimpleName,	
128
		returnQualification, 
144
		returnQualification, 
Lines 130-135 Link Here
130
		parameterQualifications, 
146
		parameterQualifications, 
131
		parameterSimpleNames,
147
		parameterSimpleNames,
132
		method.getDeclaringType(),
148
		method.getDeclaringType(),
149
		limitTo,
133
		matchRule);
150
		matchRule);
134
	
151
	
135
	// Set flags
152
	// Set flags
Lines 184-191 Link Here
184
 * Instanciate a method pattern with signatures for generics search
201
 * Instanciate a method pattern with signatures for generics search
185
 */
202
 */
186
public MethodPattern(
203
public MethodPattern(
187
	boolean findDeclarations,
188
	boolean findReferences,
189
	char[] selector, 
204
	char[] selector, 
190
	char[] declaringQualification,
205
	char[] declaringQualification,
191
	char[] declaringSimpleName,	
206
	char[] declaringSimpleName,	
Lines 197-207 Link Here
197
	char[][] parameterSimpleNames,
212
	char[][] parameterSimpleNames,
198
	String[] parameterSignatures,
213
	String[] parameterSignatures,
199
	char[][] arguments,
214
	char[][] arguments,
215
	int limitTo,
200
	int matchRule) {
216
	int matchRule) {
201
217
202
	this(findDeclarations,
218
	this(selector, 
203
		findReferences,
204
		selector, 
205
		declaringQualification,
219
		declaringQualification,
206
		declaringSimpleName,	
220
		declaringSimpleName,	
207
		returnQualification, 
221
		returnQualification, 
Lines 209-214 Link Here
209
		parameterQualifications, 
223
		parameterQualifications, 
210
		parameterSimpleNames,
224
		parameterSimpleNames,
211
		null,
225
		null,
226
		limitTo,
212
		matchRule);
227
		matchRule);
213
228
214
	// Store type signature and arguments for declaring type
229
	// Store type signature and arguments for declaring type
(-)search/org/eclipse/jdt/internal/core/search/matching/DeclarationOfReferencedMethodsPattern.java (-1 / +2 lines)
Lines 13-18 Link Here
13
//import java.util.HashSet;
13
//import java.util.HashSet;
14
14
15
import org.eclipse.jdt.core.IJavaElement;
15
import org.eclipse.jdt.core.IJavaElement;
16
import org.eclipse.jdt.core.search.IJavaSearchConstants;
16
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
17
import org.eclipse.jdt.internal.compiler.util.SimpleSet;
17
18
18
public class DeclarationOfReferencedMethodsPattern extends MethodPattern {
19
public class DeclarationOfReferencedMethodsPattern extends MethodPattern {
Lines 21-27 Link Here
21
protected SimpleSet knownMethods;
22
protected SimpleSet knownMethods;
22
23
23
public DeclarationOfReferencedMethodsPattern(IJavaElement enclosingElement) {
24
public DeclarationOfReferencedMethodsPattern(IJavaElement enclosingElement) {
24
	super(false, true, null, null, null, null, null, null, null, null, R_PATTERN_MATCH);
25
	super(null, null, null, null, null, null, null, null, IJavaSearchConstants.REFERENCES, R_PATTERN_MATCH);
25
26
26
	this.enclosingElement = enclosingElement;
27
	this.enclosingElement = enclosingElement;
27
	this.knownMethods = new SimpleSet();
28
	this.knownMethods = new SimpleSet();
(-)search/org/eclipse/jdt/internal/core/search/matching/ImportMatchLocatorParser.java (-4 / +17 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core.search.matching;
11
package org.eclipse.jdt.internal.core.search.matching;
12
12
13
import org.eclipse.jdt.core.search.IJavaSearchConstants;
13
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
14
import org.eclipse.jdt.internal.compiler.problem.ProblemReporter;
14
15
15
class ImportMatchLocatorParser extends MatchLocatorParser {
16
class ImportMatchLocatorParser extends MatchLocatorParser {
Lines 19-37 Link Here
19
}
20
}
20
protected void consumeStaticImportOnDemandDeclarationName() {
21
protected void consumeStaticImportOnDemandDeclarationName() {
21
	super.consumeStaticImportOnDemandDeclarationName();
22
	super.consumeStaticImportOnDemandDeclarationName();
22
	this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
23
	int patternFineGrain = this.patternLocator.fineGrain();
24
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) {
25
		this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
26
	}
23
}
27
}
24
protected void consumeSingleStaticImportDeclarationName() {
28
protected void consumeSingleStaticImportDeclarationName() {
25
	super.consumeSingleStaticImportDeclarationName();
29
	super.consumeSingleStaticImportDeclarationName();
26
	this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
30
	int patternFineGrain = this.patternLocator.fineGrain();
31
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) {
32
		this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
33
	}
27
}
34
}
28
protected void consumeSingleTypeImportDeclarationName() {
35
protected void consumeSingleTypeImportDeclarationName() {
29
	super.consumeSingleTypeImportDeclarationName();
36
	super.consumeSingleTypeImportDeclarationName();
30
	this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
37
	int patternFineGrain = this.patternLocator.fineGrain();
38
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) {
39
		this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
40
	}
31
}
41
}
32
protected void consumeTypeImportOnDemandDeclarationName() {
42
protected void consumeTypeImportOnDemandDeclarationName() {
33
	super.consumeTypeImportOnDemandDeclarationName();
43
	super.consumeTypeImportOnDemandDeclarationName();
34
	this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
44
	int patternFineGrain = this.patternLocator.fineGrain();
45
	if (patternFineGrain == 0 || (patternFineGrain & IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE) != 0) {
46
		this.patternLocator.match(this.astStack[this.astPtr], this.nodeSet);
47
	}
35
}
48
}
36
49
37
}
50
}
(-)search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java (-2 / +2 lines)
Lines 27-34 Link Here
27
	
27
	
28
LocalVariable localVariable;
28
LocalVariable localVariable;
29
29
30
public LocalVariablePattern(boolean findDeclarations, boolean readAccess, boolean writeAccess, LocalVariable localVariable, int matchRule) {
30
public LocalVariablePattern(LocalVariable localVariable, int limitTo, int matchRule) {
31
	super(LOCAL_VAR_PATTERN, findDeclarations, readAccess, writeAccess, localVariable.getElementName().toCharArray(), matchRule);
31
	super(LOCAL_VAR_PATTERN, localVariable.getElementName().toCharArray(), limitTo, matchRule);
32
	this.localVariable = localVariable;
32
	this.localVariable = localVariable;
33
}
33
}
34
public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) {
34
public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) {
(-)model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java (+17 lines)
Lines 17-22 Link Here
17
public class SourceElementRequestorAdapter implements ISourceElementRequestor {
17
public class SourceElementRequestorAdapter implements ISourceElementRequestor {
18
18
19
	/**
19
	/**
20
	 * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[][], int, int)
21
	 */
22
	public void acceptAnnotationTypeReference(
23
		char[][] typeName,
24
		int sourceStart,
25
		int sourceEnd) {
26
		// default implementation: do nothing
27
	}
28
29
	/**
30
	 * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[], int)
31
	 */
32
	public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) {
33
		// default implementation: do nothing
34
	}
35
36
	/**
20
	 * @see ISourceElementRequestor#acceptConstructorReference(char[], int, int)
37
	 * @see ISourceElementRequestor#acceptConstructorReference(char[], int, int)
21
	 */
38
	 */
22
	public void acceptConstructorReference(
39
	public void acceptConstructorReference(
(-)model/org/eclipse/jdt/internal/compiler/SourceElementParser.java (-3 / +3 lines)
Lines 263-269 Link Here
263
	super.consumeAnnotationAsModifier();
263
	super.consumeAnnotationAsModifier();
264
	Annotation annotation = (Annotation)expressionStack[expressionPtr];
264
	Annotation annotation = (Annotation)expressionStack[expressionPtr];
265
	if (reportReferenceInfo) { // accept annotation type reference
265
	if (reportReferenceInfo) { // accept annotation type reference
266
		this.requestor.acceptTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd);
266
		this.requestor.acceptAnnotationTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd);
267
	}
267
	}
268
}
268
}
269
protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() {
269
protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() {
Lines 424-430 Link Here
424
	super.consumeMarkerAnnotation();
424
	super.consumeMarkerAnnotation();
425
	Annotation annotation = (Annotation)expressionStack[expressionPtr];
425
	Annotation annotation = (Annotation)expressionStack[expressionPtr];
426
	if (reportReferenceInfo) { // accept annotation type reference
426
	if (reportReferenceInfo) { // accept annotation type reference
427
		this.requestor.acceptTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd);
427
		this.requestor.acceptAnnotationTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd);
428
	}
428
	}
429
}
429
}
430
protected void consumeMethodHeaderName(boolean isAnnotationMethod) {
430
protected void consumeMethodHeaderName(boolean isAnnotationMethod) {
Lines 541-547 Link Here
541
	super.consumeNormalAnnotation();
541
	super.consumeNormalAnnotation();
542
	Annotation annotation = (Annotation)expressionStack[expressionPtr];
542
	Annotation annotation = (Annotation)expressionStack[expressionPtr];
543
	if (reportReferenceInfo) { // accept annotation type reference
543
	if (reportReferenceInfo) { // accept annotation type reference
544
		this.requestor.acceptTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd);
544
		this.requestor.acceptAnnotationTypeReference(annotation.type.getTypeName(), annotation.sourceStart, annotation.sourceEnd);
545
	}
545
	}
546
}
546
}
547
protected void consumeSingleMemberAnnotation() {
547
protected void consumeSingleMemberAnnotation() {
(-)model/org/eclipse/jdt/internal/compiler/ISourceElementRequestor.java (+4 lines)
Lines 92-97 Link Here
92
		public char[][] categories;
92
		public char[][] categories;
93
		public Annotation[] annotations;
93
		public Annotation[] annotations;
94
	}
94
	}
95
96
	void acceptAnnotationTypeReference(char[][] annotation, int sourceStart, int sourceEnd);
97
98
	void acceptAnnotationTypeReference(char[] annotation, int sourcePosition);
95
	
99
	
96
	void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition);
100
	void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition);
97
	
101
	
(-)search/org/eclipse/jdt/core/search/SearchPattern.java (-10 / +46 lines)
Lines 857-862 Link Here
857
			typeSimpleName = null;
857
			typeSimpleName = null;
858
	}
858
	}
859
	// Create field pattern
859
	// Create field pattern
860
	/*
860
	boolean findDeclarations = false;
861
	boolean findDeclarations = false;
861
	boolean readAccess = false;
862
	boolean readAccess = false;
862
	boolean writeAccess = false;
863
	boolean writeAccess = false;
Lines 890-895 Link Here
890
			typeQualification,
891
			typeQualification,
891
			typeSimpleName,
892
			typeSimpleName,
892
			matchRule);
893
			matchRule);
894
	*/
895
	return new FieldPattern(
896
			fieldNameChars,
897
			declaringTypeQualification,
898
			declaringTypeSimpleName,
899
			typeQualification,
900
			typeSimpleName,
901
			limitTo,
902
			matchRule);
893
}
903
}
894
904
895
/**
905
/**
Lines 1248-1253 Link Here
1248
			returnTypeSimpleName = null;
1258
			returnTypeSimpleName = null;
1249
	}
1259
	}
1250
	// Create method/constructor pattern
1260
	// Create method/constructor pattern
1261
	/*
1251
	boolean findDeclarations = true;
1262
	boolean findDeclarations = true;
1252
	boolean findReferences = true;
1263
	boolean findReferences = true;
1253
	switch (limitTo) {
1264
	switch (limitTo) {
Lines 1260-1269 Link Here
1260
		case IJavaSearchConstants.ALL_OCCURRENCES :
1271
		case IJavaSearchConstants.ALL_OCCURRENCES :
1261
			break;
1272
			break;
1262
	}
1273
	}
1274
	*/
1263
	if (isConstructor) {
1275
	if (isConstructor) {
1264
		return new ConstructorPattern(
1276
		return new ConstructorPattern(
1265
				findDeclarations,
1266
				findReferences,
1267
				declaringTypeSimpleName, 
1277
				declaringTypeSimpleName, 
1268
				declaringTypeQualification,
1278
				declaringTypeQualification,
1269
				declaringTypeSignature,
1279
				declaringTypeSignature,
Lines 1271-1281 Link Here
1271
				parameterTypeSimpleNames,
1281
				parameterTypeSimpleNames,
1272
				parameterTypeSignatures,
1282
				parameterTypeSignatures,
1273
				typeArguments,
1283
				typeArguments,
1284
				limitTo,
1274
				matchRule);
1285
				matchRule);
1275
	} else {
1286
	} else {
1276
		return new MethodPattern(
1287
		return new MethodPattern(
1277
				findDeclarations,
1278
				findReferences,
1279
				selectorChars,
1288
				selectorChars,
1280
				declaringTypeQualification,
1289
				declaringTypeQualification,
1281
				declaringTypeSimpleName,
1290
				declaringTypeSimpleName,
Lines 1287-1292 Link Here
1287
				parameterTypeSimpleNames,
1296
				parameterTypeSimpleNames,
1288
				parameterTypeSignatures,
1297
				parameterTypeSignatures,
1289
				typeArguments,
1298
				typeArguments,
1299
				limitTo,
1290
				matchRule);
1300
				matchRule);
1291
	}
1301
	}
1292
}
1302
}
Lines 1612-1617 Link Here
1612
				}
1622
				}
1613
			}
1623
			}
1614
			// Create field pattern
1624
			// Create field pattern
1625
			/*
1615
			boolean findDeclarations = false;
1626
			boolean findDeclarations = false;
1616
			boolean readAccess = false;
1627
			boolean readAccess = false;
1617
			boolean writeAccess = false;
1628
			boolean writeAccess = false;
Lines 1647-1652 Link Here
1647
					typeSimpleName,
1658
					typeSimpleName,
1648
					typeSignature,
1659
					typeSignature,
1649
					matchRule);
1660
					matchRule);
1661
			*/
1662
			searchPattern = 
1663
				new FieldPattern(
1664
					name, 
1665
					declaringQualification, 
1666
					declaringSimpleName, 
1667
					typeQualification, 
1668
					typeSimpleName,
1669
					typeSignature,
1670
					limitTo,
1671
					matchRule);
1650
			break;
1672
			break;
1651
		case IJavaElement.IMPORT_DECLARATION :
1673
		case IJavaElement.IMPORT_DECLARATION :
1652
			String elementName = element.getElementName();
1674
			String elementName = element.getElementName();
Lines 1669-1674 Link Here
1669
			break;
1691
			break;
1670
		case IJavaElement.LOCAL_VARIABLE :
1692
		case IJavaElement.LOCAL_VARIABLE :
1671
			LocalVariable localVar = (LocalVariable) element;
1693
			LocalVariable localVar = (LocalVariable) element;
1694
			/*
1672
			boolean findVarDeclarations = false;
1695
			boolean findVarDeclarations = false;
1673
			boolean findVarReadAccess = false;
1696
			boolean findVarReadAccess = false;
1674
			boolean findVarWriteAccess = false;
1697
			boolean findVarWriteAccess = false;
Lines 1699-1704 Link Here
1699
					findVarWriteAccess,
1722
					findVarWriteAccess,
1700
					localVar,
1723
					localVar,
1701
					matchRule);
1724
					matchRule);
1725
			*/
1726
			searchPattern = new LocalVariablePattern(localVar, limitTo, matchRule);
1702
			break;
1727
			break;
1703
		case IJavaElement.TYPE_PARAMETER:
1728
		case IJavaElement.TYPE_PARAMETER:
1704
			ITypeParameter typeParam = (ITypeParameter) element;
1729
			ITypeParameter typeParam = (ITypeParameter) element;
Lines 1786-1791 Link Here
1786
			}
1811
			}
1787
1812
1788
			// Create method/constructor pattern
1813
			// Create method/constructor pattern
1814
			/*
1789
			boolean findMethodDeclarations = true;
1815
			boolean findMethodDeclarations = true;
1790
			boolean findMethodReferences = true;
1816
			boolean findMethodReferences = true;
1791
			switch (maskedLimitTo) {
1817
			switch (maskedLimitTo) {
Lines 1798-1820 Link Here
1798
				case IJavaSearchConstants.ALL_OCCURRENCES :
1824
				case IJavaSearchConstants.ALL_OCCURRENCES :
1799
					break;
1825
					break;
1800
			}
1826
			}
1827
			*/
1801
			if (isConstructor) {
1828
			if (isConstructor) {
1802
				searchPattern =
1829
				searchPattern =
1803
					new ConstructorPattern(
1830
					new ConstructorPattern(
1804
						findMethodDeclarations,
1805
						findMethodReferences,
1806
						declaringSimpleName, 
1831
						declaringSimpleName, 
1807
						declaringQualification, 
1832
						declaringQualification, 
1808
						parameterQualifications, 
1833
						parameterQualifications, 
1809
						parameterSimpleNames,
1834
						parameterSimpleNames,
1810
						parameterSignatures,
1835
						parameterSignatures,
1811
						method,
1836
						method,
1837
						limitTo,
1812
						matchRule);
1838
						matchRule);
1813
			} else {
1839
			} else {
1814
				searchPattern =
1840
				searchPattern =
1815
					new MethodPattern(
1841
					new MethodPattern(
1816
						findMethodDeclarations,
1817
						findMethodReferences,
1818
						selector, 
1842
						selector, 
1819
						declaringQualification, 
1843
						declaringQualification, 
1820
						declaringSimpleName, 
1844
						declaringSimpleName, 
Lines 1825-1830 Link Here
1825
						parameterSimpleNames,
1849
						parameterSimpleNames,
1826
						parameterSignatures,
1850
						parameterSignatures,
1827
						method,
1851
						method,
1852
						limitTo,
1828
						matchRule);
1853
						matchRule);
1829
			}
1854
			}
1830
			break;
1855
			break;
Lines 1897-1902 Link Here
1897
						typeSignature,
1922
						typeSignature,
1898
						matchRule)
1923
						matchRule)
1899
			);
1924
			);
1925
		default:
1926
			if (type != null) {
1927
				return new TypeReferencePattern(
1928
					CharOperation.concatWith(packageName, enclosingTypeNames, '.'), 
1929
					simpleName,
1930
					type,
1931
					limitTo,
1932
					matchRule);
1933
			}
1900
	}
1934
	}
1901
	return null;
1935
	return null;
1902
}
1936
}
Lines 2001-2009 Link Here
2001
		case IJavaSearchConstants.ALL_OCCURRENCES :
2035
		case IJavaSearchConstants.ALL_OCCURRENCES :
2002
			return new OrPattern(
2036
			return new OrPattern(
2003
				new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, indexSuffix, matchRule),// cannot search for explicit member types
2037
				new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, indexSuffix, matchRule),// cannot search for explicit member types
2004
				new TypeReferencePattern(qualificationChars, typeChars, matchRule));
2038
				new TypeReferencePattern(qualificationChars, typeChars, typeSignature, matchRule));
2039
		default:
2040
			return new TypeReferencePattern(qualificationChars, typeChars, typeSignature, limitTo, matchRule);
2005
	}
2041
	}
2006
	return null;
2042
//	return null;
2007
}
2043
}
2008
/**
2044
/**
2009
 * Returns the enclosing type names of the given type.
2045
 * Returns the enclosing type names of the given type.
(-)search/org/eclipse/jdt/core/search/IJavaSearchConstants.java (-1 / +375 lines)
Lines 34-99 Link Here
34
	/**
34
	/**
35
	 * The searched element is a type, which may include classes, interfaces,
35
	 * The searched element is a type, which may include classes, interfaces,
36
	 * enums, and annotation types.
36
	 * enums, and annotation types.
37
	 * 
38
	 * @category searchFor
37
	 */
39
	 */
38
	int TYPE= 0;
40
	int TYPE= 0;
39
41
40
	/**
42
	/**
41
	 * The searched element is a method.
43
	 * The searched element is a method.
44
	 * 
45
	 * @category searchFor
42
	 */
46
	 */
43
	int METHOD= 1;
47
	int METHOD= 1;
44
48
45
	/**
49
	/**
46
	 * The searched element is a package.
50
	 * The searched element is a package.
51
	 * 
52
	 * @category searchFor
47
	 */
53
	 */
48
	int PACKAGE= 2;
54
	int PACKAGE= 2;
49
55
50
	/**
56
	/**
51
	 * The searched element is a constructor.
57
	 * The searched element is a constructor.
58
	 * 
59
	 * @category searchFor
52
	 */
60
	 */
53
	int CONSTRUCTOR= 3;
61
	int CONSTRUCTOR= 3;
54
62
55
	/**
63
	/**
56
	 * The searched element is a field.
64
	 * The searched element is a field.
65
	 * 
66
	 * @category searchFor
57
	 */
67
	 */
58
	int FIELD= 4;
68
	int FIELD= 4;
59
69
60
	/**
70
	/**
61
	 * The searched element is a class. 
71
	 * The searched element is a class. 
62
	 * More selective than using {@link #TYPE}.
72
	 * More selective than using {@link #TYPE}.
73
	 * 
74
	 * @category searchFor
63
	 */
75
	 */
64
	int CLASS= 5;
76
	int CLASS= 5;
65
77
66
	/**
78
	/**
67
	 * The searched element is an interface.
79
	 * The searched element is an interface.
68
	 * More selective than using {@link #TYPE}.
80
	 * More selective than using {@link #TYPE}.
81
	 * 
82
	 * @category searchFor
69
	 */
83
	 */
70
	int INTERFACE= 6;
84
	int INTERFACE= 6;
71
85
72
	/**
86
	/**
73
	 * The searched element is an enum.
87
	 * The searched element is an enum.
74
	 * More selective than using {@link #TYPE}.
88
	 * More selective than using {@link #TYPE}.
89
	 * 
75
	 * @since 3.1
90
	 * @since 3.1
91
	 * @category searchFor
76
	 */
92
	 */
77
	int ENUM= 7;
93
	int ENUM= 7;
78
94
79
	/**
95
	/**
80
	 * The searched element is an annotation type.
96
	 * The searched element is an annotation type.
81
	 * More selective than using {@link #TYPE}.
97
	 * More selective than using {@link #TYPE}.
98
	 * 
82
	 * @since 3.1
99
	 * @since 3.1
100
	 * @category searchFor
83
	 */
101
	 */
84
	int ANNOTATION_TYPE= 8;
102
	int ANNOTATION_TYPE= 8;
85
103
86
	/**
104
	/**
87
	 * The searched element is a class or enum type.
105
	 * The searched element is a class or enum type.
88
	 * More selective than using {@link #TYPE}.
106
	 * More selective than using {@link #TYPE}.
107
	 * 
89
	 * @since 3.1
108
	 * @since 3.1
109
	 * @category searchFor
90
	 */
110
	 */
91
	int CLASS_AND_ENUM= 9;
111
	int CLASS_AND_ENUM= 9;
92
112
93
	/**
113
	/**
94
	 * The searched element is a class or interface type.
114
	 * The searched element is a class or interface type.
95
	 * More selective than using {@link #TYPE}.
115
	 * More selective than using {@link #TYPE}.
116
	 * 
96
	 * @since 3.1
117
	 * @since 3.1
118
	 * @category searchFor
97
	 */
119
	 */
98
	int CLASS_AND_INTERFACE= 10;
120
	int CLASS_AND_INTERFACE= 10;
99
	
121
	
Lines 101-106 Link Here
101
	 * The searched element is an interface or annotation type.
123
	 * The searched element is an interface or annotation type.
102
	 * More selective than using {@link #TYPE}.
124
	 * More selective than using {@link #TYPE}.
103
	 * @since 3.3
125
	 * @since 3.3
126
	 * @category searchFor
104
	 */
127
	 */
105
	int INTERFACE_AND_ANNOTATION= 11;
128
	int INTERFACE_AND_ANNOTATION= 11;
106
129
Lines 110-115 Link Here
110
	 * The search result is a declaration.
133
	 * The search result is a declaration.
111
	 * Can be used in conjunction with any of the nature of searched elements
134
	 * Can be used in conjunction with any of the nature of searched elements
112
	 * so as to better narrow down the search.
135
	 * so as to better narrow down the search.
136
	 * 
137
	 * @category limitTo
113
	 */
138
	 */
114
	int DECLARATIONS= 0;
139
	int DECLARATIONS= 0;
115
140
Lines 119-124 Link Here
119
	 * respectively search for any type implementing/extending a type,
144
	 * respectively search for any type implementing/extending a type,
120
	 * or rather exclusively search for classes implementing/extending the type, or
145
	 * or rather exclusively search for classes implementing/extending the type, or
121
	 * interfaces extending the type.
146
	 * interfaces extending the type.
147
	 * 
148
	 * @category limitTo
122
	 */
149
	 */
123
	int IMPLEMENTORS= 1;
150
	int IMPLEMENTORS= 1;
124
151
Lines 128-133 Link Here
128
	 * so as to better narrow down the search.
155
	 * so as to better narrow down the search.
129
	 * References can contain implementers since they are more generic kind
156
	 * References can contain implementers since they are more generic kind
130
	 * of matches.
157
	 * of matches.
158
	 * 
159
	 * @category limitTo
131
	 */
160
	 */
132
	int REFERENCES= 2;
161
	int REFERENCES= 2;
133
162
Lines 136-141 Link Here
136
	 * of an interface.
165
	 * of an interface.
137
	 * Can be used in conjunction with any of the nature of searched elements
166
	 * Can be used in conjunction with any of the nature of searched elements
138
	 * so as to better narrow down the search.
167
	 * so as to better narrow down the search.
168
	 * 
169
	 * @category limitTo
139
	 */
170
	 */
140
	int ALL_OCCURRENCES= 3;
171
	int ALL_OCCURRENCES= 3;
141
172
Lines 145-150 Link Here
145
	 * as field read/write accesses: for example, x++; x+= 1;
176
	 * as field read/write accesses: for example, x++; x+= 1;
146
	 * 
177
	 * 
147
	 * @since 2.0
178
	 * @since 2.0
179
	 * @category limitTo
148
	 */
180
	 */
149
	int READ_ACCESSES = 4;
181
	int READ_ACCESSES = 4;
150
	
182
	
Lines 154-198 Link Here
154
	 * as field read/write accesses: for example,  x++; x+= 1;
186
	 * as field read/write accesses: for example,  x++; x+= 1;
155
	 * 
187
	 * 
156
	 * @since 2.0
188
	 * @since 2.0
189
	 * @category limitTo
157
	 */
190
	 */
158
	int WRITE_ACCESSES = 5;
191
	int WRITE_ACCESSES = 5;
159
192
160
	/**
193
	/**
161
	 * Ignore declaring type while searching result.
194
	 * Ignore declaring type while searching result.
162
	 * Can be used in conjunction with any of the nature of match.
195
	 * Can be used in conjunction with any of the nature of match.
196
	 * 
163
	 * @since 3.1
197
	 * @since 3.1
198
	 * @category limitTo
164
	 */
199
	 */
165
	int IGNORE_DECLARING_TYPE = 0x10;
200
	int IGNORE_DECLARING_TYPE = 0x10;
166
201
167
	/**
202
	/**
168
	 * Ignore return type while searching result.
203
	 * Ignore return type while searching result.
169
	 * Can be used in conjunction with any of the nature of match.
204
	 * Can be used in conjunction with any other nature of match.
170
	 * Note that:
205
	 * Note that:
171
	 * <ul>
206
	 * <ul>
172
	 * 	<li>for fields search, pattern will ignore field type</li>
207
	 * 	<li>for fields search, pattern will ignore field type</li>
173
	 * 	<li>this flag will have no effect for types search</li>
208
	 * 	<li>this flag will have no effect for types search</li>
174
	 *	</ul>
209
	 *	</ul>
210
	 *
175
	 * @since 3.1
211
	 * @since 3.1
212
	 * @category limitTo
176
	 */
213
	 */
177
	int IGNORE_RETURN_TYPE = 0x20;
214
	int IGNORE_RETURN_TYPE = 0x20;
178
	
215
	
216
	/**
217
	 * Return only references to type used in field type declaration.
218
	 * <p>
219
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
220
	 * returned.
221
	 *</p>
222
	 * @since 3.4
223
	 * @category limitTo
224
	 */
225
	int FIELD_TYPE_DECLARATION_TYPE_REFERENCE = 0x40;
226
	
227
	/**
228
	 * Return only references to type used in local variable declaration.
229
	 * <p>
230
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
231
	 * returned.
232
	 *</p>
233
	 * @since 3.4
234
	 * @category limitTo
235
	 */
236
	int LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE = 0x80;
237
	
238
	/**
239
	 * Return only references to type used in method parameter declaration.
240
	 * <p>
241
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
242
	 * returned.
243
	 *</p>
244
	 * @since 3.4
245
	 * @category limitTo
246
	 */
247
	int PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE = 0x100;
248
	
249
	/**
250
	 * Return only references to type used as super type.
251
	 * <p>
252
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
253
	 * returned.
254
	 *</p>
255
	 * @since 3.4
256
	 * @category limitTo
257
	 */
258
	int SUPERTYPE_TYPE_REFERENCE = 0x200;
259
	
260
	/**
261
	 * Return only references to type used as super interface.
262
	 * <p>
263
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
264
	 * returned.
265
	 *</p>
266
	 * @since 3.4
267
	 * @category limitTo
268
	 */
269
	int SUPERINTERFACE_TYPE_REFERENCE = 0x400;
270
	
271
	/**
272
	 * Return only references to types used in throws clause.
273
	 * <p>
274
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
275
	 * returned.
276
	 *</p>
277
	 * @since 3.4
278
	 * @category limitTo
279
	 */
280
	int THROWS_CLAUSE_TYPE_REFERENCE = 0x800;
281
	
282
	/**
283
	 * Return only reference to types used in a cast expression.
284
	 * <p>
285
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
286
	 * returned.
287
	 *</p>
288
	 * @since 3.4
289
	 * @category limitTo
290
	 */
291
	int CAST_TYPE_REFERENCE = 0x1000;
292
	
293
	/**
294
	 * Return only reference to types used in a catch header.
295
	 * <p>
296
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
297
	 * returned.
298
	 *</p>
299
	 * @since 3.4
300
	 * @category limitTo
301
	 */
302
	int CATCH_TYPE_REFERENCE = 0x2000;
303
	
304
	/**
305
	 * Return only reference to types used in an allocation expression.
306
	 * <p>
307
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
308
	 * returned.
309
	 *</p>
310
	 * @since 3.4
311
	 * @category limitTo
312
	 */
313
	int ALLOCATION_EXPRESSION_TYPE_REFERENCE = 0x4000;
314
	
315
	/**
316
	 * Return only reference to types used as method return type.
317
	 * <p>
318
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
319
	 * returned.
320
	 *</p>
321
	 * @since 3.4
322
	 * @category limitTo
323
	 */
324
	int RETURN_TYPE_REFERENCE = 0x8000;
325
	
326
	/**
327
	 * Return only reference to types used in import declaration.
328
	 * <p>
329
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
330
	 * returned.
331
	 *</p>
332
	 * @since 3.4
333
	 * @category limitTo
334
	 */
335
	int IMPORT_DECLARATION_TYPE_REFERENCE = 0x10000;
336
337
	/**
338
	 * Return only reference to types used as annotation.
339
	 * <p>
340
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
341
	 * returned.
342
	 *</p>
343
	 * @since 3.4
344
	 * @category limitTo
345
	 */
346
	int ANNOTATION_TYPE_REFERENCE = 0x20000;
347
348
	/**
349
	 * Return only reference to types used as type variable bound.
350
	 * <p>
351
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
352
	 * returned.
353
	 *</p>
354
	 * @since 3.4
355
	 * @category limitTo
356
	 */
357
	int TYPE_VARIABLE_BOUND_TYPE_REFERENCE = 0x40000;
358
359
	/**
360
	 * Return only reference to types used as parameterized type.
361
	 * <p>
362
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
363
	 * returned.
364
	 *</p>
365
	 * @since 3.4
366
	 * @category limitTo
367
	 */
368
	int PARAMETERIZED_TYPE_REFERENCE = 0x80000;
369
370
	/**
371
	 * Return only reference to types used as wildcard bound.
372
	 * <p>
373
	 * When this flag is used, only {@link TypeReferenceMatch} matches will be
374
	 * returned.
375
	 *</p>
376
	 * @since 3.4
377
	 * @category limitTo
378
	 */
379
	int WILDCARD_BOUND_TYPE_REFERENCE = 0x100000;
380
	
381
	/**
382
	 * Return only super field accesses  or method invocations (e.g. using
383
	 * <code>super</code> qualifier).
384
	 * <p>
385
	 * When this flag is used, the kind of returned matches will depend on the
386
	 * specified nature of searched element:
387
	 * <ul>
388
	 * 	<li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches
389
	 * 		will be accepted,</li>
390
	 * 	<li>for {@link #METHOD} nature, only {@link MethodReferenceMatch}
391
	 * 		matches will be returned</li>
392
	 * </ul>
393
	 *</p>
394
	 * @since 3.4
395
	 * @category limitTo
396
	 */
397
	int SUPER_REFERENCE = 0x1000000;
398
	
399
	/**
400
	 * Return only qualified field accesses or method invocations.
401
	 * <p>
402
	 * When this flag is used, the kind of returned matches will depend on the
403
	 * specified nature of searched element:
404
	 * <ul>
405
	 * 	<li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches
406
	 * 		will be accepted,</li>
407
	 * 	<li>for {@link #METHOD} nature, only {@link MethodReferenceMatch}
408
	 * 		matches will be returned</li>
409
	 * </ul>
410
	 *</p>
411
	 * @since 3.4
412
	 * @category limitTo
413
	 */
414
	int QUALIFIED_REFERENCE = 0x2000000;
415
	
416
	/**
417
	 * Return only primary field accesses  or method invocations (e.g. using
418
	 * <code>this</code> qualifier).
419
	 * <p>
420
	 * When this flag is used, the kind of returned matches will depend on the
421
	 * specified nature of searched element:
422
	 * <ul>
423
	 * 	<li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches
424
	 * 		will be accepted,</li>
425
	 * 	<li>for {@link #METHOD} nature, only {@link MethodReferenceMatch}
426
	 * 		matches will be returned</li>
427
	 * </ul>
428
	 *</p>
429
	 * @since 3.4
430
	 * @category limitTo
431
	 */
432
	int THIS_REFERENCE = 0x4000000;
433
	
434
	/**
435
	 * Return only field accesses  or method invocations without any qualification.
436
	 * <p>
437
	 * When this flag is used, the kind of returned matches will depend on the
438
	 * specified nature of searched element:
439
	 * <ul>
440
	 * 	<li>for {@link #FIELD} nature, only {@link FieldReferenceMatch} matches
441
	 * 		will be accepted,</li>
442
	 * 	<li>for {@link #METHOD} nature, only {@link MethodReferenceMatch}
443
	 * 		matches will be returned</li>
444
	 * </ul>
445
	 *</p>
446
	 * @since 3.4
447
	 * @category limitTo
448
	 */
449
	int IMPLICIT_THIS_REFERENCE = 0x8000000;
450
//	
451
//	/**
452
//	 * Return only super field accesses (e.g. using <code>super</code>
453
//	 * qualifier).
454
//	 * <p>
455
//	 * When this flag is used, only {@link FieldReferenceMatch type reference
456
//	 * matches} will be returned.
457
//	 *</p>
458
//	 * @since 3.4
459
//	 * @category limitTo
460
//	 */
461
//	int SUPER_FIELD_REFERENCE = 0x1000000;
462
//	
463
//	/**
464
//	 * Return only qualified field accesses.
465
//	 * <p>
466
//	 * When this flag is used, only {@link FieldReferenceMatch type reference
467
//	 * matches} will be returned.
468
//	 *</p>
469
//	 * @since 3.4
470
//	 * @category limitTo
471
//	 */
472
//	int QUALIFIED_FIELD_REFERENCE = 0x2000000;
473
//	
474
//	/**
475
//	 * Return only primary field accesses (e.g. using <code>this</code>
476
//	 * qualifier).
477
//	 * <p>
478
//	 * When this flag is used, only {@link FieldReferenceMatch type reference
479
//	 * matches} will be returned.
480
//	 *</p>
481
//	 * @since 3.4
482
//	 * @category limitTo
483
//	 */
484
//	int THIS_FIELD_REFERENCE = 0x4000000;
485
//	
486
//	/**
487
//	 * Return only field accesses without any qualification.
488
//	 * <p>
489
//	 * When this flag is used, only {@link FieldReferenceMatch type reference
490
//	 * matches} will be returned.
491
//	 *</p>
492
//	 * @since 3.4
493
//	 * @category limitTo
494
//	 */
495
//	int SIMPLE_FIELD_REFERENCE = 0x8000000;
496
//	
497
//	/**
498
//	 * Return only super method invocations (e.g. using <code>super</code>
499
//	 * qualifier).
500
//	 * <p>
501
//	 * When this flag is used, only {@link MethodReferenceMatch type reference
502
//	 * matches} will be returned.
503
//	 *</p>
504
//	 * @since 3.4
505
//	 * @category limitTo
506
//	 */
507
//	int SUPER_METHOD_REFERENCE = 0x10000000;
508
//	
509
//	/**
510
//	 * Return only qualified method invocations.
511
//	 * <p>
512
//	 * When this flag is used, only {@link MethodReferenceMatch type reference
513
//	 * matches} will be returned.
514
//	 *</p>
515
//	 * @since 3.4
516
//	 * @category limitTo
517
//	 */
518
//	int QUALIFIED_METHOD_REFERENCE = 0x20000000;
519
//	
520
//	/**
521
//	 * Return only primary method invocations (e.g. using <code>this</code>
522
//	 * qualifier).
523
//	 * <p>
524
//	 * When this flag is used, only {@link MethodReferenceMatch type reference
525
//	 * matches} will be returned.
526
//	 *</p>
527
//	 * @since 3.4
528
//	 * @category limitTo
529
//	 */
530
//	int THIS_METHOD_REFERENCE = 0x40000000;
531
//	
532
//	/**
533
//	 * Return only method invocations without any qualification.
534
//	 * <p>
535
//	 * When this flag is used, only {@link MethodReferenceMatch type reference
536
//	 * matches} will be returned.
537
//	 *</p>
538
//	 * @since 3.4
539
//	 * @category limitTo
540
//	 */
541
//	int SIMPLE_METHOD_REFERENCE = 0x80000000;
542
	
179
	/* Syntactic match modes */
543
	/* Syntactic match modes */
180
	
544
	
181
	/**
545
	/**
182
	 * The search pattern matches exactly the search result,
546
	 * The search pattern matches exactly the search result,
183
	 * that is, the source of the search result equals the search pattern.
547
	 * that is, the source of the search result equals the search pattern.
548
	 * 
184
	 * @deprecated Use {@link SearchPattern#R_EXACT_MATCH} instead.
549
	 * @deprecated Use {@link SearchPattern#R_EXACT_MATCH} instead.
550
	 * @category matchRule
185
	 */
551
	 */
186
	int EXACT_MATCH = 0;
552
	int EXACT_MATCH = 0;
187
	/**
553
	/**
188
	 * The search pattern is a prefix of the search result.
554
	 * The search pattern is a prefix of the search result.
555
	 * 
189
	 * @deprecated Use {@link SearchPattern#R_PREFIX_MATCH} instead.
556
	 * @deprecated Use {@link SearchPattern#R_PREFIX_MATCH} instead.
557
	 * @category matchRule
190
	 */
558
	 */
191
	int PREFIX_MATCH = 1;
559
	int PREFIX_MATCH = 1;
192
	/**
560
	/**
193
	 * The search pattern contains one or more wild cards ('*') where a 
561
	 * The search pattern contains one or more wild cards ('*') where a 
194
	 * wild-card can replace 0 or more characters in the search result.
562
	 * wild-card can replace 0 or more characters in the search result.
563
	 * 
195
	 * @deprecated Use {@link SearchPattern#R_PATTERN_MATCH} instead.
564
	 * @deprecated Use {@link SearchPattern#R_PATTERN_MATCH} instead.
565
	 * @category matchRule
196
	 */
566
	 */
197
	int PATTERN_MATCH = 2;
567
	int PATTERN_MATCH = 2;
198
568
Lines 202-215 Link Here
202
	/**
572
	/**
203
	 * The search pattern matches the search result only
573
	 * The search pattern matches the search result only
204
	 * if cases are the same.
574
	 * if cases are the same.
575
	 * 
205
	 * @deprecated Use the methods that take the matchMode
576
	 * @deprecated Use the methods that take the matchMode
206
	 *   with {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
577
	 *   with {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
578
	 * @category matchRule
207
	 */
579
	 */
208
	boolean CASE_SENSITIVE = true;
580
	boolean CASE_SENSITIVE = true;
209
	/**
581
	/**
210
	 * The search pattern ignores cases in the search result.
582
	 * The search pattern ignores cases in the search result.
583
	 * 
211
	 * @deprecated Use the methods that take the matchMode
584
	 * @deprecated Use the methods that take the matchMode
212
	 *   without {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
585
	 *   without {@link SearchPattern#R_CASE_SENSITIVE} as a matchRule instead.
586
	 * @category matchRule
213
	 */
587
	 */
214
	boolean CASE_INSENSITIVE = false;
588
	boolean CASE_INSENSITIVE = false;
215
	
589
	
(-)search/org/eclipse/jdt/internal/core/index/DiskIndex.java (-1 / +1 lines)
Lines 46-52 Link Here
46
private int streamEnd; // used when writing data from the streamBuffer to the file
46
private int streamEnd; // used when writing data from the streamBuffer to the file
47
char separator = Index.DEFAULT_SEPARATOR;
47
char separator = Index.DEFAULT_SEPARATOR;
48
48
49
public static final String SIGNATURE= "INDEX VERSION 1.124"; //$NON-NLS-1$
49
public static final String SIGNATURE= "INDEX VERSION 1.125.3"; //$NON-NLS-1$
50
private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray();
50
private static final char[] SIGNATURE_CHARS = SIGNATURE.toCharArray();
51
public static boolean DEBUG = false;
51
public static boolean DEBUG = false;
52
52
(-)search/org/eclipse/jdt/internal/core/search/indexing/AbstractIndexer.java (-1 / +4 lines)
Lines 31-37 Link Here
31
			SUPER_REF, 
31
			SUPER_REF, 
32
			SuperTypeReferencePattern.createIndexKey(
32
			SuperTypeReferencePattern.createIndexKey(
33
				modifiers, packageName, name, enclosingTypeNames, null, ANNOTATION_TYPE_SUFFIX, CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_ANNOTATION, '.'), ANNOTATION_TYPE_SUFFIX));
33
				modifiers, packageName, name, enclosingTypeNames, null, ANNOTATION_TYPE_SUFFIX, CharOperation.concatWith(TypeConstants.JAVA_LANG_ANNOTATION_ANNOTATION, '.'), ANNOTATION_TYPE_SUFFIX));
34
	}	
34
	}
35
	public void addAnnotationTypeReference(char[] typeName) {
36
		addIndexEntry(ANNOTATION_REF, CharOperation.lastSegment(typeName, '.'));
37
	}
35
	public void addClassDeclaration(
38
	public void addClassDeclaration(
36
			int modifiers, 
39
			int modifiers, 
37
			char[] packageName,
40
			char[] packageName,
(-)search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java (-8 / +8 lines)
Lines 47-79 Link Here
47
	private void addBinaryStandardAnnotations(long annotationTagBits) {
47
	private void addBinaryStandardAnnotations(long annotationTagBits) {
48
		if ((annotationTagBits & TagBits.AnnotationTargetMASK) != 0) {
48
		if ((annotationTagBits & TagBits.AnnotationTargetMASK) != 0) {
49
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
49
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_TARGET;
50
			addTypeReference(compoundName[compoundName.length-1]);
50
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
51
			addBinaryTargetAnnotation(annotationTagBits);
51
			addBinaryTargetAnnotation(annotationTagBits);
52
		}
52
		}
53
		if ((annotationTagBits & TagBits.AnnotationRetentionMASK) != 0) {
53
		if ((annotationTagBits & TagBits.AnnotationRetentionMASK) != 0) {
54
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_RETENTION;
54
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_RETENTION;
55
			addTypeReference(compoundName[compoundName.length-1]);
55
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
56
			addBinaryRetentionAnnotation(annotationTagBits);
56
			addBinaryRetentionAnnotation(annotationTagBits);
57
		}
57
		}
58
		if ((annotationTagBits & TagBits.AnnotationDeprecated) != 0) {
58
		if ((annotationTagBits & TagBits.AnnotationDeprecated) != 0) {
59
			char[][] compoundName = TypeConstants.JAVA_LANG_DEPRECATED;
59
			char[][] compoundName = TypeConstants.JAVA_LANG_DEPRECATED;
60
			addTypeReference(compoundName[compoundName.length-1]);
60
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
61
		}
61
		}
62
		if ((annotationTagBits & TagBits.AnnotationDocumented) != 0) {
62
		if ((annotationTagBits & TagBits.AnnotationDocumented) != 0) {
63
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED;
63
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_DOCUMENTED;
64
			addTypeReference(compoundName[compoundName.length-1]);
64
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
65
		}
65
		}
66
		if ((annotationTagBits & TagBits.AnnotationInherited) != 0) {
66
		if ((annotationTagBits & TagBits.AnnotationInherited) != 0) {
67
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_INHERITED;
67
			char[][] compoundName = TypeConstants.JAVA_LANG_ANNOTATION_INHERITED;
68
			addTypeReference(compoundName[compoundName.length-1]);
68
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
69
		}
69
		}
70
		if ((annotationTagBits & TagBits.AnnotationOverride) != 0) {
70
		if ((annotationTagBits & TagBits.AnnotationOverride) != 0) {
71
			char[][] compoundName = TypeConstants.JAVA_LANG_OVERRIDE;
71
			char[][] compoundName = TypeConstants.JAVA_LANG_OVERRIDE;
72
			addTypeReference(compoundName[compoundName.length-1]);
72
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
73
		}
73
		}
74
		if ((annotationTagBits & TagBits.AnnotationSuppressWarnings) != 0) {
74
		if ((annotationTagBits & TagBits.AnnotationSuppressWarnings) != 0) {
75
			char[][] compoundName = TypeConstants.JAVA_LANG_SUPPRESSWARNINGS;
75
			char[][] compoundName = TypeConstants.JAVA_LANG_SUPPRESSWARNINGS;
76
			addTypeReference(compoundName[compoundName.length-1]);
76
			addAnnotationTypeReference(compoundName[compoundName.length-1]);
77
		}
77
		}
78
	}
78
	}
79
	private void addBinaryTargetAnnotation(long bits) {
79
	private void addBinaryTargetAnnotation(long bits) {
Lines 147-153 Link Here
147
		}
147
		}
148
	}
148
	}
149
	private void addBinaryAnnotation(IBinaryAnnotation annotation) {
149
	private void addBinaryAnnotation(IBinaryAnnotation annotation) {
150
		addTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName())));
150
		addAnnotationTypeReference(replace('/', '.', Signature.toCharArray(annotation.getTypeName())));
151
		IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs();
151
		IBinaryElementValuePair[] valuePairs = annotation.getElementValuePairs();
152
		if (valuePairs != null) {
152
		if (valuePairs != null) {
153
			for (int j=0, vpLength=valuePairs.length; j<vpLength; j++) {
153
			for (int j=0, vpLength=valuePairs.length; j<vpLength; j++) {
(-)search/org/eclipse/jdt/internal/core/search/indexing/SourceIndexerRequestor.java (-1 / +16 lines)
Lines 21-27 Link Here
21
21
22
/**
22
/**
23
 * This class is used by the JavaParserIndexer. When parsing the java file, the requestor
23
 * This class is used by the JavaParserIndexer. When parsing the java file, the requestor
24
 * recognises the java elements (methods, fields, ...) and add them to an index.
24
 * recognizes the java elements (methods, fields, ...) and add them to an index.
25
 */
25
 */
26
public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants {
26
public class SourceIndexerRequestor implements ISourceElementRequestor, IIndexConstants {
27
	SourceIndexer indexer;
27
	SourceIndexer indexer;
Lines 35-40 Link Here
35
	this.indexer = indexer;
35
	this.indexer = indexer;
36
}
36
}
37
/**
37
/**
38
 * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[][], int, int)
39
 */
40
public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {
41
	int length = typeName.length;
42
	for (int i = 0; i < length - 1; i++)
43
		acceptUnknownReference(typeName[i], 0);
44
	acceptAnnotationTypeReference(typeName[length - 1], 0);
45
}
46
/**
47
 * @see ISourceElementRequestor#acceptAnnotationTypeReference(char[], int)
48
 */
49
public void acceptAnnotationTypeReference(char[] simpleTypeName, int sourcePosition) {
50
	this.indexer.addAnnotationTypeReference(simpleTypeName);
51
}
52
/**
38
 * @see ISourceElementRequestor#acceptConstructorReference(char[], int, int)
53
 * @see ISourceElementRequestor#acceptConstructorReference(char[], int, int)
39
 */
54
 */
40
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
55
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
(-)search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java (+2 lines)
Lines 16-21 Link Here
16
16
17
	/* index encoding */
17
	/* index encoding */
18
	char[] REF= "ref".toCharArray(); //$NON-NLS-1$
18
	char[] REF= "ref".toCharArray(); //$NON-NLS-1$
19
	char[] ANNOTATION_REF= "annotationRef".toCharArray(); //$NON-NLS-1$
19
	char[] METHOD_REF= "methodRef".toCharArray(); //$NON-NLS-1$
20
	char[] METHOD_REF= "methodRef".toCharArray(); //$NON-NLS-1$
20
	char[] CONSTRUCTOR_REF= "constructorRef".toCharArray(); //$NON-NLS-1$
21
	char[] CONSTRUCTOR_REF= "constructorRef".toCharArray(); //$NON-NLS-1$
21
	char[] SUPER_REF = "superRef".toCharArray(); //$NON-NLS-1$
22
	char[] SUPER_REF = "superRef".toCharArray(); //$NON-NLS-1$
Lines 59-62 Link Here
59
	int LOCAL_VAR_PATTERN = 0x0200;
60
	int LOCAL_VAR_PATTERN = 0x0200;
60
	int TYPE_PARAM_PATTERN = 0x0400;
61
	int TYPE_PARAM_PATTERN = 0x0400;
61
	int AND_PATTERN = 0x0800;
62
	int AND_PATTERN = 0x0800;
63
	int ANNOT_REF_PATTERN = 0x1000;
62
}
64
}
(-)model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java (+12 lines)
Lines 18-23 Link Here
18
/**
18
/**
19
 * Does nothing.
19
 * Does nothing.
20
 */
20
 */
21
public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {
22
	// Does nothing
23
}
24
/**
25
 * Does nothing.
26
 */
27
public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) {
28
	// Does nothing
29
}
30
/**
31
 * Does nothing.
32
 */
21
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
33
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
22
	// Does nothing
34
	// Does nothing
23
}
35
}
(-)search/org/eclipse/jdt/internal/core/search/matching/FineGrainVisitor.java (+718 lines)
Added Link Here
1
package org.eclipse.jdt.internal.core.search.matching;
2
3
import org.eclipse.core.runtime.CoreException;
4
import org.eclipse.jdt.core.*;
5
import org.eclipse.jdt.core.search.IJavaSearchConstants;
6
import org.eclipse.jdt.internal.compiler.ASTVisitor;
7
import org.eclipse.jdt.internal.compiler.ast.*;
8
import org.eclipse.jdt.internal.compiler.lookup.*;
9
10
/**
11
 * An ast visitor that visits....
12
 */
13
class FineGrainVisitor extends ASTVisitor implements IJavaSearchConstants {
14
15
	final static int FINE_GRAIN_MASK =
16
		MatchLocatorParser.UNSPECIFIED_REFERENCE_FINE_GRAIN_MASK |
17
		MatchLocatorParser.FORMAL_PARAMETER_FINE_GRAIN_MASK |
18
		MatchLocatorParser.GENERIC_FINE_GRAIN_MASK |
19
		ALLOCATION_EXPRESSION_TYPE_REFERENCE |
20
		FIELD_TYPE_DECLARATION_TYPE_REFERENCE |
21
		LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE |
22
		IMPORT_DECLARATION_TYPE_REFERENCE |
23
		THROWS_CLAUSE_TYPE_REFERENCE |
24
		RETURN_TYPE_REFERENCE;
25
26
	final MatchLocator matchLocator;
27
28
	IJavaElement element;
29
	Binding binding;
30
	MatchingNodeSet nodeSet;
31
	ASTNode[] matchingNodes;
32
	PatternLocator locator;
33
	int length;
34
	final int fineGrain;
35
	boolean completed = false;
36
37
	int parameterizedTypeRef = 0;
38
	int wildcardTypeRef = 0;
39
40
FineGrainVisitor(IJavaElement enclosingElement, Binding binding, MatchingNodeSet set, ASTNode[] nodes, PatternLocator patternLocator, MatchLocator matchLocator) {
41
	this.matchLocator = matchLocator;
42
	this.element = enclosingElement;
43
	this.binding = binding;
44
	this.nodeSet = set;
45
	this.matchingNodes = nodes;
46
	this.locator = patternLocator;
47
	this.length = nodes.length;
48
	this.fineGrain = patternLocator.fineGrain();
49
}
50
51
protected void report(ASTNode node, Scope scope) {
52
	for (int i = 0; i < this.length; i++) {
53
		if (this.matchingNodes[i] == node) {
54
			Integer level = (Integer) this.nodeSet.matchingNodes.removeKey(node);
55
			if (level != null) {
56
				try {
57
					this.locator.matchReportReference(node, this.element, this.binding, scope, level.intValue(), this.matchLocator);
58
				} catch (CoreException e) {
59
					// skip
60
				}
61
				this.completed = this.nodeSet.matchingNodes.elementSize == 0;
62
			}
63
			return;
64
		}
65
	}
66
}
67
68
public boolean visit(AllocationExpression allocationExpression, BlockScope scope) {
69
	if (this.completed) return false;
70
	if ((this.fineGrain & ALLOCATION_EXPRESSION_TYPE_REFERENCE) != 0) {
71
        report(allocationExpression.type, scope);
72
	}
73
	return !this.completed;
74
}
75
76
public boolean visit(CastExpression castExpression, BlockScope scope) {
77
	if (this.completed) return false;
78
	if ((this.fineGrain & CAST_TYPE_REFERENCE) != 0) {
79
		if (castExpression.type instanceof TypeReference) {
80
	        report(castExpression.type, scope);
81
        }
82
		else if (castExpression.type instanceof NameReference) {
83
	        report(castExpression.type, scope);
84
        }
85
	}
86
	return !this.completed;
87
}
88
89
public boolean visit(ImportReference importRef, CompilationUnitScope scope) {
90
	if (this.completed) return false;
91
	if ((this.fineGrain & IMPORT_DECLARATION_TYPE_REFERENCE) != 0) {
92
        report(importRef, scope);
93
	}
94
	return !this.completed;
95
}
96
97
public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
98
	if (this.completed) return false;
99
	if ((this.fineGrain & LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE) != 0) {
100
        report(localDeclaration.type, scope);
101
	}
102
	return !this.completed;
103
}
104
105
public boolean visit(SingleNameReference singleNameReference, BlockScope scope) {
106
	if (this.completed) return false;
107
	if ((this.fineGrain & IMPLICIT_THIS_REFERENCE) != 0) {
108
        report(singleNameReference, scope);
109
	}
110
	return !completed;
111
}
112
113
public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
114
	if (this.completed) return false;
115
	if ((this.fineGrain & PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE) != 0) {
116
		Argument[] arguments = methodDeclaration.arguments;
117
		if (arguments != null) {
118
			int argLength = arguments.length;
119
			for (int i=0; i<argLength; i++) {
120
				report(arguments[i].type, scope);
121
			}
122
		}
123
	}
124
	if ((this.fineGrain & THROWS_CLAUSE_TYPE_REFERENCE) != 0) {
125
		TypeReference[] thrownExceptions = methodDeclaration.thrownExceptions;
126
		if (thrownExceptions != null) {
127
			int thrownLength = thrownExceptions.length;
128
			for (int i=0; i<thrownLength; i++) {
129
				report(thrownExceptions[i], scope);
130
				if (this.completed) return false;
131
			}
132
		}
133
	}
134
	if ((this.fineGrain & RETURN_TYPE_REFERENCE) != 0) {
135
		report(methodDeclaration.returnType, scope);
136
	}
137
	return !this.completed;
138
}
139
140
public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope) {
141
	if (this.completed) return false;
142
	if ((this.fineGrain & PARAMETER_TYPE_DECLARATION_TYPE_REFERENCE) != 0) {
143
		Argument[] arguments = constructorDeclaration.arguments;
144
		if (arguments != null) {
145
			int argLength = arguments.length;
146
			for (int i=0; i<argLength; i++) {
147
				report(arguments[i].type, scope);
148
				if (this.completed) return false;
149
			}
150
		}
151
	}
152
	if ((this.fineGrain & THROWS_CLAUSE_TYPE_REFERENCE) != 0) {
153
		TypeReference[] thrownExceptions = constructorDeclaration.thrownExceptions;
154
		if (thrownExceptions != null) {
155
			int thrownLength = thrownExceptions.length;
156
			for (int i=0; i<thrownLength; i++) {
157
				report(thrownExceptions[i], scope);
158
				if (this.completed) return false;
159
			}
160
		}
161
	}
162
	return !this.completed;
163
}
164
165
public boolean visit(QualifiedNameReference qualifiedNameReference, BlockScope scope) {
166
	if (this.completed) return false;
167
	if ((this.fineGrain & QUALIFIED_REFERENCE) != 0) {
168
        report(qualifiedNameReference, scope);
169
	}
170
	return !this.completed;
171
}
172
173
public boolean visit(MessageSend messageSend, BlockScope scope) {
174
	if (this.completed) return false;
175
	if (messageSend.isSuperAccess()) {
176
		if ((this.fineGrain & SUPER_REFERENCE) != 0) {
177
			report(messageSend, scope);
178
		}
179
	} else if (messageSend.receiver.isImplicitThis()) {
180
		if ((this.fineGrain & IMPLICIT_THIS_REFERENCE) != 0) {
181
			report(messageSend, scope);
182
		}
183
	} else if (messageSend.receiver.isThis()) {
184
		if ((this.fineGrain & THIS_REFERENCE) != 0) {
185
			report(messageSend, scope);
186
		}
187
	} else {
188
		if ((this.fineGrain & QUALIFIED_REFERENCE) != 0) {
189
			report(messageSend, scope);
190
		}
191
	}
192
	if (messageSend.typeArguments !=  null && messageSend.typeArguments.length > 0) {
193
		this.parameterizedTypeRef++;
194
	}
195
	return !this.completed;
196
}
197
198
public void endVisit(MessageSend messageSend, BlockScope scope) {
199
	if (messageSend.typeArguments !=  null && messageSend.typeArguments.length > 0) {
200
		this.parameterizedTypeRef--;
201
	}
202
	super.endVisit(messageSend, scope);
203
}
204
205
public boolean visit(TryStatement tryStatement, BlockScope scope) {
206
	if (this.completed) return false;
207
	if ((this.fineGrain & CATCH_TYPE_REFERENCE) != 0) {
208
		Argument[] catchArguments = tryStatement.catchArguments;
209
		if (catchArguments != null) {
210
			int argLength = catchArguments.length;
211
			for (int i=0; i<argLength; i++) {
212
				report(catchArguments[i].type, scope);
213
				if (this.completed) return false;
214
			}
215
		}
216
	}
217
	return !this.completed;
218
}
219
220
public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) {
221
	if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) {
222
		report(parameterizedQualifiedTypeReference, scope);
223
	}
224
	this.parameterizedTypeRef++;
225
	return !this.completed;
226
}
227
228
public boolean visit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) {
229
	if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) {
230
		report(parameterizedQualifiedTypeReference, scope);
231
	}
232
	this.parameterizedTypeRef++;
233
	return !this.completed;
234
}
235
236
public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) {
237
	if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) {
238
		report(parameterizedSingleTypeReference, scope);
239
	}
240
	this.parameterizedTypeRef++;
241
	return !this.completed;
242
}
243
244
public boolean visit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) {
245
	if ((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0) {
246
		report(parameterizedSingleTypeReference, scope);
247
	}
248
	this.parameterizedTypeRef++;
249
	return !this.completed;
250
}
251
252
public void endVisit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, BlockScope scope) {
253
	this.parameterizedTypeRef--;
254
}
255
256
public void endVisit(ParameterizedQualifiedTypeReference parameterizedQualifiedTypeReference, ClassScope scope) {
257
	this.parameterizedTypeRef--;
258
}
259
260
public void endVisit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, BlockScope scope) {
261
	this.parameterizedTypeRef--;
262
}
263
264
public void endVisit(ParameterizedSingleTypeReference parameterizedSingleTypeReference, ClassScope scope) {
265
	this.parameterizedTypeRef--;
266
}
267
268
public boolean visit(SingleTypeReference singleTypeReference, BlockScope scope) {
269
	if (((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0 && this.parameterizedTypeRef > 0 && this.wildcardTypeRef == 0) ||
270
		((this.fineGrain & WILDCARD_BOUND_TYPE_REFERENCE) != 0 && this.wildcardTypeRef > 0)) {
271
		report(singleTypeReference, scope);
272
	}
273
	return !this.completed;
274
}
275
276
public boolean visit(Wildcard wildcard, BlockScope scope) {
277
	this.wildcardTypeRef++;
278
	return !this.completed;
279
}
280
281
public boolean visit(Wildcard wildcard, ClassScope scope) {
282
	this.wildcardTypeRef++;
283
	return !this.completed;
284
}
285
286
public void endVisit(Wildcard wildcard, BlockScope scope) {
287
	this.wildcardTypeRef--;
288
}
289
290
public void endVisit(Wildcard wildcard, ClassScope scope) {
291
	this.wildcardTypeRef--;
292
}
293
294
public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
295
	if (this.completed) return false;
296
	if ((this.fineGrain & FIELD_TYPE_DECLARATION_TYPE_REFERENCE) != 0) {
297
        report(fieldDeclaration.type, scope);
298
	}
299
	return !this.completed;
300
}
301
302
public boolean visit(FieldReference fieldReference, BlockScope scope) {
303
	if (fieldReference.isSuperAccess() && (this.fineGrain & SUPER_REFERENCE) != 0) {
304
		report(fieldReference, scope);
305
	}
306
	else if (fieldReference.receiver.isThis() && (this.fineGrain & THIS_REFERENCE) != 0) {
307
		report(fieldReference, scope);
308
	}
309
	// Qualified and Implicit This reference are not field reference AST node
310
	// They are respectively caught in visit(QualifiedNameReference) and visit(SingleNameReference) methods
311
	return !this.completed;
312
}
313
314
public boolean visit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope) {
315
	if (((this.fineGrain & PARAMETERIZED_TYPE_REFERENCE) != 0 && this.parameterizedTypeRef > 0 && this.wildcardTypeRef == 0) ||
316
		((this.fineGrain & WILDCARD_BOUND_TYPE_REFERENCE) != 0 && this.wildcardTypeRef > 0)) {
317
		report(qualifiedTypeReference, scope);
318
	}
319
	return !this.completed;
320
}
321
322
public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) {
323
	return !this.completed;
324
}
325
326
public boolean visit(AnnotationMethodDeclaration annotationTypeDeclaration, ClassScope scope) {
327
	return !this.completed;
328
}
329
330
public boolean visit(Argument argument, BlockScope scope) {
331
	return !this.completed;
332
}
333
334
public boolean visit(Argument argument, ClassScope scope) {
335
	return !this.completed;
336
}
337
338
public boolean visit(ArrayAllocationExpression arrayAllocationExpression, BlockScope scope) {
339
	return !this.completed;
340
}
341
342
public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
343
	return !this.completed;
344
}
345
346
public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) {
347
	return !this.completed;
348
}
349
350
public boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope) {
351
	return !this.completed;
352
}
353
354
public boolean visit(ArrayReference arrayReference, BlockScope scope) {
355
	return !this.completed;
356
}
357
358
public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
359
	return !this.completed;
360
}
361
362
public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
363
	return !this.completed;
364
}
365
366
public boolean visit(AssertStatement assertStatement, BlockScope scope) {
367
	return !this.completed;
368
}
369
370
public boolean visit(Assignment assignment, BlockScope scope) {
371
	return !this.completed;
372
}
373
374
public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
375
	return !this.completed;
376
}
377
378
public boolean visit(Block block, BlockScope scope) {
379
	return !this.completed;
380
}
381
382
public boolean visit(BreakStatement breakStatement, BlockScope scope) {
383
	return !this.completed;
384
}
385
386
public boolean visit(CaseStatement caseStatement, BlockScope scope) {
387
	return !this.completed;
388
}
389
390
public boolean visit(CharLiteral charLiteral, BlockScope scope) {
391
	return !this.completed;
392
}
393
394
public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) {
395
	return !this.completed;
396
}
397
398
public boolean visit(Clinit clinit, ClassScope scope) {
399
	return !this.completed;
400
}
401
402
public boolean visit(CompilationUnitDeclaration compilationUnitDeclaration, CompilationUnitScope scope) {
403
	return !this.completed;
404
}
405
406
public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) {
407
	return !this.completed;
408
}
409
410
public boolean visit(ConditionalExpression conditionalExpression, BlockScope scope) {
411
	return !this.completed;
412
}
413
414
public boolean visit(ContinueStatement continueStatement, BlockScope scope) {
415
	return !this.completed;
416
}
417
418
public boolean visit(DoStatement doStatement, BlockScope scope) {
419
	return !this.completed;
420
}
421
422
public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
423
	return !this.completed;
424
}
425
426
public boolean visit(EmptyStatement emptyStatement, BlockScope scope) {
427
	return !this.completed;
428
}
429
430
public boolean visit(EqualExpression equalExpression, BlockScope scope) {
431
	return !this.completed;
432
}
433
434
public boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope) {
435
	return !this.completed;
436
}
437
438
public boolean visit(ExtendedStringLiteral extendedStringLiteral, BlockScope scope) {
439
	return !this.completed;
440
}
441
442
public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
443
	return !this.completed;
444
}
445
446
public boolean visit(FieldReference fieldReference, ClassScope scope) {
447
	return !this.completed;
448
}
449
450
public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
451
	return !this.completed;
452
}
453
454
public boolean visit(ForeachStatement forStatement, BlockScope scope) {
455
	return !this.completed;
456
}
457
458
public boolean visit(ForStatement forStatement, BlockScope scope) {
459
	return !this.completed;
460
}
461
462
public boolean visit(IfStatement ifStatement, BlockScope scope) {
463
	return !this.completed;
464
}
465
466
public boolean visit(Initializer initializer, MethodScope methodScope) {
467
	return !this.completed;
468
}
469
470
public boolean visit(InstanceOfExpression instanceOfExpression, BlockScope scope) {
471
	return !this.completed;
472
}
473
474
public boolean visit(IntLiteral intLiteral, BlockScope scope) {
475
	return !this.completed;
476
}
477
478
public boolean visit(Javadoc javadoc, BlockScope scope) {
479
	return !this.completed;
480
}
481
482
public boolean visit(Javadoc javadoc, ClassScope scope) {
483
	return !this.completed;
484
}
485
486
public boolean visit(JavadocAllocationExpression expression, BlockScope scope) {
487
	return !this.completed;
488
}
489
490
public boolean visit(JavadocAllocationExpression expression, ClassScope scope) {
491
	return !this.completed;
492
}
493
494
public boolean visit(JavadocArgumentExpression expression, BlockScope scope) {
495
	return !this.completed;
496
}
497
498
public boolean visit(JavadocArgumentExpression expression, ClassScope scope) {
499
	return !this.completed;
500
}
501
502
public boolean visit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
503
	return !this.completed;
504
}
505
506
public boolean visit(JavadocArrayQualifiedTypeReference typeRef, ClassScope scope) {
507
	return !this.completed;
508
}
509
510
public boolean visit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
511
	return !this.completed;
512
}
513
514
public boolean visit(JavadocArraySingleTypeReference typeRef, ClassScope scope) {
515
	return !this.completed;
516
}
517
518
public boolean visit(JavadocFieldReference fieldRef, BlockScope scope) {
519
	return !this.completed;
520
}
521
522
public boolean visit(JavadocFieldReference fieldRef, ClassScope scope) {
523
	return !this.completed;
524
}
525
526
public boolean visit(JavadocImplicitTypeReference implicitTypeReference, BlockScope scope) {
527
	return !this.completed;
528
}
529
530
public boolean visit(JavadocImplicitTypeReference implicitTypeReference, ClassScope scope) {
531
	return !this.completed;
532
}
533
534
public boolean visit(JavadocMessageSend messageSend, BlockScope scope) {
535
	return !this.completed;
536
}
537
538
public boolean visit(JavadocMessageSend messageSend, ClassScope scope) {
539
	return !this.completed;
540
}
541
542
public boolean visit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
543
	return !this.completed;
544
}
545
546
public boolean visit(JavadocQualifiedTypeReference typeRef, ClassScope scope) {
547
	return !this.completed;
548
}
549
550
public boolean visit(JavadocReturnStatement statement, BlockScope scope) {
551
	return !this.completed;
552
}
553
554
public boolean visit(JavadocReturnStatement statement, ClassScope scope) {
555
	return !this.completed;
556
}
557
558
public boolean visit(JavadocSingleNameReference argument, BlockScope scope) {
559
	return !this.completed;
560
}
561
562
public boolean visit(JavadocSingleNameReference argument, ClassScope scope) {
563
	return !this.completed;
564
}
565
566
public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) {
567
	return !this.completed;
568
}
569
570
public boolean visit(JavadocSingleTypeReference typeRef, ClassScope scope) {
571
	return !this.completed;
572
}
573
574
public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
575
	return !this.completed;
576
}
577
578
public boolean visit(LongLiteral longLiteral, BlockScope scope) {
579
	return !this.completed;
580
}
581
582
public boolean visit(MarkerAnnotation annotation, BlockScope scope) {
583
	return !this.completed;
584
}
585
586
public boolean visit(MemberValuePair pair, BlockScope scope) {
587
	return !this.completed;
588
}
589
590
public boolean visit(NormalAnnotation annotation, BlockScope scope) {
591
	return !this.completed;
592
}
593
594
public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
595
	return !this.completed;
596
}
597
598
public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
599
	return !this.completed;
600
}
601
602
public boolean visit(PostfixExpression postfixExpression, BlockScope scope) {
603
	return !this.completed;
604
}
605
606
public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
607
	return !this.completed;
608
}
609
610
public boolean visit(QualifiedAllocationExpression qualifiedAllocationExpression, BlockScope scope) {
611
	return !this.completed;
612
}
613
614
public boolean visit(QualifiedNameReference qualifiedNameReference, ClassScope scope) {
615
	return !this.completed;
616
}
617
618
public boolean visit(QualifiedSuperReference qualifiedSuperReference, BlockScope scope) {
619
	return !this.completed;
620
}
621
622
public boolean visit(QualifiedSuperReference qualifiedSuperReference, ClassScope scope) {
623
	return !this.completed;
624
}
625
626
public boolean visit(QualifiedThisReference qualifiedThisReference, BlockScope scope) {
627
	return !this.completed;
628
}
629
630
public boolean visit(QualifiedThisReference qualifiedThisReference, ClassScope scope) {
631
	return !this.completed;
632
}
633
634
public boolean visit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope) {
635
	return !this.completed;
636
}
637
638
public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
639
	return !this.completed;
640
}
641
642
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
643
	return !this.completed;
644
}
645
646
public boolean visit(SingleNameReference singleNameReference, ClassScope scope) {
647
	return !this.completed;
648
}
649
650
public boolean visit(SingleTypeReference singleTypeReference, ClassScope scope) {
651
	return !this.completed;
652
}
653
654
public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
655
	return !this.completed;
656
}
657
658
public boolean visit(StringLiteralConcatenation literal, BlockScope scope) {
659
	return !this.completed;
660
}
661
662
public boolean visit(SuperReference superReference, BlockScope scope) {
663
	return !this.completed;
664
}
665
666
public boolean visit(SwitchStatement switchStatement, BlockScope scope) {
667
	return !this.completed;
668
}
669
670
public boolean visit(SynchronizedStatement synchronizedStatement, BlockScope scope) {
671
	return !this.completed;
672
}
673
674
public boolean visit(ThisReference thisReference, BlockScope scope) {
675
	return !this.completed;
676
}
677
678
public boolean visit(ThisReference thisReference, ClassScope scope) {
679
	return !this.completed;
680
}
681
682
public boolean visit(ThrowStatement throwStatement, BlockScope scope) {
683
	return !this.completed;
684
}
685
686
public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
687
	return !this.completed;
688
}
689
690
public boolean visit(TypeDeclaration localTypeDeclaration, BlockScope scope) {
691
	return !this.completed;
692
}
693
694
public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) {
695
	return !this.completed;
696
}
697
698
public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) {
699
	return !this.completed;
700
}
701
702
public boolean visit(TypeParameter typeParameter, BlockScope scope) {
703
	return !this.completed;
704
}
705
706
public boolean visit(TypeParameter typeParameter, ClassScope scope) {
707
	return !this.completed;
708
}
709
710
public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
711
	return !this.completed;
712
}
713
714
public boolean visit(WhileStatement whileStatement, BlockScope scope) {
715
	return !this.completed;
716
}
717
718
}
(-)src/org/eclipse/jdt/core/tests/compiler/parser/SourceElementParserTest.java (+8 lines)
Lines 50-55 Link Here
50
	return buildAllCompliancesTestSuite(SourceElementParserTest.class);
50
	return buildAllCompliancesTestSuite(SourceElementParserTest.class);
51
}
51
}
52
/**
52
/**
53
 * acceptAnnotationTypeReference method comment.
54
 */
55
public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {}
56
/**
57
 * acceptAnnotationTypeReference method comment.
58
 */
59
public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) {}
60
/**
53
 * acceptConstructorReference method comment.
61
 * acceptConstructorReference method comment.
54
 */
62
 */
55
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
63
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {
(-)src/org/eclipse/jdt/core/tests/compiler/parser/TestSourceElementRequestor.java (+8 lines)
Lines 23-28 Link Here
23
	super();
23
	super();
24
}
24
}
25
/**
25
/**
26
 * acceptAnnotationTypeReference method comment.
27
 */
28
public void acceptAnnotationTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {}
29
/**
30
 * acceptAnnotationTypeReference method comment.
31
 */
32
public void acceptAnnotationTypeReference(char[] typeName, int sourcePosition) {}
33
/**
26
 * acceptConstructorReference method comment.
34
 * acceptConstructorReference method comment.
27
 */
35
 */
28
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {}
36
public void acceptConstructorReference(char[] typeName, int argCount, int sourcePosition) {}

Return to bug 155013