while (it.hasNext()) { Object temp = it.next(); data.put(temp, new ListedHashTree()); order.add(temp); }
while (iter.hasNext()) { Timer timer = (Timer) iter.next(); TestBeanHelper.prepare((TestElement) timer); sum += timer.delay(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/ListedHashTree.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/JMeterThread.java
Method name: void ListedHashTree(Collection) Method name: void delay(List)
Number of AST nodes: 4 Number of AST nodes: 4
1
while (it.hasNext()) {
1
while (iter.hasNext()) {
2
			Object temp = it.next();
2
			
3
			data.put(temp, new ListedHashTree());
4
			order.add(temp
3
Timer timer = (Timer) iter.next();
4
			TestBeanHelper.prepare((TestElement) timer);
5
);
5
			sum += timer.delay();
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.1
Clones locationClones are in different classes
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    while (it.hasNext())
    4
    while (it.hasNext())
    3
    while (iter.hasNext())
    Differences
    Expression1Expression2Difference
    ititerVARIABLE_NAME_MISMATCH
    3
    while (iter.hasNext())
                                                                        
    4
    Timer timer = (Timer)iter.next();
    Preondition Violations
    Unmatched statement Timer timer=(Timer)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    Timer timer = (Timer)iter.next();
                                                                                                
    5
    TestBeanHelper.prepare((TestElement)timer);
    5
    Object temp = it.next();
    5
    Object temp = it.next();
    Preondition Violations
    Unmatched statement Object temp=it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
                                                
    6
    sum += timer.delay();
    Preondition Violations
    Unmatched statement sum+=timer.delay(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    sum += timer.delay();
    6
    data.put(temp, new ListedHashTree());
    6
    data.put(temp, new ListedHashTree());
    Preondition Violations
    Unmatched statement data.put(temp,new ListedHashTree()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    7
    order.add(temp);
    7
    order.add(temp);
    Preondition Violations
    Unmatched statement order.add(temp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                          
    Precondition Violations (5)
    Row Violation
    1Unmatched statement Timer timer=(Timer)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Object temp=it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement sum+=timer.delay(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement data.put(temp,new ListedHashTree()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement order.add(temp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted