CacheKey key = new CacheKey( entityKey.getIdentifier(), persister.getIdentifierType(), entityKey.getEntityName(), entityMode, context.getSession().getFactory() ); return persister.getCacheAccessStrategy().get( key, context.getSession().getTimestamp() ) != null;
CacheKey cacheKey = new CacheKey( collectionKey, persister.getKeyType(), persister.getRole(), entityMode, context.getSession().getFactory() ); return persister.getCacheAccessStrategy().get( cacheKey, context.getSession().getTimestamp() ) != null;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/BatchFetchQueue.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/engine/BatchFetchQueue.java
Method name: boolean isCached(EntityKey, EntityPersister, EntityMode) Method name: boolean isCached(Serializable, CollectionPersister, EntityMode)
Number of AST nodes: 2 Number of AST nodes: 2
1
CacheKey key = new CacheKey(
1
CacheKey cacheKey = new CacheKey(
2
					entityKey.getIdentifier(),
2
					
3
					
3
collectionKey,
4
persister.getIdentifierType(),
4
			        persister.getKeyType(),
5
					entityKey.getEntityName(),
5
			
6
					
6
        persister.getRole(),
7
entityMode,
7
			        entityMode,
8
					context.getSession().getFactory()
8
			        context.getSession().getFactory()
9
			);
9
			);
10
			return persister.getCacheAccessStrategy().get( key, context.getSession().getTimestamp() ) != null;
10
			return persister.getCacheAccessStrategy().get( cacheKey, context.getSession().getTimestamp() ) != null;
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.0
Clones locationClones are declared in the same class
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                      
    2
    CacheKey cacheKey = new CacheKey(collectionKey, persister.getKeyType(), persister.getRole(), entityMode, context.getSession().getFactory());
    2
    CacheKey key = new CacheKey(entityKey.getIdentifier(), persister.getIdentifierType(), entityKey.getEntityName(), entityMode, context.getSession().getFactory());
                                                                                                                                                                                                                                                                                                                              
    3
    return persister.getCacheAccessStrategy().get(key, context.getSession().getTimestamp()) != null;
    3
    return persister.getCacheAccessStrategy().get(key, context.getSession().getTimestamp()) != null;
    3
    return persister.getCacheAccessStrategy().get(cacheKey, context.getSession().getTimestamp()) != null;
    Differences
    Expression1Expression2Difference
    keycacheKeyVARIABLE_NAME_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.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
    3
    return persister.getCacheAccessStrategy().get(cacheKey, context.getSession().getTimestamp()) != null;
    Precondition Violations (2)
    Row Violation
    1Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy()
    2Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister