Makoto YUI wrote:
I have the same problem to you. I'm using the latest snapshot (mina-core-2.0.0-M1-20080124.103130-116.jar).

| java.lang.ArrayIndexOutOfBoundsException
| at
org.apache.mina.util.CircularQueue.shrinkIfNeeded(CircularQueue.java:233)

This problem caused when newLen is less than the length of
System.arraycopy().

| Object[] tmp = new Object[newLen];
| .. | if (first < last) { | System.arraycopy(items, first, tmp, 0, last - first); * bug
|            } else {
|                System.arraycopy(items, first, tmp, 0, oldLen - first);   *
bug
|                System.arraycopy(items, 0, tmp, oldLen - first, last);    *
bug
|            }

It seems to be preferred to use java.util.LinkedList instead of custom
CircularQueue for messageQueue(s) in
AbstractProtocolEncoderOutput/AbstractProtocolDecoderOutput.

Thanks,

Makoto YUI
I don't think that it's a problem to use our own brewed CircularQueue ...

I looked at the code, and I'm a little bit annoyed that there is absolutely no comment at all. There is a clear bug somewhere, as you got a java.lang.ArrayIndexOutOfBoundsException (and many thanks for having posting this mail, btw !!!), but without a knowledge about what is doing this class, it's really difficult to find a fix in 2 minutes. This should not be the case...

Btw, there is no test cases either...

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to