if (action == LIST_FILES) {
File pd = listing.getParentFile();
if (!pd.exists()) {
pd.mkdirs();
}
bw = new BufferedWriter(new FileWriter(listing));
}
File parent = destinationFile.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
os = new FileOutputStream(destinationFile.getAbsolutePath(),
append);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Concat.java
|
Method name: int transferFiles(FTPClient, FileSet)
|
|
Method name: void cat(ResourceCollection)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | if (action == LIST_FILES) {↵ | | |
|
2 | File pd = listing.getParentFile();↵ | | 1 | File parent = destinationFile.getParentFile();↵
|
|
3 | if (!pd.exists()) {↵ | | 2 | if (!parent.exists()) {↵
|
4 | pd.mkdirs();↵ | | 3 | parent.mkdirs();↵
|
5 | }↵ | | 4 | }↵
|
6 | bw = new BufferedWriter(new FileWriter(listing));↵ | | 5 | os = new ↵
|
7 | } | | 6 | FileOutputStream(destinationFile.getAbsolutePath(),↵
|
| | | 7 | append);
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
22 | File pd = listing.getParentFile(); | | 9 | File parent = destinationFile.getParentFile(); |
23 | if (!pd.exists()) | | 10 | if (!parent.exists()) |
24 | | | 11 | |
| | | 12 | os = new FileOutputStream(destinationFile.getAbsolutePath(), append); |
25 | bw = new BufferedWriter(new FileWriter(listing)); | | | |
Precondition Violations (0)
Row |
Violation |