[seam-commits] Seam SVN: r10437 - trunk/src/main/org/jboss/seam/contexts.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Apr 17 17:31:40 EDT 2009


Author: norman.richards at jboss.com
Date: 2009-04-17 17:31:40 -0400 (Fri, 17 Apr 2009)
New Revision: 10437

Modified:
   trunk/src/main/org/jboss/seam/contexts/BasicContext.java
Log:
JBSEAM-4021

Modified: trunk/src/main/org/jboss/seam/contexts/BasicContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/contexts/BasicContext.java	2009-04-17 18:41:03 UTC (rev 10436)
+++ trunk/src/main/org/jboss/seam/contexts/BasicContext.java	2009-04-17 21:31:40 UTC (rev 10437)
@@ -1,6 +1,7 @@
 //$Id$
 package org.jboss.seam.contexts;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -51,16 +52,15 @@
 
    public String[] getNames()
    {
-      //yes, I know about the toArray() method,
-      //but there is a bug in the RI!
-      Set<String> keySet = map.keySet();
-      String[] array = new String[ keySet.size() ];
-      int i=0;
-      for (String key: keySet)
+      // yes, I know about the toArray() method,
+      // but there is a bug in the RI!
+      // XXX - what bug?
+      ArrayList<String> keys = new ArrayList<String>();
+      for (String key : map.keySet())
       {
-         array[i++] = key;
+         keys.add(key);
       }
-      return array;
+      return keys.toArray(new String[keys.size()]);
    }
 
    public boolean isSet(String name)




More information about the seam-commits mailing list