if ( persister.hasCache() ) {
CacheKey ck = new CacheKey(
key,
persister.getKeyType(),
persister.getRole(),
session.getEntityMode(),
session.getFactory()
);
persister.getCacheAccessStrategy().remove( ck );
}
if ( persister.hasCache() ) {
final CacheKey ck = new CacheKey(
id,
persister.getIdentifierType(),
persister.getRootEntityName(),
source.getEntityMode(),
source.getFactory()
);
persister.getCacheAccessStrategy().evict( ck );
}
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/event/def/DefaultRefreshEventListener.java
|
Method name: void evict()
|
|
Method name: void onRefresh(RefreshEvent, Map)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( persister.hasCache() ) {↵ | | 1 | if ( persister.hasCache() ) {↵
|
2 | CacheKey ck = new CacheKey( ↵ | | 2 | final CacheKey ck = new CacheKey(↵
|
3 | key, ↵ | | 3 | id,↵
|
4 | persister.getKeyType(), ↵ | | 4 | persister.getIdentifierType(),↵
|
5 | persister.getRole(), ↵ | | 5 | persister.getRootEntityName(),↵
|
6 | session.getEntityMode(), ↵ | | 6 | source.getEntityMode(), ↵
|
7 | session.getFactory() ↵ | | 7 | source.getFactory()↵
|
8 | ↵ | | |
|
9 | );↵ | | 8 | );↵
|
10 | persister.getCacheAccessStrategy().remove( ck );↵ | | 9 | persister.getCacheAccessStrategy().evict( ck );↵
|
11 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-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) | 14.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (persister.hasCache()) | | 32 | if (persister.hasCache()) |
2 | CacheKey ck = new CacheKey(key, persister.getKeyType(), persister.getRole(), session.getEntityMode(), session.getFactory()); | | | |
| | | 33 | final CacheKey ck = new CacheKey(id, persister.getIdentifierType(), persister.getRootEntityName(), source.getEntityMode(), source.getFactory()); |
3 | persister.getCacheAccessStrategy().remove(ck); | | 34 | persister.getCacheAccessStrategy().evict(ck); |
Precondition Violations (5)
Row |
Violation |
1 | Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister |
2 | Expression persister.getCacheAccessStrategy().remove(ck) is a void method call, and thus it cannot be parameterized |
3 | Expression persister.getCacheAccessStrategy().evict(ck) is a void method call, and thus it cannot be parameterized |
4 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() |
5 | Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister |