Iterator iter = iterationListeners.iterator(); LoopIterationEvent event = new LoopIterationEvent(this, getIterCount()); while (iter.hasNext()) { LoopIterationListener item = (LoopIterationListener) iter.next(); item.iterationStart(event); }
if (samples != null) { Iterator iter = samples.iterator(); while (iter.hasNext()) { SampleEvent e = (SampleEvent) iter.next(); sampleOccurred(e); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/GenericController.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java
Method name: void fireIterationStart() Method name: void processBatch(List)
Number of AST nodes: 5 Number of AST nodes: 5
1
Iterator iter = iterationListeners.iterator();
2
		LoopIterationEvent event = new LoopIterationEvent(this, getIterCount()
1
if (samples != null) {
3
);
2
    		Iterator iter = samples.iterator();
4
		while (iter.hasNext()) {
3
			while (iter.hasNext()) {
5
			LoopIterationListener item = (LoopIterationListener) iter.next();
4
			
6
			item.iterationStart(event);
5
	SampleEvent e = (SampleEvent) iter.next();
6
				sampleOccurred(e);
7
			}
7
		}
8
		}
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Iterator iter = iterationListeners.iterator();
    1
    Iterator iter = iterationListeners.iterator();
    2
    Iterator iter = samples.iterator();
    Differences
    Expression1Expression2Difference
    iterationListenerssamplesVARIABLE_NAME_MISMATCH
    java.util.LinkedListjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.LinkedList of variable iterationListeners does not match with type java.util.List of variable samples
    • Make classes java.util.LinkedList and java.util.List extend a common superclass
    2
    Iterator iter = samples.iterator();
    2
    LoopIterationEvent event = new LoopIterationEvent(this, getIterCount());
                                                                                                                                                    
    3
    while (iter.hasNext())
    3
    while (iter.hasNext())
                                                                                        
    4
    SampleEvent e = (SampleEvent)iter.next();
    Preondition Violations
    Unmatched statement SampleEvent e=(SampleEvent)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    SampleEvent e = (SampleEvent)iter.next();
    4
    LoopIterationListener item = (LoopIterationListener)iter.next();
    4
    LoopIterationListener item = (LoopIterationListener)iter.next();
    Preondition Violations
    Unmatched statement LoopIterationListener item=(LoopIterationListener)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                      
                                              
    5
    sampleOccurred(e);
    Preondition Violations
    Unmatched statement sampleOccurred(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    sampleOccurred(e);
    5
    item.iterationStart(event);
    5
    item.iterationStart(event);
    Preondition Violations
    Unmatched statement item.iterationStart(event); 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
    1Type java.util.LinkedList of variable iterationListeners does not match with type java.util.List of variable samples
    2Unmatched statement SampleEvent e=(SampleEvent)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement LoopIterationListener item=(LoopIterationListener)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement sampleOccurred(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement item.iterationStart(event); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted