if ( p.hasCache() ) { 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 ( p.hasCache() ) { 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 evict(Class, Serializable) Method name: void evictCollection(String, Serializable)
Number of AST nodes: 5 Number of AST nodes: 5
1
if ( p.hasCache() ) {
1
if ( p.hasCache() ) {
2
			if ( log.isDebugEnabled() ) {
2
			if ( log.isDebugEnabled() ) {
3
				log.debug( "evicting second-level cache: " + MessageHelper.infoString(p, id, this) );
3
				log.debug( "evicting second-level cache: " + MessageHelper.collectionInfoString(p, id, this) );
4
			}
4
			}
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 );
6
			p.getCacheAccessStrategy().evict( cacheKey );
6
			p.getCacheAccessStrategy().evict( cacheKey );
7
		}
7
		}
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 comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1797.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (p.hasCache())
    2
    if (p.hasCache())
    2
    if (p.hasCache())
    Differences
    Expression1Expression2Difference
    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
    2
    if (p.hasCache())
    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
    Expression MessageHelper.infoString(p,id,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression MessageHelper.collectionInfoString(p,id,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Expression p.getIdentifierType() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.getKeyType() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Expression p.getRootEntityName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.getRole() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Expression p.getCacheAccessStrategy() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.getCacheAccessStrategy() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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 (14)
    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
    3Expression MessageHelper.infoString(p,id,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression MessageHelper.collectionInfoString(p,id,this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression p.getIdentifierType() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression p.getKeyType() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    8Expression p.getRootEntityName() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression p.getRole() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p
    11Expression p.getCacheAccessStrategy() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression p.getCacheAccessStrategy() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable p.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable p.getCacheAccessStrategy()
    14Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p