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

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Wed Jun 13 09:23:05 UTC 2018


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