if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
for (Iterator i = rc.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof DataType) {
stk.push(o);
invokeCircularReferenceCheck((DataType) o, stk, p);
stk.pop();
}
}
setChecked(true);
}
if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
for (Iterator i = v.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof DataType) {
stk.push(o);
invokeCircularReferenceCheck((DataType) o, stk, p);
}
}
setChecked(true);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/BaseResourceCollectionContainer.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/resources/selectors/ResourceSelectorContainer.java
|
Method name: void dieOnCircularReference(Stack, Project)
|
|
Method name: void dieOnCircularReference(Stack, Project)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 8
|
|
1 | if (isReference()) {↵ | | 1 | if (isReference()) {↵
|
2 | super.dieOnCircularReference(stk, p);↵ | | 2 | super.dieOnCircularReference(stk, p);↵
|
3 | } else {↵ | | 3 | } else {↵
|
4 | for (Iterator i = rc.iterator(); i.hasNext();) {↵ | | 4 | for (Iterator i = v.iterator(); i.hasNext();) {↵
|
5 | Object o = i.next();↵ | | 5 | Object o = i.next();↵
|
6 | if (o instanceof DataType) {↵ | | 6 | if (o instanceof DataType) {↵
|
7 | stk.push(o);↵ | | 7 | stk.push(o);↵
|
8 | invokeCircularReferenceCheck((DataType) o, stk, p);↵ | | 8 | invokeCircularReferenceCheck((DataType) o, stk, p);↵
|
9 | stk.pop();↵ | | |
|
10 | }↵ | | 9 | }↵
|
11 | }↵ | | 10 | }↵
|
12 | setChecked(true);↵ | | 11 | setChecked(true);↵
|
13 | } | | 12 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.9 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (isReference()) | | 3 | if (isReference()) |
4 | super.dieOnCircularReference(stk, p); | | 4 | super.dieOnCircularReference(stk, p); |
| | | | |
5 | for (Iterator i = rc.iterator(); i.hasNext(); ) | | 5 | for (Iterator i = v.iterator(); i.hasNext(); ) |
6 | | | 6 | |
7 | if (o instanceof DataType) | | 7 | if (o instanceof DataType) |
8 | | | 8 | |
9 | invokeCircularReferenceCheck((DataType)o, stk, p); | | 9 | invokeCircularReferenceCheck((DataType)o, stk, p); |
10 | | | | |
11 | | | 10 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.util.List of variable rc does not match with type java.util.Vector of variable v |
2 | Unmatched statement stk.pop(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |