Session s = openSession(); Transaction t = s.beginTransaction(); User gavin = new User("gavin", "secret"); User turin = new User("turin", "tiger"); Group g = new Group("developers"); g.getUsers().put("gavin", gavin); g.getUsers().put("turin", turin); s.persist(g); gavin.getSession().put( "foo", new SessionAttribute("foo", "foo bar baz") ); gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); assertEquals( g.getUsers().size(), 2 ); g.getUsers().remove("turin"); Map smap = ( (User) g.getUsers().get("gavin") ).getSession(); assertEquals(smap.size(), 2); smap.remove("bar"); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); assertEquals( g.getUsers().size(), 1 ); smap = ( (User) g.getUsers().get("gavin") ).getSession(); assertEquals(smap.size(), 1); gavin = (User) g.getUsers().put("gavin", turin); s.delete(gavin); assertEquals( s.createQuery("select count(*) from SessionAttribute").uniqueResult(), new Long(0) ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); assertEquals( g.getUsers().size(), 1 ); turin = (User) g.getUsers().get("turin"); smap = turin.getSession(); assertEquals(smap.size(), 0); assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(1) ); s.delete(g); s.delete(turin); assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(0) ); t.commit(); s.close();
Session s = openSession(); Transaction t = s.beginTransaction(); User gavin = new User("gavin", "secret"); User turin = new User("turin", "tiger"); Group g = new Group("developers"); g.getUsers().put("gavin", gavin); g.getUsers().put("turin", turin); s.persist(g); gavin.getSession().put( "foo", new SessionAttribute("foo", "foo bar baz") ); gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); assertEquals( g.getUsers().size(), 2 ); g.getUsers().remove("turin"); Map smap = ( (User) g.getUsers().get("gavin") ).getSession(); assertEquals(smap.size(), 2); smap.remove("bar"); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); assertEquals( g.getUsers().size(), 1 ); smap = ( (User) g.getUsers().get("gavin") ).getSession(); assertEquals(smap.size(), 1); gavin = (User) g.getUsers().put("gavin", turin); s.delete(gavin); assertEquals( s.createQuery("select count(*) from SessionAttribute").uniqueResult(), new Long(0) ); t.commit(); s.close(); s = openSession(); t = s.beginTransaction(); g = (Group) s.get(Group.class, "developers"); assertEquals( g.getUsers().size(), 1 ); turin = (User) g.getUsers().get("turin"); smap = turin.getSession(); assertEquals(smap.size(), 0); assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(1) ); s.delete(g); s.delete(turin); assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(0) ); 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/extralazy/ExtraLazyTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/map/MapIndexFormulaTest.java
Method name: void testIndexFormulaMap() Method name: void testIndexFormulaMap()
Number of AST nodes: 46 Number of AST nodes: 46
1
Session s = openSession();
1
Session s = openSession();
2
		Transaction t = s.beginTransaction();
2
		Transaction t = s.beginTransaction();
3
		User gavin = new User("gavin", "secret");
3
		User gavin = new User("gavin", "secret");
4
		User turin = new User("turin", "tiger");
4
		User turin = new User("turin", "tiger");
5
		Group g = new Group("developers");
5
		Group g = new Group("developers");
6
		g.getUsers().put("gavin", gavin);
6
		g.getUsers().put("gavin", gavin);
7
		g.getUsers().put("turin", turin);
7
		g.getUsers().put("turin", turin);
8
		s.persist(g);
8
		s.persist(g);
9
		gavin.getSession().put( "foo", new SessionAttribute("foo", "foo bar baz") );
9
		gavin.getSession().put( "foo", new SessionAttribute("foo", "foo bar baz") );
10
		gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") );
10
		gavin.getSession().put( "bar", new SessionAttribute("bar", "foo bar baz 2") );
11
		t.commit();
11
		t.commit();
12
		s.close();
12
		s.close();
13
		
13
		
14
		s = openSession();
14
		s = openSession();
15
		t = s.beginTransaction();
15
		t = s.beginTransaction();
16
		g = (Group) s.get(Group.class, "developers");
16
		g = (Group) s.get(Group.class, "developers");
17
		assertEquals( g.getUsers().size(), 2 );
17
		assertEquals( g.getUsers().size(), 2 );
18
		g.getUsers().remove("turin");
18
		g.getUsers().remove("turin");
19
		Map smap = ( (User) g.getUsers().get("gavin") ).getSession();
19
		Map smap = ( (User) g.getUsers().get("gavin") ).getSession();
20
		assertEquals(smap.size(), 2);
20
		assertEquals(smap.size(), 2);
21
		smap.remove("bar");
21
		smap.remove("bar");
