while (it.hasNext()) { Object temp = it.next(); data.put(temp, new ListedHashTree()); order.add(temp); }
while(it.hasNext()){ ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next(); log.debug("Disposing pool: "+dsc.getInstrumentableName()+" @"+System.identityHashCode(dsc)); dsc.dispose(); }
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/protocol/jdbc/config/DataSourceElement.java
Method name: void ListedHashTree(Collection) Method name: void testEnded()
Number of AST nodes: 4 Number of AST nodes: 4
1
while (it.hasNext()) {
1
while(it.hasNext()){
2
			Object temp = it.next();
2
			
3
			data.put(temp, new ListedHashTree());
4
			order.add(temp
3
	ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next();
4
				log.debug("Disposing pool: "+dsc.getInstrumentableName()+" @"+System.identityHashCode(dsc));
5
);
5
				dsc.dispose();
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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    while (it.hasNext())
    7
    while (it.hasNext())
    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
    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
                                          
                                                                                                                                                                    
    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
    8
    ResourceLimitingJdbcDataSource dsc = (ResourceLimitingJdbcDataSource)it.next();
                                                                                                                                                                                                            
    9
    log.debug("Disposing pool: " + dsc.getInstrumentableName() + " @" + System.identityHashCode(dsc));
                                        
    10
    dsc.dispose();
    Precondition Violations (4)
    Row Violation
    1Unmatched 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
    2Unmatched 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
    3Unmatched statement order.add(temp); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched 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