for (int idx = 0; idx < params.length; idx++) { SAMPLE.addArgument(params[idx].getName(), params[idx].getValue()); }
if (log.isDebugEnabled()) { for (int i = 0; i < superClasses.length ; i++){ log.debug("superclass: "+superClasses[i].getName()); } }
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/reflect/ClassFinder.java
Method name: void setParams(NVPair[]) Method name: List findClassesThatExtend(String[], Class[], boolean, String, String)
Number of AST nodes: 2 Number of AST nodes: 3
1
if (log.isDebugEnabled()) {
1
for (int idx = 0; idx < params.length; idx++) {
2
			for (int i = 0; i < superClasses.length ; i++){
2
			SAMPLE.addArgument(params[idx].getName(), params[idx].getValue());
3
				log.debug("superclass: "+superClasses[i].getName());  
4
			}
3
		}
5
		}
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.5
    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++)
    2
    for (int i = 0; i < superClasses.length; i++)
    Differences
    Expression1Expression2Difference
    idxiVARIABLE_NAME_MISMATCH
    idxiVARIABLE_NAME_MISMATCH
    paramssuperClassesVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.http.util.accesslog.NVPair[]java.lang.Class[]VARIABLE_TYPE_MISMATCH
    idxiVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.protocol.http.util.accesslog.NVPair[] of variable params does not match with type java.lang.Class[] of variable superClasses
    • Make classes org.apache.jmeter.protocol.http.util.accesslog.NVPair[] and java.lang.Class[] extend a common superclass
    2
    for (int i = 0; i < superClasses.length; i++)
    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
                                                                                                                                            
                                                                                                                      
    3
    log.debug("superclass: " + superClasses[i].getName());
    Preondition Violations
    Unmatched statement log.debug("superclass: " + superClasses[i].getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    log.debug("superclass: " + superClasses[i].getName());
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jmeter.protocol.http.util.accesslog.NVPair[] of variable params does not match with type java.lang.Class[] of variable superClasses
    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 log.debug("superclass: " + superClasses[i].getName()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted