if (!loginSuceeded) { return; } if (!changeRemoteDir(remoteTmpDir)) { return; } FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setExcludes(new String[] { "alpha/**", "alpha/beta/gamma/**" });
if (!loginSuceeded) { return; } if (!changeRemoteDir(remoteTmpDir)) { return; } FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); ds.setIncludes(new String[] { "alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML" });
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/taskdefs/optional/net/FTPTest.java
Method name: void testAlternateExcludeInclude() Method name: void testFullpathDiffersInCaseScanningInsensitive()
Number of AST nodes: 7 Number of AST nodes: 7
1
if (!loginSuceeded) {
1
if (!loginSuceeded) {
2
            return;
2
            return;
3
        }
3
        }
4
        if (!changeRemoteDir(remoteTmpDir)) {
4
        if (!changeRemoteDir(remoteTmpDir)) {
5
            return;
5
            return;
6
        }
6
        }
7
        FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
7
        FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
8
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
8
        ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
9
        ds.setExcludes(new String[] {
9
        ds.setIncludes(new String[] {
10
            "alpha/**",
10
            "alpha/beta/gamma/gamma.xml",
11
            "alpha/beta/gamma/**"
11
            "alpha/beta/gamma/GAMMA.XML"
12
        });
12
        });
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.5
Clones locationClones are declared in the same class
Number of node comparisons22
  1. {Non-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)30.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (!loginSuceeded)
    1
    if (!loginSuceeded)
    2
    return;
    2
    return;
    2
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    2
    return;
    3
    if (!changeRemoteDir(remoteTmpDir))
    3
    if (!changeRemoteDir(remoteTmpDir))
    4
    return;
    4
    return;
    4
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    4
    return;
    5
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    5
    FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);
    6
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    6
    ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));
    7
    ds.setExcludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
    7
    ds.setExcludes(new String[] {"alpha/**", "alpha/beta/gamma/**"});
    7
    ds.setIncludes(new String[] {"alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML"});
    Differences
    Expression1Expression2Difference
    "alpha/**""alpha/beta/gamma/gamma.xml"LITERAL_VALUE_MISMATCH
    "alpha/beta/gamma/**""alpha/beta/gamma/GAMMA.XML"LITERAL_VALUE_MISMATCH
    setExcludessetIncludesMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression ds.setExcludes(new String[]{"alpha/**","alpha/beta/gamma/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setIncludes(new String[]{"alpha/beta/gamma/gamma.xml","alpha/beta/gamma/GAMMA.XML"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ds.setExcludes(new String[]{"alpha/**","alpha/beta/gamma/**"}) is a void method call, and thus it cannot be parameterized
    Expression ds.setIncludes(new String[]{"alpha/beta/gamma/gamma.xml","alpha/beta/gamma/GAMMA.XML"}) is a void method call, and thus it cannot be parameterized
    7
    ds.setIncludes(new String[] {"alpha/beta/gamma/gamma.xml", "alpha/beta/gamma/GAMMA.XML"});
    Precondition Violations (8)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Conditional return;
    4Conditional return;
    5Expression ds.setExcludes(new String[]{"alpha/**","alpha/beta/gamma/**"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression ds.setIncludes(new String[]{"alpha/beta/gamma/gamma.xml","alpha/beta/gamma/GAMMA.XML"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ds.setExcludes(new String[]{"alpha/**","alpha/beta/gamma/**"}) is a void method call, and thus it cannot be parameterized
    8Expression ds.setIncludes(new String[]{"alpha/beta/gamma/gamma.xml","alpha/beta/gamma/GAMMA.XML"}) is a void method call, and thus it cannot be parameterized