meatballspaghetti commented on code in PR #4745:
URL: https://github.com/apache/accumulo/pull/4745#discussion_r1687078497
##########
core/src/main/java/org/apache/accumulo/core/data/ArrayByteSequence.java:
##########
@@ -180,4 +180,21 @@ public byte[] toArray() {
public String toString() {
return new String(data, offset, length, UTF_8);
}
+
+ public void setArray(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);
+ }
+ this.data = data;
+ this.offset = offset;
+ this.length = length;
+ }
+
+ public void setLength(int length) {
+ if (length < 0) {
+ throw new IllegalArgumentException(" Bad length = " + length);
+ }
+ this.length = length;
+ }
Review Comment:
Agreed that it can be dropped. Updated.
--
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]