HTTPArgument arg = (HTTPArgument) args.next().getObjectValue(); String value = null; if (haveContentEncoding){ value = arg.getEncodedValue(contentEncoding); } else { value = arg.getEncodedValue(); } putBodyContent.append(value);
for (Iterator vit = sortedVals.iterator(); vit.hasNext();) { final String value = (String) vit.next(); if (first) { first = false; } else { sb.append(", "); // $NON-NLS-1$ } sb.append(value); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler2.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
Method name: String sendPutData(PutMethod) Method name: void writeSearchResult(SearchResult, XMLBuffer)
Number of AST nodes: 6 Number of AST nodes: 6
1
HTTPArgument arg = (HTTPArgument) args.next().getObjectValue();
1
for (Iterator vit = sortedVals.iterator(); vit.hasNext();)
2
       
2
			        {
3
         String value = null;
3
			            final String    value = 
4
   
4
(String) vit.next();
5
             if (haveContentEncoding){
5
			            if (
6
                    value = arg.getEncodedValue(contentEncoding);
7
    
6
first) {
7
			                first = false;
8
            } else {
8
			            } else {
9
                    value = arg.getEncodedValue();
9
			                
10
    
10
sb.append(", "); // $NON-NLS-1$
11
            }
11
			            }
12
                putBodyContent.append(value);
12
			            sb.append(value);
13
			        }
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 having the same super class
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    21
    HTTPArgument arg = (HTTPArgument)args.next().getObjectValue();
                                                                                                                                    
    22
    String value = null;
    22
    String value = null;
    Preondition Violations
    Unmatched statement String value=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                
                                                                                        
    25
    final String value = (String)vit.next();
    Preondition Violations
    Unmatched statement final String value=(String)vit.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    25
    final String value = (String)vit.next();
    23
    if (haveContentEncoding)
    23
    if (haveContentEncoding)
    26
    if (first)
    Differences
    Expression1Expression2Difference
    haveContentEncodingfirstVARIABLE_NAME_MISMATCH
    26
    if (first)
    24
    value = arg.getEncodedValue(contentEncoding);
                                                                                                  
    else
            
    25
    value = arg.getEncodedValue();
                                                                    
                                            
    28
    sb.append(", ");
    Preondition Violations
    Unmatched statement sb.append(", "); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    28
    sb.append(", ");
                                    
    27
    first = false;
    Preondition Violations
    Unmatched statement first=false; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    27
    first = false;
    26
    putBodyContent.append(value);
    26
    putBodyContent.append(value);
    29
    sb.append(value);
    Differences
    Expression1Expression2Difference
    putBodyContentsbVARIABLE_NAME_MISMATCH
    29
    sb.append(value);
    Precondition Violations (4)
    Row Violation
    1Unmatched statement String value=null; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement final String value=(String)vit.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement sb.append(", "); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement first=false; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted