if (startToken == null) { throw new BuildException("The starttoken attribute must be set.", getLocation()); } if (endToken == null) { throw new BuildException("The endtoken attribute must be set.", getLocation()); }
if (userId == null) { throw new BuildException("UserId attribute must be set!", getLocation()); } if (password == null) { throw new BuildException("Password attribute must be set!", getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/JDBCTask.java
Method name: void execute() Method name: Connection getConnection()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (startToken == null) {
1
if (userId == null) {
2
            throw new BuildException("The starttoken attribute must be set.",
2
            throw new BuildException("UserId attribute must be set!",
3
                                     getLocation());
3
 getLocation());
4
        }
4
        }
5
        if (endToken == null) {
5
        if (password == null) {
6
            throw new BuildException("The endtoken attribute must be set.",
6
            throw new BuildException("Password attribute must be set!",
7
                                     getLocation());
7
 getLocation());
8
        }
8
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (startToken == null)
    3
    if (startToken == null)
    1
    if (userId == null)
    Differences
    Expression1Expression2Difference
    startTokenuserIdVARIABLE_NAME_MISMATCH
    1
    if (userId == null)
    4
    throw new BuildException("The starttoken attribute must be set.", getLocation());
    4
    throw new BuildException("The starttoken attribute must be set.", getLocation());
    2
    throw new BuildException("UserId attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "The starttoken attribute must be set.""UserId attribute must be set!"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("UserId attribute must be set!", getLocation());
    5
    if (endToken == null)
    5
    if (endToken == null)
    3
    if (password == null)
    Differences
    Expression1Expression2Difference
    endTokenpasswordVARIABLE_NAME_MISMATCH
    3
    if (password == null)
    6
    throw new BuildException("The endtoken attribute must be set.", getLocation());
    6
    throw new BuildException("The endtoken attribute must be set.", getLocation());
    4
    throw new BuildException("Password attribute must be set!", getLocation());
    Differences
    Expression1Expression2Difference
    "The endtoken attribute must be set.""Password attribute must be set!"LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("Password attribute must be set!", getLocation());
    Precondition Violations (0)
    Row Violation