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[] {});
ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] { "alpha/**" }); ds.setExcludes(new String[] { "alpha/**" }); ds.scan(); compareFiles(ds, new String[] {}, 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/DirectoryScannerTest.java
Method name: void testExcludeOneFile() Method name: void testExcludeHasPrecedence()
Number of AST nodes: 5 Number of AST nodes: 5
1
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
1
ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
2
        ds.setIncludes(new String[] {
2
        ds.setIncludes(new String[] {
3
            "**/*.xml"
3
            "alpha/**"
4
        });
4
        });
5
        ds.setExcludes(new String[] {
5
        ds.setExcludes(new String[] {
6
            "alpha/beta/b*xml"
6
            "alpha/**"
7
        });
7
        });
8
        ds.scan();
8
        ds.scan();
9
        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
9
        compareFiles(ds, new String[] {},
10
                     new String[] {});
10
                     new String[] {});
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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 comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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
    6
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    6
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    2
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    2
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    7
    ds.setIncludes(new String[] {"**/*.xml"});
    7
    ds.setIncludes(new String[] {"**/*.xml"});
    3
    ds.setIncludes(new String[] {"alpha/**"});
    Differences
    Expression1Expression2Difference
    "**/*.xml""alpha/**"LITERAL_VALUE_MISMATCH
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    3
    ds.setIncludes(new String[] {"alpha/**"});
    8
    ds.setExcludes(new String[] {"alpha/beta/b*xml"});
    8
    ds.setExcludes(new String[] {"alpha/beta/b*xml"});
    4
    ds.setExcludes(new String[] {"alpha/**"});
    Differences
    Expression1Expression2Difference
    "alpha/beta/b*xml""alpha/**"LITERAL_VALUE_MISMATCH
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    4
    ds.setExcludes(new String[] {"alpha/**"});
    9
    ds.scan();
    9
    ds.scan();
    5
    ds.scan();
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    5
    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[] {});
    6
    compareFiles(ds, new String[] {}, new String[] {});
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerorg.apache.tools.ant.DirectoryScannerSUBCLASS_TYPE_MISMATCH
    {"alpha/beta/gamma/gamma.xml"}{}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {"alpha/beta/gamma/gamma.xml"}{}ARRAY_INITIALIZER_MISMATCH
    6
    compareFiles(ds, new String[] {}, new String[] {});
    Precondition Violations (0)
    Row Violation