protected void setUp() throws Exception { super.setUp(); 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()));
protected void setUp() throws Exception { super.setUp(); 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
protected void setUp() throws Exception {
1
protected void setUp() throws Exception {
2
        super.setUp();
2
        super.setUp();
3
        
3
        
4
        if (getCollectionAccessStrategy() == null) {
4
        if (getEntityAccessStrategy() == null) {
5
            Configuration cfg = createConfiguration();
5
            Configuration cfg = createConfiguration();
6
            JBossCacheRegionFactory rf  = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
6
            JBossCacheRegionFactory rf  = CacheTestUtil.startRegionFactory(cfg, getCacheTestSupport());
7
            Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance();
7
            Cache localCache = rf.getCacheInstanceManager().getEntityCacheInstance();
8
            optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
8
            optimistic = localCache.getConfiguration().getNodeLockingScheme() == org.jboss.cache.config.Configuration.NodeLockingScheme.OPTIMISTIC;
9
            
9
            
10
            // Sleep a bit to avoid concurrent FLUSH problem
10
            // Sleep a bit to avoid concurrent FLUSH problem
11
            avoidConcurrentFlush();
11
            avoidConcurrentFlush();
12
            
12
            
13
            CollectionRegion localCollectionRegion = rf.buildCollectionRegion(REGION_NAME, cfg.getProperties(), null);
13
            EntityRegion localEntityRegion = rf.buildEntityRegion(REGION_NAME, cfg.getProperties(), null);
14
            setCollectionAccessStrategy(localCollectionRegion.buildAccessStrategy(getAccessType()));
14
            setEntityRegionAccessStrategy(localEntityRegion.buildAccessStrategy(getAccessType()));
15
        
15
        
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