8219597: (bf) Heap buffer state changes could provoke unexpected exceptions
Brian Burkhalter
brian.burkhalter at oracle.com
Tue Mar 5 09:08:49 UTC 2019
> On Mar 1, 2019, at 5:28 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
>
>> So I think the changes are okay. One more to look at is the checkIndex usages in the new 2-arg slice method.
>
> Yes I think that this
> 117 public $Type$Buffer slice(int index, int length) {
> 118 Objects.checkIndex(index, limit() + 1);
> 119 Objects.checkIndex(length, limit() - index + 1);
> should be changed to
> 117 public $Type$Buffer slice(int index, int length) {
> 118 Objects.checkFromIndexSize(index, length, limit() + 1);
> and also in the other places slice(int,int) occurs. IIRC I had it that way to begin with and modified it while addressing comments. I think however that this change perhaps ought to be the subject of a separate issue.
I think I can check this in and file a separate issue to address the above.
>> A minor nit at L242 where the line break makes it harder to read.
>
> I can change that before checking in.
On reexamination I don’t see what you mean at L242.
Thanks,
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190305/187e849b/attachment.html>
More information about the nio-dev
mailing list