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) | 1.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 factory=cfg.buildSessionFactory(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement FlushEntityEvent entityEvent=new FlushEntityEvent(source,me.getKey(),entry); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | 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 |
4 | Type int of variable listeners.length does not match with type int of variable resources.length |
5 | 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 |
6 | Unmatched statement cfg.addResource(resources[i]); 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 |
7 | 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 |
8 | Unmatched statement listeners[j].onFlushEntity(entityEvent); 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 |
9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |