if ( batchUpdate != null ) { batchUpdate.close(); }
if (cache != null) { stopSharedCache(cache); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/jdbc/AbstractBatcher.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/builder/SharedCacheInstanceManager.java
Method name: void closeStatements() Method name: void stop()
Number of AST nodes: 2 Number of AST nodes: 2
1
if ( batchUpdate != null ) {
1
if (cache != null) {
2
					batchUpdate.close();
3
				
2
            stopSharedCache(cache);
4
}
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 fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (batchUpdate != null)
    4
    if (batchUpdate != null)
    1
    if (cache != null)
    Differences
    Expression1Expression2Difference
    batchUpdatecacheVARIABLE_NAME_MISMATCH
    java.sql.PreparedStatementorg.jboss.cache.CacheVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.sql.PreparedStatement of variable batchUpdate does not match with type org.jboss.cache.Cache of variable cache
    • Make classes java.sql.PreparedStatement and org.jboss.cache.Cache extend a common superclass
    1
    if (cache != null)
    5
    batchUpdate.close();
    5
    batchUpdate.close();
    2
    stopSharedCache(cache);
    Differences
    Expression1Expression2Difference
    closestopSharedCacheMETHOD_INVOCATION_NAME_MISMATCH
    batchUpdate.close()stopSharedCache(cache)ARGUMENT_NUMBER_MISMATCH
    batchUpdateMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression batchUpdate.close() is a void method call, and thus it cannot be parameterized
    Expression stopSharedCache(cache) is a void method call, and thus it cannot be parameterized
    Expression batchUpdate.close() is a void method call, and thus it cannot be parameterized
    Expression stopSharedCache(cache) is a void method call, and thus it cannot be parameterized
    2
    stopSharedCache(cache);
    Precondition Violations (5)
    Row Violation
    1Type java.sql.PreparedStatement of variable batchUpdate does not match with type org.jboss.cache.Cache of variable cache
    2Expression batchUpdate.close() is a void method call, and thus it cannot be parameterized
    3Expression stopSharedCache(cache) is a void method call, and thus it cannot be parameterized
    4Expression batchUpdate.close() is a void method call, and thus it cannot be parameterized
    5Expression stopSharedCache(cache) is a void method call, and thus it cannot be parameterized