if (jc != null) { jc.getVars().clear(); jc = null; }
if (itr.hasNext()) { SamplingStatCalculator row = (SamplingStatCalculator)itr.next(); if (row != null) { items.add(row); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/commons/jexl/bsf/JexlEngine.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/JTLData.java
Method name: void terminate() Method name: List getStats(List)
Number of AST nodes: 3 Number of AST nodes: 4
1
if (jc != null) {
1
if (itr.hasNext()) {
2
            jc.getVars().clear();
2
            
3
            jc = null;
3
SamplingStatCalculator row = (SamplingStatCalculator)itr.next();
4
            if (row != null) {
5
                items.add(row);
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 statements1
    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.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                      
    4
    SamplingStatCalculator row = (SamplingStatCalculator)itr.next();
    1
    if (jc != null)
    1
    if (jc != null)
    5
    if (row != null)
    Differences
    Expression1Expression2Difference
    jcrowVARIABLE_NAME_MISMATCH
    org.apache.commons.jexl.JexlContextorg.apache.jmeter.visualizers.SamplingStatCalculatorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.commons.jexl.JexlContext of variable jc does not match with type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row
    • Make classes org.apache.commons.jexl.JexlContext and org.apache.jmeter.visualizers.SamplingStatCalculator extend a common superclass
    5
    if (row != null)
    2
    jc.getVars().clear();
                                                    
    3
    jc = null;
                          
                                        
    6
    items.add(row);
    Precondition Violations (1)
    Row Violation
    1Type org.apache.commons.jexl.JexlContext of variable jc does not match with type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row