synchronized (this) { if (excaliburSource != null) { excaliburSource.dispose(); } excaliburSource = null; }
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/protocol/jdbc/config/DataSourceElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java
Method name: void testEnded() Method name: Collection createCollection(Configuration, String)
Number of AST nodes: 4 Number of AST nodes: 3
1
synchronized (this) {
1
JMeterProperty prop = createProperty(items[i], testClass);
2
			if (excaliburSource != null) {
2
				if (prop!=null) {
3
				excaliburSource.dispose();
3
				
4
			}
5
		    excaliburSource = null;
4
    coll.add(prop);
6
		}
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.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
                                                                                                                          
    13
    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
    13
    JMeterProperty prop = createProperty(items[i], testClass);
    2
    if (excaliburSource != null)
    2
    if (excaliburSource != null)
    14
    if (prop != null)
    Differences
    Expression1Expression2Difference
    excaliburSourcepropVARIABLE_NAME_MISMATCH
    org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSourceorg.apache.jmeter.testelement.property.JMeterPropertyVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource of variable excaliburSource does not match with type org.apache.jmeter.testelement.property.JMeterProperty of variable prop
    • Make classes org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource and org.apache.jmeter.testelement.property.JMeterProperty extend a common superclass
    14
    if (prop != null)
    3
    excaliburSource.dispose();
                                                              
                                          
    15
    coll.add(prop);
    Precondition Violations (2)
    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.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource of variable excaliburSource does not match with type org.apache.jmeter.testelement.property.JMeterProperty of variable prop