EntityPersister p = getEntityPersister( persistentClass.getName() ); if ( p.hasCache() ) { if ( log.isDebugEnabled() ) { log.debug( "evicting second-level cache: " + p.getEntityName() ); } p.getCacheAccessStrategy().evictAll(); }
CollectionPersister p = getCollectionPersister( roleName ); if ( p.hasCache() ) { if ( log.isDebugEnabled() ) { log.debug( "evicting second-level cache: " + p.getRole() ); } 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 evict(Class) Method name: void evictCollection(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
EntityPersister p = getEntityPersister( persistentClass.getName() );
1
CollectionPersister p = getCollectionPersister( roleName );
2
		if ( p.hasCache() ) {
2
		if ( p.hasCache() ) {
3
			if ( log.isDebugEnabled() ) {
3
			if ( log.isDebugEnabled() ) {
4
				log.debug( "evicting second-level cache: " + p.getEntityName() );
4
				log.debug( "evicting second-level cache: " + p.getRole() );
5
			}
5
			}
6
			p.getCacheAccessStrategy().evictAll();
6
			p.getCacheAccessStrategy().evictAll();
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.1
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                        
    1
    CollectionPersister p = getCollectionPersister(roleName);
    1
    EntityPersister p = getEntityPersister(persistentClass.getName());
                                                                                                                                          
    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: " + p.getEntityName());
    4
    log.debug("evicting second-level cache: " + p.getEntityName());
    4
    log.debug("evicting second-level cache: " + p.getRole());
    Differences
    Expression1Expression2Difference
    getEntityNamegetRoleMETHOD_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
    4
    log.debug("evicting second-level cache: " + p.getRole());
    5
    p.getCacheAccessStrategy().evictAll();
    5
    p.getCacheAccessStrategy().evictAll();
    5
    p.getCacheAccessStrategy().evictAll();
    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
    5
    p.getCacheAccessStrategy().evictAll();
    Precondition Violations (4)
    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.cache.access.EntityRegionAccessStrategy of variable p.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable p.getCacheAccessStrategy()
    4Type org.hibernate.persister.entity.EntityPersister of variable p does not match with type org.hibernate.persister.collection.CollectionPersister of variable p