this.displayName = displayName; init(); setState(1);
while (i.hasNext()) { JavaSampler sampler = (JavaSampler) i.next(); sampler.releaseJavaClient(); i.remove(); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/RunTimeGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/java/sampler/JavaSampler.java
Method name: void RunTimeGui(boolean) Method name: void testEnded()
Number of AST nodes: 3 Number of AST nodes: 4
1
this.displayName = displayName;
1
whi
2
		init();
3
		setStat
2
le (i.hasNext()) {
3
				JavaSampler sampler = (JavaSampler) i.next();
4
				sampler.releaseJavaClient();
4
e(1);
5
				i.remove();
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.0
Clones locationClones are in different classes
Number of node comparisons9
  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
    1
    this.displayName = displayName;
                                                                    
                                                                                              
    5
    JavaSampler sampler = (JavaSampler)i.next();
    Preondition Violations
    Unmatched statement JavaSampler sampler=(JavaSampler)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    JavaSampler sampler = (JavaSampler)i.next();
    2
    init();
    2
    init();
    7
    i.remove();
    Differences
    Expression1Expression2Difference
    initremoveMETHOD_INVOCATION_NAME_MISMATCH
    iMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression init() is a void method call, and thus it cannot be parameterized
    Expression i.remove() is a void method call, and thus it cannot be parameterized
    Expression init() is a void method call, and thus it cannot be parameterized
    Expression i.remove() is a void method call, and thus it cannot be parameterized
    7
    i.remove();
    3
    setState(1);
    3
    setState(1);
    6
    sampler.releaseJavaClient();
    Differences
    Expression1Expression2Difference
    setStatereleaseJavaClientMETHOD_INVOCATION_NAME_MISMATCH
    setState(1)sampler.releaseJavaClient()ARGUMENT_NUMBER_MISMATCH
    samplerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression setState(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method setState
    Expression setState(1) is a void method call, and thus it cannot be parameterized
    Expression sampler.releaseJavaClient() is a void method call, and thus it cannot be parameterized
    Expression setState(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method setState
    Expression setState(1) is a void method call, and thus it cannot be parameterized
    Expression sampler.releaseJavaClient() is a void method call, and thus it cannot be parameterized
    6
    sampler.releaseJavaClient();
    Precondition Violations (11)
    Row Violation
    1Unmatched statement JavaSampler sampler=(JavaSampler)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression init() is a void method call, and thus it cannot be parameterized
    3Expression i.remove() is a void method call, and thus it cannot be parameterized
    4Expression init() is a void method call, and thus it cannot be parameterized
    5Expression i.remove() is a void method call, and thus it cannot be parameterized
    6Expression setState(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression setState(1) is a void method call, and thus it cannot be parameterized
    8Expression sampler.releaseJavaClient() is a void method call, and thus it cannot be parameterized
    9Expression setState(1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression setState(1) is a void method call, and thus it cannot be parameterized
    11Expression sampler.releaseJavaClient() is a void method call, and thus it cannot be parameterized