if (temporaryProperties != null) { temporaryProperties.remove(property); }
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/testelement/AbstractTestElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
Method name: void clearTemporary(JMeterProperty) Method name: void setConnectionAuthorization(HttpURLConnection, URL, AuthManager)
Number of AST nodes: 2 Number of AST nodes: 4
1
if (temporaryProperties != null) {
1
if (
2
			temporaryProperties.remove(property);
2
authManager != null) {
3
			Authorization auth = authManager.getAuthForURL(u);
4
			if (auth != null) {
5
				conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader());
6
			}
3
		}
7
		}
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 having the same super class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                          
    2
    Authorization auth = authManager.getAuthForURL(u);
    1
    if (temporaryProperties != null)
    1
    if (temporaryProperties != null)
    3
    if (auth != null)
    Differences
    Expression1Expression2Difference
    temporaryPropertiesauthVARIABLE_NAME_MISMATCH
    java.util.Setorg.apache.jmeter.protocol.http.control.AuthorizationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Set of variable temporaryProperties does not match with type org.apache.jmeter.protocol.http.control.Authorization of variable auth
    • Make classes java.util.Set and org.apache.jmeter.protocol.http.control.Authorization extend a common superclass
    3
    if (auth != null)
    2
    temporaryProperties.remove(property);
                                                                                    
                                                                                                                                                
    4
    conn.setRequestProperty(HEADER_AUTHORIZATION, auth.toBasicHeader());
    Precondition Violations (1)
    Row Violation
    1Type java.util.Set of variable temporaryProperties does not match with type org.apache.jmeter.protocol.http.control.Authorization of variable auth