File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultEvictEventListener.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultMergeEventListener.java | |||
Method name: void onEvict(EvictEvent)
|
Method name: boolean existsInDatabase(Object, EventSource, EntityPersister)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | final Object entity = persistenceContext.removeEntity( key );↵ | |||
2 | if ( entity != null ) {↵ | |||
3 | EntityEntry e = event.getSession()↵ | 1 | if ( id != null ) {↵ | |
2 | EntityKey key = new EntityKey( id, persister, source.getEntityMode() );↵ | |||
4 | .getPersistenceContext().removeEntry( entity );↵ | 3 | Object managedEntity = source.getPersistenceContext().getEntity( key );↵ | |
5 | doEvict( entity, key, e.getPersister(), event.getSession() );↵ | 4 | entry = source.getPersistenceContext().getEntry( managedEntity );↵ | |
6 | } | 5 | } | |
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 in different classes |
Number of node comparisons | 13 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13 | final Object entity = persistenceContext.removeEntity(key); |
| | |||||||||||||||
14 | if (entity != null) |
| 4 | if (id != null) | ||||||||||||||
|
| 5 | EntityKey key = new EntityKey(id, persister, source.getEntityMode()); | |||||||||||||||
| 6 | Object managedEntity = source.getPersistenceContext().getEntity(key); | ||||||||||||||||
| 7 | entry = source.getPersistenceContext().getEntry(managedEntity); | ||||||||||||||||
15 | EntityEntry e = event.getSession().getPersistenceContext().removeEntry(entity); |
| | |||||||||||||||
16 | doEvict(entity, key, e.getPersister(), event.getSession()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement final Object entity=persistenceContext.removeEntity(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Type java.lang.Object of variable entity does not match with type java.io.Serializable of variable id |
3 | Unmatched statement EntityKey key=new EntityKey(id,persister,source.getEntityMode()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched statement EntityKey key=new EntityKey(id,persister,source.getEntityMode()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement EntityEntry e=event.getSession().getPersistenceContext().removeEntry(entity); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement doEvict(entity,key,e.getPersister(),event.getSession()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched statement doEvict(entity,key,e.getPersister(),event.getSession()); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
8 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |