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

Lance Andersen lance.andersen at oracle.com
Mon Apr 20 15:17:40 UTC 2015


Hi Pavel,

So we are just documenting/clarifying the current behavior from what I can tell from the change?  If so, this looks OK assuming you have an approved CCC?  The test seems fine.

I am assuming there should not be any issues here but would be good to hear from others on this change as well

Best
Lance
On Apr 20, 2015, at 11:10 AM, Pavel Rappo <pavel.rappo at oracle.com> wrote:

> 
> Hi everyone,
> 
> Could you please review my change for JDK-8029689
> 
> http://cr.openjdk.java.net/~prappo/8029689/webrev.00/
> 
> -------------------------------------------------------------------------------
> 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.
> 
> -Pavel
> 



Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com






More information about the core-libs-dev mailing list