SplitFunction split = new SplitFunction(); Collection parms = new LinkedList(); parms.add(new CompoundVariable(p1)); if (p2 != null) { parms.add(new CompoundVariable(p2)); } if (p3 != null) { parms.add(new CompoundVariable(p3)); } split.setParameters(parms); return split;
CSVRead cr = new CSVRead(); Collection parms = new LinkedList(); if (p1 != null) { parms.add(new CompoundVariable(p1)); } if (p2 != null) { parms.add(new CompoundVariable(p2)); } cr.setParameters(parms); return cr;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/PackageTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/PackageTest.java
Method name: SplitFunction SplitParams(String, String, String) Method name: CSVRead setCSVReadParams(String, String)
Number of AST nodes: 9 Number of AST nodes: 8
1
SplitFunction split = new SplitFunction();
1
CSVRead cr = new CSVRead();
2
		Collection parms = new LinkedList();
2
		Collection parms = new LinkedList();
3
		parms.add(new CompoundVariable(p1));
3
		if (p1 != null) {
4
			parms.add(new CompoundVariable(p1));
5
		}
4
		if (p2 != null) {
6
		if (p2 != null) {
5
			parms.add(new CompoundVariable(p2));
7
			parms.add(new CompoundVariable(p2));
6
		}
8
		}
7
		if (p3 != null) {
9
		
8
			parms.add(new CompoundVariable(p3));
9
		}
10
		split.setParameters(parms);
10
cr.setParameters(parms);
11
		return split;
11
		return cr;
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.3
Clones locationClones are declared in the same class
Number of node comparisons23
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    SplitFunction split = new SplitFunction();
    1
    SplitFunction split = new SplitFunction();
    1
    CSVRead cr = new CSVRead();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.functions.SplitFunctionorg.apache.jmeter.functions.CSVReadSUBCLASS_TYPE_MISMATCH
    splitcrVARIABLE_NAME_MISMATCH
    org.apache.jmeter.functions.SplitFunctionorg.apache.jmeter.functions.CSVReadSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.functions.SplitFunctionorg.apache.jmeter.functions.CSVReadSUBCLASS_TYPE_MISMATCH
    1
    CSVRead cr = new CSVRead();
    2
    Collection parms = new LinkedList();
    2
    Collection parms = new LinkedList();
    3
    parms.add(new CompoundVariable(p1));
    3
    parms.add(new CompoundVariable(p1));
    Preondition Violations
    Unmatched statement parms.add(new CompoundVariable(p1)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
    4
    if (p2 != null)
    5
    if (p2 != null)
    5
    parms.add(new CompoundVariable(p2));
    6
    parms.add(new CompoundVariable(p2));
    6
    if (p3 != null)
    6
    if (p3 != null)
    3
    if (p1 != null)
    Differences
    Expression1Expression2Difference
    p3p1VARIABLE_NAME_MISMATCH
    3
    if (p1 != null)
    7
    parms.add(new CompoundVariable(p3));
    7
    parms.add(new CompoundVariable(p3));
    4
    parms.add(new CompoundVariable(p1));
    Differences
    Expression1Expression2Difference
    p3p1VARIABLE_NAME_MISMATCH
    4
    parms.add(new CompoundVariable(p1));
    8
    split.setParameters(parms);
    8
    split.setParameters(parms);
    7
    cr.setParameters(parms);
    Differences
    Expression1Expression2Difference
    splitcrVARIABLE_NAME_MISMATCH
    org.apache.jmeter.functions.SplitFunctionorg.apache.jmeter.functions.CSVReadSUBCLASS_TYPE_MISMATCH
    7
    cr.setParameters(parms);
    9
    return split;
    9
    return split;
    8
    return cr;
    Differences
    Expression1Expression2Difference
    splitcrVARIABLE_NAME_MISMATCH
    org.apache.jmeter.functions.SplitFunctionorg.apache.jmeter.functions.CSVReadSUBCLASS_TYPE_MISMATCH
    8
    return cr;
    Precondition Violations (2)
    Row Violation
    1Unmatched statement parms.add(new CompoundVariable(p1)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Clone fragment #1 returns variables parms , while Clone fragment #2 returns variables