7199551: (bf) CharBuffer.append(CharSequence) throws BufferOverflowException for read-only buffer

Alan Bateman Alan.Bateman at oracle.com
Thu Sep 20 03:38:10 PDT 2012


On 20/09/2012 11:27, Chris Hegarty wrote:
> A little tricky to review, but looks fine.
>
> I am a little perplexed that the put($Type$Buffer) methods are 
> specified to throw BOE, rather than ROBE (in this case), but not the 
> other put's or append's. It is understandable that we do not want to 
> change this behavior now.
>
> -Chris.
I'm not following you, all put methods should be specified to throw 
ReadOnlyBufferException if the buffer is read-only. CharBuffer 
additionally implements Appendable and so its append methods are also 
specified to throw this exception for read-only buffers. Can you clarify 
what you mean?

-Alan.


More information about the nio-dev mailing list