synchronized (sampleStore) { Iterator i = sampleStore.iterator(); while (i.hasNext()) { SampleEvent se = (SampleEvent) i.next(); listener.sampleOccurred(se); } }
if (getLogger().isDebugEnabled()) { Iterator argsIt = context.getParameterNamesIterator(); while (argsIt.hasNext()) { String name = (String) argsIt.next(); getLogger().debug(name + "=" + context.getParameter(name)); } }
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/protocol/java/test/SleepTest.java
Method name: void testEnded() Method name: void listParameters(JavaSamplerContext)
Number of AST nodes: 5 Number of AST nodes: 5
1
synchronized (sampleStore) {
1
if (getLogger().isDebugEnabled()) {
2
				Iterator i = sampleStore.iterator();
2
			Iterator argsIt = context.getParameterNamesIterator();
3
				while (i.hasNext()) {
3
			while (argsIt.hasNext()) {
4
					SampleEvent se = (SampleEvent) i.next();
4
				
5
					listener.sampleOccurred(se
5
String name = (String) argsIt.next();
6
);
6
				getLogger().debug(name + "=" + context.getParameter(name));
7
				}
7
			}
8
			}
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 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.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                  
    2
    Iterator argsIt = context.getParameterNamesIterator();
    5
    while (i.hasNext())
    5
    while (i.hasNext())
    3
    while (argsIt.hasNext())
    Differences
    Expression1Expression2Difference
    iargsItVARIABLE_NAME_MISMATCH
    3
    while (argsIt.hasNext())
                                                                              
    4
    String name = (String)argsIt.next();
    Preondition Violations
    Unmatched statement String name=(String)argsIt.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    String name = (String)argsIt.next();
                                                                                                                                
    5
    getLogger().debug(name + "=" + context.getParameter(name));
    Preondition Violations
    Unmatched statement getLogger().debug(name + "=" + context.getParameter(name)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    getLogger().debug(name + "=" + context.getParameter(name));
    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
                                                                  
    Precondition Violations (4)
    Row Violation
    1Unmatched statement String name=(String)argsIt.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement getLogger().debug(name + "=" + context.getParameter(name)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched 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
    4Unmatched statement listener.sampleOccurred(se); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted