File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/cfg/Configuration.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/DefaultEvictEventListener.java | |||
Method name: String[] generateSchemaCreationScript(Dialect)
|
Method name: void onEvict(EvictEvent)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 5 | |||
1 | if ( !dialect.supportsUniqueConstraintInCreateAlterTable() ) {↵ | |||
2 | Iterator subIter = table.getUniqueKeyIterator();↵ | 1 | EntityEntry e = persistenceContext.removeEntry( object );↵ | |
3 | while ( subIter.hasNext() ) {↵ | 2 | if ( e != null ) {↵ | |
4 | UniqueKey uk = (UniqueKey) subIter.next();↵ | 3 | EntityKey ↵ | |
5 | String constraintString = uk.sqlCreateString( dialect, mapping, defaultCatalog, defaultSchema );↵ | |||
6 | if (constraintString != null) script.add( constraintString );↵ | |||
7 | }↵ | |||
8 | ↵ | 4 | key = new EntityKey( e.getId(), e.getPersister(), source.getEntityMode() );↵ | |
5 | persistenceContext.removeEntity( key );↵ | |||
6 | doEvict( object, key, e.getPersister(), source );↵ | |||
9 | } | 7 |
| |
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 | 10 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 18 | EntityEntry e = persistenceContext.removeEntry(object); | ||||||||||||||||
20 | UniqueKey uk = (UniqueKey)subIter.next(); | | ||||||||||||||||
21 | String constraintString = uk.sqlCreateString(dialect, mapping, defaultCatalog, defaultSchema); |
| | |||||||||||||||
22 | if (constraintString != null) |
| 19 | if (e != null) | ||||||||||||||
|
| 20 | EntityKey key = new EntityKey(e.getId(), e.getPersister(), source.getEntityMode()); | |||||||||||||||
|
| 21 | persistenceContext.removeEntity(key); | |||||||||||||||
|
| 22 | doEvict(object, key, e.getPersister(), source); | |||||||||||||||
23 | script.add(constraintString); |
| |
Row | Violation |
---|---|
1 | Unmatched statement String constraintString=uk.sqlCreateString(dialect,mapping,defaultCatalog,defaultSchema); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type java.lang.String of variable constraintString does not match with type org.hibernate.engine.EntityEntry of variable e |
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 script.add(constraintString); 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 |