RFR JDK-8029689: (spec) Reader.read(char[], int, int) throws unspecified IndexOutOfBoundsException

Pavel Rappo pavel.rappo at oracle.com
Mon Apr 20 15:10:10 UTC 2015

Hi everyone,

Could you please review my change for JDK-8029689


There is a long-standing issue when platform implementations of java.io.Reader
throw IndexOutOfBoundsException for bounds checks from inherited
java.io.Reader.read(char[], int, int) method though java.io.Reader itself does
not specify this situation.

Suggested solution is to update the contract of java.io.Reader.read(char[], int,
int) and its publicly exported descendants to capture the implied preconditions
for reading range and the array size.

Given that throwing IOBE in this situation is a de facto standard, this change
won't bring any kind of incompatibility, though to stay compliant 3rd party
implementations may need to be updated.


More information about the core-libs-dev mailing list