FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] {"alpha/"}); ds.scan(); compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"}, new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
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"});
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 test2() Method name: void test2bisButCaseInsensitive()
Number of AST nodes: 5 Number of AST nodes: 6
1
FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
1
FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
2
                ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
2
                ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
3
                ds.setIncludes(new String[] {"alpha/"}
3
                ds.setIncludes(new String[] {"alpha/BETA/gamma/"});
4
);
4
                ds.setCaseSensitive(false);
5
                ds.scan();
5
                ds.scan();
6
                compareFiles(ds, new String[] {"alpha/beta/beta.xml",
6
                compareFiles(ds, new String[] {
7
                                               "alpha/beta/gamma/gamma.xml"},
7
"alpha/beta/gamma/gamma.xml"},
8
                    new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
8
                    new String[] {"alpha/beta/gamma"});
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    3
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    4
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    4
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    5
    ds.setIncludes(new String[] {"alpha/"});
    5
    ds.setIncludes(new String[] {"alpha/"});
    5
    ds.setIncludes(new String[] {"alpha/BETA/gamma/"});
    Differences
    Expression1Expression2Difference
    "alpha/""alpha/BETA/gamma/"LITERAL_VALUE_MISMATCH
    5
    ds.setIncludes(new String[] {"alpha/BETA/gamma/"});
                                                                
    6
    ds.setCaseSensitive(false);
    Preondition Violations
    Unmatched statement ds.setCaseSensitive(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    ds.setCaseSensitive(false);
    6
    ds.scan();
    7
    ds.scan();
    7
    compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"}, new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
    7
    compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml"}, new String[] {"alpha", "alpha/beta", "alpha/beta/gamma"});
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    Differences
    Expression1Expression2Difference
    {"alpha/beta/beta.xml","alpha/beta/gamma/gamma.xml"}{"alpha/beta/gamma/gamma.xml"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {"alpha","alpha/beta","alpha/beta/gamma"}{"alpha/beta/gamma"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    Precondition Violations (2)
    Row Violation
    1Unmatched statement ds.setCaseSensitive(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables , while Clone fragment #2 returns variables ds