Lines 2157-2169
Link Here
|
2157 |
int length = nodes.length; |
2157 |
int length = nodes.length; |
2158 |
for (int i = 0; i < length; i++) { |
2158 |
for (int i = 0; i < length; i++) { |
2159 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(nodes[i]); |
2159 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(nodes[i]); |
2160 |
this.patternLocator.matchReportReference(nodes[i], enclosingElement, declarationVisitor.getLocalElement(i), declarationVisitor.getOtherElements(i), method.binding, level.intValue(), this); |
2160 |
if (level != null) { // ensure that the reference has not been already reported while visiting |
|
|
2161 |
this.patternLocator.matchReportReference(nodes[i], enclosingElement, declarationVisitor.getLocalElement(i), declarationVisitor.getOtherElements(i), method.binding, level.intValue(), this); |
2162 |
} |
2161 |
} |
2163 |
} |
2162 |
} else { |
2164 |
} else { |
2163 |
for (int i = 0, l = nodes.length; i < l; i++) { |
2165 |
for (int i = 0, l = nodes.length; i < l; i++) { |
2164 |
ASTNode node = nodes[i]; |
2166 |
ASTNode node = nodes[i]; |
2165 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
2167 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
2166 |
this.patternLocator.matchReportReference(node, enclosingElement, null, null, method.binding, level.intValue(), this); |
2168 |
if (level != null) { // ensure that the reference has not been already reported while visiting |
|
|
2169 |
this.patternLocator.matchReportReference(node, enclosingElement, null, null, method.binding, level.intValue(), this); |
2170 |
} |
2167 |
} |
2171 |
} |
2168 |
} |
2172 |
} |
2169 |
return; |
2173 |
return; |
Lines 2452-2465
Link Here
|
2452 |
for (int i = 0; i < length; i++) { |
2456 |
for (int i = 0; i < length; i++) { |
2453 |
ASTNode node = nodes[i]; |
2457 |
ASTNode node = nodes[i]; |
2454 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
2458 |
Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); |
2455 |
if (node instanceof TypeDeclaration) { |
2459 |
if (level != null) { // ensure that the reference has not been already reported while visiting |
2456 |
// use field declaration to report match (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174) |
2460 |
if (node instanceof TypeDeclaration) { |
2457 |
AllocationExpression allocation = ((TypeDeclaration)node).allocation; |
2461 |
// use field declaration to report match (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=88174) |
2458 |
if (allocation != null && allocation.enumConstant != null) { |
2462 |
AllocationExpression allocation = ((TypeDeclaration)node).allocation; |
2459 |
node = field; |
2463 |
if (allocation != null && allocation.enumConstant != null) { |
|
|
2464 |
node = field; |
2465 |
} |
2460 |
} |
2466 |
} |
|
|
2467 |
this.patternLocator.matchReportReference(node, enclosingElement, declarationVisitor.getLocalElement(i), declarationVisitor.getOtherElements(i), field.binding, level.intValue(), this); |
2461 |
} |
2468 |
} |
2462 |
this.patternLocator.matchReportReference(node, enclosingElement, declarationVisitor.getLocalElement(i), declarationVisitor.getOtherElements(i), field.binding, level.intValue(), this); |
|
|
2463 |
} |
2469 |
} |
2464 |
return; |
2470 |
return; |
2465 |
} |
2471 |
} |