if ( p.hasCache() ) { if ( log.isDebugEnabled() ) { log.debug( "evicting second-level cache: " + p.getRole() ); } p.getCacheAccessStrategy().evictAll(); }
if ( p.hasCache() ) { if ( log.isDebugEnabled() ) { log.debug( "evicting second-level cache: " + p.getEntityName() ); } p.getCacheAccessStrategy().evictAll(); }
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 evictCollection(String) Method name: void evict(Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
if ( p.hasCache() ) {
1
if ( p.hasCache() ) {
2
			if ( log.isDebugEnabled() ) {
2
			if ( log.isDebugEnabled() ) {
3
				log.debug( "evicting second-level cache: " + p.getRole() );
3
				log.debug( "evicting second-level cache: " + p.getEntityName() );
4
			}
4
			}
5
			p.getCacheAccessStrategy().evictAll();
5
			p.getCacheAccessStrategy().evictAll();
6
		}
6
		}
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 comparisons8
  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)0.8
    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.collection.CollectionPersisterorg.hibernate.persister.entity.EntityPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.collection.CollectionPersister of variable p does not match with type org.hibernate.persister.entity.EntityPersister of variable p
    • Make classes org.hibernate.persister.collection.CollectionPersister and org.hibernate.persister.entity.EntityPersister extend a common superclass
    2
    if (p.hasCache())
    3
    if (log.isDebugEnabled())
    3
    if (log.isDebugEnabled())
    4
    log.debug("evicting second-level cache: " + p.getRole());
    4
    log.debug("evicting second-level cache: " + p.getRole());
    4
    log.debug("evicting second-level cache: " + p.getEntityName());
    Differences
    Expression1Expression2Difference
    getRolegetEntityNameMETHOD_INVOCATION_NAME_MISMATCH
    org.hibernate.persister.collection.CollectionPersisterorg.hibernate.persister.entity.EntityPersisterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.persister.collection.CollectionPersister of variable p does not match with type org.hibernate.persister.entity.EntityPersister of variable p
    • Make classes org.hibernate.persister.collection.CollectionPersister and org.hibernate.persister.entity.EntityPersister extend a common superclass
    4
    log.debug("evicting second-level cache: " + p.getEntityName());
    5
    p.getCacheAccessStrategy().evictAll();
    5
    p.getCacheAccessStrategy().evictAll();
    5
    p.getCacheAccessStrategy().evictAll();
    Differences
    Expression1Expression2Difference
    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.access.CollectionRegionAccessStrategy of variable p.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable p.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 p does not match with type org.hibernate.persister.entity.EntityPersister of variable p
    • Make classes org.hibernate.persister.collection.CollectionPersister and org.hibernate.persister.entity.EntityPersister extend a common superclass
    5
    p.getCacheAccessStrategy().evictAll();
    Precondition Violations (4)
    Row Violation
    1Type org.hibernate.persister.collection.CollectionPersister of variable p does not match with type org.hibernate.persister.entity.EntityPersister of variable p
    2Type org.hibernate.persister.collection.CollectionPersister of variable p does not match with type org.hibernate.persister.entity.EntityPersister of variable p
    3Type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable p.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.EntityRegionAccessStrategy of variable p.getCacheAccessStrategy()
    4Type org.hibernate.persister.collection.CollectionPersister of variable p does not match with type org.hibernate.persister.entity.EntityPersister of variable p