Concurrency Modification Error Fixed

We were getting a concurrency Modification error on the treemap because multiple operations may have been accessing the RoutingTable's getAllNodes() method at once.
- Fixed it by making this method synchronized.
This commit is contained in:
Joshua Kissoon 2014-05-01 19:22:26 +05:30
parent 0ce64529c6
commit cb42c507de

View File

@ -183,7 +183,7 @@ public class RoutingTable implements KadRoutingTable
* @return List A List of all Nodes in this RoutingTable * @return List A List of all Nodes in this RoutingTable
*/ */
@Override @Override
public final List getAllNodes() public synchronized final List getAllNodes()
{ {
List<Node> nodes = new ArrayList<>(); List<Node> nodes = new ArrayList<>();