if (rhs == null || rhs.getClass() != getClass()) { return false; } if (rhs == this) { return true; }
if (rhs == null || rhs.getClass() != getClass()) { return false; } if (rhs == this) { return true; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Manifest.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (rhs == null || rhs.getClass() != getClass()) {
1
if (rhs == null || rhs.getClass() != getClass()) {
2
                return false;
2
            return false;
3
            }
3
        }
4
            if (rhs == this) {
4
        if (rhs == this) {
5
                return true;
5
            return true;
6
            }
6
        }
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.4
Clones locationClones are in the same java file
Number of node comparisons13
  1. {Non-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)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (rhs == null || rhs.getClass() != getClass())
    1
    if (rhs == null || rhs.getClass() != getClass())
    1
    if (rhs == null || rhs.getClass() != getClass())
    Differences
    Expression1Expression2Difference
    java.lang.Classjava.lang.ClassVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    • Make classes java.lang.Class and java.lang.Class extend a common superclass
    1
    if (rhs == null || rhs.getClass() != getClass())
    2
    return false;
    2
    return false;
    2
    return false;
    Preondition Violations
    Conditional return false;
    Conditional return false;
    2
    return false;
    3
    if (rhs == this)
    3
    if (rhs == this)
    4
    return true;
    4
    return true;
    4
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    4
    return true;
    Precondition Violations (5)
    Row Violation
    1Type java.lang.Class<> of variable getClass() does not match with type java.lang.Class<> of variable getClass()
    2Conditional return false;
    3Conditional return false;
    4Conditional return true;
    5Conditional return true;