Iterator it = keys.iterator(); while (it.hasNext()) { add(it.next()); }
PropertyIterator pi = el.propertyIterator(); while(pi.hasNext()){ pi.next().setRunningVersion(true); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/HashTree.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/control/TestWhileController.java
Method name: void add(Collection) Method name: void setRunning(TestElement)
Number of AST nodes: 3 Number of AST nodes: 3
1
Iterator it = keys.iterator();
1
PropertyIterator pi = el.propertyIterator();
2
		while (it.hasNext()) {
2
			while(pi.hasNext()){
3
			add(it.next());
3
				pi.next().setRunningVersion(true);
4
		}
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.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)9.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                              
    1
    PropertyIterator pi = el.propertyIterator();
    Preondition Violations
    Unmatched statement PropertyIterator pi=el.propertyIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    PropertyIterator pi = el.propertyIterator();
    1
    Iterator it = keys.iterator();
    1
    Iterator it = keys.iterator();
    Preondition Violations
    Unmatched statement Iterator it=keys.iterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                  
    2
    while (it.hasNext())
    2
    while (it.hasNext())
    2
    while (pi.hasNext())
    Differences
    Expression1Expression2Difference
    itpiVARIABLE_NAME_MISMATCH
    java.util.Iteratororg.apache.jmeter.testelement.property.PropertyIteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Iterator of variable it does not match with type org.apache.jmeter.testelement.property.PropertyIterator of variable pi
    • Make classes java.util.Iterator and org.apache.jmeter.testelement.property.PropertyIterator extend a common superclass
    2
    while (pi.hasNext())
                                                                              
    3
    pi.next().setRunningVersion(true);
    Preondition Violations
    Unmatched statement pi.next().setRunningVersion(true); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    pi.next().setRunningVersion(true);
    3
    add(it.next());
    3
    add(it.next());
    Preondition Violations
    Unmatched statement add(it.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                        
    Precondition Violations (6)
    Row Violation
    1Unmatched statement PropertyIterator pi=el.propertyIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement Iterator it=keys.iterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type java.util.Iterator of variable it does not match with type org.apache.jmeter.testelement.property.PropertyIterator of variable pi
    4Unmatched statement pi.next().setRunningVersion(true); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement add(it.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero