RFR(M): 8204943: Improve message of ArrayStoreException.

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Tue Jun 19 06:38:33 UTC 2018


Hi,

I'm sorry for this failure, I had meant to remove the test 
before pushing the change because I think this is 
undefined JNI behavior.
http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2018-June/028586.html

I had speculated whether this should be fixed, but 
as these JNI functions are quite unstable, I thought
I better remove the test instead, which I forgot.
(It didn't fail in the nightly test run where I tested 
the patch, but intermittently after I had it pushed.)

Thanks David and Thomas for looking at it!

Sorry again,
  Goetz.



> -----Original Message-----
> From: David Holmes [mailto:david.holmes at oracle.com]
> Sent: Montag, 18. Juni 2018 08:18
> To: Lindenmaier, Goetz <goetz.lindenmaier at sap.com>; Lois Foltan
> <lois.foltan at oracle.com>; Harold David Seigel <harold.seigel at oracle.com>;
> hotspot-runtime-dev at openjdk.java.net
> Subject: Re: RFR(M): 8204943: Improve message of ArrayStoreException.
> 
> Just so reviewers are aware the new test is failing intermittently:
> 
> https://bugs.openjdk.java.net/browse/JDK-8205141
> 
> Though how it can be intermittent has me baffled.
> 
> David
> 
> On 15/06/2018 8:29 PM, Lindenmaier, Goetz wrote:
> > Hi Lois,
> >
> > thanks a lot!
> >
> > I'll run it through jdk-submit and then push.
> >
> > Best regards,
> >    Goetz.
> >
> >> -----Original Message-----
> >> From: hotspot-runtime-dev [mailto:hotspot-runtime-dev-
> >> bounces at openjdk.java.net] On Behalf Of Lois Foltan
> >> Sent: Donnerstag, 14. Juni 2018 22:50
> >> To: Harold David Seigel <harold.seigel at oracle.com>; hotspot-runtime-
> >> dev at openjdk.java.net
> >> Subject: Re: RFR(M): 8204943: Improve message of ArrayStoreException.
> >>
> >> +1
> >> Lois
> >>
> >> On 6/14/2018 2:57 PM, Harold David Seigel wrote:
> >>> Hi Goetz,
> >>>
> >>> The new webrev looks good!
> >>>
> >>> Thanks, Harold
> >>>
> >>>
> >>> On 6/14/2018 11:58 AM, Lindenmaier, Goetz wrote:
> >>>> Hi Lois,
> >>>>
> >>>> thanks for looking at my change!
> >>>>
> >>>> I prepared a new webrev considering your and Harold's comments:
> >>>> http://cr.openjdk.java.net/~goetz/wr18/8204943-exMsg-
> ArrayStore/02/
> >>>>
> >>>>> Looks good, nice improvement.
> >>>> Thanks :)
> >>>>
> >>>>> - I think "ResourceMark rm;" could be changed to "ResourceMark
> >>>>> rm(THREAD);"
> >>>>>      objArrayKlass.cpp line #238 & 261,
> >>>>>      typeArrayKlass.cpp line #136
> >>>> Good point. Fixed all of them in the functions I touched.
> >>>>
> >>>>> - objArrayKlass.cpp line #263 - can you capitalize the word "object" as
> >>>>> I am assuming it is a java/lang/Object[]?
> >>>> No, it just wants to say that the array has some object type instead of
> >>>> primitives.  See also Harolds mail. I changed it to 'object array' as in
> >>>> the exception texts below.
> >>>> I could change it to java.lang.Object[] or java.lang.Date[],
> >>>> but then I should do that for the AIOOBs, too?
> >>>> And how to put multidimensional arrays?
> >>>>
> >>>> I also figured that it's not necessarily an array at all, and added
> >>>> "arraycopy: source type java.lang.String is not an array");
> >>>> "arraycopy: destination type java.lang.String is not an array");
> >>>> See also my Mail to Harold.
> >>>>
> >>>> Best regards,
> >>>>     Goetz.
> >>>>
> >>>>
> >>>>
> >>>>> Thanks,
> >>>>> Lois
> >>>>>
> >>>>> On 6/13/2018 5:23 AM, Lindenmaier, Goetz wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> this change improves the messages of the ArrayStoreException:
> >>>>>> http://cr.openjdk.java.net/~goetz/wr18/8204943-exMsg-
> >> ArrayStore/01/
> >>>>>>
> >>>>>> For example:
> >>>>>>
> >>>>>> When doing arraycopy:
> >>>>>>
> >>>>>> "arraycopy: type mismatch: can not copy double[] into object[]"
> >>>>>> "arraycopy: type mismatch: can not copy object[] into boolean[]"
> >>>>>>
> >>>>>> For Object arrays, be more precise:
> >>>>>>
> >>>>>> "arraycopy: type mismatch: can not copy java.lang.String[] into
> >>>>> java.util.Date[]"
> >>>>>> "arraycopy: element type mismatch: can not cast one of the
> elements
> >> of
> >>>>> java.lang.Object[] to the type of the destination array,
> >>>>> java.util.Date"
> >>>>>> For JNI call to SetObjectArrayElement() print types and index:
> >>>>>>
> >>>>>> "type mismatch: can not store java.lang.String to java.util.Date[0]"
> >>>>>> "type mismatch: can not store java.lang.String to
> >>>>>> java.lang.Object[1][][]"
> >>>>>>
> >>>>>> For more examples see the included test.
> >>>>>>
> >>>>>> Best regards,
> >>>>>>      Goetz.
> >>>
> >


More information about the hotspot-runtime-dev mailing list