Github user nickwallen commented on a diff in the pull request:
https://github.com/apache/metron/pull/1254#discussion_r239054070
--- Diff:
metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/update/Document.java
---
@@ -89,46 +91,29 @@ public void setGuid(String guid) {
this.guid = guid;
}
- @Override
- public String toString() {
- return "Document{" +
- "timestamp=" + timestamp +
- ", document=" + document +
- ", guid='" + guid + '\'' +
- ", sensorType='" + sensorType + '\'' +
- '}';
- }
-
@Override
public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
+ if (this == o) return true;
+ if (!(o instanceof Document)) return false;
Document document1 = (Document) o;
-
- if (timestamp != null ? !timestamp.equals(document1.timestamp) :
document1.timestamp != null) {
- return false;
- }
- if (document != null ? !document.equals(document1.document) :
document1.document != null) {
- return false;
- }
- if (guid != null ? !guid.equals(document1.guid) : document1.guid !=
null) {
- return false;
- }
- return sensorType != null ? sensorType.equals(document1.sensorType)
- : document1.sensorType == null;
+ return Objects.equals(timestamp, document1.timestamp) &&
--- End diff --
It is an auto-create from IntelliJ. It changed when on a previous
iteration, I added a field to the Document class. I since backed that out and
went with another approach. So there really is no need for this to change now.
I will back this out.
---