synchronized (sampleStore) { Iterator i = sampleStore.iterator(); while (i.hasNext()) { SampleEvent se = (SampleEvent) i.next(); listener.sampleOccurred(se); } }
Iterator iter = configs.iterator(); while (iter.hasNext()) { ConfigTestElement config = (ConfigTestElement) iter.next(); sam.addTestElement(config); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/HoldSampleSender.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/TestCompiler.java
Method name: void testEnded() Method name: void configureWithConfigElements(Sampler, List)
Number of AST nodes: 5 Number of AST nodes: 4
1
synchronized (sampleStore) {
2
				Iterator i = sampleStore.iterator();
1
Iterator iter = configs.iterator();
3
				while (i.hasNext()) {
2
		while (iter.hasNext()) {
4
					SampleEvent se = (SampleEvent) i.next();
3
			ConfigTestElement config = (ConfigTestElement) iter.next();
5
					listener.sampleOccurred(se);
4
			
6
				}
7
	
5
sam.addTestElement(config);
8
		}
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 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)9.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Iterator i = sampleStore.iterator();
    4
    Iterator i = sampleStore.iterator();
    1
    Iterator iter = configs.iterator();
    Differences
    Expression1Expression2Difference
    iiterVARIABLE_NAME_MISMATCH
    sampleStoreconfigsVARIABLE_NAME_MISMATCH
    1
    Iterator iter = configs.iterator();
    5
    while (i.hasNext())
    5
    while (i.hasNext())
    2
    while (iter.hasNext())
    Differences
    Expression1Expression2Difference
    iiterVARIABLE_NAME_MISMATCH
    2
    while (iter.hasNext())
                                                                                                                          
    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
    3
    ConfigTestElement config = (ConfigTestElement)iter.next();
                                                                
    4
    sam.addTestElement(config);
    6
    SampleEvent se = (SampleEvent)i.next();
    6
    SampleEvent se = (SampleEvent)i.next();
    Preondition Violations
    Unmatched statement SampleEvent se=(SampleEvent)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                    
    7
    listener.sampleOccurred(se);
    7
    listener.sampleOccurred(se);
    Preondition Violations
    Unmatched statement listener.sampleOccurred(se); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement listener.sampleOccurred(se); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                  
    Precondition Violations (5)
    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 se=(SampleEvent)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement listener.sampleOccurred(se); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement listener.sampleOccurred(se); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5The refactoring of the clones is infeasible, because classes org.apache.jmeter.samplers.HoldSampleSender and org.apache.jmeter.threads.TestCompiler do not have a common superclass