guiyanakuang commented on a change in pull request #1072:
URL: https://github.com/apache/orc/pull/1072#discussion_r837030697



##########
File path: java/core/src/java/org/apache/orc/impl/BufferChunk.java
##########
@@ -89,7 +89,10 @@ public boolean equals(Object other) {
       return false;
     }
     BufferChunk ob = (BufferChunk) other;
-    return chunk.equals(ob.chunk);
+    return (chunk != null && ob.chunk != null && chunk.equals(ob.chunk))
+           || (chunk == null && ob.chunk == null
+               && offset == ob.offset
+               && getLength() == ob.getLength());

Review comment:
       It looks like the offset/length comparison is missing when chunck != 
null, how about this
   ```java
   return Objects.equals(chunk, ob.chunk) && offset == ob.offset && getLength() 
== ob.getLength();
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@orc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to