if (itr.hasNext()) { SamplingStatCalculator row = (SamplingStatCalculator)itr.next(); if (row != null) { items.add(row); } }
JMeterProperty prop = createProperty(items[i], testClass); if (prop!=null) { coll.add(prop); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/JTLData.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java
Method name: List getStats(List) Method name: Collection createCollection(Configuration, String)
Number of AST nodes: 4 Number of AST nodes: 3
1
if (itr.hasNext()) {
2
            SamplingStatCalculator row = (SamplingStatCalculator)itr.next();
1
JMeterProperty prop = 
3
            
2
createProperty(items[i], testClass);
4
if (row != null) {
3
				if (prop!=null) {
5
                items.add(row);
4
				    coll.add(prop);
6
            }
7
        }
5
				}
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.2
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)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    SamplingStatCalculator row = (SamplingStatCalculator)itr.next();
                                                                                                                                      
                                                                                                                        
    5
    JMeterProperty prop = createProperty(items[i], testClass);
    Preondition Violations
    Unmatched statement JMeterProperty prop=createProperty(items[i],testClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    JMeterProperty prop = createProperty(items[i], testClass);
    5
    if (row != null)
    5
    if (row != null)
    6
    if (prop != null)
    Differences
    Expression1Expression2Difference
    rowpropVARIABLE_NAME_MISMATCH
    org.apache.jmeter.visualizers.SamplingStatCalculatororg.apache.jmeter.testelement.property.JMeterPropertyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.testelement.property.JMeterProperty of variable prop
    • Make classes org.apache.jmeter.visualizers.SamplingStatCalculator and org.apache.jmeter.testelement.property.JMeterProperty extend a common superclass
    6
    if (prop != null)
    6
    items.add(row);
    6
    items.add(row);
    7
    coll.add(prop);
    Differences
    Expression1Expression2Difference
    rowpropVARIABLE_NAME_MISMATCH
    org.apache.jmeter.visualizers.SamplingStatCalculatororg.apache.jmeter.testelement.property.JMeterPropertyVARIABLE_TYPE_MISMATCH
    itemscollVARIABLE_NAME_MISMATCH
    java.util.ArrayListjava.util.CollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.testelement.property.JMeterProperty of variable prop
    • Make classes org.apache.jmeter.visualizers.SamplingStatCalculator and org.apache.jmeter.testelement.property.JMeterProperty extend a common superclass
    Type java.util.ArrayList of variable items does not match with type java.util.Collection of variable coll
    • Make classes java.util.ArrayList and java.util.Collection extend a common superclass
    7
    coll.add(prop);
    Precondition Violations (4)
    Row Violation
    1Unmatched statement JMeterProperty prop=createProperty(items[i],testClass); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.testelement.property.JMeterProperty of variable prop
    3Type org.apache.jmeter.visualizers.SamplingStatCalculator of variable row does not match with type org.apache.jmeter.testelement.property.JMeterProperty of variable prop
    4Type java.util.ArrayList of variable items does not match with type java.util.Collection of variable coll