Iterator iter = configs.iterator(); while (iter.hasNext()) { ConfigTestElement config = (ConfigTestElement) iter.next(); sam.addTestElement(config); }
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/threads/TestCompiler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java
Method name: void configureWithConfigElements(Sampler, List) Method name: void processBatch(List)
Number of AST nodes: 4 Number of AST nodes: 5
1
if (samples != null) {
1
Iterator iter = configs.iterator();
2
    		Iterator iter = samples.iterator();
2
		while (iter.hasNext()) {
3
			while (iter.hasNext()) {
3
			ConfigTestElement config = (ConfigTestElement) iter.next();
4
				SampleEvent e = (SampleEvent) iter.next();
4
			sam.addTestElement(config);
5
				sampleOccurred(e);
6
			}
5
		}
7
		}
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Iterator iter = configs.iterator();
    1
    Iterator iter = configs.iterator();
    2
    Iterator iter = samples.iterator();
    Differences
    Expression1Expression2Difference
    configssamplesVARIABLE_NAME_MISMATCH
    2
    Iterator iter = samples.iterator();
    2
    while (iter.hasNext())
    3
    while (iter.hasNext())
    3
    ConfigTestElement config = (ConfigTestElement)iter.next();
    3
    ConfigTestElement config = (ConfigTestElement)iter.next();
    Preondition Violations
    Unmatched statement ConfigTestElement config=(ConfigTestElement)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();
    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
    sam.addTestElement(config);
                                                                
                                              
    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);
    Precondition Violations (3)
    Row Violation
    1Unmatched statement ConfigTestElement config=(ConfigTestElement)iter.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    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 sampleOccurred(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted