Withdrawn: 8259925: [Vector API] Unreasonable IndexOutOfBoundsException message when length < vlen
Jie Fu
jiefu at openjdk.java.net
Wed Mar 17 11:23:49 UTC 2021
On Mon, 18 Jan 2021 13:32:24 GMT, Jie Fu <jiefu at openjdk.org> wrote:
> Hi all,
>
> For this reproducer:
>
> import jdk.incubator.vector.ByteVector;
> import jdk.incubator.vector.VectorSpecies;
>
> public class Test {
> static final VectorSpecies<Byte> SPECIES_128 = ByteVector.SPECIES_128;
> static byte[] a = new byte[8];
> static byte[] b = new byte[8];
>
> public static void main(String[] args) {
> ByteVector av = ByteVector.fromArray(SPECIES_128, a, 0);
> av.intoArray(b, 0);
> System.out.println("b: " + b[0]);
> }
> }
>
> The following IndexOutOfBoundsException message (length -7) is unreasonable.
>
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length -7
>
> It might be better to fix it like this.
>
> Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
>
> Thanks.
> Best regards,
> Jie
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2127
More information about the core-libs-dev
mailing list