if (isReference()) { return getCheckedRef().hashCode(); } String name = getName(); return MAGIC * (name == null ? NULL_NAME : name.hashCode());
if (isReference()) { return getCheckedRef().toString(); } String n = getName(); return n == null ? "(anonymous)" : n;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Resource.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/Resource.java
Method name: int hashCode() Method name: String toString()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (isReference()) {
1
if (isReference()) {
2
            return getCheckedRef().hashCode();
2
            return getCheckedRef().toString();
3
        }
3
        }
4
        String name = getName();
4
        String n = getName();
5
        return MAGIC * (name == null ? NULL_NAME : name.hashCode());
5
        return n == null ? "(anonymous)" : n;
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.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isReference())
    1
    if (isReference())
                                                                              
    2
    return getCheckedRef().toString();
    Preondition Violations
    Unmatched return getCheckedRef().toString();
    2
    return getCheckedRef().toString();
    2
    return getCheckedRef().hashCode();
    2
    return getCheckedRef().hashCode();
    Preondition Violations
    Unmatched return getCheckedRef().hashCode();
                                                                              
    3
    String name = getName();
    3
    String name = getName();
    3
    String n = getName();
    Differences
    Expression1Expression2Difference
    namenVARIABLE_NAME_MISMATCH
    3
    String n = getName();
                                                                                    
    4
    return n == null ? "(anonymous)" : n;
    4
    return MAGIC * (name == null ? NULL_NAME : name.hashCode());
                                                                                                                                  
    Precondition Violations (2)
    Row Violation
    1Unmatched return getCheckedRef().toString();
    2Unmatched return getCheckedRef().hashCode();