synchronized (this) { if (excaliburSource != null) { excaliburSource.dispose(); } excaliburSource = null; }
if (treePath != null) { add(Arrays.asList(treePath), values); }
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/jorphan/collections/HashTree.java
Method name: void testEnded() Method name: void add(Object[], Collection)
Number of AST nodes: 4 Number of AST nodes: 2
1
synchronized (this) {
2
			if (excaliburSource != null) {
3
				excaliburSource.dispose();
4
			}
5
		    excaliburSource = null
1
if (treePath != null) {
6
;
2
			add(Arrays.asList(treePath), values);
7
		}
3
		}
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 comparisons4
  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 fragment0
    Time elapsed for statement mapping (ms)1125.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (excaliburSource != null)
    2
    if (excaliburSource != null)
    1
    if (treePath != null)
    Differences
    Expression1Expression2Difference
    excaliburSourcetreePathVARIABLE_NAME_MISMATCH
    org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSourcejava.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource of variable excaliburSource does not match with type java.lang.Object[] of variable treePath
    • Make classes org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource and java.lang.Object[] extend a common superclass
    1
    if (treePath != null)
    3
    excaliburSource.dispose();
    3
    excaliburSource.dispose();
    2
    add(Arrays.asList(treePath), values);
    Differences
    Expression1Expression2Difference
    disposeaddMETHOD_INVOCATION_NAME_MISMATCH
    excaliburSource.dispose()add(Arrays.asList(treePath),values)ARGUMENT_NUMBER_MISMATCH
    excaliburSourceMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression excaliburSource.dispose() is a void method call, and thus it cannot be parameterized
    Expression add(Arrays.asList(treePath),values) is a void method call, and thus it cannot be parameterized
    Expression excaliburSource.dispose() is a void method call, and thus it cannot be parameterized
    Expression add(Arrays.asList(treePath),values) is a void method call, and thus it cannot be parameterized
    2
    add(Arrays.asList(treePath), values);
    Precondition Violations (5)
    Row Violation
    1Type org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSource of variable excaliburSource does not match with type java.lang.Object[] of variable treePath
    2Expression excaliburSource.dispose() is a void method call, and thus it cannot be parameterized
    3Expression add(Arrays.asList(treePath),values) is a void method call, and thus it cannot be parameterized
    4Expression excaliburSource.dispose() is a void method call, and thus it cannot be parameterized
    5Expression add(Arrays.asList(treePath),values) is a void method call, and thus it cannot be parameterized