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.setCaseSensitive(false); ds.scan(); compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
if (!loginSuceeded) { return; } if (!changeRemoteDir(remoteTmpDir)) { return; } FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] { "**/*.xml" }); ds.setExcludes(new String[] { "alpha/beta/b*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 testFullpathDiffersInCaseScanningInsensitive() Method name: void testExcludeOneFile()
Number of AST nodes: 10 Number of AST nodes: 10
1
if (!loginSuceeded) {
1
if (!loginSuceeded) {
2
            return;
2
            return;
3
        }
3
        }
4
        if (!changeRemoteDir(remoteTmpDir)) {
4
        if (!changeRemoteDir(remoteTmpDir)) {
5
            return;
5
            return;
6
        }
6
        }
7
        FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
7
        FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
8
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
8
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
9
        ds.setIncludes(new String[] {
9
        ds.setIncludes(new String[] {
10
            "alpha/beta/gamma/gamma.xml",
10
            "
11
            "alpha/beta/gamma/GAMMA.XML"
12
        });
13
        ds.setCaseSensitive(false
11
**/*.xml"
12
        });
13
        ds.setExcludes(new String[] {
14
            "alpha/beta/b*xml"
14
);
15
        });
15
        ds.scan();
16
        ds.scan();
16
        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
17
        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
17
                     new String[] {});
18
                     new String[] {});
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.6
Clones locationClones are declared in the same class
Number of node comparisons41
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!loginSuceeded)
    1
    if (!loginSuceeded)
    2
    return;
    2
    return;
    3
    if (!changeRemoteDir(remoteTmpDir))
    3
    if (!changeRemoteDir(remoteTmpDir))
    4
    return;
    4
    return;
    5
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    5
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    6
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    6
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    7
    ds.setIncludes(new String[] {"alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML"});
    7
    ds.setIncludes(new String[] {"alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML"});
    7
    ds.setIncludes(new String[] {"**/*.xml"});
    Differences
    Expression1Expression2Difference
    {"alpha/beta/gamma/gamma.xml","alpha/beta/gamma/GAMMA.XML"}{"**/*.xml"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    7
    ds.setIncludes(new String[] {"**/*.xml"});
    8
    ds.setCaseSensitive(false);
    8
    ds.setCaseSensitive(false);
    10
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
    Differences
    Expression1Expression2Difference
    setCaseSensitivecompareFilesMETHOD_INVOCATION_NAME_MISMATCH
    ds.setCaseSensitive(false)compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{})ARGUMENT_NUMBER_MISMATCH
    dsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method compareFiles
    Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method compareFiles
    Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    10
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
    9
    ds.scan();
    9
    ds.scan();
    10
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
    10
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {});
    8
    ds.setExcludes(new String[] {"alpha/beta/b*xml"});
    Differences
    Expression1Expression2Difference
    compareFilessetExcludesMETHOD_INVOCATION_NAME_MISMATCH
    compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{})ds.setExcludes(new String[]{"alpha/beta/b*xml"})ARGUMENT_NUMBER_MISMATCH
    dsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method compareFiles
    Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method compareFiles
    Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) is a void method call, and thus it cannot be parameterized
    8
    ds.setExcludes(new String[] {"alpha/beta/b*xml"});
    Precondition Violations (16)
    Row Violation
    1Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    4Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    5Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    8Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    9Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    12Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) is a void method call, and thus it cannot be parameterized
    13Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{}) is a void method call, and thus it cannot be parameterized
    16Expression ds.setExcludes(new String[]{"alpha/beta/b*xml"}) is a void method call, and thus it cannot be parameterized