if (server == null) { throw new BuildException("server attribute must be set!"); } if (userid == null) { throw new BuildException("userid attribute must be set!"); } if (password == null) { throw new BuildException("password attribute must be set!"); }
if (input == null) { throw new BuildException("Missing attribute 'input'"); } if (output == null) { throw new BuildException("Missing attribute 'output'"); } if (fileNameMapper == null) { throw new BuildException("Missing a nested file name mapper type element"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/mappers/MapperResult.java
Method name: void checkAttributes() Method name: void execute()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (server == null) {
1
if (input == null) {
2
            throw new BuildException("server attribute must be set!");
2
            throw new BuildException("Missing attribute 'input'");
3
        }
3
        }
4
        if (userid == null) {
4
        if (output == null) {
5
            throw new BuildException("userid attribute must be set!");
5
            throw new BuildException("Missing attribute 'output'");
6
        }
6
        }
7
        if (password == null) {
7
        if (fileNameMapper == null) {
8
            throw new BuildException("password attribute must be set!");
8
            throw new BuildException("Missing a nested file name mapper type element");
9
        }
9
        }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons27
  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)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (server == null)
    1
    if (server == null)
    1
    if (input == null)
    Differences
    Expression1Expression2Difference
    serverinputVARIABLE_NAME_MISMATCH
    1
    if (input == null)
    2
    throw new BuildException("server attribute must be set!");
    2
    throw new BuildException("server attribute must be set!");
    2
    throw new BuildException("Missing attribute 'input'");
    Differences
    Expression1Expression2Difference
    "server attribute must be set!""Missing attribute 'input'"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("Missing attribute 'input'");
    3
    if (userid == null)
    3
    if (userid == null)
    3
    if (output == null)
    Differences
    Expression1Expression2Difference
    useridoutputVARIABLE_NAME_MISMATCH
    3
    if (output == null)
    4
    throw new BuildException("userid attribute must be set!");
    4
    throw new BuildException("userid attribute must be set!");
    4
    throw new BuildException("Missing attribute 'output'");
    Differences
    Expression1Expression2Difference
    "userid attribute must be set!""Missing attribute 'output'"LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("Missing attribute 'output'");
    5
    if (password == null)
    5
    if (password == null)
    5
    if (fileNameMapper == null)
    Differences
    Expression1Expression2Difference
    passwordfileNameMapperVARIABLE_NAME_MISMATCH
    java.lang.Stringorg.apache.tools.ant.util.FileNameMapperVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable password does not match with type org.apache.tools.ant.util.FileNameMapper of variable fileNameMapper
    • Make classes java.lang.String and org.apache.tools.ant.util.FileNameMapper extend a common superclass
    5
    if (fileNameMapper == null)
    6
    throw new BuildException("password attribute must be set!");
    6
    throw new BuildException("password attribute must be set!");
    6
    throw new BuildException("Missing a nested file name mapper type element");
    Differences
    Expression1Expression2Difference
    "password attribute must be set!""Missing a nested file name mapper type element"LITERAL_VALUE_MISMATCH
    6
    throw new BuildException("Missing a nested file name mapper type element");
    Precondition Violations (1)
    Row Violation
    1Type java.lang.String of variable password does not match with type org.apache.tools.ant.util.FileNameMapper of variable fileNameMapper