Skip to content

Commit e7313a0

Browse files
committed
[Java] Clarify that copy will go out of range when dealing with a character array. Issue aeron-io#448.
1 parent 5956a2f commit e7313a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ private CharSequence generatePrimitiveArrayPropertyDecode(
16491649
indent + " if (dstOffset < 0 || dstOffset > (dst.length - length))\n" +
16501650
indent + " {\n" +
16511651
indent + " throw new IndexOutOfBoundsException(" +
1652-
"\"dstOffset out of range for copy: offset=\" + dstOffset);\n" +
1652+
"\"Copy will go out of range: offset=\" + dstOffset);\n" +
16531653
indent + " }\n\n" +
16541654
"%s" +
16551655
indent + " buffer.getBytes(this.offset + %d, dst, dstOffset, length);\n\n" +
@@ -1742,7 +1742,7 @@ private CharSequence generatePrimitiveArrayPropertyEncode(
17421742
indent + " if (srcOffset < 0 || srcOffset > (src.length - length))\n" +
17431743
indent + " {\n" +
17441744
indent + " throw new IndexOutOfBoundsException(" +
1745-
"\"srcOffset out of range for copy: offset=\" + srcOffset);\n" +
1745+
"\"Copy will go out of range: offset=\" + srcOffset);\n" +
17461746
indent + " }\n\n" +
17471747
indent + " buffer.putBytes(this.offset + %d, src, srcOffset, length);\n\n" +
17481748
indent + " return this;\n" +

0 commit comments

Comments
 (0)