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/mapping/Table.java | |||
Method name: void onEvict(EvictEvent)
|
Method name: String sqlCreateString(Dialect, Mapping, String, String)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 6 | |||
1 | if ( e != null↵ | 1 | Iterator ukiter = getUniqueKeyIterator();↵ | |
2 | ) {↵ | 2 | while ( ukiter.hasNext() ) {↵ | |
3 | EntityKey key = new EntityKey( e.getId(), e.getPersister(), source.getEntityMode() );↵ | 3 | ↵ | |
4 | persistenceContext.removeEntity( key );↵ | |||
5 | doEvict( object, key, e.getPersister(), source );↵ | 4 | UniqueKey uk = (UniqueKey) ukiter.next();↵ | |
5 | String constraint = uk.sqlConstraintString( dialect );↵ | |||
6 | if ( constraint != null ) {↵ | |||
7 | buf.append( ", " ).append( constraint );↵ | |||
8 | }↵ | |||
6 | } | 9 |
| |
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 | 8 |
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.3 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 39 | UniqueKey uk = (UniqueKey)ukiter.next(); | ||||||||||||||||
|
| 40 | String constraint = uk.sqlConstraintString(dialect); | |||||||||||||||
19 | if (e != null) |
| 41 | if (constraint != null) | ||||||||||||||
20 | EntityKey key = new EntityKey(e.getId(), e.getPersister(), source.getEntityMode()); |
| | |||||||||||||||
21 | persistenceContext.removeEntity(key); |
| | |||||||||||||||
22 | doEvict(object, key, e.getPersister(), source); |
| | |||||||||||||||
|
| 42 | buf.append(", ").append(constraint); |
Row | Violation |
---|---|
1 | Unmatched statement String constraint=uk.sqlConstraintString(dialect); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type org.hibernate.engine.EntityEntry of variable e does not match with type java.lang.String of variable constraint |
3 | Unmatched statement EntityKey key=new EntityKey(e.getId(),e.getPersister(),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(e.getId(),e.getPersister(),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 persistenceContext.removeEntity(key); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched statement doEvict(object,key,e.getPersister(),source); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
7 | Unmatched statement doEvict(object,key,e.getPersister(),source); 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 | Unmatched statement buf.append(", ").append(constraint); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |