From e676662aeca6901ff5d9b393bb9f3c4773e1bf4c Mon Sep 17 00:00:00 2001 From: Dylan Hutchison Date: Thu, 11 Jun 2015 20:12:08 -0400 Subject: [PATCH] Fix precondition check in AbstractEncoder. --- .../apache/accumulo/core/client/lexicoder/AbstractEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/AbstractEncoder.java b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/AbstractEncoder.java index 6ba7e029543..d7763294e7d 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/lexicoder/AbstractEncoder.java +++ b/core/src/main/java/org/apache/accumulo/core/client/lexicoder/AbstractEncoder.java @@ -51,7 +51,7 @@ public T decode(byte[] b, int offset, int len) { Preconditions.checkNotNull(b, "cannot decode null byte array"); Preconditions.checkArgument(offset >= 0, "offset %s cannot be negative", offset); Preconditions.checkArgument(len >= 0, "length %s cannot be negative", len); - Preconditions.checkArgument(offset + len < b.length, "offset + length %s exceeds byte array length %s", (offset + len), b.length); + Preconditions.checkArgument(offset + len <= b.length, "offset + length %s exceeds byte array length %s", (offset + len), b.length); return decodeUnchecked(b, offset, len); }