SerialBlob.getBytes() may throw ArrayIndexOutOfBoundsException when pos > 1

Mitsuru Kariya mitsuru.kariya at oss.nttdata.com
Tue May 11 15:00:10 UTC 2021


Hi,

Please see the sample code below.

SerialBlob sb = new SerialBlob(new byte[]{1, 2, 3});
System.out.println(Arrays.toString(sb.getBytes(3, 3)));

I think that it should output "[3]" but the current implementation 
throws ArrayIndexOutOfBoundsException.

If it's worth changing, could anyone submit this issue to JBS for me?
I'm ready to submit a pull request, but I don't have an Author role.

Please let me know if there is a better place to do so.

Thanks


More information about the core-libs-dev mailing list