if (loginSuceeded) {
if (changeRemoteDir(remoteTmpDir)) {
FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
ds.setIncludes(new String[] {"alpha/BETA/gamma/"});
ds.setCaseSensitive(false);
ds.scan();
compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
new String[] {"alpha/beta/gamma"});
}
}
if (!loginSuceeded) {
return;
}
if (!changeRemoteDir(remoteTmpDir)) {
return;
}
FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
ds.setIncludes(new String[] {
"alpha/beta/gamma/gamma.xml",
"alpha/beta/gamma/GAMMA.XML"
});
ds.scan();
compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
new String[] {});
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java
|
Method name: void test2bisButCaseInsensitive()
|
|
Method name: void testFullpathDiffersInCaseScanningSensitive()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 9
|
|
1 | if (loginSuceeded) {↵ | | 1 | if (!loginSuceeded) {↵
|
2 | ↵ | | 2 | return;↵
|
| | | 3 | }↵
|
3 | if (changeRemoteDir(remoteTmpDir)) {↵ | | 4 | if (!changeRemoteDir(remoteTmpDir)) {↵
|
4 | ↵ | | 5 | return;↵
|
| | | 6 | }↵
|
5 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);↵ | | 7 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);↵
|
6 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));↵ | | 8 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));↵
|
7 | ds.setIncludes(new String[] {↵ | | 9 | ds.setIncludes(new String[] {↵
|
8 | "alpha/BETA/gamma/"});↵ | | 10 | "alpha/beta/gamma/↵
|
9 | ds.setCaseSensitive(false);↵ | | 11 | gamma.xml",↵
|
| | | 12 | "alpha/beta/gamma/GAMMA.XML"↵
|
10 | ↵ | | 13 | });↵
|
11 | ds.scan();↵ | | 14 | ds.scan();↵
|
12 | compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},↵ | | 15 | compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},↵
|
13 | new String[] {"alpha/beta/gamma"});↵ | | 16 | new String[] {↵
|
14 | }↵ | | |
|
15 | } | | 17 | });
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 15 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | if (changeRemoteDir(remoteTmpDir)) | | 1 | if (!loginSuceeded) |
| | | 2 | |
3 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); | | | |
4 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); | | | |
5 | ds.setIncludes(new String[] {"alpha/BETA/gamma/"}); | | | |
6 | ds.setCaseSensitive(false); | | | |
7 | | | | |
8 | compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"}); | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched return; |