if (!supportsSymlinks) { return; } getProject().executeTarget("symlink-setup"); DirectoryScanner ds = new DirectoryScanner(); 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"});
DirectoryScanner ds = new DirectoryScanner(); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] { "alpha/**", "alpha/beta/gamma/**" }); ds.setExcludes(new String[] { "alpha/beta/**" }); ds.scan(); compareFiles(ds, new String[] {}, new String[] {"alpha"});
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 testAllowSymlinks() Method name: void testAlternateIncludeExclude()
Number of AST nodes: 8 Number of AST nodes: 6
1
if (!supportsSymlinks) {
2
            return;
3
        }
4
        getProject().executeTarget("symlink-setup");
5
        DirectoryScanner ds = new DirectoryScanner();
1
DirectoryScanner ds = new DirectoryScanner();
6
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
2
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
7
        ds.setIncludes(new String[] {"alpha/beta/gamma/"
3
        ds.setIncludes(new String[] {
4
            "alpha/**",
5
            "alpha/beta/gamma/**"
6
        });
7
        ds.setExcludes(new String[] {
8
            "alpha/beta/**"
8
});
9
        });
9
        ds.scan();
10
        ds.scan();
10
        compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
11
        compareFiles(ds, new String[] {},
11
                     new String[] {"alpha/beta/gamma"});
12
                     new String[] {"alpha"});
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 comparisons24
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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
    3
    getProject().executeTarget("symlink-setup");
    3
    getProject().executeTarget("symlink-setup");
    6
    compareFiles(ds, new String[] {}, new String[] {"alpha"});
    Differences
    Expression1Expression2Difference
    executeTargetcompareFilesMETHOD_INVOCATION_NAME_MISMATCH
    getProject().executeTarget("symlink-setup")compareFiles(ds,new String[]{},new String[]{"alpha"})ARGUMENT_NUMBER_MISMATCH
    getProject()MISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method compareFiles
    Expression getProject().executeTarget("symlink-setup") is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method compareFiles
    Expression getProject().executeTarget("symlink-setup") is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) is a void method call, and thus it cannot be parameterized
    6
    compareFiles(ds, new String[] {}, new String[] {"alpha"});
    4
    DirectoryScanner ds = new DirectoryScanner();
    1
    DirectoryScanner ds = new DirectoryScanner();
    5
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    2
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    6
    ds.setIncludes(new String[] {"alpha/beta/gamma/"});
    6
    ds.setIncludes(new String[] {"alpha/beta/gamma/"});
    3
    ds.setIncludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
    Differences
    Expression1Expression2Difference
    {"alpha/beta/gamma/"}{"alpha/**","alpha/beta/gamma/**"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    3
    ds.setIncludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
    7
    ds.scan();
    5
    ds.scan();
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    4
    ds.setExcludes(new String[] {"alpha/beta/**"});
    Differences
    Expression1Expression2Difference
    compareFilessetExcludesMETHOD_INVOCATION_NAME_MISMATCH
    compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"})ds.setExcludes(new String[]{"alpha/beta/**"})ARGUMENT_NUMBER_MISMATCH
    dsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"}) 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/**"}) 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[]{"alpha/beta/gamma"}) is a void method call, and thus it cannot be parameterized
    Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"}) 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/**"}) 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[]{"alpha/beta/gamma"}) is a void method call, and thus it cannot be parameterized
    Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    4
    ds.setExcludes(new String[] {"alpha/beta/**"});
    Precondition Violations (14)
    Row Violation
    1Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getProject().executeTarget("symlink-setup") is a void method call, and thus it cannot be parameterized
    3Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) is a void method call, and thus it cannot be parameterized
    4Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression getProject().executeTarget("symlink-setup") is a void method call, and thus it cannot be parameterized
    6Expression compareFiles(ds,new String[]{},new String[]{"alpha"}) is a void method call, and thus it cannot be parameterized
    7Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression ds.setExcludes(new String[]{"alpha/beta/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"}) is a void method call, and thus it cannot be parameterized
    10Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    11Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression ds.setExcludes(new String[]{"alpha/beta/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression compareFiles(ds,new String[]{"alpha/beta/gamma/gamma.xml"},new String[]{"alpha/beta/gamma"}) is a void method call, and thus it cannot be parameterized
    14Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized