DataSourceElement el = (DataSourceElement) super.clone(); el.excaliburSource = excaliburSource; el.perThreadPoolSet = perThreadPoolSet; return el;
CollectionProperty prop = (CollectionProperty) super.clone(); prop.value = cloneCollection(); return prop;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jdbc/config/DataSourceElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/property/CollectionProperty.java
Method name: Object clone() Method name: Object clone()
Number of AST nodes: 4 Number of AST nodes: 3
1
DataSourceElement el = (DataSourceElement) super.clone();
1
CollectionProperty prop = (CollectionProperty) super.clone();
2
		el.excaliburSource = excaliburSource;
2
		
3
		el.perThreadPoolSet = perThreadPoolSet;
3
prop.value = cloneCollection();
4
		return el;
4
		return prop;
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
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                              
    1
    CollectionProperty prop = (CollectionProperty)super.clone();
    1
    DataSourceElement el = (DataSourceElement)super.clone();
                                                                                                                      
    2
    el.excaliburSource = excaliburSource;
    2
    el.excaliburSource = excaliburSource;
    Preondition Violations
    Unmatched statement el.excaliburSource=excaliburSource; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                
    3
    el.perThreadPoolSet = perThreadPoolSet;
    3
    el.perThreadPoolSet = perThreadPoolSet;
    2
    prop.value = cloneCollection();
    Differences
    Expression1Expression2Difference
    elpropVARIABLE_NAME_MISMATCH
    org.apache.jmeter.protocol.jdbc.config.DataSourceElementorg.apache.jmeter.testelement.property.CollectionPropertyVARIABLE_TYPE_MISMATCH
    perThreadPoolSetvalueVARIABLE_NAME_MISMATCH
    java.util.Setjava.util.CollectionSUBCLASS_TYPE_MISMATCH
    java.util.Setjava.util.CollectionSUBCLASS_TYPE_MISMATCH
    perThreadPoolSetcloneCollection()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression el.perThreadPoolSet cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression prop.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.util.Set of variable el.perThreadPoolSet does not match with type java.util.Collection of variable prop.value
    • Make classes org.apache.jmeter.protocol.jdbc.config.DataSourceElement and org.apache.jmeter.testelement.property.CollectionProperty extend a common superclass
    Expression el.perThreadPoolSet cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression prop.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression el.perThreadPoolSet is a field being modified, and thus it cannot be parameterized
    Expression prop.value is a field being modified, and thus it cannot be parameterized
    2
    prop.value = cloneCollection();
                                  
    3
    return prop;
    4
    return el;
                              
    Precondition Violations (9)
    Row Violation
    1Unmatched statement el.excaliburSource=excaliburSource; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression el.perThreadPoolSet cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression prop.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.util.Set of variable el.perThreadPoolSet does not match with type java.util.Collection of variable prop.value
    5Expression el.perThreadPoolSet cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression prop.value cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression el.perThreadPoolSet is a field being modified, and thus it cannot be parameterized
    8Expression prop.value is a field being modified, and thus it cannot be parameterized
    9The refactoring of the clones is infeasible, because classes org.apache.jmeter.protocol.jdbc.config.DataSourceElement and org.apache.jmeter.testelement.property.CollectionProperty do not have a common superclass