ctubbsii commented on code in PR #4745:
URL: https://github.com/apache/accumulo/pull/4745#discussion_r1693468898


##########
core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java:
##########
@@ -168,10 +161,7 @@ public void reset(byte[] data, int offset, int length) {
   @Override
   public ByteSequence subSequence(int start, int end) {
 
-    if (start > end || start < 0 || end > length) {
-      throw new IllegalArgumentException("Bad start and/end start = " + start 
+ " end=" + end
-          + " offset=" + offset + " length=" + length);
-    }

Review Comment:
   You commented on the wrong line in GitHub, so it's not showing me the line 
you're asking about. If you want to comment on a range of lines, you can click 
on the first line and drag down until the last line, and it will show the whole 
chunk. To your question, I think you did it correctly. `length` refers to the 
length of the limited "view" of the backing array, and the start and end of the 
subsequence are coming from that "view" of the backing array, not the full 
backing array, and have to fit in that view's length.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to