public static class Id implements Serializable { private String customerId; private int orderNumber; public Id(String customerId, int orderNumber) { this.customerId = customerId; this.orderNumber = orderNumber; } public Id() {} /** * @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 orderNumber. */ public int getOrderNumber() { return orderNumber; } /** * @param orderNumber The orderNumber to set. */ public void setOrderNumber(int orderNumber) { this.orderNumber = orderNumber; } public int hashCode() { return customerId.hashCode() + orderNumber; } public boolean equals(Object other) { if (other instanceof Id) { Id that = (Id) other; return that.customerId.equals(this.customerId) && that.orderNumber == this.orderNumber; } else { return false;
public static class Id implements Serializable { private int purchaseNumber; private String purchaseSequence; public Id(int purchaseNumber, String purchaseSequence) { this.purchaseNumber = purchaseNumber; this.purchaseSequence = purchaseSequence; } public Id() {} /** * @return Returns the purchaseNumber. */ public int getPurchaseNumber() { return purchaseNumber; } /** * @param purchaseNumber The purchaseNumber to set. */ public void setPurchaseNumber(int purchaseNumber) { this.purchaseNumber = purchaseNumber; } /** * @return the purchaseSequence */ public String getPurchaseSequence() { return purchaseSequence; } /** * @param purchaseSequence the purchaseSequence to set */ public void setPurchaseSequence(String purchaseSequence) { this.purchaseSequence = purchaseSequence; } public int hashCode() { return purchaseNumber + purchaseSequence.hashCode(); } public boolean equals(Object other) { if (other instanceof Id) { Id that = (Id) other; return purchaseSequence.equals(this.purchaseSequence) && that.purchaseNumber == this.purchaseNumber; } else { return false;
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/cid/Order.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/cid/PurchaseRecord.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public static class Id implements Serializable {
1
public static class Id implements Serializable {
2
		private String customerId;
2
		private int purchaseNumber;
3
		private int orderNumber;
3
		private String purchaseSequence;
4
		public Id(String customerId, int orderNumber) {
4
		public Id(
5
			this.customerId = customerId;
6
			this.orderNumber = orderNumber
5
int purchaseNumber, String purchaseSequence) {
6
			this.purchaseNumber = purchaseNumber;
7
;
7
			this.purchaseSequence = purchaseSequence;
8
		}
8
		}
9
		public Id() {}
9
		public Id() {}
10
		/**
10
		/**
11
		 * @return Returns the customerId.
11
		 * @return Returns the purchaseNumber.
12
		 */
12
		 */
13
		public String getCustomerId() {
13
		public int getPurchaseNumber() {
14
			return customerId;
14
			return purchaseNumber;
15
		}
15
		}
16
		/**
16
		/**
17
		 * @param customerId The customerId to set.
17
		 * @param purchaseNumber The purchaseNumber to set.
18
		 */
18
		 */
19
		public void setCustomerId(String customerId) {
19
		public void set
20
			this.customerId = customerId
20
PurchaseNumber(int purchaseNumber) {
21
;
21
			this.purchaseNumber = purchaseNumber;
22
		}
22
		}
23
		/**
23
		/**
24
		 * @return Returns the orderNumber.
24
		 * @return the purchaseSequence
25
		 */
25
		 */
26
		public int getOrderNumber() {
26
		public String get
27
			return orderNumber
27
PurchaseSequence() {
28
;
28
			return purchaseSequence;
29
		}
29
		}
30
		/**
30
		/**
31
		 * @param orderNumber The orderNumber to set.
31
		 * @param purchaseSequence the purchaseSequence to set
32
		 */
32
		 */
33
		public void setOrderNumber(int orderNumber) {
33
		public void set
34
			this.orderNumber = orderNumber;
35
		}
36
		public int hashCode() {
37
			return customerId.hashCode() + orderNumber
34
PurchaseSequence(String purchaseSequence) {
35
			this.purchaseSequence = purchaseSequence;
36
		}
37
		public int hashCode() {
38
;
38
			return purchaseNumber + purchaseSequence.hashCode();
39
		}
39
		}
40
		public boolean equals(Object other) {
40
		public boolean equals(Object other) {
41
			if (other instanceof Id) {
41
			if (other instanceof Id) {
42
				Id that = (Id) other;
42
				Id that = (Id) other;
43
				return that.customerId.equals(this.customerId) &&
43
				return purchaseSequence.equals(this.purchaseSequence) &&
44
					that.orderNumber == this.orderNumber;
44
					that.purchaseNumber == this.purchaseNumber;
45
			}
45
			}
46
			else {
46
			else {
47
				return false;
47
				return false;
48
			
48
			
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