public void testBagOneToMany() throws Exception { Session s = openSession(); Baz baz = new Baz(); List list = new ArrayList(); baz.setBazez(list); list.add( new Baz() ); s.save(baz); s.flush(); list.add( new Baz() ); s.flush(); list.add( 0, new Baz() ); s.flush(); s.delete( list.remove(1) ); s.flush(); s.delete(baz); s.flush(); s.connection().commit(); s.close();
public void testNoUpdateManyToOne() throws Exception { Session s = openSession(); W w1 = new W(); W w2 = new W(); Z z = new Z(); z.setW(w1); s.save(z); s.flush(); z.setW(w2); s.flush(); s.connection().commit(); s.close(); s = openSession(); s.update(z); s.flush(); s.delete(z); s.delete("from W"); s.flush(); s.connection().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/FooBarTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/MasterDetailTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void testBagOneToMany() throws Exception {
1
public void testNoUpdateManyToOne() throws Exception {
2
		Session s = openSession();
2
		Session s = openSession();
3
		Baz baz = new Baz();
3
		W w1 = new W();
4
		List list = new ArrayList();
4
		
5
		baz.setBazez(list);
6
		list.add( new Baz() 
5
W w2 = new W();
6
		Z z = new Z();
7
);
7
		z.setW(w1);
8
		s.save(baz);
8
		s.save(z);
9
		s.flush();
9
		s.flush();
10
		list.add( new Baz() );
10
		
11
		s.flush();
12
		list.add( 0, new Baz() 
11
z.setW(w2);
12
		s.flush();
13
);
13
		s.connection().commit();
14
		s.flush();
14
		s.close();
15
		s.delete( list.remove(1) 
15
		s = openSession();
16
);
16
		s.update(z);
17
		s.flush();
17
		s.flush();
18
		s.delete(baz
18
		s.delete(z);
19
);
19
		s.delete("from W");
20
		s.flush();
20
		s.flush();
21
		s.connection().commit();
21
		s.connection().commit();
22
		s.close();
22
		s.close();
23
	
23
	
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0