HashTree temp = (HashTree) data.get(key); if (temp != null) { return temp.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(Object) Method name: String getContentType()
Number of AST nodes: 4 Number of AST nodes: 4
1
HashTree temp = (HashTree) data.get(key);
1
H
2
		if (temp != null) {
3
			return temp.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.2
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)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                
    1
    Header contentTypeHeader = (Header)headers.get(CONTENT_TYPE);
    Preondition Violations
    Unmatched statement Header contentTypeHeader=(Header)headers.get(CONTENT_TYPE); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    Header contentTypeHeader = (Header)headers.get(CONTENT_TYPE);
    1
    HashTree temp = (HashTree)data.get(key);
    1
    HashTree temp = (HashTree)data.get(key);
    Preondition Violations
    Unmatched statement HashTree temp=(HashTree)data.get(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                      
    2
    if (temp != null)
    2
    if (temp != null)
    2
    if (contentTypeHeader != null)
    Differences
    Expression1Expression2Difference
    tempcontentTypeHeaderVARIABLE_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 temp 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 statement return contentTypeHeader.getValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return contentTypeHeader.getValue();
    3
    return contentTypeHeader.getValue();
    3
    return temp.list();
    3
    return temp.list();
    Preondition Violations
    Unmatched statement return temp.list(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return temp.list();
                                                
    4
    return new LinkedList();
    4
    return new LinkedList();
    4
    return null;
    Differences
    Expression1Expression2Difference
    new LinkedList()nullTYPE_COMPATIBLE_REPLACEMENT
    4
    return null;
    Precondition Violations (7)
    Row Violation
    1Unmatched statement Header contentTypeHeader=(Header)headers.get(CONTENT_TYPE); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement HashTree temp=(HashTree)data.get(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type org.apache.jorphan.collections.HashTree of variable temp does not match with type org.apache.jmeter.protocol.http.control.Header of variable contentTypeHeader
    4Unmatched statement return contentTypeHeader.getValue(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return contentTypeHeader.getValue();
    6Unmatched statement return temp.list(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched return temp.list();