for (int i = 0; i < BINARY_TYPES.length; i++){ if (ct.startsWith(BINARY_TYPES[i])){ return true; } } return false;
for (int i = 0; i < container.length; i++) { if (container[i] == item) { return true; } } return false;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/SampleResult.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/tree/ReportTreeListener.java
Method name: boolean isBinaryType(String) Method name: boolean contains(Object[], Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < BINARY_TYPES.length; i++){
1
for (int i = 0; i < container.length; i++) {
2
            if (ct.startsWith(BINARY_TYPES[i])){
3
                return true;
4
            }           
5
        }
6
        
2
			if (container[i] == item) {
3
				return true;
4
			}
5
		}
7
return false;
6
		return false;
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
Number of node comparisons3
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    for (int i = 0; i < BINARY_TYPES.length; i++)
    1
    for (int i = 0; i < BINARY_TYPES.length; i++)
    1
    for (int i = 0; i < container.length; i++)
    Differences
    Expression1Expression2Difference
    BINARY_TYPEScontainerVARIABLE_NAME_MISMATCH
    java.lang.String[]java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable BINARY_TYPES.length does not match with type int of variable container.length
    • Make classes java.lang.String[] and java.lang.Object[] extend a common superclass
    1
    for (int i = 0; i < container.length; i++)
                                                          
    2
    if (container[i] == item)
    Preondition Violations
    Unmatched statement if(container[i] == item) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    if (container[i] == item)
                                  
    3
    return true;
    Preondition Violations
    Unmatched return true;
    3
    return true;
    2
    if (ct.startsWith(BINARY_TYPES[i]))
    2
    if (ct.startsWith(BINARY_TYPES[i]))
    Preondition Violations
    Unmatched statement if(ct.startsWith(BINARY_TYPES[i])) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                              
    3
    return true;
    3
    return true;
    Preondition Violations
    Unmatched return true;
                                  
    4
    return false;
    4
    return false;
    Precondition Violations (6)
    Row Violation
    1Type int of variable BINARY_TYPES.length does not match with type int of variable container.length
    2Unmatched statement if(container[i] == item) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return true;
    4Unmatched statement if(ct.startsWith(BINARY_TYPES[i])) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched return true;
    6The refactoring of the clones is infeasible, because classes org.apache.jmeter.samplers.SampleResult and org.apache.jmeter.report.gui.tree.ReportTreeListener do not have a common superclass