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());
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());
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 testUseQueryCache() Method name: void testUse2ndLevelCache()
Number of AST nodes: 7 Number of AST nodes: 7
1
Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
1
Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
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
        assertNotNull(cim.getCollectionCacheInstance());
7
        assertNull(cim.getCollectionCacheInstance());
8
        assertNotNull(cim.getEntityCacheInstance());
8
        assertNull(cim.getEntityCacheInstance());
9
        assertNull(cim.getQueryCacheInstance());
9
        assertNotNull(cim.getQueryCacheInstance());
10
        assertNull(cim.getTimestampsCacheInstance());
10
        assertNotNull(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(), true, false);
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), true, false);
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    falsetrueLITERAL_VALUE_MISMATCH
    1
    Configuration cfg = CacheTestUtil.buildConfiguration("", getRegionFactoryClass(), false, true);
    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
    assertNotNull(cim.getCollectionCacheInstance());
    4
    assertNotNull(cim.getCollectionCacheInstance());
    4
    assertNull(cim.getCollectionCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNotNullassertNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNotNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    4
    assertNull(cim.getCollectionCacheInstance());
    5
    assertNotNull(cim.getEntityCacheInstance());
    5
    assertNotNull(cim.getEntityCacheInstance());
    5
    assertNull(cim.getEntityCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNotNullassertNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNotNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    5
    assertNull(cim.getEntityCacheInstance());
    6
    assertNull(cim.getQueryCacheInstance());
    6
    assertNull(cim.getQueryCacheInstance());
    6
    assertNotNull(cim.getQueryCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNullassertNotNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    6
    assertNotNull(cim.getQueryCacheInstance());
    7
    assertNull(cim.getTimestampsCacheInstance());
    7
    assertNull(cim.getTimestampsCacheInstance());
    7
    assertNotNull(cim.getTimestampsCacheInstance());
    Differences
    Expression1Expression2Difference
    assertNullassertNotNullMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized
    7
    assertNotNull(cim.getTimestampsCacheInstance());
    Precondition Violations (16)
    Row Violation
    1Expression assertNotNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertNull(cim.getCollectionCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertNotNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    4Expression assertNull(cim.getCollectionCacheInstance()) is a void method call, and thus it cannot be parameterized
    5Expression assertNotNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression assertNull(cim.getEntityCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertNotNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    8Expression assertNull(cim.getEntityCacheInstance()) is a void method call, and thus it cannot be parameterized
    9Expression assertNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertNotNull(cim.getQueryCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression assertNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    12Expression assertNotNull(cim.getQueryCacheInstance()) is a void method call, and thus it cannot be parameterized
    13Expression assertNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression assertNotNull(cim.getTimestampsCacheInstance()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression assertNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized
    16Expression assertNotNull(cim.getTimestampsCacheInstance()) is a void method call, and thus it cannot be parameterized