if ( log.isDebugEnabled() ) { log.debug( "evicting second-level cache: " + MessageHelper.infoString(p, id, this) ); } CacheKey cacheKey = new CacheKey( id, p.getIdentifierType(), p.getRootEntityName(), EntityMode.POJO, this ); p.getCacheAccessStrategy().evict( cacheKey );
if ( log.isDebugEnabled() ) { log.debug( "evicting second-level cache: " + MessageHelper.collectionInfoString(p, id, this) ); } CacheKey cacheKey = new CacheKey( id, p.getKeyType(), p.getRole(), EntityMode.POJO, this ); p.getCacheAccessStrategy().evict( cacheKey );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/impl/SessionFactoryImpl.java
Method name: void evictEntity(String, Serializable) Method name: void evictCollection(String, Serializable)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( log.isDebugEnabled() ) {
1
if ( log.isDebugEnabled() ) {
2
				log.debug( "evicting second-level cache: " + MessageHelper.infoString(p, id, this) );
2
				log.debug( "evicting second-level cache: " + MessageHelper.collectionInfoString(p, id, this) );
3
			}
3
			}
4
			CacheKey cacheKey = new CacheKey( id, p.getIdentifierType(), p.getRootEntityName(), EntityMode.POJO, this );
4
			CacheKey cacheKey = new CacheKey( id, p.getKeyType(), p.getRole(), EntityMode.POJO, this );
5
			p.getCacheAccessStrategy().evict( cacheKey );
5
			p.getCacheAccessStrategy().evict( cacheKey );
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 declared in the same class
Number of node comparisons7
  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)1699.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (log.isDebugEnabled())
    3
    if (log.isDebugEnabled())
    4
    log.debug("evicting second-level cache: " + MessageHelper.infoString(p, id, this));
    4
    log.debug("evicting second-level cache: " + MessageHelper.infoString(p, id, this));
    4
    log.debug("evicting second-level cache: " + MessageHelper.collectionInfoString(p, id, this));
    Differences
    Expression1Expression2Difference
    org.hibernate.persister.entity.EntityPersisterorg.hibernate.persister.collection.CollectionPersisterVARIABLE_TYPE_MISMATCH
    infoStringcollectionInfoStringMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    • Make classes org.hibernate.persister.entity.EntityPersister and org.hibernate.persister.collection.CollectionPersister extend a common superclass
    4
    log.debug("evicting second-level cache: " + MessageHelper.collectionInfoString(p, id, this));
    5
    CacheKey cacheKey = new CacheKey(id, p.getIdentifierType(), p.getRootEntityName(), EntityMode.POJO, this);
    5
    CacheKey cacheKey = new CacheKey(id, p.getIdentifierType(), p.getRootEntityName(), EntityMode.POJO, this);
    5
    CacheKey cacheKey = new CacheKey(id, p.getKeyType(), p.getRole(), EntityMode.POJO, this);
    Differences
    Expression1Expression2Difference
    getIdentifierTypegetKeyTypeMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.persister.entity.EntityPersisterorg.hibernate.persister.collection.CollectionPersisterVARIABLE_TYPE_MISMATCH
    getRootEntityNamegetRoleMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.persister.entity.EntityPersisterorg.hibernate.persister.collection.CollectionPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    • Make classes org.hibernate.persister.entity.EntityPersister and org.hibernate.persister.collection.CollectionPersister extend a common superclass
    Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    • Make classes org.hibernate.persister.entity.EntityPersister and org.hibernate.persister.collection.CollectionPersister extend a common superclass
    5
    CacheKey cacheKey = new CacheKey(id, p.getKeyType(), p.getRole(), EntityMode.POJO, this);
    6
    p.getCacheAccessStrategy().evict(cacheKey);
    6
    p.getCacheAccessStrategy().evict(cacheKey);
    6
    p.getCacheAccessStrategy().evict(cacheKey);
    Differences
    Expression1Expression2Difference
    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.access.EntityRegionAccessStrategy of variable p.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable p.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 p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    • Make classes org.hibernate.persister.entity.EntityPersister and org.hibernate.persister.collection.CollectionPersister extend a common superclass
    6
    p.getCacheAccessStrategy().evict(cacheKey);
    Precondition Violations (5)
    Row Violation
    1Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    2Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    3Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    4Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable p.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable p.getCacheAccessStrategy()
    5Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p