JMeterProperty prop = createProperty(children[i], newClass); if (prop!=null) { element.setProperty(prop); }
if (authManager != null) { Authorization auth = authManager.getAuthForURL(u); if (auth != null) { conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader()); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Method name: TestElement createTestElement(Configuration) Method name: void setConnectionAuthorization(HttpURLConnection, URL, AuthManager)
Number of AST nodes: 3 Number of AST nodes: 4
1
JMeterProperty prop = createProperty(children[i], newClass
1
if (authManager != null) {
2
);
2
			Authorization auth = authManager.getAuthForURL(u);
3
					if (prop!=null) {
3
			if (auth != null) {
4
					    element.setProperty(prop);
4
				conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader());
5
			
5
			}
6
		}
6
		}
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    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.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                          
    2
    Authorization auth = authManager.getAuthForURL(u);
    15
    if (prop != null)
    15
    if (prop != null)
    3
    if (auth != null)
    Differences
    Expression1Expression2Difference
    propauthVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.property.JMeterPropertyorg.apache.jmeter.protocol.http.control.AuthorizationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.testelement.property.JMeterProperty of variable prop does not match with type org.apache.jmeter.protocol.http.control.Authorization of variable auth
    • Make classes org.apache.jmeter.testelement.property.JMeterProperty and org.apache.jmeter.protocol.http.control.Authorization extend a common superclass
    3
    if (auth != null)
                                                                                                                                                
    4
    conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader());
    16
    element.setProperty(prop);
                                                                
    Precondition Violations (1)
    Row Violation
    1Type org.apache.jmeter.testelement.property.JMeterProperty of variable prop does not match with type org.apache.jmeter.protocol.http.control.Authorization of variable auth