Mark Mc Keown created SYNAPSE-1113:
--------------------------------------
Summary: UnboundedQueue has suspect code
Key: SYNAPSE-1113
URL: https://issues.apache.org/jira/browse/SYNAPSE-1113
Project: Synapse
Issue Type: Bug
Components: Core
Affects Versions: 3.0.1
Reporter: Mark Mc Keown
Assignee: Isuru Udana
The code in org.apache.synapse.commons.executors.queues.UnboundedQueue for
drainTo(Collection<? super E> c, int maxElements) looks suspect:
{code}
public int drainTo(Collection<? super E> c, int maxElements) {
if (maxElements >= elements.size()) {
return drainTo(c);
} else {
elements.subList(elements.size() - maxElements - 1,
elements.size());
return maxElements;
}
}
{code}
The subList call does nothing - I assume it should be added to {{c}} and
removed from elements. Not clear this causes a problem given the usage in
{{MultiPriorityBlockingQueue.drainTo}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]