if (el != null) { super.addTestElement(el); log.info("TestElement: " + el.getClass().getName()); }
if (variable.length() > 0) { JMeterVariables vars = getVariables(); if (vars != null){// vars will be null on TestPlan vars.put(variable, datetime); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/AbstractTable.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/TimeFunction.java
Method name: void addTestElement(TestElement) Method name: String execute(SampleResult, Sampler)
Number of AST nodes: 3 Number of AST nodes: 4
1
if (el != null) {
1
if (
2
            super.addTestElement(el);
3
            log.info("TestElement: " + el.getClass().getName());
2
variable.length() > 0) {
3
            JMeterVariables vars = getVariables();
4
            if (vars != null){// vars will be null on TestPlan
5
            	vars.put(variable, datetime);
6
            }
4
        }
7
        }
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 comparisons6
  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)443.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                    
    10
    JMeterVariables vars = getVariables();
    1
    if (el != null)
    1
    if (el != null)
    11
    if (vars != null)
    Differences
    Expression1Expression2Difference
    elvarsVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.TestElementorg.apache.jmeter.threads.JMeterVariablesVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.testelement.TestElement of variable el does not match with type org.apache.jmeter.threads.JMeterVariables of variable vars
    • Make classes org.apache.jmeter.testelement.TestElement and org.apache.jmeter.threads.JMeterVariables extend a common superclass
    11
    if (vars != null)
    2
    super.addTestElement(el);
    2
    super.addTestElement(el);
    12
    vars.put(variable, datetime);
    Differences
    Expression1Expression2Difference
    super.addTestElement(el)vars.put(variable,datetime)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression super.addTestElement(el) is a void method call, and thus it cannot be parameterized
    Expression vars.put(variable,datetime) is a void method call, and thus it cannot be parameterized
    12
    vars.put(variable, datetime);
    3
    log.info("TestElement: " + el.getClass().getName());
                                                                                                                  
    Precondition Violations (3)
    Row Violation
    1Type org.apache.jmeter.testelement.TestElement of variable el does not match with type org.apache.jmeter.threads.JMeterVariables of variable vars
    2Expression super.addTestElement(el) is a void method call, and thus it cannot be parameterized
    3Expression vars.put(variable,datetime) is a void method call, and thus it cannot be parameterized