while(it.hasNext()){ ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next(); log.debug("Disposing pool: "+dsc.getInstrumentableName()+" @"+System.identityHashCode(dsc)); dsc.dispose(); }
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/jmeter/protocol/jdbc/config/DataSourceElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/JMeterThread.java
Method name: void testEnded() Method name: void delay(List)
Number of AST nodes: 4 Number of AST nodes: 4
1
while(it.hasNext()){
1
while (iter.hasNext()) {
2
				ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next();
2
			
3
				log.debug("Disposing pool: "+dsc.getInstrumentableName()+" @"+System.identityHashCode(dsc));
4
				dsc.dispose
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.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    while (it.hasNext())
    7
    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);
                                                
    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();
    8
    ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next();
    8
    ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next();
    Preondition Violations
    Unmatched statement ResourceLimitingJdbcDataSource dsc=(ResourceLimitingJdbcDataSource)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                    
    9
    log.debug("Disposing pool: " + dsc.getInstrumentableName() + " @" + System.identityHashCode(dsc));
                                                                                                                                                                                                            
    10
    dsc.dispose();
                                        
    Precondition Violations (3)
    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 sum+=timer.delay(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement ResourceLimitingJdbcDataSource dsc=(ResourceLimitingJdbcDataSource)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted