if (cacheInstanceManager != null) { cacheInstanceManager.stop(); }
if (cache != null) { stopSharedCache(cache); }
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/JBossCacheRegionFactory.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 stop() Method name: void stop()
Number of AST nodes: 2 Number of AST nodes: 2
1
if (cacheInstanceManager != null) {
1
if (cache != null) {
2
            cacheInstanceManager.stop();
2
            stopSharedCache(cache);
3
        }
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)9.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (cacheInstanceManager != null)
    1
    if (cacheInstanceManager != null)
    1
    if (cache != null)
    Differences
    Expression1Expression2Difference
    cacheInstanceManagercacheVARIABLE_NAME_MISMATCH
    org.hibernate.cache.jbc2.CacheInstanceManagerorg.jboss.cache.CacheVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.jbc2.CacheInstanceManager of variable cacheInstanceManager does not match with type org.jboss.cache.Cache of variable cache
    • Make classes org.hibernate.cache.jbc2.CacheInstanceManager and org.jboss.cache.Cache extend a common superclass
    1
    if (cache != null)
    2
    cacheInstanceManager.stop();
    2
    cacheInstanceManager.stop();
    2
    stopSharedCache(cache);
    Differences
    Expression1Expression2Difference
    stopstopSharedCacheMETHOD_INVOCATION_NAME_MISMATCH
    cacheInstanceManager.stop()stopSharedCache(cache)ARGUMENT_NUMBER_MISMATCH
    cacheInstanceManagerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression cacheInstanceManager.stop() 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 cacheInstanceManager.stop() 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 org.hibernate.cache.jbc2.CacheInstanceManager of variable cacheInstanceManager does not match with type org.jboss.cache.Cache of variable cache
    2Expression cacheInstanceManager.stop() 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 cacheInstanceManager.stop() 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