22
		t.commit();
22
		t.commit();
23
		s.close();
23
		s.close();
24
		s = openSession();
24
		s = openSession();
25
		t = s.beginTransaction();
25
		t = s.beginTransaction();
26
		g = (Group) s.get(Group.class, "developers");
26
		g = (Group) s.get(Group.class, "developers");
27
		assertEquals( g.getUsers().size(), 1 );
27
		assertEquals( g.getUsers().size(), 1 );
28
		smap = ( (User) g.getUsers().get("gavin") ).getSession();
28
		smap = ( (User) g.getUsers().get("gavin") ).getSession();
29
		assertEquals(smap.size(), 1);
29
		assertEquals(smap.size(), 1);
30
		gavin = (User) g.getUsers().put("gavin", turin);
30
		gavin = (User) g.getUsers().put("gavin", turin);
31
		s.delete(gavin);
31
		s.delete(gavin);
32
		assertEquals( s.createQuery("select count(*) from SessionAttribute").uniqueResult(), new Long(0) );
32
		assertEquals( s.createQuery("select count(*) from SessionAttribute").uniqueResult(), new Long(0) );
33
		t.commit();
33
		t.commit();
34
		s.close();
34
		s.close();
35
		s = openSession();
35
		s = openSession();
36
		t = s.beginTransaction();
36
		t = s.beginTransaction();
37
		g = (Group) s.get(Group.class, "developers");
37
		g = (Group) s.get(Group.class, "developers");
38
		assertEquals( g.getUsers().size(), 1 );
38
		assertEquals( g.getUsers().size(), 1 );
39
		turin = (User) g.getUsers().get("turin");
39
		turin = (User) g.getUsers().get("turin");
40
		smap = turin.getSession();
40
		smap = turin.getSession();
41
		assertEquals(smap.size(), 0);
41
		assertEquals(smap.size(), 0);
42
		assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(1) );
42
		assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(1) );
43
		s.delete(g);
43
		s.delete(g);
44
		s.delete(turin);
44
		s.delete(turin);
45
		assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(0) );
45
		assertEquals( s.createQuery("select count(*) from User").uniqueResult(), new Long(0) );
46
		t.commit();
46
		t.commit();
47
		s.close();
