geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/network/src/java/org/apache/geronimo/network SelectorManager.java
Date Tue, 03 Aug 2004 20:09:27 GMT
adc         2004/08/03 13:09:27

  Modified:    modules/network/src/java/org/apache/geronimo/network
                        SelectorManager.java
  Log:
  Best to make our own copy of the set before iterating.
  
  Revision  Changes    Path
  1.19      +4 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/SelectorManager.java
  
  Index: SelectorManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/SelectorManager.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SelectorManager.java	3 Aug 2004 12:53:10 -0000	1.18
  +++ SelectorManager.java	3 Aug 2004 20:09:27 -0000	1.19
  @@ -26,6 +26,7 @@
   import java.util.Iterator;
   import java.util.Set;
   import java.util.Stack;
  +import java.util.HashSet;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -153,7 +154,7 @@
                       if (selector.select(timeout) == 0) {
                           log.trace("timeout == 0");
   
  -                        Iterator list = selector.keys().iterator();
  +                        Iterator list = new HashSet(selector.keys()).iterator();
                           while (list.hasNext()) {
                               SelectionKey key = (SelectionKey) list.next();
                               log.trace("Still watching " + key + " key is "
  @@ -190,7 +191,7 @@
                           continue;
                       }
   
  -                    Iterator list = selector.keys().iterator();
  +                    Iterator list = new HashSet(selector.keys()).iterator();
                       while (list.hasNext()) {
                           SelectionKey key = (SelectionKey) list.next();
                           log.trace("Still watching " + key + " key is "
  
  
  

Mime
View raw message