if ( factory.getStatistics().isStatisticsEnabled() ) { if ( ce == null ) { factory.getStatisticsImplementor().secondLevelCacheMiss( persister.getCacheAccessStrategy().getRegion().getName() ); } else { factory.getStatisticsImplementor().secondLevelCacheHit( persister.getCacheAccessStrategy().getRegion().getName() ); } }
if ( factory.getStatistics().isStatisticsEnabled() ) { 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: 4 Number of AST nodes: 4
1
if ( factory.getStatistics().isStatisticsEnabled() ) {
1
if ( factory.getStatistics().isStatisticsEnabled() ) {
2
				if ( ce == null ) {
2
				if ( ce == null ) {
3
					factory.getStatisticsImplementor().secondLevelCacheMiss(
3
					factory.getStatisticsImplementor().secondLevelCacheMiss(
4
							persister.getCacheAccessStrategy().getRegion().getName()
4
							persister.getCacheAccessStrategy().getRegion().getName()
5
					);
5
					);
6
				}
6
				}
7
				else {
7
				else {
8
					factory.getStatisticsImplementor().secondLevelCacheHit(
8
					factory.getStatisticsImplementor().secondLevelCacheHit(
9
							persister.getCacheAccessStrategy().getRegion().getName()
9
							persister.getCacheAccessStrategy().getRegion().getName()
10
					);
10
					);
11
				}
11
				}
12
				
13
			}
12
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (factory.getStatistics().isStatisticsEnabled())
    7
    if (factory.getStatistics().isStatisticsEnabled())
    11
    if (ce == null)
    8
    if (ce == null)
    12
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    12
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    9
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    Differences
    Expression1Expression2Difference
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionVARIABLE_TYPE_MISMATCH
    org.hibernate.cache.access.CollectionRegionAccessStrategyorg.hibernate.cache.access.EntityRegionAccessStrategyVARIABLE_TYPE_MISMATCH
    org.hibernate.persister.collection.CollectionPersisterorg.hibernate.persister.entity.EntityPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion()
    • Make classes org.hibernate.cache.CollectionRegion and org.hibernate.cache.EntityRegion extend a common superclass
    Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    • Make classes org.hibernate.cache.access.CollectionRegionAccessStrategy and org.hibernate.cache.access.EntityRegionAccessStrategy extend a common superclass
    Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister
    • Make classes org.hibernate.persister.collection.CollectionPersister and org.hibernate.persister.entity.EntityPersister extend a common superclass
    9
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    else
    else
    13
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    13
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    10
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    Differences
    Expression1Expression2Difference
    org.hibernate.cache.CollectionRegionorg.hibernate.cache.EntityRegionVARIABLE_TYPE_MISMATCH
    org.hibernate.cache.access.CollectionRegionAccessStrategyorg.hibernate.cache.access.EntityRegionAccessStrategyVARIABLE_TYPE_MISMATCH
    org.hibernate.persister.collection.CollectionPersisterorg.hibernate.persister.entity.EntityPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion()
    • Make classes org.hibernate.cache.CollectionRegion and org.hibernate.cache.EntityRegion extend a common superclass
    Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    • Make classes org.hibernate.cache.access.CollectionRegionAccessStrategy and org.hibernate.cache.access.EntityRegionAccessStrategy extend a common superclass
    Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister
    • Make classes org.hibernate.persister.collection.CollectionPersister and org.hibernate.persister.entity.EntityPersister extend a common superclass
    10
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    Precondition Violations (6)
    Row Violation
    1Type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion()
    2Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    3Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister
    4Type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion()
    5Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    6Type org.hibernate.persister.collection.CollectionPersister of variable persister does not match with type org.hibernate.persister.entity.EntityPersister of variable persister