Till Westmann has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/2034

Change subject: [NO ISSUE] Cleanup for commit b67505d
......................................................................

[NO ISSUE] Cleanup for commit b67505d

Change-Id: I370bc289de4a281136e43a3985eb8fae367a6bc6
---
M 
hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java
1 file changed, 11 insertions(+), 7 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/34/2034/1

diff --git 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java
 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java
index a58b0b1..d017d5a 100644
--- 
a/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java
+++ 
b/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/TracedIOOperation.java
@@ -81,16 +81,20 @@
 
     protected ComparableTracedIOOperation(ILSMIOOperation ioOp, Tracer trace) {
         super(ioOp, trace);
-        System.err.println("COMPARE ComparableTracedIOOperation");
     }
 
+    @Override
+    public boolean equals(Object other) {
+        return other instanceof ILSMIOOperation && compareTo((ILSMIOOperation) 
other) == 0;
+    }
+
+    @Override
     public int compareTo(ILSMIOOperation other) {
-        System.err.println("COMPARE compareTo " + 
other.getClass().getSimpleName());
-        if (other instanceof ComparableTracedIOOperation) {
-            other = ((ComparableTracedIOOperation) other).getIoOp();
-            return ((Comparable) this.ioOp).compareTo(other);
+        final ILSMIOOperation myIoOp = this.ioOp;
+        if (myIoOp instanceof Comparable && other instanceof 
ComparableTracedIOOperation) {
+            return ((Comparable) 
myIoOp).compareTo(((ComparableTracedIOOperation) other).getIoOp());
         }
-        throw new IllegalArgumentException("Comparing ioOps of type " + 
this.ioOp.getClass().getSimpleName() + " and "
+        throw new IllegalArgumentException("Comparing ioOps of type " + 
myIoOp.getClass().getSimpleName() + " and "
                 + other.getClass().getSimpleName());
     }
-}
\ No newline at end of file
+}

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2034
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I370bc289de4a281136e43a3985eb8fae367a6bc6
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <[email protected]>

Reply via email to