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?

Kind Regards,
John Fallows.
-- 
>|< Kaazing Corporation >|<
John Fallows | CTO | +1.650.943.2436
800 W. El Camino Real, Ste 180 | Mountain View, CA 94040, USA

Reply via email to