--- old/src/hotspot/share/oops/typeArrayKlass.cpp 2018-04-24 15:41:34.285354000 +0200 +++ new/src/hotspot/share/oops/typeArrayKlass.cpp 2018-04-24 15:41:33.796317000 +0200 @@ -142,30 +142,28 @@ ResourceMark rm; stringStream ss; if (src_pos < 0) { - ss.print("while trying to copy from index %i of a %s array with length %i", + ss.print("arraycopy source index %i out of bounds for %s[%i].", src_pos, type2name_tab[ArrayKlass::cast(s->klass())->element_type()], s->length()); } else if (dst_pos < 0) { - ss.print("while trying to copy to index %i of a %s array with length %i", + ss.print("arraycopy destination index %i out of bounds for %s[%i].", dst_pos, type2name_tab[ArrayKlass::cast(d->klass())->element_type()], d->length()); } else { - ss.print("while trying to copy a negative range %i from a %s array with length %i to a %s array with length %i", - length, type2name_tab[ArrayKlass::cast(s->klass())->element_type()], s->length(), - type2name_tab[ArrayKlass::cast(d->klass())->element_type()], d->length()); + ss.print("arraycopy length %i is negative.", length); } THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string()); } // Check if the ranges are valid - if ( (((unsigned int) length + (unsigned int) src_pos) > (unsigned int) s->length()) - || (((unsigned int) length + (unsigned int) dst_pos) > (unsigned int) d->length()) ) { + if ((((unsigned int) length + (unsigned int) src_pos) > (unsigned int) s->length()) || + (((unsigned int) length + (unsigned int) dst_pos) > (unsigned int) d->length())) { // Pass specific exception reason. ResourceMark rm; stringStream ss; if (((unsigned int) length + (unsigned int) src_pos) > (unsigned int) s->length()) { - ss.print("while trying to copy from index %u of a %s array with length %i", + ss.print("arraycopy: last source index %u out of bounds for %s[%i].", (unsigned int) length + (unsigned int) src_pos, type2name_tab[ArrayKlass::cast(s->klass())->element_type()], s->length()); } else { - ss.print("while trying to copy to index %u of a %s array with length %i", + ss.print("arraycopy: last destination index %u out of bounds for %s[%i].", (unsigned int) length + (unsigned int) dst_pos, type2name_tab[ArrayKlass::cast(d->klass())->element_type()], d->length()); }