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

Lois Foltan lois.foltan at oracle.com
Wed Jun 13 23:55:14 UTC 2018


Hi Goetz,

Looks good, nice improvement.  Just some minor comments:

- I think "ResourceMark rm;" could be changed to "ResourceMark rm(THREAD);"
   objArrayKlass.cpp line #238 & 261,
   typeArrayKlass.cpp line #136

- objArrayKlass.cpp line #263 - can you capitalize the word "object" as 
I am assuming it is a java/lang/Object[]?

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