while (i.hasNext()) { JavaSampler sampler = (JavaSampler) i.next(); sampler.releaseJavaClient(); i.remove(); }
BeanShellTestElement o = (BeanShellTestElement) super.clone(); o.init(); return o;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/java/sampler/JavaSampler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/util/BeanShellTestElement.java
Method name: void testEnded() Method name: Object clone()
Number of AST nodes: 4 Number of AST nodes: 3
1
while (i.hasNext()) {
2
				JavaSampler sampler = (JavaSampler) i.next();
3
				sampler.releaseJavaClient();
4
				i.remove();
5
			}
1
BeanShellTestElement o = (BeanShellTestElement) super.clone();
2
        o.init();
3
       return o;
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    JavaSampler sampler = (JavaSampler)i.next();
    5
    JavaSampler sampler = (JavaSampler)i.next();
    1
    BeanShellTestElement o = (BeanShellTestElement)super.clone();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.protocol.java.sampler.JavaSamplerorg.apache.jmeter.util.BeanShellTestElementSUBCLASS_TYPE_MISMATCH
    sampleroVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.java.sampler.JavaSamplerorg.apache.jmeter.util.BeanShellTestElementSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.protocol.java.sampler.JavaSamplerorg.apache.jmeter.util.BeanShellTestElementSUBCLASS_TYPE_MISMATCH
    i.next()super.clone()TYPE_COMPATIBLE_REPLACEMENT
    1
    BeanShellTestElement o = (BeanShellTestElement)super.clone();
    6
    sampler.releaseJavaClient();
    6
    sampler.releaseJavaClient();
    2
    o.init();
    Differences
    Expression1Expression2Difference
    releaseJavaClientinitMETHOD_INVOCATION_NAME_MISMATCH
    sampleroVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.java.sampler.JavaSamplerorg.apache.jmeter.util.BeanShellTestElementSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression sampler.releaseJavaClient() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method releaseJavaClient
    Expression o.init() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method init
    Expression sampler.releaseJavaClient() is a void method call, and thus it cannot be parameterized
    Expression o.init() is a void method call, and thus it cannot be parameterized
    2
    o.init();
                            
    3
    return o;
    7
    i.remove();
    7
    i.remove();
    Preondition Violations
    Unmatched statement i.remove(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                
    Precondition Violations (6)
    Row Violation
    1Expression sampler.releaseJavaClient() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression o.init() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression sampler.releaseJavaClient() is a void method call, and thus it cannot be parameterized
    4Expression o.init() is a void method call, and thus it cannot be parameterized
    5Unmatched statement i.remove(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Clone fragment #1 returns variables , while Clone fragment #2 returns variables o