return false; } Text other = (Text) obj; if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; }
return false; } Attribute other = (Attribute) obj; if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/MacroDef.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 7 Number of AST nodes: 7
1
return false;
1
return false;
2
            }
2
            }
3
            Text other = (Text) obj;
3
            Attribute other = (Attribute) obj;
4
            if (name == null) {
4
            if (name == null) {
5
                if (other.name != null) {
5
                if (other.name != null) {
6
                    return false;
6
                    return false;
7
                }
7
                }
8
            } else if (!name.equals(other.name)) {
8
            } else if (!name.equals(other.name)) {
9
                return false;
9
                return false;
10
            }
10
            }
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.3
Clones locationClones are in the same java file
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                        
    5
    Attribute other = (Attribute)obj;
    5
    Text other = (Text)obj;
                                                    
    6
    if (name == null)
    6
    if (name == null)
    7
    if (other.name != null)
    7
    if (other.name != null)
    7
    if (other.name != null)
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.MacroDef.Textorg.apache.tools.ant.taskdefs.MacroDef.AttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other
    • Make classes org.apache.tools.ant.taskdefs.MacroDef.Text and org.apache.tools.ant.taskdefs.MacroDef.Attribute extend a common superclass
    7
    if (other.name != null)
    8
    return false;
    8
    return false;
    8
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    8
    return false;
    9
    else if (!name.equals(other.name))
    9
    else if (!name.equals(other.name))
    9
    else if (!name.equals(other.name))
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.MacroDef.Textorg.apache.tools.ant.taskdefs.MacroDef.AttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other
    • Make classes org.apache.tools.ant.taskdefs.MacroDef.Text and org.apache.tools.ant.taskdefs.MacroDef.Attribute extend a common superclass
    9
    else if (!name.equals(other.name))
    10
    return false;
    10
    return false;
    10
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    10
    return false;
    Precondition Violations (6)
    Row Violation
    1Type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other
    2Type org.apache.tools.ant.taskdefs.MacroDef.Text of variable other does not match with type org.apache.tools.ant.taskdefs.MacroDef.Attribute of variable other
    3Conditional return false;
    4Conditional return false;
    5Conditional return false;
    6Conditional return false;