[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 19:36:36 UTC 2015


On Apr 21, 2015, at 11:23 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:

> On Apr 21, 2015, at 11:20 AM, Vitaly Davidovich <vitalyd at gmail.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.
>> 
>> Martin mentioned this bug earlier in this thread:https://bugs.openjdk.java.net/browse/JDK-6533165
> 
> Thanks, Vitaly. I saw that. My response was intended to change the names for consistency only, not to change that the method only returned the exception. Sorry I was unclear.

To re-clarify, given the issue that Vitaly and previously Martin referred to, I think that if name consistency were desirable then something like createXXXException() (createNegativeCapacityException() or createPositionOutOfBoundsException() for example) with the throw statement remaining in the caller would be more appropriate.

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


More information about the nio-dev mailing list