File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/SQLFunctionsTest.java | File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/dialect/functional/cache/SQLFunctionsInterSystemsTest.java | |||
Method name: void testBroken()
|
Method name: void testBroken()
|
|||
Number of AST nodes: 25 | Number of AST nodes: 25 | |||
1 | Session s = openSession();↵ | 1 | Session s = openSession(); ↵ | |
2 | Transaction t = s.beginTransaction();↵ | 2 | Transaction t = s.beginTransaction(); ↵ | |
3 | Broken b = new Fixed();↵ | 3 | Broken b = new Fixed(); ↵ | |
4 | b.setId( new Long(123));↵ | 4 | b.setId( new Long(123)); ↵ | |
5 | b.setOtherId("foobar");↵ | 5 | b.setOtherId("foobar"); ↵ | |
6 | s.save(b);↵ | 6 | s.save(b); ↵ | |
7 | s.flush();↵ | 7 | s.flush(); ↵ | |
8 | b.setTimestamp( new Date() );↵ | 8 | b.setTimestamp( new Date() ); ↵ | |
9 | t.commit();↵ | 9 | t.commit(); ↵ | |
10 | s.close();↵ | 10 | s.close();↵ | |
11 | ↵ | |||
11 | s = openSession();↵ | 12 | s = openSession(); ↵ | |
12 | t = s.beginTransaction();↵ | 13 | t = s.beginTransaction(); ↵ | |
13 | s.update(b);↵ | 14 | s.update(b); ↵ | |
14 | t.commit();↵ | 15 | t.commit(); ↵ | |
15 | s.close();↵ | 16 | s.close();↵ | |
17 | ↵ | |||
16 | s = openSession();↵ | 18 | s = openSession(); ↵ | |
17 | t = s.beginTransaction();↵ | 19 | t = s.beginTransaction(); ↵ | |
18 | b = (Broken) s.load( Broken.class, b );↵ | 20 | b = (Broken) s.load( Broken.class, b ); ↵ | |
19 | t.commit();↵ | 21 | t.commit(); ↵ | |
20 | s.close();↵ | 22 | s.close();↵ | |
23 | ↵ | |||
21 | s = openSession();↵ | 24 | s = openSession(); ↵ | |
22 | t = s.beginTransaction();↵ | 25 | t = s.beginTransaction(); ↵ | |
23 | s.delete(b);↵ | 26 | s.delete(b); ↵ | |
24 | t.commit();↵ | 27 | t.commit(); ↵ | |
25 | s.close(); | 28 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 131 |
Number of mapped statements | 25 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | Session s = openSession(); | 1 | Session s = openSession(); | |
2 | Transaction t = s.beginTransaction(); | 2 | Transaction t = s.beginTransaction(); | |
3 | Broken b = new Fixed(); | 3 | Broken b = new Fixed(); | |
4 | b.setId(new Long(123)); | 4 | b.setId(new Long(123)); | |
5 | b.setOtherId("foobar"); | 5 | b.setOtherId("foobar"); | |
6 | s.save(b); | 6 | s.save(b); | |
7 | s.flush(); | 7 | s.flush(); | |
8 | b.setTimestamp(new Date()); | 8 | b.setTimestamp(new Date()); | |
9 | t.commit(); | 9 | t.commit(); | |
10 | s.close(); | 10 | s.close(); | |
11 | s = openSession(); | 11 | s = openSession(); | |
12 | t = s.beginTransaction(); | 12 | t = s.beginTransaction(); | |
13 | s.update(b); | 13 | s.update(b); | |
14 | t.commit(); | 14 | t.commit(); | |
15 | s.close(); | 15 | s.close(); | |
16 | s = openSession(); | 16 | s = openSession(); | |
17 | t = s.beginTransaction(); | 17 | t = s.beginTransaction(); | |
18 | b = (Broken)s.load(Broken.class, b); | 18 | b = (Broken)s.load(Broken.class, b); | |
19 | t.commit(); | 19 | t.commit(); | |
20 | s.close(); | 20 | s.close(); | |
21 | s = openSession(); | 21 | s = openSession(); | |
22 | t = s.beginTransaction(); | 22 | t = s.beginTransaction(); | |
23 | s.delete(b); | 23 | s.delete(b); | |
24 | t.commit(); | 24 | t.commit(); | |
25 | s.close(); | 25 | s.close(); |
Row | Violation |
---|