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: 4 | Number of AST nodes: 4 | |||
1 | if ( persister.hasCache() ) {↵ | 1 | if ( persister.hasCache() ) {↵ | |
2 | CacheKey key = new CacheKey(↵ | 2 | CacheKey cacheKey = new CacheKey(↵ | |
3 | entityKey.getIdentifier(),↵ | 3 | ↵ | |
4 | ↵ | 4 | collectionKey,↵ | |
5 | persister.getIdentifierType(),↵ | 5 | persister.getKeyType(),↵ | |
6 | entityKey.getEntityName(),↵ | 6 | ↵ | |
7 | ↵ | 7 | persister.getRole(),↵ | |
8 | entityMode,↵ | 8 | entityMode,↵ | |
9 | context.getSession().getFactory()↵ | 9 | context.getSession().getFactory()↵ | |
10 | );↵ | 10 | );↵ | |
11 | return persister.getCacheAccessStrategy().get( key, context.getSession().getTimestamp() ) != null;↵ | 11 | return persister.getCacheAccessStrategy().get( cacheKey, context.getSession().getTimestamp() ) != null;↵ | |
12 | }↵ | 12 | }↵ | |
13 | return false; | 13 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 20.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (persister.hasCache()) |
| 1 | if (persister.hasCache()) | ||||||||||||||||||||
|
| 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(cacheKey, context.getSession().getTimestamp()) != null; | ||||||||||||||||||||
4 | return false; | 4 | return false; |
Row | Violation |
---|---|
1 | Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister |
2 | Unmatched statement CacheKey cacheKey=new CacheKey(collectionKey,persister.getKeyType(),persister.getRole(),entityMode,context.getSession().getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement CacheKey key=new CacheKey(entityKey.getIdentifier(),persister.getIdentifierType(),entityKey.getEntityName(),entityMode,context.getSession().getFactory()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Expression persister.getCacheAccessStrategy() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression persister.getCacheAccessStrategy() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Type org.hibernate.cache.access.EntityRegionAccessStrategy of variable persister.getCacheAccessStrategy() does not match with type org.hibernate.cache.access.CollectionRegionAccessStrategy of variable persister.getCacheAccessStrategy() |
7 | Type org.hibernate.persister.entity.EntityPersister of variable persister does not match with type org.hibernate.persister.collection.CollectionPersister of variable persister |