Header contentTypeHeader = (Header) headers.get(CONTENT_TYPE); if (contentTypeHeader != null) { return contentTypeHeader.getValue(); } return null;
HashTree temp = (HashTree) data.get(key); if (temp != null) { return temp.list(); } return new LinkedList();
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/HashTree.java
Method name: String getContentType() Method name: Collection list(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
Header contentTypeHeader = (Header) headers.get(CONTENT_TYPE);
1
H
2
		if (contentTypeHeader != null) {
3
			return contentTypeHeader.getValue();
4
		}
5
        return null
2
ashTree temp = (HashTree) data.get(key);
3
		if (temp != null) {
4
			return temp.list();
5
		}
6
;
6
		return new LinkedList();
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 in different classes
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
    HashTree temp = (HashTree)data.get(key);
    1
    Header contentTypeHeader = (Header)headers.get(CONTENT_TYPE);
                                                                                                                                
    2
    if (contentTypeHeader != null)
    2
    if (contentTypeHeader != null)
    2
    if (temp != null)
    Differences
    Expression1Expression2Difference
    contentTypeHeadertempVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.control.Headerorg.apache.jorphan.collections.HashTreeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.protocol.http.control.Header of variable contentTypeHeader does not match with type org.apache.jorphan.collections.HashTree of variable temp
    • Make classes org.apache.jmeter.protocol.http.control.Header and org.apache.jorphan.collections.HashTree extend a common superclass
    2
    if (temp != null)
                                                
    3
    return temp.list();
    Preondition Violations
    Unmatched return temp.list();
    3
    return temp.list();
    3
    return contentTypeHeader.getValue();
    3
    return contentTypeHeader.getValue();
    Preondition Violations
    Unmatched return contentTypeHeader.getValue();
                                                                                  
    4
    return null;
    4
    return null;
    4
    return new LinkedList();
    Differences
    Expression1Expression2Difference
    nullnew LinkedList()TYPE_COMPATIBLE_REPLACEMENT
    4
    return new LinkedList();
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jmeter.protocol.http.control.Header of variable contentTypeHeader does not match with type org.apache.jorphan.collections.HashTree of variable temp
    2Unmatched return temp.list();
    3Unmatched return contentTypeHeader.getValue();