RFR(M): 8217628: Verbose ArrayIndexOutOfBoundsException message also in JNI

David Holmes david.holmes at oracle.com
Thu Jan 24 00:40:28 UTC 2019


Hi Goetz,

On 24/01/2019 12:37 am, Lindenmaier, Goetz wrote:
> Hi
> 
> Change JDK-8201593 <https://bugs.openjdk.java.net/browse/JDK-8201593> : Print array length in ArrayIndexOutOfBoundsException
> introduced text as "Index 13 out of bounds for length 10" to various AIOOB exceptions
> thrown in the VM. It omitted the exceptions thrown in jni calls.
> 
> This change extends the messages to the AIOOB exceptions thrown in
> Get|SetObjectArrayElement and Get|Set<type>ArrayRegion.
> 
> Before, Get|SetObjectArrayElement printed just the index,
> Get|Set<type>ArrayRegion printed no message.
> 
> Now the following messages are printed:
>    "Index %d out of bounds for length %d"
>    "length %d is negative"
>    "array region %d..%d out of bounds for length %d"
> 
> Any advice on capitalizing the first word?  It's already
> handled inconsistently...

I'd suggest capitalizing.

> Please review:
> http://cr.openjdk.java.net/~goetz/wr19/8217628-AIOOBE_msg_jni/01/

Could I ask that you factor the region check into a small function so we 
don't duplicate the logic please. It would take TRAPS and would be 
called with a CHECK.

Thanks,
David
-----

> 
> 
> Best regards,
> 
>    Goetz.
> 


More information about the hotspot-runtime-dev mailing list