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/"});
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/"});
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 testProhibitSymlinks() Method name: void testAllowSymlinks()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (!supportsSymlinks) {
1
if (!supportsSymlinks) {
2
            return;
2
            return;
3
        }
3
        }
4
        getProject().executeTarget("symlink-setup");
4
        getProject().executeTarget("symlink-setup");
5
        DirectoryScanner ds = new DirectoryScanner();
5
        DirectoryScanner ds = new DirectoryScanner();
6
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
6
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
7
        ds.setIncludes(new String[] {"alpha/beta/gamma/"});
7
        ds.setIncludes(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.1
Clones locationClones are declared in the same class
Number of node comparisons14
  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)11.6
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (!supportsSymlinks)
    1
    if (!supportsSymlinks)
    2
    return;
    2
    return;
    2
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    2
    return;
    3
    getProject().executeTarget("symlink-setup");
    3
    getProject().executeTarget("symlink-setup");
    4
    DirectoryScanner ds = new DirectoryScanner();
    4
    DirectoryScanner ds = new DirectoryScanner();
    5
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    5
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    6
    ds.setIncludes(new String[] {"alpha/beta/gamma/"});
    6
    ds.setIncludes(new String[] {"alpha/beta/gamma/"});
    Precondition Violations (2)
    Row Violation
    1Conditional return;
    2Conditional return;