HashTree tree = getTreePath(treePath); if (tree != null) { return tree.list(); } return new LinkedList();
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: Collection list(Collection) Method name: String getContentType()
Number of AST nodes: 4 Number of AST nodes: 4
1
HashTree tree = getTreePath(treePath);
1
H
2
		if (tree != null) {
3
			return tree.list();
4
		}
5
		return new LinkedList()
2
eader contentTypeHeader = (Header) headers.get(CONTENT_TYPE);
3
		if (contentTypeHeader != null) {
4
			return contentTypeHeader.getValue();
5
		}
6
;
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.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                
    1
    Header contentTypeHeader = (Header)headers.get(CONTENT_TYPE);
    1
    HashTree tree = getTreePath(treePath);
                                                                                  
    2
    if (tree != null)
    2
    if (tree != null)
    2
    if (contentTypeHeader != null)
    Differences
    Expression1Expression2Difference
    treecontentTypeHeaderVARIABLE_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 tree 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 tree.list();
    3
    return tree.list();
    Preondition Violations
    Unmatched return tree.list();
                                                
    4
    return new LinkedList();
    4
    return new LinkedList();
    4
    return null;
    Differences
    Expression1Expression2Difference
    new LinkedList()nullTYPE_COMPATIBLE_REPLACEMENT
    4
    return null;
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jorphan.collections.HashTree of variable tree does not match with type org.apache.jmeter.protocol.http.control.Header of variable contentTypeHeader
    2Unmatched return contentTypeHeader.getValue();
    3Unmatched return tree.list();