[seam-commits] Seam SVN: r10548 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Apr 21 09:02:46 EDT 2009


Author: manaRH
Date: 2009-04-21 09:02:46 -0400 (Tue, 21 Apr 2009)
New Revision: 10548

Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BasicContext.java
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/SessionContext.java
Log:
JBPAPP-1785

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BasicContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BasicContext.java	2009-04-21 12:12:54 UTC (rev 10547)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/BasicContext.java	2009-04-21 13:02:46 UTC (rev 10548)
@@ -1,7 +1,9 @@
 //$Id$
 package org.jboss.seam.contexts;
 
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -51,15 +53,14 @@
    public String[] getNames()
    {
       //yes, I know about the toArray() method,
-      //but there is a bug in the RI!
+      //but there is a bug in the RI!      
       Set<String> keySet = map.keySet();
-      String[] array = new String[ keySet.size() ];
-      int i=0;
+      List<String> list = new ArrayList<String>();      
       for (String key: keySet)
       {
-         array[i++] = key;
+         list.add(key);
       }
-      return array;
+      return list.toArray(new String[list.size()]);
    }
 
    public boolean isSet(String name)

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/SessionContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/SessionContext.java	2009-04-21 12:12:54 UTC (rev 10547)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/SessionContext.java	2009-04-21 13:02:46 UTC (rev 10548)
@@ -33,7 +33,7 @@
       String prefix = ScopeType.CONVERSATION.getPrefix();
       for ( String name: super.getNames() ) 
       {
-         if ( !name.contains(prefix) )
+         if ( name != null && !name.contains(prefix) )
          {
             results.add(name);
          }




More information about the seam-commits mailing list