if (currentelement.length() > 0) {
if (currentelement.charAt(currentelement
.length() - 1)
!= File.separatorChar) {
currentelement =
currentelement + File.separatorChar;
}
}
scandir(myfile, currentelement, true);
if (currentelement.length() > 0) {
if (currentelement.charAt(currentelement
.length() - 1)
!= File.separatorChar) {
currentelement =
currentelement + File.separatorChar;
}
}
scandir(myfile.getAbsolutePath(), currentelement, true);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DirectoryScanner.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java
|
Method name: void checkIncludePatterns()
|
|
Method name: void checkIncludePatterns()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (currentelement.length() > 0) {↵ | | 1 | if (currentelement.length() > 0) {↵
|
2 | if (currentelement.charAt(currentelement↵ | | 2 | if (currentelement.charAt(currentelement↵
|
3 | .length() - 1)↵ | | 3 | .length() - 1)↵
|
4 | != File.separatorChar) {↵ | | 4 | != File.separatorChar) {↵
|
5 | currentelement =↵ | | 5 | currentelement =↵
|
6 | currentelement + File.separatorChar;↵ | | 6 | currentelement + File.separatorChar;↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | ↵
|
| | | 9 | }↵
|
9 | scandir(myfile, currentelement, true); | | 10 | scandir(myfile.getAbsolutePath(), currentelement, true);
|
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.5 |
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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
41 | if (currentelement.length() > 0) | | 35 | if (currentelement.length() > 0) |
42 | if (currentelement.charAt(currentelement.length() - 1) != File.separatorChar) | | 36 | if (currentelement.charAt(currentelement.length() - 1) != File.separatorChar) |
43 | currentelement = currentelement + File.separatorChar; | | 37 | currentelement = currentelement + File.separatorChar; |
| | | 38 | scandir(myfile.getAbsolutePath(), currentelement, true); |
44 | scandir(myfile, currentelement, true); | | | |
Precondition Violations (0)
Row |
Violation |