[9] RFR of 8065556: (bf) Buffer.position and other methods should include detail in IAE

Brian Burkhalter brian.burkhalter at oracle.com
Tue Apr 21 16:47:11 UTC 2015


On Apr 21, 2015, at 9:10 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> Would it be cleaner to rename of these to something like failXXXX (failNegativeCapacity or failPositionOutOfBounds for example) that throws the exception rather than returns it. That would reduce the method names a bit too.

Sounds like a good idea.

> What is the issue with srcEqualsThisBufferException? That scenario is specified to throw IAE.

It was more a matter of its relative importance in the cold vs. hot code dichotomy as this methods does not perform String construction. It does make things uniform at least.

> Extending the test coverage for this case is good. If you can then keep the line length consistent with the rest of the test.

Good idea, also.

I’ll work on this and post another patch when ready.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150421/f99e615e/attachment.html>


More information about the nio-dev mailing list