if (getCollectionAccessStrategy() == null) { Configuration cfg = createConfiguration(); JBossCacheRegionFactory rf = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport()); Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance(); optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC; // Sleep a bit to avoid concurrent FLUSH problem avoidConcurrentFlush(); CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null); setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType())); }
if (getEntityAccessStrategy() == null) { Configuration cfg = createConfiguration(); JBossCacheRegionFactory rf = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport()); Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance(); optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC; // Sleep a bit to avoid concurrent FLUSH problem avoidConcurrentFlush(); EntityRegion localEntityRegion = rf.buildEntityRegion(REGION_NAME, cfg.getProperties(), null); setEntityRegionAccessStrategy(localEntityRegion.buildAccessStrategy(getAccessType())); }
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/collection/OptimisticTransactionalExtraAPITestCase.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/entity/OptimisticTransactionalExtraAPITestCase.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (getCollectionAccessStrategy() == null) {
1
if (getEntityAccessStrategy() == null) {
2
            Configuration cfg = createConfiguration();
2
            Configuration cfg = createConfiguration();
3
            JBossCacheRegionFactory rf  = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
3
            JBossCacheRegionFactory rf  = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
4
            Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance();
4
            Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance();
5
            optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
5
            optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
6
            
6
            
7
            // Sleep a bit to avoid concurrent FLUSH problem
7
            // Sleep a bit to avoid concurrent FLUSH problem
8
            avoidConcurrentFlush();
8
            avoidConcurrentFlush();
9
            
9
            
10
            CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null);
10
            EntityRegion localEntityRegion = rf.buildEntityRegion(REGION_NAME, cfg.getProperties(), null);
11
            setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType()));
11
            setEntityRegionAccessStrategy(localEntityRegion.buildAccessStrategy(getAccessType()));
12
        }
12
        }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0