Thanks for your reply, Emmanuel, and thanks for fixing the bug.
Is there any documentation of the discussion regarding the upcoming change
of public API between 2.0-beta-3 and 2.0 final?
Perhaps you are planning to leave IoBuffer as deprecated to ease migration
from 1.0 to 2.0?
Is the change of strategy an extension of the thinking behind the desire for
CompositeIoBuffer?
Will there be an opportunity to evaluate the new API in an upcoming 2.0-beta
before the 2.0-final release?
Btw, some open source projects don't enjoy the file-bug-first strategy, and
prefer to verify the bug on the mailing list first. I understand from your
feedback that filing bugs first is okay, and that detailed, code-specific
issues such as this should be addressed to the development mailing list
instead of the users mailing list, so I'll subscribe to that list before
posting about such potential bugs in future.
Kind Regards,
John Fallows.
On Mon, Oct 20, 2008 at 5:21 AM, Emmanuel Lecharny <[EMAIL PROTECTED]>wrote:
> John Fallows wrote:
>
>> Folks,
>>
>> I think there might be a bug in AbstractIoBuffer.getSlice(index, length)
>> in
>> Mina 2.0.0-M3.
>>
>> public final IoBuffer getSlice(int index, int length) {
>> if (length < 0) {
>> throw new IllegalArgumentException("length: " + length);
>> }
>> int pos = position();
>> int limit = limit();
>> int endIndex = *pos* + length;
>> ...
>> limit(endIndex);
>>
>> Shouldn't that be:
>>
>> int endIndex = *index* + length;
>> ...
>> limit(endIndex);
>>
>> Otherwise, the wrong slice would be returned if index differs from the
>> current position, right?
>>
>>
> Seems right.
>
> FYI, the IoBuffer class is likely to be removed in the final version of
> MINA, and AFAIK, the getSlice( int, int ) method is neither used nor
> documented, so the question is : does it worth the effort to fix it and
> document it ? It seems that YAGNI hasen't been applied in this area ... (
> http://en.wikipedia.org/wiki/You_Ain%27t_Gonna_Need_It)
>
> Thanks for pointing the bug (I will fix it)
>
> Btw, you should either post such a mail to the dev mailing list, or better,
> create a JIRA (with possibly a proposed patch).
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
--
>|< Kaazing Corporation >|<
John Fallows | CTO | +1.650.943.2436
800 W. El Camino Real, Ste 180 | Mountain View, CA 94040, USA