if (data != null) { hashCode += (data.hashCode() * 17); } if (name != null) { hashCode += (name.hashCode() * 29); } if (subElements != null) { hashCode += (subElements.hashCode() * 57); }
if (attributes != null) { hashCode += (attributes.hashCode() * 13); } if (data != null) { hashCode += (data.hashCode() * 17); } if (name != null) { hashCode += (name.hashCode() * 29); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core-api/src/main/java/org/columba/core/xml/XmlElement.java File path: /columba-1.4-src/core-api/src/main/java/org/columba/core/xml/XmlElement.java
Method name: int hashCode() Method name: int hashCode()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (attributes != null) {
2
			hashCode += (attributes.hashCode() * 13);
3
		}
1
if (data != null) {
4
		if (data != null) {
2
			hashCode += (data.hashCode() * 17);
5
			hashCode += (data.hashCode() * 17);
3
		}
6
		}
4
		if (name != null) {
7
		if (name != null) {
5
			hashCode += (name.hashCode() * 29);
8
			hashCode += (name.hashCode() * 29);
6
		}
9
		}
7
		if (subElements != null) {
8
			hashCode += (subElements.hashCode() * 57);
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.4
Clones locationClones are in the same method
Number of node comparisons27
  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)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (data != null)
    4
    if (data != null)
    5
    hashCode += (data.hashCode() * 17);
    5
    hashCode += (data.hashCode() * 17);
    6
    if (name != null)
    6
    if (name != null)
    7
    hashCode += (name.hashCode() * 29);
    7
    hashCode += (name.hashCode() * 29);
    8
    if (subElements != null)
    8
    if (subElements != null)
    2
    if (attributes != null)
    Differences
    Expression1Expression2Difference
    subElementsattributesVARIABLE_NAME_MISMATCH
    java.util.Listjava.util.HashtableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List of variable subElements does not match with type java.util.Hashtable of variable attributes
    • Make classes java.util.List and java.util.Hashtable extend a common superclass
    2
    if (attributes != null)
                                                                                        
    3
    hashCode += (attributes.hashCode() * 13);
    9
    hashCode += (subElements.hashCode() * 57);
                                                                                          
    Precondition Violations (1)
    Row Violation
    1Type java.util.List of variable subElements does not match with type java.util.Hashtable of variable attributes