Fix ConcurrentModificationEx in RpcRegistry.onBucketsUpdated 75/35775/2
authorTom Pantelis <tpanteli@brocade.com>
Thu, 3 Mar 2016 17:52:47 +0000 (12:52 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 4 Mar 2016 13:14:59 +0000 (13:14 +0000)
commit07240de983bb33924965ae3ee17118e93610a507
tree486510d94f0cc3f3eaba72cc00f033e8b13b607a
parentd0c79d42f124753a8487b7d1f76057f388895316
Fix ConcurrentModificationEx in RpcRegistry.onBucketsUpdated

This was introduced by a recent patch. onBucketsUpdated iterates the
routesUpdateCallbacks however one of the callbacks in receiveGetRouter
removes itself from the list causing the ConcurrentModificationEx.

I changed onBucketsUpdated to first copy the list to an array to prevent
this.

Change-Id: I44c9a89b4b433f711cf4f90bf28e6955d8784f5f
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
(cherry picked from commit f09d37ec4cce2411eaae11dde18f9ce2d2f14118)
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java