mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Makoto YUI <yuin...@gmail.com>
Subject Re: ArrayIndexOutOfBoundsException in CircularQueue.
Date Sat, 02 Feb 2008 10:07:33 GMT

Hi, 

With replacing CircularQueue with LinkedQueue, my task is working fine.

BTW, I have reviewed CircularQueue class.

Is not CircularQueue#increaseSize() wrong?

| private void increaseSize() {
|  last = (last + 1) & mask;
|  full = first == last; // this check condition is insufficient.
| }

This full flag affect shrinkIfNeeded() via size(). 

Moreover, both of isEmpty() and remove(int) seem strange.

e.g., 
|    public boolean isEmpty() {
|        return (first == last) && !full;  // should return (first == last)
|    }

Makoto
-- 
View this message in context: http://www.nabble.com/mina-and-jdk6u4-tp14922204s16868p15241380.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Mime
View raw message