File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/MasterDetailTest.java | |||
Method name: void testBagOneToMany()
|
Method name: void testNoUpdateManyToOne()
|
|||
Number of AST nodes: 17 | Number of AST nodes: 19 | |||
1 | Session s = openSession();↵ | 1 | Session s = openSession();↵ | |
2 | Baz baz = new Baz();↵ | 2 | W w1 = new W();↵ | |
3 | List list = new ArrayList();↵ | 3 | ↵ | |
4 | baz.setBazez(list);↵ | |||
5 | list.add( new Baz() ↵ | 4 | W w2 = new W();↵ | |
5 | Z z = new Z();↵ | |||
6 | );↵ | 6 | z.setW(w1);↵ | |
7 | s.save(baz);↵ | 7 | s.save(z);↵ | |
8 | s.flush();↵ | 8 | s.flush();↵ | |
9 | list.add( new Baz() );↵ | 9 | ↵ | |
10 | s.flush();↵ | |||
11 | list.add( 0, new Baz() ↵ | 10 | z.setW(w2);↵ | |
11 | s.flush();↵ | |||
12 | );↵ | 12 | s.connection().commit();↵ | |
13 | s.flush();↵ | 13 | s.close();↵ | |
14 | s.delete( list.remove(1) ↵ | 14 | s = openSession();↵ | |
15 | );↵ | 15 | s.update(z);↵ | |
16 | s.flush();↵ | 16 | s.flush();↵ | |
17 | s.delete(baz↵ | 17 | s.delete(z);↵ | |
18 | );↵ | 18 | s.delete("from W");↵ | |
19 | s.flush();↵ | 19 | s.flush();↵ | |
20 | s.connection().commit();↵ | 20 | s.connection().commit();↵ | |
21 | s.close(); | 21 |
| |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 215 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 9 |
Number of unmapped statements in the second code fragment | 11 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Session s = openSession(); | 1 | Session s = openSession(); | |||||||||||||||
| 2 | W w1 = new W(); | ||||||||||||||||
2 | Baz baz = new Baz(); | | ||||||||||||||||
| 3 | W w2 = new W(); | ||||||||||||||||
3 | List list = new ArrayList(); | | ||||||||||||||||
| 4 | Z z = new Z(); | ||||||||||||||||
4 | baz.setBazez(list); |
| | |||||||||||||||
|
| 5 | z.setW(w1); | |||||||||||||||
5 | list.add(new Baz()); | | ||||||||||||||||
6 | s.save(baz); |
| 6 | s.save(z); | ||||||||||||||
7 | s.flush(); | 7 | s.flush(); | |||||||||||||||
|
| 8 | z.setW(w2); | |||||||||||||||
8 | list.add(new Baz()); | | ||||||||||||||||
9 | s.flush(); | 9 | s.flush(); | |||||||||||||||
10 | list.add(0, new Baz()); | | ||||||||||||||||
11 | s.flush(); |
| | |||||||||||||||
|
| 12 | s = openSession(); | |||||||||||||||
12 | s.delete(list.remove(1)); |
| | |||||||||||||||
| 13 | s.update(z); | ||||||||||||||||
13 | s.flush(); | 14 | s.flush(); | |||||||||||||||
14 | s.delete(baz); |
| | |||||||||||||||
| 15 | s.delete(z); | ||||||||||||||||
|
| 16 | s.delete("from W"); | |||||||||||||||
15 | s.flush(); | 17 | s.flush(); | |||||||||||||||
16 | s.connection().commit(); | 10 | s.connection().commit(); | |||||||||||||||
17 | s.close(); | 11 | s.close(); | |||||||||||||||
| 18 | s.connection().commit(); | ||||||||||||||||
| 19 | s.close(); |
Row | Violation |
---|---|
1 | Unmatched statement baz.setBazez(list); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement z.setW(w1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Type org.hibernate.test.legacy.Baz of variable baz does not match with type org.hibernate.test.legacy.Z of variable z |
4 | Unmatched statement z.setW(w2); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched statement s.flush(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement s=openSession(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement s.delete(list.remove(1)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement s.delete(baz); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched statement s.delete("from W"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |