8220614: (bf) Buffer absolute slice methods should use Objects.checkFromIndexSize()

Brian Burkhalter brian.burkhalter at oracle.com
Thu Mar 14 14:26:38 UTC 2019


Hi Ivan,

> On Mar 13, 2019, at 5:42 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:
> 
> While you're there.
> 
> It seems that the check at StringCharBuffer, lines 39-41 can also be simplified as
> Object.checkFromToIndex​(start, end, s.length());
> 
> A few other places (toString, subSequence) in some Buffers could also benefit from this kind of refactoring.

All good points. Thanks for catching them.

> Or save it for a separate cleanup :)

I think it would be better to file a separate issue to deal with these.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190314/2bc836fc/attachment.html>


More information about the nio-dev mailing list