HashTree t = getTree(key); if (t != null) { return t.getArray(); } return null;
Header contentTypeHeader = (Header) headers.get(CONTENT_TYPE); if (contentTypeHeader != null) { return contentTypeHeader.getValue(); } return null;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/HashTree.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
Method name: Object[] getArray(Object) Method name: String getContentType()
Number of AST nodes: 4 Number of AST nodes: 4
1
HashTree t = getTree(key);
1
H
2
		if (t
2
eader contentTypeHeader = (Header) headers.get(CONTENT_TYPE);
3
 != null) {
3
		if (contentTypeHeader != null) {
4
			return t.getArray();
4
			return contentTypeHeader.getValue();
5
		}
5
		}
6
		return null;
6
        return null;
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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                
    1
    Header contentTypeHeader = (Header)headers.get(CONTENT_TYPE);
    1
    HashTree t = getTree(key);
                                                          
    2
    if (t != null)
    2
    if (t != null)
    2
    if (contentTypeHeader != null)
    Differences
    Expression1Expression2Difference
    tcontentTypeHeaderVARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.HashTreeorg.apache.jmeter.protocol.http.control.HeaderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jorphan.collections.HashTree of variable t does not match with type org.apache.jmeter.protocol.http.control.Header of variable contentTypeHeader
    • Make classes org.apache.jorphan.collections.HashTree and org.apache.jmeter.protocol.http.control.Header extend a common superclass
    2
    if (contentTypeHeader != null)
                                                                                  
    3
    return contentTypeHeader.getValue();
    Preondition Violations
    Unmatched return contentTypeHeader.getValue();
    3
    return contentTypeHeader.getValue();
    3
    return t.getArray();
    3
    return t.getArray();
    Preondition Violations
    Unmatched return t.getArray();
                                                  
    4
    return null;
    4
    return null;
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jorphan.collections.HashTree of variable t does not match with type org.apache.jmeter.protocol.http.control.Header of variable contentTypeHeader
    2Unmatched return contentTypeHeader.getValue();
    3Unmatched return t.getArray();