public class OptimisticReadOnlyAccess extends OptimisticTransactionalAccess { private static final Logger log = LoggerFactory.getLogger(OptimisticReadOnlyAccess.class); public OptimisticReadOnlyAccess(EntityRegionImpl region) { super(region); } @Override public SoftLock lockItem(Object key, Object version) throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only item"); } @Override public SoftLock lockRegion() throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only region"); } @Override public void unlockItem(Object key, SoftLock lock) throws CacheException { log.error("Illegal attempt to edit read only item"); } @Override public void unlockRegion(SoftLock lock) throws CacheException { log.error("Illegal attempt to edit read only region"); } @Override public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only item"); } @Override public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only item");
public class ReadOnlyAccess extends TransactionalAccess { private static final Logger log = LoggerFactory.getLogger(ReadOnlyAccess.class); public ReadOnlyAccess(EntityRegionImpl region) { super(region); } @Override public SoftLock lockItem(Object key, Object version) throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only item"); } @Override public SoftLock lockRegion() throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only region"); } @Override public void unlockItem(Object key, SoftLock lock) throws CacheException { log.error("Illegal attempt to edit read only item"); } @Override public void unlockRegion(SoftLock lock) throws CacheException { log.error("Illegal attempt to edit read only region"); } @Override public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only item"); } @Override public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException { throw new UnsupportedOperationException("Illegal attempt to edit read only item");
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/entity/OptimisticReadOnlyAccess.java File path: /hibernate-distribution-3.3.2.GA/project/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/entity/ReadOnlyAccess.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class OptimisticReadOnlyAccess extends OptimisticTransactionalAccess {
1
public class ReadOnlyAccess extends TransactionalAccess {
2
    private static final Logger log = LoggerFactory.getLogger(OptimisticReadOnlyAccess.class);
2
    private static final Logger log = LoggerFactory.getLogger(ReadOnlyAccess.class);
3
    public OptimisticReadOnlyAccess(EntityRegionImpl region) {
3
    public ReadOnlyAccess(EntityRegionImpl region) {
4
        super(region);
4
        super(region);
5
    }
5
    }
6
    @Override
6
    @Override
7
    public SoftLock lockItem(Object key, Object version) throws CacheException {
7
    public SoftLock lockItem(Object key, Object version) throws CacheException {
8
        throw new UnsupportedOperationException("Illegal attempt to edit read only item");
8
        throw new UnsupportedOperationException("Illegal attempt to edit read only item");
9
    }
9
    }
10
    @Override
10
    @Override
11
    public SoftLock lockRegion() throws CacheException {
11
    public SoftLock lockRegion() throws CacheException {
12
        throw new UnsupportedOperationException("Illegal attempt to edit read only region");
12
        throw new UnsupportedOperationException("Illegal attempt to edit read only region");
13
    }
13
    }
14
    @Override
14
    @Override
15
    public void unlockItem(Object key, SoftLock lock) throws CacheException {
15
    public void unlockItem(Object key, SoftLock lock) throws CacheException {
16
        log.error("Illegal attempt to edit read only item");
16
        log.error("Illegal attempt to edit read only item");
17
    }
17
    }
18
    @Override
18
    @Override
19
    public void unlockRegion(SoftLock lock) throws CacheException {
19
    public void unlockRegion(SoftLock lock) throws CacheException {
20
        log.error("Illegal attempt to edit read only region");
20
        log.error("Illegal attempt to edit read only region");
21
    }
21
    }
22
    @Override
22
    @Override
23
    public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
23
    public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
24
            throws CacheException {
24
            throws CacheException {
25
        throw new UnsupportedOperationException("Illegal attempt to edit read only item");
25
        throw new UnsupportedOperationException("Illegal attempt to edit read only item");
26
    }
26
    }
27
    @Override
27
    @Override
28
    public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
28
    public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
29
            throws CacheException {
29
            throws CacheException {
30
        throw new UnsupportedOperationException("Illegal attempt to edit read only item");
30
        throw new UnsupportedOperationException("Illegal attempt to edit read only item");
31
    
31
    
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