params.add(new CompoundVariable("1+2+3")); params.add(new CompoundVariable("TOTAL")); function.setParameters(params); String ret = function.execute(result, null); assertEquals("6", ret);
params.add(new CompoundVariable("YMD")); variable.setParameters(params); value = variable.execute(result, null); assertEquals(8,value.length()); assertNull(vars.get("NAME"));
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestJexlFunction.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestTimeFunction.java
Method name: void testSumVar() Method name: void testYMDnoV()
Number of AST nodes: 5 Number of AST nodes: 5
1
params.add(new CompoundVariable("1+2+3"));
1
params.add(new CompoundVariable("YMD"));
2
        params.add(new CompoundVariable("TOTAL"));
2
        
3
        function.setParameters(params);
3
    variable.setParameters(params);
4
        String ret = function.execute(result, null);
4
            value = variable.execute(result, null);
5
        assertEquals("6", ret
5
            assertEquals(8,value.length());
6
);
6
            assertNull(vars.get("NAME"));
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 comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    params.add(new CompoundVariable("1+2+3"));
    1
    params.add(new CompoundVariable("1+2+3"));
    1
    params.add(new CompoundVariable("YMD"));
    Differences
    Expression1Expression2Difference
    "1+2+3""YMD"LITERAL_VALUE_MISMATCH
    1
    params.add(new CompoundVariable("YMD"));
    2
    params.add(new CompoundVariable("TOTAL"));
                                                                                              
    3
    function.setParameters(params);
    3
    function.setParameters(params);
    2
    variable.setParameters(params);
    Differences
    Expression1Expression2Difference
    functionvariableVARIABLE_NAME_MISMATCH
    org.apache.jmeter.functions.JexlFunctionorg.apache.jmeter.functions.FunctionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.functions.JexlFunction of variable function does not match with type org.apache.jmeter.functions.Function of variable variable
    • Make classes org.apache.jmeter.functions.JexlFunction and org.apache.jmeter.functions.Function extend a common superclass
    2
    variable.setParameters(params);
                                                                                  
    3
    value = variable.execute(result, null);
                                                                        
    4
    assertEquals(8, value.length());
    4
    String ret = function.execute(result, null);
    4
    String ret = function.execute(result, null);
    Preondition Violations
    Unmatched statement String ret=function.execute(result,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                            
    5
    assertEquals("6", ret);
    5
    assertEquals("6", ret);
    5
    assertNull(vars.get("NAME"));
    Differences
    Expression1Expression2Difference
    assertEqualsassertNullMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals("6",ret)assertNull(vars.get("NAME"))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals("6",ret) is a void method call, and thus it cannot be parameterized
    Expression assertNull(vars.get("NAME")) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("6",ret) is a void method call, and thus it cannot be parameterized
    Expression assertNull(vars.get("NAME")) is a void method call, and thus it cannot be parameterized
    5
    assertNull(vars.get("NAME"));
    Precondition Violations (6)
    Row Violation
    1Type org.apache.jmeter.functions.JexlFunction of variable function does not match with type org.apache.jmeter.functions.Function of variable variable
    2Unmatched statement String ret=function.execute(result,null); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Expression assertEquals("6",ret) is a void method call, and thus it cannot be parameterized
    4Expression assertNull(vars.get("NAME")) is a void method call, and thus it cannot be parameterized
    5Expression assertEquals("6",ret) is a void method call, and thus it cannot be parameterized
    6Expression assertNull(vars.get("NAME")) is a void method call, and thus it cannot be parameterized