Community
Participate
Working Groups
Build Identifier: 20110615-0604 Calling IJavaArray.setValues(array) where array is a zero-length array results in an IndexOutOfBoundsException. This case should be handled more gracefully; that is, setValues should do nothing and exit early. The source of the problem is at ArrayReferenceImpl.java:227: 227: if (index < 0 || index >= arrayLength) { 228: throw new IndexOutOfBoundsException(JDIMessages.ArrayReferenceImpl_Invalid_index_1); 229: } In this case, index == 0, but arrayLength == 0 as well. An additional check needs to be added for the special-case of a zero-length array. Reproducible: Always
> This case should be handled more gracefully; that is, setValues should do > nothing and exit early. Agreed. Pushed fix + regression tests to master.
verified in I20111027-1800