5029431: (bf) Add absolute bulk put and get methods

Brian Burkhalter brian.burkhalter at oracle.com
Wed Feb 13 22:15:30 UTC 2019


> On Feb 13, 2019, at 12:04 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 13/02/2019 01:36, Brian Burkhalter wrote:
>> :
>> 
>> I have revised the specifications of exceptions for the five methods in question and updated the tests accordingly:
>> 
>> http://cr.openjdk.java.net/~bpb/5029431/webrev.02/ <http://cr.openjdk.java.net/~bpb/5029431/webrev.02/>
>> 
>> I have not yet updated the wording of the Buffer*flowException classes to remove the restriction to relative operations. I can do that once the rest looks good.
>> 
> I spent a bit of time going through the existing spec to get the various exception cases into my head. I think my concerns and suggestion to keep this consistent with the relative bulk get/set methods were incorrect and that IOOBE is actually the right exception. The methods that I think settle this debate is the absolute get/put methods defined by ByteBuffer for reading/writing primitive values. As an example getLong(index) throws IOOBE if the index is not smaller than the limit minus seven. Sorry for wasting your time on Buffer*flowException, they only come into the picture for methods that need to change the position.

I changed all the conditions which would have provoked a Buffer*flowException back to IOOBEs:

http://cr.openjdk.java.net/~bpb/5029431/webrev.03/

The reverted work to put the Buffer*flowExceptions in was not a waste time as it resulted in some verbiage improvements as well as locating and correcting one or two incidental javadoc errors elsewhere.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190213/01b2d5fc/attachment-0001.html>


More information about the nio-dev mailing list