- if ((len < 0) || (sp < 0) || (sp + len > s->size) || (dp < 0) || (dp + len > d->size) || (dp+len<0)) {
- *exceptionptr = new_exception(string_java_lang_ArrayIndexOutOfBoundsException);
+ /* we try to throw exception with the same message as SUN does */
+
+ if ((len < 0) || (sp < 0) || (dp < 0) ||
+ (sp + len < 0) || (sp + len > s->size) ||
+ (dp + len < 0) || (dp + len > d->size)) {
+ *exceptionptr =
+ new_exception(string_java_lang_ArrayIndexOutOfBoundsException);