portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r484686 - /portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java
Date Fri, 08 Dec 2006 18:20:36 GMT
Author: taylor
Date: Fri Dec  8 10:20:35 2006
New Revision: 484686

URL: http://svn.apache.org/viewvc?view=rev&rev=484686
Log:
http://issues.apache.org/jira/browse/JS2-613
ConcurrentModificationException under high load
Patch from Ethan Adams (sorry couldn't use the Java 1.5 features yet)

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java?view=diff&rev=484686&r1=484685&r2=484686
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/document/impl/NodeSetImpl.java
Fri Dec  8 10:20:35 2006
@@ -43,16 +43,16 @@
 
     public NodeSetImpl(List nodes, Comparator comparator)
     {
-        this.nodes = new TreeMap(comparator);
-        Iterator addIter = nodes.iterator();
-        while (addIter.hasNext())
+        this.nodes = new TreeMap(comparator);        
+        Object[] nodeToCopy = nodes.toArray();
+        for (int ix = 0; ix < nodeToCopy.length; ix++)
         {
-            Node node = (Node)addIter.next();
-            if (!this.nodes.containsKey(node.getName()))
+            Node node = (Node)nodeToCopy[ix];
+            if (!this.nodes.containsKey( node.getName()))
             {
                 this.nodes.put(node.getName(), node);
             }
-        }
+        }         
         this.comparator = comparator;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message