Session s = openSession(); Transaction t = s.beginTransaction(); Broken b = new Fixed(); b.setId( new Long(123)); b.setOtherId("foobar"); s.save(b); s.flush(); b.setTimestamp( new Date() ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); s.update(b); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); b = (Broken) s.load( Broken.class, b ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); s.delete(b); t.commit(); s.close();
Session s = openSession(); Transaction t = s.beginTransaction(); Broken b = new Fixed(); b.setId( new Long(123)); b.setOtherId("foobar"); s.save(b); s.flush(); b.setTimestamp( new Date() ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); s.update(b); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); b = (Broken) s.load( Broken.class, b ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); s.delete(b); t.commit(); s.close();
Clone fragments detected by clone detection tool
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
		s.close();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons131
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements25
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 1
    Mapped Statements
    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();
    Precondition Violations (0)
    Row Violation