Skip to content

Commit

Permalink
apacheGH-43048: [JAVA] Fix IndexOutOfBoundsException message by repor…
Browse files Browse the repository at this point in the history
…ting index correctly (apache#43049)

The detailed message for IndexOutOfBoundsException should report the srcIndex that was previously passed to the isOutOfBounds() check

Fixes apache#43048
* GitHub Issue: apache#43048

Authored-by: Alexandra Wang <alex.wang@dremio.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
  • Loading branch information
l-wang authored Jun 26, 2024
1 parent 237987a commit 3834a38
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ public void setBytes(long index, ArrowBuf src, long srcIndex, long length) {
if (isOutOfBounds(srcIndex, length, src.capacity())) {
throw new IndexOutOfBoundsException(
String.format(
"index: %d, length: %d (expected: range(0, %d))", index, length, src.capacity()));
"index: %d, length: %d (expected: range(0, %d))", srcIndex, length, src.capacity()));
}
if (length != 0) {
// copy length bytes of data from src ArrowBuf starting at
Expand Down

0 comments on commit 3834a38

Please sign in to comment.