ensureRegionRootExists(); // Don't hold the JBC node lock throughout the tx, as that // prevents reads and other updates Transaction tx = suspend(); try { // TODO Why not use the timestamp in a DataVersion? Option opt = getNonLockingDataVersionOption(false); // We ensure ASYNC semantics (JBCACHE-1175) opt.setForceAsynchronous(true); CacheHelper.put(getCacheInstance(), getRegionFqn(), key, value, opt); } catch (Exception e) { throw new CacheException(e); } finally { resume(tx); }
errorIfClosed(); checkTransactionSynchStatus(); String entityName = criteria.getEntityOrClassName(); CriteriaLoader loader = new CriteriaLoader( getOuterJoinLoadable(entityName), factory, criteria, entityName, getEnabledFilters() ); autoFlushIfRequired( loader.getQuerySpaces() ); dontFlushFromFind++; try { return loader.scroll(this, scrollMode); } finally { dontFlushFromFind--; }
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/timestamp/TimestampsRegionImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionImpl.java
Method name: void put(Object, Object) Method name: ScrollableResults scroll(CriteriaImpl, ScrollMode)
Number of AST nodes: 6 Number of AST nodes: 8
1
ensureRegionRootExists();
1
e
2
        // Don't hold the JBC node lock throughout the tx, as that
3
        // prevents reads and other updates
4
        Transaction tx = suspend();
5
        try {
6
            // TODO Why not use the timestamp in a DataVersion?
7
            Option opt = getNonLockingDataVersionOption(false);
8
            // We ensure ASYNC semantics (JBCACHE-1175)
9
            opt.setForceAsynchronous(true);
10
            CacheHelper.put(getCacheInstan
2
rrorIfClosed();
3
		checkTransactionSynchStatus();
4
		String entityName = criteria.getEntityOrClassName();
5
		CriteriaLoader loader = new CriteriaLoader(
6
				getOuterJoinLoadable(entityName),
7
				factory,
8
				criteria,
9
				entityName,
10
				getEnabledFilters()
11
		);
11
ce(), getRegionFqn(), key, value, opt);
12
		autoFlushIfRequired( loader.getQuerySpaces()
12
        } catch (Exception e) {
13
            throw new CacheException(e);
14
        } finally {
15
            resume(tx);
16
        
13
 );
14
		dontFlushFromFind++;
15
		try {
16
			return loader.scroll(this, scrollMode);
17
		}
18
		finally {
19
			dontFlushFromFind--;
17
}
20
		}
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.1
Clones locationClones are in different classes
Number of node comparisons1