meatballspaghetti commented on code in PR #4745:
URL: https://github.com/apache/accumulo/pull/4745#discussion_r1693454291
##########
core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java:
##########
@@ -160,6 +160,10 @@ public int offset() {
* @since 3.1.0
*/
public void reset(byte[] data, int offset, int length) {
+ if (offset < 0 || offset > data.length || length < 0 || (offset + length)
> data.length) {
+ throw new IllegalArgumentException(" Bad offset and/or length
data.length = " + data.length
+ + " offset = " + offset + " length = " + length);
+ }
Review Comment:
Updated to use the Objects methods. They throw IndexOutOfBoundsException
instead, which I updated in the unit tests in ArrayByteSequenceTest as well.
--
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]