mdf369 commented on a change in pull request #31: Fix sonar
URL: https://github.com/apache/incubator-iotdb/pull/31#discussion_r251181651
##########
File path:
iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/PriorityMergeReader.java
##########
@@ -126,5 +126,22 @@ public int compareTo(Element o) {
return o.priority.compareTo(this.priority);
}
+
+ @Override
+ public boolean equals(Object o){
+ if (o instanceof Element){
+ Element element = (Element) o;
+ if (this.timeValuePair.getTimestamp() ==
element.timeValuePair.getTimestamp()
+ && this.priority.equals(element.priority)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode(){
+ return (int) (timeValuePair.getTimestamp() * 37 + priority.hashCode());
Review comment:
It is just for hashing, so I think it brings no problem.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services