From 04a4bcdca0374f1473b1264274954f4506e7403d Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 30 Jun 2016 08:47:55 -0700 Subject: [PATCH] Add comment explaining bytes reference edge case --- .../common/bytes/AbstractBytesReferenceTestCase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/test/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java b/core/src/test/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java index 76757e76724..f31d7c69325 100644 --- a/core/src/test/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java +++ b/core/src/test/java/org/elasticsearch/common/bytes/AbstractBytesReferenceTestCase.java @@ -394,7 +394,7 @@ public abstract class AbstractBytesReferenceTestCase extends ESTestCase { public void testSliceArrayOffset() throws IOException { int length = randomInt(PAGE_SIZE * randomIntBetween(2, 5)); BytesReference pbr = newBytesReference(length); - int sliceOffset = randomIntBetween(0, pbr.length() - 1); + int sliceOffset = randomIntBetween(0, pbr.length() - 1); // an offset to the end would be len 0 int sliceLength = randomIntBetween(pbr.length() - sliceOffset, pbr.length() - sliceOffset); BytesReference slice = pbr.slice(sliceOffset, sliceLength); if (slice.hasArray()) {