for (int i = 0; i < subNodes.length; i++) { HashTree t = generateNode(subNodes[i]); if (t != null) { subTree.add(element, t); } }
for (int i = 0; i < results.length; i++){ message = results[i].getFailureMessage(); if (message != null) { break; } }
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/save/CSVSaveService.java
Method name: HashTree generateNode(Configuration) Method name: String resultToDelimitedString(SampleEvent, String)
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < subNodes.length; i++) {
1
for (int i = 0; i < results.length; i++){
2
			HashTree t = generateNode(subNodes[i]);
3
			if (t != null) {
4
				subTree.add(element, t);
2
        			message = results[i].getFailureMessage();
3
    				if (message != null) {
4
    				    break;
5
			}
5
    				}
6
		}
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 comparisons8
  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)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    for (int i = 0; i < subNodes.length; i++)
    6
    for (int i = 0; i < subNodes.length; i++)
    28
    for (int i = 0; i < results.length; i++)
    Differences
    Expression1Expression2Difference
    subNodesresultsVARIABLE_NAME_MISMATCH
    org.apache.avalon.framework.configuration.Configuration[]org.apache.jmeter.assertions.AssertionResult[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.avalon.framework.configuration.Configuration[] of variable subNodes does not match with type org.apache.jmeter.assertions.AssertionResult[] of variable results
    • Make classes org.apache.avalon.framework.configuration.Configuration[] and org.apache.jmeter.assertions.AssertionResult[] extend a common superclass
    28
    for (int i = 0; i < results.length; i++)
    7
    HashTree t = generateNode(subNodes[i]);
    7
    HashTree t = generateNode(subNodes[i]);
    Preondition Violations
    Unmatched statement HashTree t=generateNode(subNodes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
                                                                                          
    29
    message = results[i].getFailureMessage();
    Preondition Violations
    Unmatched statement message=results[i].getFailureMessage(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    29
    message = results[i].getFailureMessage();
    8
    if (t != null)
    8
    if (t != null)
    30
    if (message != null)
    Differences
    Expression1Expression2Difference
    tmessageVARIABLE_NAME_MISMATCH
    org.apache.jorphan.collections.HashTreejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jorphan.collections.HashTree of variable t does not match with type java.lang.String of variable message
    • Make classes org.apache.jorphan.collections.HashTree and java.lang.String extend a common superclass
    30
    if (message != null)
    9
    subTree.add(element, t);
    9
    subTree.add(element, t);
    Preondition Violations
    Unmatched statement subTree.add(element,t); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                        
                        
    31
    break;
    Preondition Violations
    Unmatched break;
    31
    break;
    Precondition Violations (6)
    Row Violation
    1Type org.apache.avalon.framework.configuration.Configuration[] of variable subNodes does not match with type org.apache.jmeter.assertions.AssertionResult[] of variable results
    2Unmatched statement HashTree t=generateNode(subNodes[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement message=results[i].getFailureMessage(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Type org.apache.jorphan.collections.HashTree of variable t does not match with type java.lang.String of variable message
    5Unmatched statement subTree.add(element,t); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched break;