commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1741758 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java
Date Sat, 30 Apr 2016 12:44:21 GMT
Author: sebb
Date: Sat Apr 30 12:44:21 2016
New Revision: 1741758

URL: http://svn.apache.org/viewvc?rev=1741758&view=rev
Log:
Findbugs: more efficient to use entrySet

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java?rev=1741758&r1=1741757&r2=1741758&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java Sat Apr
30 12:44:21 2016
@@ -30,6 +30,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 public class Threader {
 
@@ -211,11 +212,11 @@ public class Threader {
      */
     private ThreadContainer findRootSet(HashMap<String, ThreadContainer> idTable) {
         ThreadContainer root = new ThreadContainer();
-        Iterator<String> iter = idTable.keySet().iterator();
+        Iterator<Map.Entry<String, ThreadContainer>> iter = idTable.entrySet().iterator();
 
         while (iter.hasNext()) {
-            Object key = iter.next();
-            ThreadContainer c = idTable.get(key);
+            Map.Entry<String, ThreadContainer> entry = iter.next();
+            ThreadContainer c = entry.getValue();
             if (c.parent == null) {
                 if (c.next != null) {
                     throw new RuntimeException(



Mime
View raw message