File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/event/def/AbstractFlushingEventListener.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/instrument/cases/AbstractExecutable.java | |||
Method name: void flushEntities(FlushEvent)
|
Method name: void prepare()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 5 | |||
1 | FlushEntityEvent entityEvent = new FlushEntityEvent( source, me.getKey(), entry );↵ | 1 | Configuration cfg = new Configuration().setProperty( Environment.HBM2DDL_AUTO, "create-drop" ); ↵ | |
2 | FlushEntityEventListener[] listeners = source.getListeners().getFlushEntityEventListeners();↵ | 2 | String[] resources = getResources(); ↵ | |
3 | for ( int j = 0; j < listeners.length; j++ ) {↵ | 3 | for ( int i = 0; i < resources.length; i++ ) { ↵ | |
4 | listeners[j].onFlushEntity(entityEvent);↵ | 4 | ↵ | |
5 | } | 5 | cfg.addResource( resources[i] );↵ | |
6 | }↵ | |||
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
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) | 0.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Configuration cfg = new Configuration().setProperty(Environment.HBM2DDL_AUTO, "create-drop"); | |||||||||||||||||||||||||
| 2 | String[] resources = getResources(); | |||||||||||||||||||||||||
| 5 | factory = cfg.buildSessionFactory(); | |||||||||||||||||||||||||
10 | FlushEntityEvent entityEvent = new FlushEntityEvent(source, me.getKey(), entry); | | |||||||||||||||||||||||||
11 | FlushEntityEventListener[] listeners = source.getListeners().getFlushEntityEventListeners(); |
| | ||||||||||||||||||||||||
12 | for (int j = 0; j < listeners.length; j++) |
| 3 | for (int i = 0; i < resources.length; i++) | |||||||||||||||||||||||
|
| 4 | cfg.addResource(resources[i]); | ||||||||||||||||||||||||
13 | listeners[j].onFlushEntity(entityEvent); |
| |
Row | Violation |
---|---|
1 | Unmatched statement FlushEntityEventListener[] listeners=source.getListeners().getFlushEntityEventListeners(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Type org.hibernate.event.FlushEntityEventListener[] of variable listeners does not match with type java.lang.String[] of variable resources |
3 | Unmatched statement cfg.addResource(resources[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement listeners[j].onFlushEntity(entityEvent); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |