hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1407078 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
Date Thu, 08 Nov 2012 13:50:49 GMT
Author: ggregory
Date: Thu Nov  8 13:50:49 2012
New Revision: 1407078

URL: http://svn.apache.org/viewvc?rev=1407078&view=rev
Log:
Revert: Use Java 5 enhanced 'for' loops.

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java?rev=1407078&r1=1407077&r2=1407078&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
Thu Nov  8 13:50:49 2012
@@ -38,6 +38,7 @@ import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ThreadFactory;
@@ -412,9 +413,9 @@ public abstract class AbstractMultiworke
         // Close out all channels
         if (this.selector.isOpen()) {
             Set<SelectionKey> keys = this.selector.keys();
-            for (SelectionKey key : keys) {
+            for (Iterator<SelectionKey> it = keys.iterator(); it.hasNext(); ) {
                 try {
-                    SelectionKey key = key;
+                    SelectionKey key = it.next();
                     Channel channel = key.channel();
                     if (channel != null) {
                         channel.close();



Mime
View raw message