if ( persister.hasCache() ) {
final CacheKey ck = new CacheKey(
key,
persister.getKeyType(),
persister.getRole(),
session.getEntityMode(),
session.getFactory()
);
lock = persister.getCacheAccessStrategy().lockItem( ck, null );
}
if ( persister.hasCache() ) {
final CacheKey ck = new CacheKey(
key,
persister.getKeyType(),
persister.getRole(),
session.getEntityMode(),
session.getFactory()
);
persister.getCacheAccessStrategy().unlockItem( ck, lock );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionAction.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/action/CollectionAction.java
|
Method name: void beforeExecutions()
|
|
Method name: void afterTransactionCompletion(boolean)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( persister.hasCache() ) {↵ | | 1 | if ( persister.hasCache() ) {↵
|
2 | final CacheKey ck = new CacheKey( ↵ | | 2 | final CacheKey ck = new CacheKey( ↵
|
3 | key, ↵ | | 3 | key, ↵
|
4 | persister.getKeyType(), ↵ | | 4 | persister.getKeyType(), ↵
|
5 | persister.getRole(), ↵ | | 5 | persister.getRole(), ↵
|
6 | session.getEntityMode(), ↵ | | 6 | session.getEntityMode(), ↵
|
7 | session.getFactory() ↵ | | 7 | session.getFactory() ↵
|
8 | );↵ | | 8 | );↵
|
9 | lock = persister.getCacheAccessStrategy().lockItem( ck, null );↵ | | 9 | persister.getCacheAccessStrategy().unlockItem( ck, lock );↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (persister.hasCache()) | | 1 | if (persister.hasCache()) |
2 | final CacheKey ck = new CacheKey(key, persister.getKeyType(), persister.getRole(), session.getEntityMode(), session.getFactory()); | | 2 | final CacheKey ck = new CacheKey(key, persister.getKeyType(), persister.getRole(), session.getEntityMode(), session.getFactory()); |
| | | 3 | persister.getCacheAccessStrategy().unlockItem(ck, lock); |
3 | lock = persister.getCacheAccessStrategy().lockItem(ck, null); | | | |
Precondition Violations (0)
Row |
Violation |