File d = new File(toDirNames[i]);
if (!d.exists()) {
if (!d.mkdirs()) {
log("Unable to create directory "
+ d.getAbsolutePath(), Project.MSG_ERR);
} else {
createCount++;
}
}
File d = new File(dirs[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/Move.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Copy.java
|
Method name: void doFileOperations()
|
|
Method name: void doFileOperations()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | File d = new File(toDirNames[i]);↵ | | 1 | File d = new File(dirs[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.7 |
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) | 78.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
51 | File d = new File(toDirNames[i]); | | 26 | File d = new File(dirs[i]); |
52 | if (!d.exists()) | | 27 | if (!d.exists()) |
53 | | | 28 | |
54 | log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR); | | 29 | log("Unable to create directory " + d.getAbsolutePath(), Project.MSG_ERR); |
| | | | |
55 | | | 30 | |
Precondition Violations (0)
Row |
Violation |