[jitsi-dev] [ice4j] r362 committed - Loops on copy of parent checklist to prevent ConcurrentModificationExc...


#1

Revision: 362
Author: paweldomas@gmail.com
Date: Wed Nov 13 20:48:21 2013 UTC
Log: Loops on copy of parent checklist to prevent
ConcurrentModificationException.
http://code.google.com/p/ice4j/source/detail?r=362

Modified:
/trunk/src/org/ice4j/ice/ConnectivityCheckClient.java

=======================================
--- /trunk/src/org/ice4j/ice/ConnectivityCheckClient.java Tue Sep 17
11:20:51 2013 UTC
+++ /trunk/src/org/ice4j/ice/ConnectivityCheckClient.java Wed Nov 13
20:48:21 2013 UTC
@@ -643,7 +643,8 @@

         synchronized(this)
         {
- CheckList parentCheckList = parentStream.getCheckList();
+ Vector<CandidatePair> parentCheckList
+ = new Vector<CandidatePair>(parentStream.getCheckList());

I guess I'm bitching but I don't feel particularly happy about (1)
suddenly starting to allocate a new Vector on each STUN success
response and (2) using Vector which is synchronized (in contrast to
ArrayList) given that its synchronization is unnecessary here. Anyway,
I may address my concerns myself.

···

2013/11/13 <ice4j@googlecode.com>:

             for(CandidatePair pair : parentCheckList)
                 if ((pair.getState() == CandidatePairState.FROZEN) &&