if ( ce == null ) {
factory.getStatisticsImplementor().secondLevelCacheMiss(
persister.getCacheAccessStrategy().getRegion().getName()
);
}
else {
factory.getStatisticsImplementor().secondLevelCacheHit(
persister.getCacheAccessStrategy().getRegion().getName()
);
}
if ( ce == null ) {
factory.getStatisticsImplementor().secondLevelCacheMiss(
persister.getCacheAccessStrategy().getRegion().getName()
);
}
else {
factory.getStatisticsImplementor().secondLevelCacheHit(
persister.getCacheAccessStrategy().getRegion().getName()
);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultInitializeCollectionEventListener.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultLoadEventListener.java
|
Method name: boolean initializeCollectionFromCache(Serializable, CollectionPersister, PersistentCollection, SessionImplementor)
|
|
Method name: Object loadFromSecondLevelCache(LoadEvent, EntityPersister, LoadEventListener.LoadType)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if ( ce == null ) {↵ | | 1 | if ( ce == null ) {↵
|
2 | factory.getStatisticsImplementor().secondLevelCacheMiss(↵ | | 2 | factory.getStatisticsImplementor().secondLevelCacheMiss(↵
|
3 | persister.getCacheAccessStrategy().getRegion().getName()↵ | | 3 | persister.getCacheAccessStrategy().getRegion().getName()↵
|
4 | );↵ | | 4 | );↵
|
5 | }↵ | | 5 | }↵
|
6 | else {↵ | | 6 | else {↵
|
7 | factory.getStatisticsImplementor().secondLevelCacheHit(↵ | | 7 | factory.getStatisticsImplementor().secondLevelCacheHit(↵
|
8 | persister.getCacheAccessStrategy().getRegion().getName()↵ | | 8 | persister.getCacheAccessStrategy().getRegion().getName()↵
|
9 | );↵ | | 9 | );↵
|
10 | } | | 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 | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 20.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
11 | if (ce == null) | | 8 | if (ce == null) |
12 | factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName()); | | 9 | factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName()); |
| | | | |
13 | factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName()); | | 10 | factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName()); |
Precondition Violations (6)
Row |
Violation |
1 | Expression persister.getCacheAccessStrategy() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
2 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() |
3 | Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister |
4 | Expression persister.getCacheAccessStrategy() is a method call throwing exception(s) that should be caught by a try block that will be extracted |
5 | Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() |
6 | Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister |