RFR(M): 8201593: Print array length in ArrayIndexOutOfBoundsException.

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Fri Apr 20 06:51:29 UTC 2018


Hi Roger, 

I removed the constructor im my latest webrev.

Best regards,
  Goetz.

> -----Original Message-----
> From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-
> bounces at openjdk.java.net] On Behalf Of Roger Riggs
> Sent: Donnerstag, 19. April 2018 19:21
> To: David Holmes <david.holmes at oracle.com>; core-libs-
> dev at openjdk.java.net; hotspot-runtime-dev at openjdk.java.net
> Subject: Re: RFR(M): 8201593: Print array length in
> ArrayIndexOutOfBoundsException.
> 
> Hi David,
> 
> A private constructor that is apparently unused (because it is used
> implicitly by code
> buried in HotSpot) is going to raise questions.
> 
> Strictly speaking the new constructor is not necessary since the native
> code can
> compose the full message and use the existing constructor.
> I'd recommend that approach.
> 
> Thanks, Roger
> 
> p.s. I'm headed out on vacation today
> 
> 
> On 4/18/18 6:07 PM, David Holmes wrote:
> > Adding back hotspot-runtime-dev  - please reply-all
> >
> > On 19/04/2018 1:26 AM, Roger Riggs wrote:
> >> Hi,
> >>
> >> Also, the new constructor should be public so it can be used in other
> >> places.
> >
> > That takes this from being a simple change that adds more info to the
> > exception message, to an API addition that requires a CSR etc. That
> > changes the scope considerably.
> >
> > I'm not 100% clear why we need to change the Java side of this when we
> > can push a message with the desired info from the VM side?
> Agreed
> >
> > David
> >
> >> It seems in some cases the error message is a literal in the VM code
> >> ( typeArrayKlass.cpp:149).
> >> That would seem to be a duplication and not really a good idea.
> >>
> >> Roger
> >>
> >>
> >> On 4/18/18 10:30 AM, Roger Riggs wrote:
> >>> Hi,
> >>>
> >>> The message can be simpler and more efficiently convey the
> information.
> >>> It should be more consistent with existing uses of
> >>> ArrayIndexOutOfBoundsException as
> >>> throw by:  Objects.checkIndex(index, length).
> >>>
> >>> Which roughly reads as:
> >>>
> >>>    Index %d out-of-bounds for length %d
> >>>
> >>> Regards, Roger
> >>>
> >>> On 4/18/18 4:54 AM, David Holmes wrote:
> >>>> Adding core-libs-dev as you're changing
> >>>> java.lang.ArrayIndexOutOfBoundsException.
> >>>>
> >>>> I appreciate the intent here but I find the messages excessively
> >>>> verbose. The basic error is:
> >>>>
> >>>> index N is outside range [0, length-1]
> >>>>
> >>>> David
> >>>>
> >>>> On 18/04/2018 6:09 PM, Lindenmaier, Goetz wrote:
> >>>>> Hi,
> >>>>>
> >>>>> I would like to print a more verbose text on ArrayIndexOutOfBounds
> >>>>> exception
> >>>>> that not only mentions the index, but also the length of the array
> >>>>> accessed.
> >>>>> See the bug for documentation of the change of the message.
> >>>>> http://cr.openjdk.java.net/~goetz/wr18/8201593-lenInAIOOB/01/
> >>>>>
> >>>>> @aarch/arm people:
> >>>>> I edited the aarch/arm files. Could you please verify this is
> >>>>> correct?
> >>>>> I can not build on these platforms.
> >>>>>
> >>>>> The code on all the other platforms is tested with all the jtreg
> >>>>> and jck tests etc.
> >>>>>
> >>>>> Best regards,
> >>>>>    Goetz.
> >>>>>
> >>>>>
> >>>
> >>



More information about the core-libs-dev mailing list