RFR: JDK-7154662: {CRC32, Adler32}.update(byte[] b, int off, int len): undocumented ArrayIndexOutOfBoundsException

Xueming Shen xueming.shen at oracle.com
Wed Aug 14 21:49:04 UTC 2013


Thanks Chris!

"the" removed.

I would assume the jck team probably will add a unit test for it. They filed the
bug originally.

-Sherman

On 08/14/2013 02:33 PM, Chris Hegarty wrote:
>
> > * @throws  ArrayIndexOutOfBoundsException
> > *          if the {@code off} is negative, or the {@code len} is
> > *          negative, or the {@code off+len} is greater than the
> > *          length of the array {@code b}
>
> I agree that specifying this in CRC32 and Adler32 is the right thing to do. Trivially I'd drop the 'the' before the arguments, or maybe take the working from InputStream.read(byte[],int,int) :
>
>   "If off is negative, len is negative, or len is greater than b.length
>    - off"
>
> Either is ok with me. Is it worth adding a test? or will JCK be updated to catch this.
>
> -Chris.
>
> On 14/08/2013 20:10, Xueming Shen wrote:
>> Hi,
>>
>> Please help review the change to document the AIOBE exception
>> for CRC32/Adler32.update() methods (may need a followup CCC).
>> This has been the behavior probably from day one, but the exception
>> is just not explicitly listed. Ideally it probably should be in
>> Checksum.update(),
>> but that probably is too late for a public interface that has been there
>> for so many years.
>>
>> http://cr.openjdk.java.net/~sherman/7154662/webrev/
>>
>> Thanks!
>> -Sherman




More information about the core-libs-dev mailing list