|
15 | 15 | import lombok.NoArgsConstructor; |
16 | 16 | import lombok.NonNull; |
17 | 17 | import lombok.Setter; |
18 | | -import lombok.SneakyThrows; |
19 | | -import org.json.simple.JSONObject; |
20 | | -import org.json.simple.parser.JSONParser; |
| 18 | +// import lombok.SneakyThrows; |
| 19 | +// import org.json.simple.JSONObject; |
| 20 | +// import org.json.simple.parser.JSONParser; |
21 | 21 |
|
22 | 22 |
|
23 | 23 | /** |
@@ -88,38 +88,39 @@ public static class PrimaryKey { |
88 | 88 | @Column(name = CREATED_FOR_COLUMN, nullable = true) |
89 | 89 | private String createdFor; |
90 | 90 |
|
91 | | - @SneakyThrows |
92 | | - @Override |
93 | | - public boolean equals(Object o) { |
94 | | - if (o == null) { |
95 | | - return false; |
96 | | - } |
97 | | - if (o.getClass() != this.getClass()) { |
98 | | - return false; |
99 | | - } |
100 | | - EbeanMetadataAspect other = (EbeanMetadataAspect) o; |
101 | | - |
102 | | - boolean primitiveEqualityCheck = this.key.equals(other.key) |
103 | | - // either both metadata fields are null or both are equal (will check non-null equality after) |
104 | | - && ((this.metadata == null && other.metadata == null) || (this.metadata != null && other.metadata != null)) |
105 | | - && Math.abs(this.createdOn.getTime() - other.getCreatedOn().getTime()) < 1000 // timestamps are considered equal if within 1s of each other |
106 | | - && this.createdBy.equals(other.getCreatedBy()) |
107 | | - // either both createdFor fields are null or both are equal (need to check this.createdFor != null to avoid NPE) |
108 | | - && ((this.createdFor == null && other.getCreatedFor() == null) || (this.createdFor != null && this.createdFor.equals(other.getCreatedFor()))); |
109 | | - if (!primitiveEqualityCheck) { |
110 | | - return false; |
111 | | - } |
112 | | - |
113 | | - JSONParser parser = new JSONParser(); |
114 | | - JSONObject thisMetadata = (JSONObject) parser.parse(this.metadata); |
115 | | - JSONObject otherMetadata = (JSONObject) parser.parse(other.metadata); |
116 | | - return thisMetadata.equals(otherMetadata); |
117 | | - } |
118 | | - |
119 | | - @Override |
120 | | - public int hashCode() { |
121 | | - return super.hashCode(); |
122 | | - } |
| 91 | + // TODO (@jphui) META-18962 De-deduplicity investigation |
| 92 | + // @SneakyThrows |
| 93 | + // @Override |
| 94 | + // public boolean equals(Object o) { |
| 95 | + // if (o == null) { |
| 96 | + // return false; |
| 97 | + // } |
| 98 | + // if (o.getClass() != this.getClass()) { |
| 99 | + // return false; |
| 100 | + // } |
| 101 | + // EbeanMetadataAspect other = (EbeanMetadataAspect) o; |
| 102 | + |
| 103 | + // boolean primitiveEqualityCheck = this.key.equals(other.key) |
| 104 | + // // either both metadata fields are null or both are equal (will check non-null equality after) |
| 105 | + // && ((this.metadata == null && other.metadata == null) || (this.metadata != null && other.metadata != null)) |
| 106 | + // && Math.abs(this.createdOn.getTime() - other.getCreatedOn().getTime()) < 1000 // timestamps are considered equal if within 1s of each other |
| 107 | + // && this.createdBy.equals(other.getCreatedBy()) |
| 108 | + // // either both createdFor fields are null or both are equal (need to check this.createdFor != null to avoid NPE) |
| 109 | + // && ((this.createdFor == null && other.getCreatedFor() == null) || (this.createdFor != null && this.createdFor.equals(other.getCreatedFor()))); |
| 110 | + // if (!primitiveEqualityCheck) { |
| 111 | + // return false; |
| 112 | + // } |
| 113 | + |
| 114 | + // JSONParser parser = new JSONParser(); |
| 115 | + // JSONObject thisMetadata = (JSONObject) parser.parse(this.metadata); |
| 116 | + // JSONObject otherMetadata = (JSONObject) parser.parse(other.metadata); |
| 117 | + // return thisMetadata.equals(otherMetadata); |
| 118 | + // } |
| 119 | + |
| 120 | + // @Override |
| 121 | + // public int hashCode() { |
| 122 | + // return super.hashCode(); |
| 123 | + // } |
123 | 124 |
|
124 | 125 | @Override |
125 | 126 | public String toString() { |
|
0 commit comments