getProject().executeTarget("extended-setup"); DirectoryScanner ds = new DirectoryScanner(); String tmpdir = getProject().getBaseDir().getAbsolutePath().replace( File.separatorChar, '/') + "/tmp"; ds.setIncludes(new String[] {tmpdir + "/**/*"}); ds.setExcludes(new String[] {"**/alpha", "**/delta/*"}); ds.scan(); compareFiles(ds, new String[] {tmpdir + "/alpha/beta/beta.xml", tmpdir + "/alpha/beta/gamma/gamma.xml"}, new String[] {tmpdir + "/alpha/beta", tmpdir + "/alpha/beta/gamma", tmpdir + "/delta"});
getProject().executeTarget("extended-setup"); DirectoryScanner ds = new DirectoryScanner(); String tmpdir = getProject().getBaseDir().getAbsolutePath().replace( File.separatorChar, '/') + "/tmp"; ds.setIncludes(new String[] {tmpdir + "/alpha/beta/**/*", tmpdir + "/delta/*"}); ds.setExcludes(new String[] {"**/beta.xml"}); ds.scan(); compareFiles(ds, new String[] {tmpdir + "/alpha/beta/gamma/gamma.xml", tmpdir + "/delta/delta.xml"}, new String[] {tmpdir + "/alpha/beta/gamma"});
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
Method name: void testAbsolute3() Method name: void testAbsolute4()
Number of AST nodes: 7 Number of AST nodes: 7
1
getProject().executeTarget("extended-setup");
1
getProject().executeTarget("extended-setup");
2
        DirectoryScanner ds = new DirectoryScanner();
2
        DirectoryScanner ds = new DirectoryScanner();
3
        String tmpdir = getProject().getBaseDir().getAbsolutePath().replace(
3
        String tmpdir = getProject().getBaseDir().getAbsolutePath().replace(
4
            File.separatorChar, '/') + "/tmp";
4
            File.separatorChar, '/') + "/tmp";
5
        ds.setIncludes(new String[] {tmpdir + "/**/*"});
5
        ds.setIncludes(new String[] {tmpdir + "/alpha/beta/**/*",
6
        ds.setExcludes(new String[] {"**/alpha",
6
        
7
                                     "**/delta/*
7
                             tmpdir + "/delta/*"});
8
"});
8
        ds.setExcludes(new String[] {"**/beta.xml"});
9
        ds.scan();
9
        ds.scan();
10
        compareFiles(ds, new String[] {tmpdir + "/alpha/beta/beta.xml",
10
        compareFiles(ds, new String[] {tmpdir + "/alpha/beta/gamma/gamma.xml",
11
                                       tmpdir + "/alpha/beta/gamma/gamma.xml"},
11
                                       tmpdir + "/delta/delta.xml"},
12
                     new String[] {tmpdir + "/alpha/beta",
12
                     new String[] {tmpdir + "/alpha/beta
13
                                   tmpdir + "/alpha/beta/gamma",
14
                                   tmpdir + "/delta"});
13
/gamma"});
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 declared in the same class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    1
    getProject().executeTarget("extended-setup");
    1
    getProject().executeTarget("extended-setup");
    2
    DirectoryScanner ds = new DirectoryScanner();
    2
    DirectoryScanner ds = new DirectoryScanner();
    3
    String tmpdir = getProject().getBaseDir().getAbsolutePath().replace(File.separatorChar, '/') + "/tmp";
    3
    String tmpdir = getProject().getBaseDir().getAbsolutePath().replace(File.separatorChar, '/') + "/tmp";
    4
    ds.setIncludes(new String[] {tmpdir + "/**/*"});
    4
    ds.setIncludes(new String[] {tmpdir + "/**/*"});
    4
    ds.setIncludes(new String[] {tmpdir + "/alpha/beta/**/*", tmpdir + "/delta/*"});
    Differences
    Expression1Expression2Difference
    {tmpdir + "/**/*"}{tmpdir + "/alpha/beta/**/*",tmpdir + "/delta/*"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {tmpdir + "/**/*"}{tmpdir + "/alpha/beta/**/*",tmpdir + "/delta/*"}ARRAY_INITIALIZER_MISMATCH
    Preondition Violations
    Expression new String[]{tmpdir + "/**/*"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new String[]{tmpdir + "/alpha/beta/**/*",tmpdir + "/delta/*"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    ds.setIncludes(new String[] {tmpdir + "/alpha/beta/**/*", tmpdir + "/delta/*"});
    5
    ds.setExcludes(new String[] {"**/alpha", "**/delta/*"});
    5
    ds.setExcludes(new String[] {"**/alpha", "**/delta/*"});
    5
    ds.setExcludes(new String[] {"**/beta.xml"});
    Differences
    Expression1Expression2Difference
    {"**/alpha","**/delta/*"}{"**/beta.xml"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {"**/alpha","**/delta/*"}{"**/beta.xml"}ARRAY_INITIALIZER_MISMATCH
    5
    ds.setExcludes(new String[] {"**/beta.xml"});
    6
    ds.scan();
    6
    ds.scan();
    7
    compareFiles(ds, new String[] {tmpdir + "/alpha/beta/beta.xml", tmpdir + "/alpha/beta/gamma/gamma.xml"}, new String[] {tmpdir + "/alpha/beta", tmpdir + "/alpha/beta/gamma", tmpdir + "/delta"});
    7
    compareFiles(ds, new String[] {tmpdir + "/alpha/beta/beta.xml", tmpdir + "/alpha/beta/gamma/gamma.xml"}, new String[] {tmpdir + "/alpha/beta", tmpdir + "/alpha/beta/gamma", tmpdir + "/delta"});
    7
    compareFiles(ds, new String[] {tmpdir + "/alpha/beta/gamma/gamma.xml", tmpdir + "/delta/delta.xml"}, new String[] {tmpdir + "/alpha/beta/gamma"});
    Differences
    Expression1Expression2Difference
    "/alpha/beta/beta.xml""/alpha/beta/gamma/gamma.xml"LITERAL_VALUE_MISMATCH
    "/alpha/beta/gamma/gamma.xml""/delta/delta.xml"LITERAL_VALUE_MISMATCH
    {tmpdir + "/alpha/beta",tmpdir + "/alpha/beta/gamma",tmpdir + "/delta"}{tmpdir + "/alpha/beta/gamma"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {tmpdir + "/alpha/beta",tmpdir + "/alpha/beta/gamma",tmpdir + "/delta"}{tmpdir + "/alpha/beta/gamma"}ARRAY_INITIALIZER_MISMATCH
    Preondition Violations
    Expression new String[]{tmpdir + "/alpha/beta",tmpdir + "/alpha/beta/gamma",tmpdir + "/delta"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new String[]{tmpdir + "/alpha/beta/gamma"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    compareFiles(ds, new String[] {tmpdir + "/alpha/beta/gamma/gamma.xml", tmpdir + "/delta/delta.xml"}, new String[] {tmpdir + "/alpha/beta/gamma"});
    Precondition Violations (4)
    Row Violation
    1Expression new String[]{tmpdir + "/**/*"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new String[]{tmpdir + "/alpha/beta/**/*",tmpdir + "/delta/*"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new String[]{tmpdir + "/alpha/beta",tmpdir + "/alpha/beta/gamma",tmpdir + "/delta"} cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new String[]{tmpdir + "/alpha/beta/gamma"} cannot be parameterized, because it has dependencies to/from statements that will be extracted