PropertyIterator iter = map.valueIterator(); while (iter.hasNext()) { traverseProperty(traverser, iter.next()); }
Iterator it = keys.iterator(); while (it.hasNext()) { add(it.next()); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/AbstractTestElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/HashTree.java
Method name: void traverseMap(MapProperty, TestElementTraverser) Method name: void add(Collection)
Number of AST nodes: 3 Number of AST nodes: 3
1
PropertyIterator iter = map.valueIterator();
1
Iterator it = keys.iterator();
2
		while (iter.hasNext()) {
2
		while (it.hasNext()) {
3
			traverseProperty(traverser, iter.next());
3
			add(it.next());
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)8.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                  
    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
    1
    Iterator it = keys.iterator();
    1
    PropertyIterator iter = map.valueIterator();
    1
    PropertyIterator iter = map.valueIterator();
    Preondition Violations
    Unmatched statement PropertyIterator iter=map.valueIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                              
    2
    while (iter.hasNext())
    2
    while (iter.hasNext())
    2
    while (it.hasNext())
    Differences
    Expression1Expression2Difference
    iteritVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.property.PropertyIteratorjava.util.IteratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.testelement.property.PropertyIterator of variable iter does not match with type java.util.Iterator of variable it
    • Make classes org.apache.jmeter.testelement.property.PropertyIterator and java.util.Iterator extend a common superclass
    2
    while (it.hasNext())
                                        
    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
    3
    add(it.next());
    3
    traverseProperty(traverser, iter.next());
    3
    traverseProperty(traverser, iter.next());
    Preondition Violations
    Unmatched statement traverseProperty(traverser,iter.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 Iterator it=keys.iterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement PropertyIterator iter=map.valueIterator(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Type org.apache.jmeter.testelement.property.PropertyIterator of variable iter does not match with type java.util.Iterator of variable it
    4Unmatched statement add(it.next()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement traverseProperty(traverser,iter.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