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 testMixNativeAssigned()
|
|||
Number of AST nodes: 17 | Number of AST nodes: 18 | |||
1 | Session s = openSession();↵ | 1 | Session s = openSession();↵ | |
2 | Baz baz = new Baz();↵ | 2 | ↵ | |
3 | List list = new ArrayList();↵ | |||
4 | baz.setBazez(list↵ | 3 | Category c = new Category();↵ | |
4 | c.setName("NAME");↵ | |||
5 | Assignable assn = new Assignable();↵ | |||
5 | );↵ | 6 | assn.setId("i.d.");↵ | |
6 | list.add( new Baz() );↵ | 7 | List↵ | |
7 | s.save(baz);↵ | |||
8 | s.flush();↵ | |||
9 | list.add( new Baz() );↵ | |||
10 | s.flush();↵ | |||
11 | list.add( 0, new Baz() );↵ | |||
12 | s.flush();↵ | |||
13 | s.delete( list.remove(1) );↵ | |||
14 | s.flush↵ | 8 | l = new ArrayList();↵ | |
9 | l.add(c);↵ | |||
10 | assn.setCategories(l);↵ | |||
11 | c.setAssignable(assn);↵ | |||
12 | s.save(assn);↵ | |||
13 | s.flush();↵ | |||
14 | s.connection().commit();↵ | |||
15 | s.close();↵ | |||
15 | ();↵ | 16 | s = openSession();↵ | |
16 | s.delete(baz);↵ | 17 | s.delete(assn);↵ | |
17 | s.flush();↵ | 18 | s.flush();↵ | |
18 | s.connection().commit();↵ | 19 | s.connection().commit();↵ | |
19 | s.close(); | 20 |
| |
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 | 250 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 9 |
Number of unmapped statements in the second code fragment | 10 |
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 | Category c = new Category(); | |||||||||||||||||||||
2 | Baz baz = new Baz(); | | |||||||||||||||||||||
| 3 | c.setName("NAME"); | |||||||||||||||||||||
| 4 | Assignable assn = new Assignable(); | |||||||||||||||||||||
| 5 | assn.setId("i.d."); | |||||||||||||||||||||
3 | List list = new ArrayList(); |
| 6 | List l = new ArrayList(); | |||||||||||||||||||
4 | baz.setBazez(list); | | |||||||||||||||||||||
5 | list.add(new Baz()); | | |||||||||||||||||||||
| 7 | l.add(c); | |||||||||||||||||||||
| 8 | assn.setCategories(l); | |||||||||||||||||||||
| 9 | c.setAssignable(assn); | |||||||||||||||||||||
6 | s.save(baz); |
| 10 | s.save(assn); | |||||||||||||||||||
7 | s.flush(); |
| 15 | s.delete(assn); | |||||||||||||||||||
8 | list.add(new Baz()); | | |||||||||||||||||||||
9 | s.flush(); | | |||||||||||||||||||||
10 | list.add(0, new Baz()); | | |||||||||||||||||||||
11 | s.flush(); | 11 | s.flush(); | ||||||||||||||||||||
| 12 | s.connection().commit(); | |||||||||||||||||||||
12 | s.delete(list.remove(1)); | | |||||||||||||||||||||
13 | s.flush(); | | |||||||||||||||||||||
|
| 14 | s = openSession(); | ||||||||||||||||||||
14 | s.delete(baz); | | |||||||||||||||||||||
15 | s.flush(); | 16 | s.flush(); | ||||||||||||||||||||
16 | s.connection().commit(); | 17 | s.connection().commit(); | ||||||||||||||||||||
17 | s.close(); | 13 | s.close(); | ||||||||||||||||||||
| 18 | s.close(); |
Row | Violation |
---|---|
1 | Type org.hibernate.test.legacy.Baz of variable baz does not match with type org.hibernate.test.legacy.Assignable of variable assn |
2 | Expression s.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression s.flush() is a void method call, and thus it cannot be parameterized |
4 | Expression s.delete(assn) is a void method call, and thus it cannot be parameterized |
5 | Expression s.flush() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression s.flush() is a void method call, and thus it cannot be parameterized |
7 | Expression s.delete(assn) is a void method call, and thus it cannot be parameterized |
8 | Unmatched statement s=openSession(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Clone fragment #1 returns variables list, s , while Clone fragment #2 returns variables l, s |