for (int idx = 0; idx < params.length; idx++) { SAMPLE.addArgument(params[idx].getName(), params[idx].getValue()); }
while (d.next()) { for (int count = 0; count < headers.length; count++) { addColumnValue(headers[count], d.getColumnValue(headers[count])); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/StandardGenerator.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/Data.java
Method name: void setParams(NVPair[]) Method name: void append(Data)
Number of AST nodes: 2 Number of AST nodes: 3
1
while (d.next()) {
1
for (int idx = 0; idx < params.length; idx++) {
2
				for (int count = 0; count < headers.length; count++) {
2
			SAMPLE.addArgument(params[idx].getName(), params[idx].getValue());
3
			
4
		addColumnValue(headers[count], d.getColumnValue(headers[count]));
5
				}
3
		}
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.2
Clones locationClones are in different classes
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 fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    for (int idx = 0; idx < params.length; idx++)
    1
    for (int idx = 0; idx < params.length; idx++)
    13
    for (int count = 0; count < headers.length; count++)
    Differences
    Expression1Expression2Difference
    idxcountVARIABLE_NAME_MISMATCH
    idxcountVARIABLE_NAME_MISMATCH
    paramsheadersVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.util.accesslog.NVPair[]java.lang.String[]VARIABLE_TYPE_MISMATCH
    idxcountVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.protocol.http.util.accesslog.NVPair[] of variable params does not match with type java.lang.String[] of variable headers
    • Make classes org.apache.jmeter.protocol.http.util.accesslog.NVPair[] and java.lang.String[] extend a common superclass
    13
    for (int count = 0; count < headers.length; count++)
    2
    SAMPLE.addArgument(params[idx].getName(), params[idx].getValue());
    2
    SAMPLE.addArgument(params[idx].getName(), params[idx].getValue());
    Preondition Violations
    Unmatched statement SAMPLE.addArgument(params[idx].getName(),params[idx].getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                            
                                                                                                                                            
    14
    addColumnValue(headers[count], d.getColumnValue(headers[count]));
    Preondition Violations
    Unmatched statement addColumnValue(headers[count],d.getColumnValue(headers[count])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14
    addColumnValue(headers[count], d.getColumnValue(headers[count]));
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jmeter.protocol.http.util.accesslog.NVPair[] of variable params does not match with type java.lang.String[] of variable headers
    2Unmatched statement SAMPLE.addArgument(params[idx].getName(),params[idx].getValue()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement addColumnValue(headers[count],d.getColumnValue(headers[count])); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted