File d = new File(dirs[i]);
if (!d.exists()) {
if (!d.mkdirs()) {
log("Unable to create directory "
+ d.getAbsolutePath(), Project.MSG_ERR);
} else {
createCount++;
}
}
File d = new File(toDirNames[i]);
if (!d.exists()) {
if (!d.mkdirs()) {
log("Unable to create directory "
+ d.getAbsolutePath(), Project.MSG_ERR);
} else {
createCount++;
}
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copy.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Move.java
|
Method name: void doFileOperations()
|
|
Method name: void doFileOperations()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | File d = new File(dirs[i]);↵ | | 1 | File d = new File(toDirNames[i]);↵
|
2 | if (!d.exists()) {↵ | | 2 | if (!d.exists()) {↵
|
3 | if (!d.mkdirs()) {↵ | | 3 | if (!d.mkdirs()) {↵
|
4 | log("Unable to create directory "↵ | | 4 | log("Unable to create directory "↵
|
5 | + d.getAbsolutePath(), Project.MSG_ERR);↵ | | 5 | + d.getAbsolutePath(), Project.MSG_ERR);↵
|
6 | } else {↵ | | 6 | } else {↵
|
7 | createCount++;↵ | | 7 | createCount++;↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 15 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 13.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | File d = new File(dirs[i]); | | 51 | File d = new File(toDirNames[i]); |
27 | if (!d.exists()) | | 52 | if (!d.exists()) |
28 | | | 53 | |
29 | log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR); | | 54 | log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR); |
| | | | |
30 | | | 55 | |
Precondition Violations (0)
Row |
Violation |