DefaultIoFilterChainBuilder synchronization issue with contains(...) methods
----------------------------------------------------------------------------
Key: DIRMINA-410
URL: https://issues.apache.org/jira/browse/DIRMINA-410
Project: MINA
Issue Type: Bug
Affects Versions: 1.1.1, 2.0.0-M1
Reporter: im-james
Fix For: 1.1.2, 2.0.0-M1
In org.apache.mina.common.DefaultIoFilterChainBuilder, most public methods are
synchronized to guard the variables "entries" and "entriesByName".
However, 2 methods are not synchronized and I believe that they should be
synchronized.
I'm talking about these 2:
public boolean contains(IoFilter filter) {...}
public boolean contains(Class<? extends IoFilter> filterType) {...}
it should be:
public synchronized boolean contains(IoFilter filter) {...}
public synchronized boolean contains(Class<? extends IoFilter> filterType) {...}
The version on the trunk is different but I've got the impression that there is
another type of bug:
I've noticed that the variable "entries" is initialized with a "new
CopyOnWriteArrayList<Entry>()". However, the clear() method put a regular "new
ArrayList<Entry>()" into it. This is probably not what is intended.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.