if (u.children != null) {
List newChildren = new ArrayList();
newChildren.addAll(u.children);
if (children != null) {
newChildren.addAll(children);
}
children = newChildren;
}
if (r.children != null) {
List newChildren = new ArrayList();
newChildren.addAll(r.children);
if (children != null) {
newChildren.addAll(children);
}
children = newChildren;
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/UnknownElement.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/RuntimeConfigurable.java
|
Method name: void applyPreSet(UnknownElement)
|
|
Method name: void applyPreSet(RuntimeConfigurable)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | if (u.children != null) {↵ | | 1 | if (r.children != null) {↵
|
2 | List newChildren = new ArrayList();↵ | | 2 | List newChildren = new ArrayList();↵
|
3 | newChildren.addAll(u.children);↵ | | 3 | newChildren.addAll(r.children);↵
|
4 | if (children != null) {↵ | | 4 | if (children != null) {↵
|
5 | newChildren.addAll(children);↵ | | 5 | newChildren.addAll(children);↵
|
6 | }↵ | | 6 | }↵
|
7 | children = newChildren;↵ | | 7 | children = newChildren;↵
|
8 | } | | 8 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 20 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (u.children != null) | | 7 | if (r.children != null) |
5 | List newChildren = new ArrayList(); | | 8 | List newChildren = new ArrayList(); |
6 | newChildren.addAll(u.children); | | 9 | newChildren.addAll(r.children); |
7 | | | 10 | |
8 | newChildren.addAll(children); | | 11 | newChildren.addAll(children); |
9 | | | 12 | |
Precondition Violations (2)
Row |
Violation |
1 | Type org.apache.tools.ant.UnknownElement of variable u does not match with type org.apache.tools.ant.RuntimeConfigurable of variable r |
2 | Type org.apache.tools.ant.UnknownElement of variable u does not match with type org.apache.tools.ant.RuntimeConfigurable of variable r |