if (subResults != null) { for (int i = 0; i < subResults.length; i++) { config.addChild(getConfiguration(subResults[i], saveConfig)); } }
for (int idx = 0; idx < params.length; idx++) { SAMPLE.addArgument(params[idx].getName(), params[idx].getValue()); }
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/util/accesslog/StandardGenerator.java
Method name: Configuration getConfiguration(SampleResult, SampleSaveConfiguration) Method name: void setParams(NVPair[])
Number of AST nodes: 3 Number of AST nodes: 2
1
if (subResults != null) {
2
			for (int i = 0; i < subResults.length; i++) {
1
for (int idx = 0; idx < params.length; idx++) {
3
				config.addChild(getConfiguration(subResults[i], saveConfig));
2
			
4
			}
3
SAMPLE.addArgument(params[idx].getName(), params[idx].getValue());
5
		}
4
		}
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)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    for (int i = 0; i < subResults.length; i++)
    23
    for (int i = 0; i < subResults.length; i++)
    1
    for (int idx = 0; idx < params.length; idx++)
    Differences
    Expression1Expression2Difference
    iidxVARIABLE_NAME_MISMATCH
    iidxVARIABLE_NAME_MISMATCH
    subResultsparamsVARIABLE_NAME_MISMATCH
    org.apache.jmeter.samplers.SampleResult[]org.apache.jmeter.protocol.http.util.accesslog.NVPair[]VARIABLE_TYPE_MISMATCH
    iidxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type int of variable subResults.length does not match with type int of variable params.length
    • Make classes org.apache.jmeter.samplers.SampleResult[] and org.apache.jmeter.protocol.http.util.accesslog.NVPair[] extend a common superclass
    1
    for (int idx = 0; idx < params.length; idx++)
                                                                                                                                            
    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
    2
    SAMPLE.addArgument(params[idx].getName(), params[idx].getValue());
    24
    config.addChild(getConfiguration(subResults[i], saveConfig));
    24
    config.addChild(getConfiguration(subResults[i], saveConfig));
    Preondition Violations
    Unmatched statement config.addChild(getConfiguration(subResults[i],saveConfig)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                    
    Precondition Violations (4)
    Row Violation
    1Type int of variable subResults.length does not match with type int of variable params.length
    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 config.addChild(getConfiguration(subResults[i],saveConfig)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero