Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true); JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport()); CacheInstanceManager cim = regionFactory.getCacheInstanceManager(); assertNull(cim.getCollectionCacheInstance()); assertNull(cim.getEntityCacheInstance()); assertNotNull(cim.getQueryCacheInstance()); assertNotNull(cim.getTimestampsCacheInstance());
Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false); JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport()); CacheInstanceManager cim = regionFactory.getCacheInstanceManager(); assertNotNull(cim.getCollectionCacheInstance()); assertNotNull(cim.getEntityCacheInstance()); assertNull(cim.getQueryCacheInstance()); assertNull(cim.getTimestampsCacheInstance());
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/builder/CacheInstanceManagerTestBase.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/builder/CacheInstanceManagerTestBase.java
Method name: void testUse2ndLevelCache() Method name: void testUseQueryCache()
Number of AST nodes: 7 Number of AST nodes: 7
1
Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
1
Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
2
        
2
        
3
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
3
        JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
4
        
4
        
5
        CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
5
        CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
6
        
6
        
7
        assertNull(cim.getCollectionCacheInstance());
7
        assertNotNull(cim.getCollectionCacheInstance());
8
        assertNull(cim.getEntityCacheInstance());
8
        assertNotNull(cim.getEntityCacheInstance());
9
        assertNotNull(cim.getQueryCacheInstance());
9
        assertNull(cim.getQueryCacheInstance());
10
        assertNotNull(cim.getTimestampsCacheInstance());
10
        assertNull(cim.getTimestampsCacheInstance());
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 declared in the same class
Number of node comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    truefalseLITERAL_VALUE_MISMATCH
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
    2
    JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
    2
    JBossCacheRegionFactory regionFactory = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
    3
    CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
    3
    CacheInstanceManager cim = regionFactory.getCacheInstanceManager();
    4
    assertNull(cim.getCollectionCacheInstance());
    4
    assertNull(cim.getCollectionCacheInstance());
    4
    assertNotNull(cim.getCollectionCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNullassertNotNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    4
    assertNotNull(cim.getCollectionCacheInstance());
    5
    assertNull(cim.getEntityCacheInstance());
    5
    assertNull(cim.getEntityCacheInstance());
    5
    assertNotNull(cim.getEntityCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNullassertNotNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    5
    assertNotNull(cim.getEntityCacheInstance());
    6
    assertNotNull(cim.getQueryCacheInstance());
    6
    assertNotNull(cim.getQueryCacheInstance());
    6
    assertNull(cim.getQueryCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNotNullassertNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNotNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    6
    assertNull(cim.getQueryCacheInstance());
    7
    assertNotNull(cim.getTimestampsCacheInstance());
    7
    assertNotNull(cim.getTimestampsCacheInstance());
    7
    assertNull(cim.getTimestampsCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNotNullassertNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNotNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized
    7
    assertNull(cim.getTimestampsCacheInstance());
    Precondition Violations (16)
    Row Violation
    1Expression assertNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertNotNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    4Expression assertNotNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    5Expression assertNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression assertNotNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    8Expression assertNotNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    9Expression assertNotNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression assertNotNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    12Expression assertNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    13Expression assertNotNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression assertNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression assertNotNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized
    16Expression assertNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized