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"});
FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] {"alpha/BETA/gamma/"}); ds.setCaseSensitive(false); 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/DirectoryScannerTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java
Method name: void testAlternateIncludeExclude() Method name: void test2bisButCaseInsensitive()
Number of AST nodes: 6 Number of AST nodes: 6
1
DirectoryScanner ds = new DirectoryScanner();
1
FTP.FTPDirectoryScanner ds = 
2
myFTPTask.newScanner(ftp);
2
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
3
                ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
3
        ds.setIncludes(new String[] {
4
                ds.setIncludes(new String[] {
4
            "alpha/**",
5
            "alpha/beta/gamma/**"
5
"alpha/BETA/gamma/"});
6
        });
6
        
7
        ds.setExcludes(new String[] {
7
        ds.set
8
            "alpha/beta/**"
8
CaseSensitive(false);
9
        });
9
        
10
        ds.scan();
10
        ds.scan();
11
        compareFiles(ds, new String[] {},
11
                compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},
12
                     new String[] {"alpha"});
12
                    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 comparisons26
  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
    1
    DirectoryScanner ds = new DirectoryScanner();
    1
    DirectoryScanner ds = new DirectoryScanner();
    3
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    Differences
    Expression1Expression2Difference
    DirectoryScannerFTP.FTPDirectoryScannerTYPE_COMPATIBLE_REPLACEMENT
    org.apache.tools.ant.DirectoryScannerorg.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerSUBCLASS_TYPE_MISMATCH
    new DirectoryScanner()myFTPTask.newScanner(ftp)TYPE_COMPATIBLE_REPLACEMENT
    3
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    2
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    2
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    4
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.DirectoryScannerorg.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerSUBCLASS_TYPE_MISMATCH
    4
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    3
    ds.setIncludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
    3
    ds.setIncludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
    5
    ds.setIncludes(new String[] {"alpha/BETA/gamma/"});
    Differences
    Expression1Expression2Difference
    {"alpha/**","alpha/beta/gamma/**"}{"alpha/BETA/gamma/"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    org.apache.tools.ant.DirectoryScannerorg.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerSUBCLASS_TYPE_MISMATCH
    5
    ds.setIncludes(new String[] {"alpha/BETA/gamma/"});
    4
    ds.setExcludes(new String[] {"alpha/beta/**"});
    4
    ds.setExcludes(new String[] {"alpha/beta/**"});
    7
    ds.scan();
    Differences
    Expression1Expression2Difference
    setExcludesscanMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.DirectoryScannerorg.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerSUBCLASS_TYPE_MISMATCH
    ds.setExcludes(new String[]{"alpha/beta/**"})ds.scan()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ds.setExcludes(new String[]{"alpha/beta/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    Expression ds.scan() is a void method call, and thus it cannot be parameterized
    Expression ds.setExcludes(new String[]{"alpha/beta/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    Expression ds.scan() is a void method call, and thus it cannot be parameterized
    7
    ds.scan();
    5
    ds.scan();
    5
    ds.scan();
    6
    ds.setCaseSensitive(false);
    Differences
    Expression1Expression2Difference
    scansetCaseSensitiveMETHOD_INVOCATION_NAME_MISMATCH
    org.apache.tools.ant.DirectoryScannerorg.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerSUBCLASS_TYPE_MISMATCH
    ds.scan()ds.setCaseSensitive(false)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.scan() is a void method call, and thus it cannot be parameterized
    Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.scan() is a void method call, and thus it cannot be parameterized
    Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    6
    ds.setCaseSensitive(false);
    6
    compareFiles(ds, new String[] {}, new String[] {"alpha"});
    6
    compareFiles(ds, new String[] {}, new String[] {"alpha"});
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.DirectoryScannerorg.apache.tools.ant.taskdefs.optional.net.FTP.FTPDirectoryScannerSUBCLASS_TYPE_MISMATCH
    {}{"alpha/beta/gamma/gamma.xml"}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    "alpha""alpha/beta/gamma"LITERAL_VALUE_MISMATCH
    8
    compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"});
    Precondition Violations (16)
    Row Violation
    1Expression ds.setExcludes(new String[]{"alpha/beta/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    4Expression ds.scan() is a void method call, and thus it cannot be parameterized
    5Expression ds.setExcludes(new String[]{"alpha/beta/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ds.setExcludes(new String[]{"alpha/beta/**"}) is a void method call, and thus it cannot be parameterized
    8Expression ds.scan() is a void method call, and thus it cannot be parameterized
    9Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression ds.scan() is a void method call, and thus it cannot be parameterized
    12Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized
    13Expression ds.scan() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression ds.setCaseSensitive(false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression ds.scan() is a void method call, and thus it cannot be parameterized
    16Expression ds.setCaseSensitive(false) is a void method call, and thus it cannot be parameterized