xiaoyuyao commented on a change in pull request #339: HDDS-2553. Iterator.next() methods should throw NoSuchElementException URL: https://github.com/apache/hadoop-ozone/pull/339#discussion_r356409911
########## File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChunkBufferImplWithByteBuffer.java ########## @@ -53,6 +54,9 @@ public boolean hasNext() { @Override public ByteBuffer next() { final ByteBuffer duplicated = buffer.duplicate(); + if (!buffer.hasRemaining()) { Review comment: Should we move this before Line 56? Can you add a unit test for repro and verification to avoid regression in future? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org