if (getLogger().isDebugEnabled()) { Iterator argsIt = context.getParameterNamesIterator(); while (argsIt.hasNext()) { String name = (String) argsIt.next(); getLogger().debug(name + "=" + context.getParameter(name)); } }
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/protocol/java/test/SleepTest.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/RemoteSampleListenerImpl.java
Method name: void listParameters(JavaSamplerContext) Method name: void processBatch(List)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (getLogger().isDebugEnabled()) {
1
if (samples != null) {
2
			Iterator argsIt = context.getParameterNamesIterator();
2
    		Iterator iter = samples.iterator();
3
			while (argsIt.hasNext()) {
3
			while (iter.hasNext()) {
4
				String name = (String) argsIt.next();
4
				S
5
				getLogger().debug(name + "=" + context.getParameter(name)
5
ampleEvent e = (SampleEvent) iter.next();
6
);
6
				sampleOccurred(e);
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 2
    Mapped Statements
    ID Statement ID Statement
                                                                            
    2
    Iterator iter = samples.iterator();
    2
    Iterator argsIt = context.getParameterNamesIterator();
                                                                                                                  
    3
    while (argsIt.hasNext())
    3
    while (argsIt.hasNext())
    3
    while (iter.hasNext())
    Differences
    Expression1Expression2Difference
    argsItiterVARIABLE_NAME_MISMATCH
    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
    String name = (String)argsIt.next();
    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
                                                                              
                                              
    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
    getLogger().debug(name + "=" + context.getParameter(name));
    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
                                                                                                                                
    Precondition Violations (4)
    Row Violation
    1Unmatched 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
    2Unmatched 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
    3Unmatched statement sampleOccurred(e); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched 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