ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setExcludes(new String[] {"alpha"}); ds.scan(); compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml", "delta/delta.xml"}, new String[] {"alpha/beta", "alpha/beta/gamma", "delta"});
ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] {"alpha/beta/gamma/"}); 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/DirectoryScannerTest.java
Method name: void testChildrenOfExcludedDirectory() Method name: void testAllowSymlinks()
Number of AST nodes: 4 Number of AST nodes: 4
1
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
1
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
2
        ds.setExcludes(new String[] {"alpha"});
2
        ds.setIncludes(new String[] {"alpha/beta/gamma/"});
3
        ds.scan();
3
        ds.scan();
4
        compareFiles(ds, new String[] {"alpha/beta/beta.xml",
4
        compareFiles(ds, new String[] {"alpha/beta/
5
                                       "alpha/beta/gamma/gamma.xml",
6
                                        "delta/delta.xml"},
5
gamma/gamma.xml"},
7
                     new String[] {"alpha/beta", "alpha/beta/gamma", "delta"});
6
                     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 in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    14
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    5
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    5
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    15
    ds.setExcludes(new String[] {"alpha"});
    15
    ds.setExcludes(new String[] {"alpha"});
    6
    ds.setIncludes(new String[] {"alpha/beta/gamma/"});
    Differences
    Expression1Expression2Difference
    "alpha""alpha/beta/gamma/"LITERAL_VALUE_MISMATCH
    setExcludessetIncludesMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression ds.setExcludes(new String[]{"alpha"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setIncludes(new String[]{"alpha/beta/gamma/"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setExcludes(new String[]{"alpha"}) is a void method call, and thus it cannot be parameterized
    Expression ds.setIncludes(new String[]{"alpha/beta/gamma/"}) is a void method call, and thus it cannot be parameterized
    6
    ds.setIncludes(new String[] {"alpha/beta/gamma/"});
    16
    ds.scan();
    16
    ds.scan();
    7
    ds.scan();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    7
    ds.scan();
    17
    compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml", "delta/delta.xml"}, new String[] {"alpha/beta", "alpha/beta/gamma", "delta"});
    17
    compareFiles(ds, new String[] {"alpha/beta/beta.xml", "alpha/beta/gamma/gamma.xml", "delta/delta.xml"}, new String[] {"alpha/beta", "alpha/beta/gamma", "delta"});
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    {"alpha/beta/beta.xml","alpha/beta/gamma/gamma.xml","delta/delta.xml"}{"alpha/beta/gamma/gamma.xml"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {"alpha/beta/beta.xml","alpha/beta/gamma/gamma.xml","delta/delta.xml"}{"alpha/beta/gamma/gamma.xml"}ARRAY_INITIALIZER_MISMATCH
    {"alpha/beta","alpha/beta/gamma","delta"}{"alpha/beta/gamma"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {"alpha/beta","alpha/beta/gamma","delta"}{"alpha/beta/gamma"}ARRAY_INITIALIZER_MISMATCH
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    Precondition Violations (4)
    Row Violation
    1Expression ds.setExcludes(new String[]{"alpha"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ds.setIncludes(new String[]{"alpha/beta/gamma/"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ds.setExcludes(new String[]{"alpha"}) is a void method call, and thus it cannot be parameterized
    4Expression ds.setIncludes(new String[]{"alpha/beta/gamma/"}) is a void method call, and thus it cannot be parameterized