public class Customer { private String customerId; private String name; private String address; private List orders = new ArrayList(); /** * @return Returns the address. */ public String getAddress() { return address; } /** * @param address The address to set. */ public void setAddress(String address) { this.address = address; } /** * @return Returns the customerId. */ public String getCustomerId() { return customerId; } /** * @param customerId The customerId to set. */ public void setCustomerId(String customerId) { this.customerId = customerId; } /** * @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 orders. */ public List getOrders() { return orders; } /** * @param orders The orders to set. */ public void setOrders(List orders) { this.orders = orders; } public Order generateNewOrder(BigDecimal total) { Order order = new Order(this); order.setOrderDate( new GregorianCalendar() ); order.setTotal( total ); return order;
public class User { private Integer id; private String userid; private Set mail = new HashSet(); public User() { } public User(String userid) { this.userid = userid; } public Integer getId() { return id; } protected void setId(Integer id) { this.id = id; } public String getUserid() { return userid; } public void setUserid(String userid) { this.userid = userid; } public Set getMail() { return mail; } private void setMail(Set mail) { this.mail = mail; } public Mail addMail(String alias) { Mail mail = new Mail( alias, this ); getMail().add( mail ); return mail; } public void removeMail(Mail mail) { getMail().remove( mail );
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/cid/Customer.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/orphan/User.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class Customer {
1
public class User {
2
	private String customerId;
2
	private Integer id;
3
	private String name;
3
	private String userid;
4
	private String address;
4
	private S
5
	private List orders = new ArrayList();
6
	/**
7
	 * @return Returns the address.
8
	 */
9
	public String getAddress() {
10
		return address;
11
	}
12
	/**
13
	 * @param address The address to set.
14
	 */
15
	public void setAddress
5
et mail = new HashSet();
6
	public User() {
7
	}
16
(String address) {
8
	public User(String userid) {
17
		this.address = address;
9
		this.
18
	}
19
	/**
20
	 * @return Returns the customerId.
21
	 */
22
	public String getCustomer
10
userid = userid;
11
	}
23
Id() {
12
	public Integer getId() {
24
		return customerId;
13
		return 
25
	}
26
	/**
27
	 * @param customerId The customerId to set.
28
	 */
29
	public void setCustomerId(String customerId) {
30
		this.customerId = customerId;
31
	}
32
	/**
33
	 * @return Returns the name.
34
	 */
14
id;
15
	}
16
	protected void setId(Integer id) {
17
		this.id = id;
18
	}
35
	public String getName() {
19
	public String getUserid() {
36
		return name;
20
		return 
37
	}
38
	/**
39
	 * @param name The name to set.
40
	 */
21
userid;
22
	}
41
	public void setName(String name) {
23
	public void setUserid(String userid) {
42
		this.name = name;
24
		this.
43
	}
44
	/**
45
	 * @return Returns the orders.
46
	 */
25
userid = userid;
26
	}
47
	public List getOrders() {
27
	public Set getMail() {
48
		return orders;
28
		return 
49
	}
50
	/**
51
	 * @param orders The orders to set.
52
	 */
53
	public void setOrders(List orders) {
54
		this.orders = orders;
55
	}
56
	public Order generateNewOrder(BigDecimal total) {
57
		Order order = new Order(
29
mail;
30
	}
31
	private void setMail(Set mail) {
32
		this.mail = mail;
33
	}
34
	public Mail addMail(String alias) {
58
this);
35
		Mail mail = new Mail( alias, this );
59
		order.setOrderDate( new GregorianCalendar() );
36
		
60
		order.setTotal( total );
37
getMail().add( mail );
38
		return mail;
39
	}
40
	public void removeMail(Mail mail) {
61
		return order;
41
		getMail().remove( mail );
62
	
42
	
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