public class Employee { private String personName; private Person person; private Collection employments = new ArrayList(); Employee() {} public Employee(Person p) { this.person = p; this.personName = p.getName(); p.setEmployee(this); } public Person getPerson() { return person; } public void setPerson(Person person) { this.person = person; } public String getPersonName() { return personName; } public void setPersonName(String personName) { this.personName = personName; } public Collection getEmployments() { return employments; } public void setEmployments(Collection employments) { this.employments = employments;
public class Location { private long id; private String name; private Collection beings = new ArrayList(); Location() {} public Location(String name) { this.name = name; } public void addBeing(Being b) { b.setLocation(this); beings.add(b); } /** * @return Returns the id. */ public long getId() { return id; } /** * @param id The id to set. */ public void setId(long id) { this.id = id; } /** * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name = name; } /** * @return Returns the beings. */ public Collection getBeings() { return beings; } /** * @param beings The beings to set. */ public void setBeings(Collection beings) { this.beings = beings;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/lazyonetoone/Employee.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/unionsubclass/Location.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class Employee {
1
public class Location {
2
	private String personName;
2
	private 
3
	private Person person
3
long id;
4
;
4
	private String name;
5
	private Collection employments = new ArrayList(); 
5
	private Collection beings = new ArrayList();
6
	Employee
6
	
7
() {}
7
	Location() {}
8
	
8
	
9
public Employee(Person p) {
9
	public 
10
		this.person = p;
11
		this.personName = p.getName();
12
		p.setEmployee(this);
13
	}
10
Location(String name) {
11
		this.name = name;
12
	}
13
	
14
	public void addBeing(Being b) {
15
		b.setLocation(this);
16
		beings.add(b);
17
	}
18
	/**
19
	 * @return Returns the id.
20
	 */
14
	public Person getPerson() {
21
	public long getId() {
15
		return person;
22
		return 
16
	}
23
id;
24
	}
25
	/**
26
	 * @param id The id to set.
27
	 */
17
	public void setPerson(Person person) {
28
	public void set
18
		this.person = person;
19
	}
29
Id(long id) {
30
		this.id = id;
31
	}
32
	/**
33
	 * @return Returns the name.
34
	 */
20
	public String getPersonName() {
35
	public String getName() {
21
		return personName;
36
		return 
22
	}
37
name;
38
	}
39
	/**
40
	 * @param name The name to set.
41
	 */
23
	public void setPersonName(String personName) {
42
	public void setName(String name) {
24
		this.personName = personName;
43
		this.
25
	}
44
name = name;
45
	}
46
	/**
47
	 * @return Returns the beings.
48
	 */
26
	public Collection getEmployments() {
49
	public Collection getBeings() {
27
		return employments;
50
		return 
28
	}
51
beings;
52
	}
53
	/**
54
	 * @param beings The beings to set.
55
	 */
29
	public void setEmployments(Collection employments) {
56
	public void setBeings(Collection beings) {
30
		this.employments = employments;
57
		this.beings = beings;
31
	
58
	
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