47
		s.close();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
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 comparisons919
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements38
    Number of unmapped statements in the first code fragment8
    Number of unmapped statements in the second code fragment8
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    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
    User gavin = new User("gavin", "secret");
    Preondition Violations
    Unmatched statement User gavin=new User("gavin","secret"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    User gavin = new User("gavin", "secret");
    3
    User gavin = new User("gavin", "secret");
    3
    User gavin = new User("gavin", "secret");
    Preondition Violations
    Unmatched statement User gavin=new User("gavin","secret"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                      
                                                                                    
    4
    User turin = new User("turin", "tiger");
    Preondition Violations
    Unmatched statement User turin=new User("turin","tiger"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    User turin = new User("turin", "tiger");
    4
    User turin = new User("turin", "tiger");
    4
    User turin = new User("turin", "tiger");
    Preondition Violations
    Unmatched statement User turin=new User("turin","tiger"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                    
                                                                          
    5
    Group g = new Group("developers");
    Preondition Violations
    Unmatched statement Group g=new Group("developers"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    Group g = new Group("developers");
    5
    Group g = new Group("developers");
    5
    Group g = new Group("developers");
    Preondition Violations
    Unmatched statement Group g=new Group("developers"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                          
    6
    g.getUsers().put("gavin", gavin);
    6
    g.getUsers().put("gavin", gavin);
    6
    g.getUsers().put("gavin", gavin);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    6
    g.getUsers().put("gavin", gavin);
    7
    g.getUsers().put("turin", turin);
    7
    g.getUsers().put("turin", turin);
    7
    g.getUsers().put("turin", turin);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.User of variable turin does not match with type org.hibernate.test.map.User of variable turin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    7
    g.getUsers().put("turin", turin);
    8
    s.persist(g);
    8
    s.persist(g);
    8
    s.persist(g);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    8
    s.persist(g);
    9
    gavin.getSession().put("foo", new SessionAttribute("foo", "foo bar baz"));
    9
    gavin.getSession().put("foo", new SessionAttribute("foo", "foo bar baz"));
    9
    gavin.getSession().put("foo", new SessionAttribute("foo", "foo bar baz"));
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.SessionAttributeorg.hibernate.test.map.SessionAttributeVARIABLE_TYPE_MISMATCH
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.SessionAttribute does not match with type org.hibernate.test.map.SessionAttribute
    • Make classes org.hibernate.test.extralazy.SessionAttribute and org.hibernate.test.map.SessionAttribute extend a common superclass
    Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    9
    gavin.getSession().put("foo", new SessionAttribute("foo", "foo bar baz"));
    10
    gavin.getSession().put("bar", new SessionAttribute("bar", "foo bar baz 2"));
    10
    gavin.getSession().put("bar", new SessionAttribute("bar", "foo bar baz 2"));
    10
    gavin.getSession().put("bar", new SessionAttribute("bar", "foo bar baz 2"));
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.SessionAttributeorg.hibernate.test.map.SessionAttributeVARIABLE_TYPE_MISMATCH
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.SessionAttribute does not match with type org.hibernate.test.map.SessionAttribute
    • Make classes org.hibernate.test.extralazy.SessionAttribute and org.hibernate.test.map.SessionAttribute extend a common superclass
    Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    10
    gavin.getSession().put("bar", new SessionAttribute("bar", "foo bar baz 2"));
    11
    t.commit();
    11
    t.commit();
    12
    s.close();
    12
    s.close();
    13
    s = openSession();
    13
    s = openSession();
    14
    t = s.beginTransaction();
    14
    t = s.beginTransaction();
                                                                                              
    15
    g = (Group)s.get(Group.class, "developers");
    Preondition Violations
    Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15
    g = (Group)s.get(Group.class, "developers");
    15
    g = (Group)s.get(Group.class, "developers");
    15
    g = (Group)s.get(Group.class, "developers");
    Preondition Violations
    Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    16
    assertEquals(g.getUsers().size(), 2);
    16
    assertEquals(g.getUsers().size(), 2);
    16
    assertEquals(g.getUsers().size(), 2);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    16
    assertEquals(g.getUsers().size(), 2);
    17
    g.getUsers().remove("turin");
    17
    g.getUsers().remove("turin");
    17
    g.getUsers().remove("turin");
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    17
    g.getUsers().remove("turin");
    18
    Map smap = ((User)g.getUsers().get("gavin")).getSession();
    18
    Map smap = ((User)g.getUsers().get("gavin")).getSession();
    18
    Map smap = ((User)g.getUsers().get("gavin")).getSession();
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.extralazy.User does not match with type org.hibernate.test.map.User
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    18
    Map smap = ((User)g.getUsers().get("gavin")).getSession();
    19
    assertEquals(smap.size(), 2);
    19
    assertEquals(smap.size(), 2);
    20
    smap.remove("bar");
    20
    smap.remove("bar");
    21
    t.commit();
    21
    t.commit();
    22
    s.close();
    22
    s.close();
    23
    s = openSession();
    23
    s = openSession();
    24
    t = s.beginTransaction();
    24
    t = s.beginTransaction();
                                                                                              
    25
    g = (Group)s.get(Group.class, "developers");
    Preondition Violations
    Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    25
    g = (Group)s.get(Group.class, "developers");
    25
    g = (Group)s.get(Group.class, "developers");
    25
    g = (Group)s.get(Group.class, "developers");
    Preondition Violations
    Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    26
    assertEquals(g.getUsers().size(), 1);
    26
    assertEquals(g.getUsers().size(), 1);
    26
    assertEquals(g.getUsers().size(), 1);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    26
    assertEquals(g.getUsers().size(), 1);
    27
    smap = ((User)g.getUsers().get("gavin")).getSession();
    27
    smap = ((User)g.getUsers().get("gavin")).getSession();
    27
    smap = ((User)g.getUsers().get("gavin")).getSession();
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.hibernate.test.extralazy.User does not match with type org.hibernate.test.map.User
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    27
    smap = ((User)g.getUsers().get("gavin")).getSession();
    28
    assertEquals(smap.size(), 1);
    28
    assertEquals(smap.size(), 1);
                                                                                                    
    29
    gavin = (User)g.getUsers().put("gavin", turin);
    Preondition Violations
    Unmatched statement gavin=(User)g.getUsers().put("gavin",turin); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    29
    gavin = (User)g.getUsers().put("gavin", turin);
    29
    gavin = (User)g.getUsers().put("gavin", turin);
    29
    gavin = (User)g.getUsers().put("gavin", turin);
    Preondition Violations
    Unmatched statement gavin=(User)g.getUsers().put("gavin",turin); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                    
    30
    s.delete(gavin);
    30
    s.delete(gavin);
    30
    s.delete(gavin);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    30
    s.delete(gavin);
    31
    assertEquals(s.createQuery("select count(*) from SessionAttribute").uniqueResult(), new Long(0));
    31
    assertEquals(s.createQuery("select count(*) from SessionAttribute").uniqueResult(), new Long(0));
    32
    t.commit();
    32
    t.commit();
    33
    s.close();
    33
    s.close();
    34
    s = openSession();
    34
    s = openSession();
    35
    t = s.beginTransaction();
    35
    t = s.beginTransaction();
                                                                                              
    36
    g = (Group)s.get(Group.class, "developers");
    Preondition Violations
    Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    36
    g = (Group)s.get(Group.class, "developers");
    36
    g = (Group)s.get(Group.class, "developers");
    36
    g = (Group)s.get(Group.class, "developers");
    Preondition Violations
    Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                              
    37
    assertEquals(g.getUsers().size(), 1);
    37
    assertEquals(g.getUsers().size(), 1);
    37
    assertEquals(g.getUsers().size(), 1);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    37
    assertEquals(g.getUsers().size(), 1);
                                                                                        
    38
    turin = (User)g.getUsers().get("turin");
    Preondition Violations
    Unmatched statement turin=(User)g.getUsers().get("turin"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    38
    turin = (User)g.getUsers().get("turin");
    38
    turin = (User)g.getUsers().get("turin");
    38
    turin = (User)g.getUsers().get("turin");
    Preondition Violations
    Unmatched statement turin=(User)g.getUsers().get("turin"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                        
    39
    smap = turin.getSession();
    39
    smap = turin.getSession();
    39
    smap = turin.getSession();
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.User of variable turin does not match with type org.hibernate.test.map.User of variable turin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    39
    smap = turin.getSession();
    40
    assertEquals(smap.size(), 0);
    40
    assertEquals(smap.size(), 0);
    41
    assertEquals(s.createQuery("select count(*) from User").uniqueResult(), new Long(1));
    41
    assertEquals(s.createQuery("select count(*) from User").uniqueResult(), new Long(1));
    42
    s.delete(g);
    42
    s.delete(g);
    42
    s.delete(g);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Grouporg.hibernate.test.map.GroupVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    • Make classes org.hibernate.test.extralazy.Group and org.hibernate.test.map.Group extend a common superclass
    42
    s.delete(g);
    43
    s.delete(turin);
    43
    s.delete(turin);
    43
    s.delete(turin);
    Differences
    Expression1Expression2Difference
    org.hibernate.test.extralazy.Userorg.hibernate.test.map.UserVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.hibernate.test.extralazy.User of variable turin does not match with type org.hibernate.test.map.User of variable turin
    • Make classes org.hibernate.test.extralazy.User and org.hibernate.test.map.User extend a common superclass
    43
    s.delete(turin);
    44
    assertEquals(s.createQuery("select count(*) from User").uniqueResult(), new Long(0));
    44
    assertEquals(s.createQuery("select count(*) from User").uniqueResult(), new Long(0));
    45
    t.commit();
    45
    t.commit();
    46
    s.close();
    46
    s.close();
    Precondition Violations (41)
    Row Violation
    1Unmatched statement User gavin=new User("gavin","secret"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement User gavin=new User("gavin","secret"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement User turin=new User("turin","tiger"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement User turin=new User("turin","tiger"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement Group g=new Group("developers"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement Group g=new Group("developers"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    8Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    9Type org.hibernate.test.extralazy.User of variable turin does not match with type org.hibernate.test.map.User of variable turin
    10Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    11Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    12Type org.hibernate.test.extralazy.SessionAttribute does not match with type org.hibernate.test.map.SessionAttribute
    13Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    14Type org.hibernate.test.extralazy.SessionAttribute does not match with type org.hibernate.test.map.SessionAttribute
    15Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    16Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    17Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    19Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    20Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Type org.hibernate.test.extralazy.User does not match with type org.hibernate.test.map.User
    23Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    24Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    25Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    26Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    27Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    28Expression (User)g.getUsers().get("gavin") cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Type org.hibernate.test.extralazy.User does not match with type org.hibernate.test.map.User
    30Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    31Unmatched statement gavin=(User)g.getUsers().put("gavin",turin); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    32Unmatched statement gavin=(User)g.getUsers().put("gavin",turin); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    33Type org.hibernate.test.extralazy.User of variable gavin does not match with type org.hibernate.test.map.User of variable gavin
    34Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35Unmatched statement g=(Group)s.get(Group.class,"developers"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    36Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    37Unmatched statement turin=(User)g.getUsers().get("turin"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    38Unmatched statement turin=(User)g.getUsers().get("turin"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    39Type org.hibernate.test.extralazy.User of variable turin does not match with type org.hibernate.test.map.User of variable turin
    40Type org.hibernate.test.extralazy.Group of variable g does not match with type org.hibernate.test.map.Group of variable g
    41Type org.hibernate.test.extralazy.User of variable turin does not match with type org.hibernate.test.map.User of variable turin