if (parent instanceof Controller && (child instanceof Sampler || child instanceof Controller)) { parent.addTestElement(child); }
if (treePath != null && values != null) { set(Arrays.asList(treePath), Arrays.asList(values)); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/threads/TestCompiler.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/HashTree.java
Method name: void addTestElements() Method name: void set(Object[], Object[])
Number of AST nodes: 2 Number of AST nodes: 2
1
if (parent instanceof Controller && (child instanceof Sampler || child instanceof Controller)) {
1
if (
2
				parent.addTestElement(child
2
treePath != null && values != null) {
3
);
3
			set(Arrays.asList(treePath), Arrays.asList(values));
4
			}
4
		}
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2073.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (parent instanceof Controller && (child instanceof Sampler || child instanceof Controller))
    1
    if (parent instanceof Controller && (child instanceof Sampler || child instanceof Controller))
    1
    if (treePath != null && values != null)
    Differences
    Expression1Expression2Difference
    parent instanceof ControllertreePath != nullINFIX_LEFT_OPERAND_MISMATCH
    (child instanceof Sampler || child instanceof Controller)values != nullINFIX_RIGHT_OPERAND_MISMATCH
    1
    if (treePath != null && values != null)
    2
    parent.addTestElement(child);
    2
    parent.addTestElement(child);
    2
    set(Arrays.asList(treePath), Arrays.asList(values));
    Differences
    Expression1Expression2Difference
    addTestElementsetMETHOD_INVOCATION_NAME_MISMATCH
    parent.addTestElement(child)set(Arrays.asList(treePath),Arrays.asList(values))ARGUMENT_NUMBER_MISMATCH
    parentMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression parent.addTestElement(child) is a void method call, and thus it cannot be parameterized
    Expression set(Arrays.asList(treePath),Arrays.asList(values)) is a void method call, and thus it cannot be parameterized
    Expression parent.addTestElement(child) is a void method call, and thus it cannot be parameterized
    Expression set(Arrays.asList(treePath),Arrays.asList(values)) is a void method call, and thus it cannot be parameterized
    2
    set(Arrays.asList(treePath), Arrays.asList(values));
    Precondition Violations (4)
    Row Violation
    1Expression parent.addTestElement(child) is a void method call, and thus it cannot be parameterized
    2Expression set(Arrays.asList(treePath),Arrays.asList(values)) is a void method call, and thus it cannot be parameterized
    3Expression parent.addTestElement(child) is a void method call, and thus it cannot be parameterized
    4Expression set(Arrays.asList(treePath),Arrays.asList(values)) is a void method call, and thus it cannot be parameterized