if (isChecked()) {
return;
}
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 (isChecked()) {
return;
}
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: 11
|
|
Number of AST nodes: 10
|
|
1 | if (isChecked()) {↵ | | 1 | if (isChecked()) {↵
|
2 | return;↵ | | 2 | return;↵
|
3 | }↵ | | 3 | }↵
|
4 | if (isReference()) {↵ | | 4 | if (isReference()) {↵
|
5 | super.dieOnCircularReference(stk, p);↵ | | 5 | super.dieOnCircularReference(stk, p);↵
|
6 | } else {↵ | | 6 | } else {↵
|
7 | for (Iterator i = rc.iterator(); i.hasNext();) {↵ | | 7 | for (Iterator i = v.iterator(); i.hasNext();) {↵
|
8 | Object o = i.next();↵ | | 8 | Object o = i.next();↵
|
9 | if (o instanceof DataType) {↵ | | 9 | if (o instanceof DataType) {↵
|
10 | stk.push(o);↵ | | 10 | stk.push(o);↵
|
11 | invokeCircularReferenceCheck((DataType) o, stk, p);↵ | | 11 | invokeCircularReferenceCheck((DataType) o, stk, p);↵
|
12 | stk.pop();↵ | | |
|
13 | }↵ | | 12 | }↵
|
14 | }↵ | | 13 | }↵
|
15 | setChecked(true);↵ | | 14 | setChecked(true);↵
|
16 | } | | 15 | }
|
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.6 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 36 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 10 |
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) | 9.1 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (isChecked()) | | 1 | if (isChecked()) |
2 | | | 2 | |
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 |