Lines 61-66
Link Here
|
61 |
import org.eclipse.jdt.internal.core.JavaElement; |
61 |
import org.eclipse.jdt.internal.core.JavaElement; |
62 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
62 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
63 |
import org.eclipse.jdt.internal.core.JavaProject; |
63 |
import org.eclipse.jdt.internal.core.JavaProject; |
|
|
64 |
import org.eclipse.jdt.internal.core.LocalVariable; |
64 |
import org.eclipse.jdt.internal.core.NameLookup; |
65 |
import org.eclipse.jdt.internal.core.NameLookup; |
65 |
import org.eclipse.jdt.internal.core.Openable; |
66 |
import org.eclipse.jdt.internal.core.Openable; |
66 |
import org.eclipse.jdt.internal.core.PackageFragment; |
67 |
import org.eclipse.jdt.internal.core.PackageFragment; |
Lines 165-171
Link Here
|
165 |
} |
166 |
} |
166 |
} |
167 |
} |
167 |
|
168 |
|
168 |
|
|
|
169 |
public static class WorkingCopyDocument extends JavaSearchDocument { |
169 |
public static class WorkingCopyDocument extends JavaSearchDocument { |
170 |
public org.eclipse.jdt.core.ICompilationUnit workingCopy; |
170 |
public org.eclipse.jdt.core.ICompilationUnit workingCopy; |
171 |
WorkingCopyDocument(org.eclipse.jdt.core.ICompilationUnit workingCopy, SearchParticipant participant) { |
171 |
WorkingCopyDocument(org.eclipse.jdt.core.ICompilationUnit workingCopy, SearchParticipant participant) { |
Lines 562-567
Link Here
|
562 |
} |
562 |
} |
563 |
return ((IType) parent).getInitializer(occurrenceCount); |
563 |
return ((IType) parent).getInitializer(occurrenceCount); |
564 |
} |
564 |
} |
|
|
565 |
/** |
566 |
* Create an handle for a local variable declartion (may be a local variable or type parameter). |
567 |
*/ |
568 |
protected IJavaElement createHandle(AbstractVariableDeclaration variableDeclaration, IJavaElement parent) { |
569 |
switch (variableDeclaration.getKind()) { |
570 |
case AbstractVariableDeclaration.LOCAL_VARIABLE: |
571 |
return new LocalVariable((JavaElement)parent, |
572 |
new String(variableDeclaration.name), |
573 |
variableDeclaration.declarationSourceStart, |
574 |
variableDeclaration.declarationSourceEnd, |
575 |
variableDeclaration.sourceStart, |
576 |
variableDeclaration.sourceEnd, |
577 |
new String(variableDeclaration.type.resolvedType.signature()) |
578 |
); |
579 |
case AbstractVariableDeclaration.PARAMETER: |
580 |
return new LocalVariable((JavaElement)parent, |
581 |
new String(variableDeclaration.name), |
582 |
variableDeclaration.declarationSourceStart, |
583 |
variableDeclaration.declarationSourceEnd, |
584 |
variableDeclaration.sourceStart, |
585 |
variableDeclaration.sourceEnd, |
586 |
new String(variableDeclaration.type.resolvedType.signature()) |
587 |
); |
588 |
case AbstractVariableDeclaration.TYPE_PARAMETER: |
589 |
return new org.eclipse.jdt.internal.core.TypeParameter((JavaElement)parent, new String(variableDeclaration.name)); |
590 |
} |
591 |
return null; |
592 |
} |
565 |
/* |
593 |
/* |
566 |
* Creates hierarchy resolver if needed. |
594 |
* Creates hierarchy resolver if needed. |
567 |
* Returns whether focus is visible. |
595 |
* Returns whether focus is visible. |
Lines 1364-1370
Link Here
|
1364 |
return new TypeParameterReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); |
1392 |
return new TypeParameterReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); |
1365 |
} |
1393 |
} |
1366 |
|
1394 |
|
1367 |
public SearchMatch newTypeReferenceMatch( |
1395 |
public TypeReferenceMatch newTypeReferenceMatch( |
1368 |
IJavaElement enclosingElement, |
1396 |
IJavaElement enclosingElement, |
1369 |
Binding enclosingBinding, |
1397 |
Binding enclosingBinding, |
1370 |
int accuracy, |
1398 |
int accuracy, |
Lines 1379-1385
Link Here
|
1379 |
return new TypeReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); |
1407 |
return new TypeReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); |
1380 |
} |
1408 |
} |
1381 |
|
1409 |
|
1382 |
public SearchMatch newTypeReferenceMatch( |
1410 |
public TypeReferenceMatch newTypeReferenceMatch( |
1383 |
IJavaElement enclosingElement, |
1411 |
IJavaElement enclosingElement, |
1384 |
Binding enclosingBinding, |
1412 |
Binding enclosingBinding, |
1385 |
int accuracy, |
1413 |
int accuracy, |
Lines 1541-1546
Link Here
|
1541 |
} catch (Exception e) { |
1569 |
} catch (Exception e) { |
1542 |
// it's just for debug purposes... ignore all exceptions in this area |
1570 |
// it's just for debug purposes... ignore all exceptions in this area |
1543 |
} |
1571 |
} |
|
|
1572 |
if (match instanceof TypeReferenceMatch) { |
1573 |
try { |
1574 |
TypeReferenceMatch typeRefMatch = (TypeReferenceMatch) match; |
1575 |
JavaElement local = (JavaElement) typeRefMatch.getLocalElement(); |
1576 |
if (local != null) { |
1577 |
System.out.println("\tLocal element: "+ local.toStringWithAncestors()); //$NON-NLS-1$ |
1578 |
} |
1579 |
IJavaElement[] others = typeRefMatch.getOtherElements(); |
1580 |
int length = others==null ? 0 : others.length; |
1581 |
if (length > 0) { |
1582 |
System.out.println("\tOther elements:"); //$NON-NLS-1$ |
1583 |
for (int i=0; i<length; i++) { |
1584 |
JavaElement other = (JavaElement) others[i]; |
1585 |
System.out.println("\t\t- "+ other.toStringWithAncestors()); //$NON-NLS-1$ |
1586 |
} |
1587 |
} |
1588 |
} catch (Exception e) { |
1589 |
// it's just for debug purposes... ignore all exceptions in this area |
1590 |
} |
1591 |
} |
1544 |
System.out.println(match.getAccuracy() == SearchMatch.A_ACCURATE |
1592 |
System.out.println(match.getAccuracy() == SearchMatch.A_ACCURATE |
1545 |
? "\tAccuracy: EXACT_MATCH" //$NON-NLS-1$ |
1593 |
? "\tAccuracy: EXACT_MATCH" //$NON-NLS-1$ |
1546 |
: "\tAccuracy: POTENTIAL_MATCH"); //$NON-NLS-1$ |
1594 |
: "\tAccuracy: POTENTIAL_MATCH"); //$NON-NLS-1$ |
Lines 1848-1853
Link Here
|
1848 |
} |
1896 |
} |
1849 |
} |
1897 |
} |
1850 |
|
1898 |
|
|
|
1899 |
// report the type parameters |
1900 |
TypeParameter[] typeParameters = method.typeParameters(); |
1901 |
if (typeParameters != null) { |
1902 |
if (enclosingElement == null) { |
1903 |
enclosingElement = createHandle(method, parent); |
1904 |
} |
1905 |
reportMatching(typeParameters, enclosingElement, parent, method.binding, nodeSet); |
1906 |
} |
1907 |
|
1851 |
// report annotations |
1908 |
// report annotations |
1852 |
if (method.annotations != null) { |
1909 |
if (method.annotations != null) { |
1853 |
if (enclosingElement == null) { |
1910 |
if (enclosingElement == null) { |
Lines 1867-1873
Link Here
|
1867 |
for (int i = 0, l = nodes.length; i < l; i++) { |
1924 |
for (int i = 0, l = nodes.length; i < l; i++) { |
1868 |
ASTNode node = nodes[i]; |
1925 |
ASTNode node = nodes[i]; |
1869 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
1926 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
1870 |
this.patternLocator.matchReportReference(node, enclosingElement, method.binding, level.intValue(), this); |
1927 |
this.patternLocator.matchReportReference(node, enclosingElement, method.binding, method.scope, level.intValue(), this); |
1871 |
} |
1928 |
} |
1872 |
return; |
1929 |
return; |
1873 |
} |
1930 |
} |
Lines 2033-2039
Link Here
|
2033 |
* Visit the given field declaration and report the nodes that match exactly the |
2090 |
* Visit the given field declaration and report the nodes that match exactly the |
2034 |
* search pattern (ie. the ones in the matching nodes set) |
2091 |
* search pattern (ie. the ones in the matching nodes set) |
2035 |
*/ |
2092 |
*/ |
2036 |
protected void reportMatching(FieldDeclaration field, TypeDeclaration type, IJavaElement parent, int accuracy, boolean typeInHierarchy, MatchingNodeSet nodeSet) throws CoreException { |
2093 |
protected void reportMatching(FieldDeclaration field, TypeDeclaration type, IJavaElement parent, IJavaElement[] otherElements, int accuracy, boolean typeInHierarchy, MatchingNodeSet nodeSet) throws CoreException { |
2037 |
IJavaElement enclosingElement = null; |
2094 |
IJavaElement enclosingElement = null; |
2038 |
if (accuracy > -1) { |
2095 |
if (accuracy > -1) { |
2039 |
enclosingElement = createHandle(field, type, parent); |
2096 |
enclosingElement = createHandle(field, type, parent); |
Lines 2065-2081
Link Here
|
2065 |
} |
2122 |
} |
2066 |
|
2123 |
|
2067 |
if (typeInHierarchy) { |
2124 |
if (typeInHierarchy) { |
2068 |
// limit scan to end part position for multiple fields declaration (see bug 73112) |
2125 |
// Look at field declaration |
2069 |
int end = field.endPart2Position==0 ? field.declarationSourceEnd : field.endPart2Position; |
2126 |
if (field.endPart1Position != 0) { // not an initializer |
2070 |
ASTNode[] nodes = nodeSet.matchingNodes(field.declarationSourceStart, end); |
2127 |
ASTNode[] nodes = nodeSet.matchingNodes(field.declarationSourceStart, field.endPart1Position); |
|
|
2128 |
if (nodes != null) { |
2129 |
if ((this.matchContainer & PatternLocator.FIELD_CONTAINER) == 0) { |
2130 |
for (int i = 0, l = nodes.length; i < l; i++) |
2131 |
nodeSet.matchingNodes.removeKey(nodes[i]); |
2132 |
} else { |
2133 |
if (enclosingElement == null) |
2134 |
enclosingElement = createHandle(field, type, parent); |
2135 |
if (encloses(enclosingElement)) { |
2136 |
for (int i = 0, l = nodes.length; i < l; i++) { |
2137 |
ASTNode node = nodes[i]; |
2138 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
2139 |
this.patternLocator.matchReportReference(node, enclosingElement, null, otherElements, field.binding, level.intValue(), this); |
2140 |
} |
2141 |
} |
2142 |
} |
2143 |
} |
2144 |
} |
2145 |
|
2146 |
// Look in initializers |
2147 |
int fieldEnd = field.endPart2Position == 0 ? field.declarationSourceEnd : field.endPart2Position; |
2148 |
ASTNode[] nodes = nodeSet.matchingNodes(field.sourceStart, fieldEnd); |
2071 |
if (nodes != null) { |
2149 |
if (nodes != null) { |
2072 |
if ((this.matchContainer & PatternLocator.FIELD_CONTAINER) == 0) { |
2150 |
if ((this.matchContainer & PatternLocator.FIELD_CONTAINER) == 0) { |
2073 |
for (int i = 0, l = nodes.length; i < l; i++) |
2151 |
for (int i = 0, l = nodes.length; i < l; i++) |
2074 |
nodeSet.matchingNodes.removeKey(nodes[i]); |
2152 |
nodeSet.matchingNodes.removeKey(nodes[i]); |
2075 |
} else { |
2153 |
} else { |
2076 |
if (enclosingElement == null) |
2154 |
if (enclosingElement == null) { |
2077 |
enclosingElement = createHandle(field, type, parent); |
2155 |
enclosingElement = createHandle(field, type, parent); |
2078 |
if (encloses(enclosingElement)) |
2156 |
} |
|
|
2157 |
if (encloses(enclosingElement)) { |
2079 |
for (int i = 0, l = nodes.length; i < l; i++) { |
2158 |
for (int i = 0, l = nodes.length; i < l; i++) { |
2080 |
ASTNode node = nodes[i]; |
2159 |
ASTNode node = nodes[i]; |
2081 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
2160 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
Lines 2088-2093
Link Here
|
2088 |
} |
2167 |
} |
2089 |
this.patternLocator.matchReportReference(node, enclosingElement, field.binding, level.intValue(), this); |
2168 |
this.patternLocator.matchReportReference(node, enclosingElement, field.binding, level.intValue(), this); |
2090 |
} |
2169 |
} |
|
|
2170 |
} |
2091 |
} |
2171 |
} |
2092 |
} |
2172 |
} |
2093 |
} |
2173 |
} |
Lines 2121-2156
Link Here
|
2121 |
} |
2201 |
} |
2122 |
|
2202 |
|
2123 |
boolean matchedClassContainer = (this.matchContainer & PatternLocator.CLASS_CONTAINER) != 0; |
2203 |
boolean matchedClassContainer = (this.matchContainer & PatternLocator.CLASS_CONTAINER) != 0; |
2124 |
|
2204 |
|
2125 |
// report the type parameters |
2205 |
// report the type parameters |
2126 |
if (type.typeParameters != null) { |
2206 |
if (type.typeParameters != null) { |
2127 |
for (int i=0, l=type.typeParameters.length; i<l; i++) { |
2207 |
reportMatching(type.typeParameters, enclosingElement, parent, type.binding, nodeSet); |
2128 |
TypeParameter typeParameter = type.typeParameters[i]; |
|
|
2129 |
if (typeParameter != null) { |
2130 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter); |
2131 |
if (level != null && matchedClassContainer) { |
2132 |
if (level.intValue() > -1 && enclosesElement) { |
2133 |
int offset = typeParameter.sourceStart; |
2134 |
SearchMatch match = this.patternLocator.newDeclarationMatch(typeParameter, enclosingElement, type.binding, level.intValue(), typeParameter.sourceEnd-offset+1, this); |
2135 |
report(match); |
2136 |
} |
2137 |
} |
2138 |
if (typeParameter.type != null) { |
2139 |
level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.type); |
2140 |
if (level != null && matchedClassContainer) { |
2141 |
this.patternLocator.matchReportReference(typeParameter.type, enclosingElement, type.binding, level.intValue(), this); |
2142 |
} |
2143 |
} |
2144 |
if (typeParameter.bounds != null) { |
2145 |
for (int j=0, b=typeParameter.bounds.length; j<b; j++) { |
2146 |
level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.bounds[j]); |
2147 |
if (level != null && matchedClassContainer) { |
2148 |
this.patternLocator.matchReportReference(typeParameter.bounds[j], enclosingElement, type.binding, level.intValue(), this); |
2149 |
} |
2150 |
} |
2151 |
} |
2152 |
} |
2153 |
} |
2154 |
} |
2208 |
} |
2155 |
|
2209 |
|
2156 |
// report annotations |
2210 |
// report annotations |
Lines 2202-2221
Link Here
|
2202 |
boolean typeInHierarchy = type.binding == null || typeInHierarchy(type.binding); |
2256 |
boolean typeInHierarchy = type.binding == null || typeInHierarchy(type.binding); |
2203 |
matchedClassContainer = matchedClassContainer && typeInHierarchy; |
2257 |
matchedClassContainer = matchedClassContainer && typeInHierarchy; |
2204 |
|
2258 |
|
|
|
2259 |
// Visit fields |
2205 |
FieldDeclaration[] fields = type.fields; |
2260 |
FieldDeclaration[] fields = type.fields; |
2206 |
if (fields != null) { |
2261 |
if (fields != null) { |
2207 |
if (nodeSet.matchingNodes.elementSize == 0) return; // reported all the matching nodes |
2262 |
if (nodeSet.matchingNodes.elementSize == 0) return; // end as all matching nodes were reported |
|
|
2263 |
IJavaElement[] otherElements = null; |
2264 |
int first = -1; |
2208 |
for (int i = 0, l = fields.length; i < l; i++) { |
2265 |
for (int i = 0, l = fields.length; i < l; i++) { |
2209 |
FieldDeclaration field = fields[i]; |
2266 |
FieldDeclaration field = fields[i]; |
2210 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(field); |
2267 |
boolean last = field.endPart2Position == 0 || field.declarationEnd == field.endPart2Position; |
2211 |
int value = (level != null && matchedClassContainer) ? level.intValue() : -1; |
2268 |
// Store first index of multiple field declaration |
2212 |
reportMatching(field, type, enclosingElement, value, typeInHierarchy, nodeSet); |
2269 |
if (!last) { |
|
|
2270 |
if (first == -1) { |
2271 |
first = i; |
2272 |
} |
2273 |
} |
2274 |
// Mutliple declaration fields |
2275 |
if (first >= 0) { |
2276 |
// Create handle for all multiple fields except first one as it would be returned through the match |
2277 |
if (i > first) { |
2278 |
if (otherElements == null) { |
2279 |
otherElements = new IJavaElement[] { createHandle(field, type, enclosingElement) }; |
2280 |
} else { |
2281 |
int length = otherElements.length; |
2282 |
System.arraycopy(otherElements, 0, otherElements = new IJavaElement[length+1], 0, length); |
2283 |
otherElements[length] = createHandle(field, type, enclosingElement); |
2284 |
} |
2285 |
} |
2286 |
// On last field, report match with all other elements |
2287 |
if (last) { |
2288 |
for (int j=first; j<=i; j++) { |
2289 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(fields[j]); |
2290 |
int value = (level != null && matchedClassContainer) ? level.intValue() : -1; |
2291 |
reportMatching(fields[j], type, enclosingElement, otherElements, value, typeInHierarchy, nodeSet); |
2292 |
} |
2293 |
first = -1; |
2294 |
otherElements = null; |
2295 |
} |
2296 |
} else { |
2297 |
// Single field, report normally |
2298 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(field); |
2299 |
int value = (level != null && matchedClassContainer) ? level.intValue() : -1; |
2300 |
reportMatching(field, type, enclosingElement, null, value, typeInHierarchy, nodeSet); |
2301 |
} |
2213 |
} |
2302 |
} |
2214 |
} |
2303 |
} |
2215 |
|
2304 |
|
|
|
2305 |
// Visit methods |
2216 |
AbstractMethodDeclaration[] methods = type.methods; |
2306 |
AbstractMethodDeclaration[] methods = type.methods; |
2217 |
if (methods != null) { |
2307 |
if (methods != null) { |
2218 |
if (nodeSet.matchingNodes.elementSize == 0) return; // reported all the matching nodes |
2308 |
if (nodeSet.matchingNodes.elementSize == 0) return; // end as all matching nodes were reported |
2219 |
for (int i = 0, l = methods.length; i < l; i++) { |
2309 |
for (int i = 0, l = methods.length; i < l; i++) { |
2220 |
AbstractMethodDeclaration method = methods[i]; |
2310 |
AbstractMethodDeclaration method = methods[i]; |
2221 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(method); |
2311 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(method); |
Lines 2224-2233
Link Here
|
2224 |
} |
2314 |
} |
2225 |
} |
2315 |
} |
2226 |
|
2316 |
|
|
|
2317 |
// Visit types |
2227 |
TypeDeclaration[] memberTypes = type.memberTypes; |
2318 |
TypeDeclaration[] memberTypes = type.memberTypes; |
2228 |
if (memberTypes != null) { |
2319 |
if (memberTypes != null) { |
2229 |
for (int i = 0, l = memberTypes.length; i < l; i++) { |
2320 |
for (int i = 0, l = memberTypes.length; i < l; i++) { |
2230 |
if (nodeSet.matchingNodes.elementSize == 0) return; // reported all the matching nodes |
2321 |
if (nodeSet.matchingNodes.elementSize == 0) return; // end as all matching nodes were reported |
2231 |
TypeDeclaration memberType = memberTypes[i]; |
2322 |
TypeDeclaration memberType = memberTypes[i]; |
2232 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(memberType); |
2323 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(memberType); |
2233 |
int value = (level != null && matchedClassContainer) ? level.intValue() : -1; |
2324 |
int value = (level != null && matchedClassContainer) ? level.intValue() : -1; |
Lines 2235-2240
Link Here
|
2235 |
} |
2326 |
} |
2236 |
} |
2327 |
} |
2237 |
} |
2328 |
} |
|
|
2329 |
/** |
2330 |
* Report matches in type parameters. |
2331 |
*/ |
2332 |
protected void reportMatching(TypeParameter[] typeParameters, IJavaElement enclosingElement, IJavaElement parent, Binding binding, MatchingNodeSet nodeSet) throws CoreException { |
2333 |
if (typeParameters == null) return; |
2334 |
for (int i=0, l=typeParameters.length; i<l; i++) { |
2335 |
TypeParameter typeParameter = typeParameters[i]; |
2336 |
if (typeParameter != null) { |
2337 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter); |
2338 |
if (level != null) { |
2339 |
if (level.intValue() > -1 && encloses(enclosingElement)) { |
2340 |
int offset = typeParameter.sourceStart; |
2341 |
SearchMatch match = this.patternLocator.newDeclarationMatch(typeParameter, enclosingElement, binding, level.intValue(), typeParameter.sourceEnd-offset+1, this); |
2342 |
report(match); |
2343 |
} |
2344 |
} |
2345 |
if (typeParameter.type != null) { |
2346 |
level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.type); |
2347 |
if (level != null) { |
2348 |
IJavaElement localElement = createHandle(typeParameter, enclosingElement); |
2349 |
this.patternLocator.matchReportReference(typeParameter.type, enclosingElement, localElement, null, binding, level.intValue(), this); |
2350 |
} |
2351 |
} |
2352 |
if (typeParameter.bounds != null) { |
2353 |
for (int j=0, b=typeParameter.bounds.length; j<b; j++) { |
2354 |
level = (Integer) nodeSet.matchingNodes.removeKey(typeParameter.bounds[j]); |
2355 |
if (level != null) { |
2356 |
IJavaElement localElement = createHandle(typeParameter, enclosingElement); |
2357 |
this.patternLocator.matchReportReference(typeParameter.bounds[j], enclosingElement, localElement, null, binding, level.intValue(), this); |
2358 |
} |
2359 |
} |
2360 |
} |
2361 |
} |
2362 |
} |
2363 |
} |
2238 |
protected void reportMatchingSuper(TypeReference superReference, IJavaElement enclosingElement, Binding elementBinding, MatchingNodeSet nodeSet, boolean matchedClassContainer) throws CoreException { |
2364 |
protected void reportMatchingSuper(TypeReference superReference, IJavaElement enclosingElement, Binding elementBinding, MatchingNodeSet nodeSet, boolean matchedClassContainer) throws CoreException { |
2239 |
ASTNode[] nodes = null; |
2365 |
ASTNode[] nodes = null; |
2240 |
if (superReference instanceof ParameterizedSingleTypeReference || superReference instanceof ParameterizedQualifiedTypeReference) { |
2366 |
if (superReference instanceof ParameterizedSingleTypeReference || superReference instanceof ParameterizedQualifiedTypeReference) { |