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/DefaultLoadEventListener.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultInitializeCollectionEventListener.java
Method name: Object loadFromSecondLevelCache(LoadEvent, EntityPersister, LoadEventListener.LoadType) Method name: boolean initializeCollectionFromCache(Serializable, CollectionPersister, PersistentCollection, SessionImplementor)
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
				
12
			}
13
			}
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.2
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)9.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    if (factory.getStatistics().isStatisticsEnabled())
    10
    if (factory.getStatistics().isStatisticsEnabled())
    8
    if (ce == null)
    11
    if (ce == null)
    9
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    9
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    12
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    Differences
    Expression1Expression2Difference
    org.hibernate.cache.EntityRegionorg.hibernate.cache.CollectionRegionVARIABLE_TYPE_MISMATCH
    org.hibernate.cache.access.EntityRegionAccessStrategyorg.hibernate.cache.access.CollectionRegionAccessStrategyVARIABLE_TYPE_MISMATCH
    org.hibernate.persister.entity.EntityPersisterorg.hibernate.persister.collection.CollectionPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion()
    • Make classes org.hibernate.cache.EntityRegion and org.hibernate.cache.CollectionRegion extend a common superclass
    Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    • Make classes org.hibernate.cache.access.EntityRegionAccessStrategy and org.hibernate.cache.access.CollectionRegionAccessStrategy extend a common superclass
    Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister
    • Make classes org.hibernate.persister.entity.EntityPersister and org.hibernate.persister.collection.CollectionPersister extend a common superclass
    12
    factory.getStatisticsImplementor().secondLevelCacheMiss(persister.getCacheAccessStrategy().getRegion().getName());
    else
    else
    10
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    10
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    13
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    Differences
    Expression1Expression2Difference
    org.hibernate.cache.EntityRegionorg.hibernate.cache.CollectionRegionVARIABLE_TYPE_MISMATCH
    org.hibernate.cache.access.EntityRegionAccessStrategyorg.hibernate.cache.access.CollectionRegionAccessStrategyVARIABLE_TYPE_MISMATCH
    org.hibernate.persister.entity.EntityPersisterorg.hibernate.persister.collection.CollectionPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion()
    • Make classes org.hibernate.cache.EntityRegion and org.hibernate.cache.CollectionRegion extend a common superclass
    Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    • Make classes org.hibernate.cache.access.EntityRegionAccessStrategy and org.hibernate.cache.access.CollectionRegionAccessStrategy extend a common superclass
    Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister
    • Make classes org.hibernate.persister.entity.EntityPersister and org.hibernate.persister.collection.CollectionPersister extend a common superclass
    13
    factory.getStatisticsImplementor().secondLevelCacheHit(persister.getCacheAccessStrategy().getRegion().getName());
    Precondition Violations (6)
    Row Violation
    1Type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion()
    2Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    3Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister
    4Type org.hibernate.cache.EntityRegion of variable persister.getCacheAccessStrategy().getRegion() does not match with type org.hibernate.cache.CollectionRegion of variable persister.getCacheAccessStrategy().getRegion()
    5Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    6Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister