[seam-commits] Seam SVN: r13964 - tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Dec 17 09:03:58 EST 2010


Author: manaRH
Date: 2010-12-17 09:03:58 -0500 (Fri, 17 Dec 2010)
New Revision: 13964

Modified:
   tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockExternalContext.java
   tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockHttpServletRequest.java
Log:
rolling back changes for JBSEAM-3770

Modified: tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockExternalContext.java
===================================================================
--- tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockExternalContext.java	2010-12-17 13:55:34 UTC (rev 13963)
+++ tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockExternalContext.java	2010-12-17 14:03:58 UTC (rev 13964)
@@ -228,17 +228,13 @@
       while (en.hasMoreElements())
       {
          String header = en.nextElement();
-         Enumeration requestHeaders = request.getHeaders(header);
-         if (requestHeaders != null)
+         List<String> headerList = Collections.list(request.getHeaders(header));
+         String[] headers = new String[headerList.size()];
+         for (int i = 0; i < headerList.size(); i++)
          {
-            List<String> headerList =  Collections.list(requestHeaders);
-            String[] headers = new String[headerList.size()];
-            for (int i = 0; i < headerList.size(); i++)
-            {
-               headers[i] = headerList.get(i);
-            }
-            result.put(header, headers);
+            headers[i] = headerList.get(i);
          }
+         result.put(header, headers);
       }
       return result;
    }

Modified: tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockHttpServletRequest.java
===================================================================
--- tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockHttpServletRequest.java	2010-12-17 13:55:34 UTC (rev 13963)
+++ tags/JBoss_Seam_2_2_1_CR3/src/main/org/jboss/seam/mock/MockHttpServletRequest.java	2010-12-17 14:03:58 UTC (rev 13964)
@@ -178,9 +178,8 @@
    }
 
    public Enumeration getHeaders(String header)
-   {      
-      String[] values = headers.get(header);
-      return values==null || values.length==0 ? null : new IteratorEnumeration( Arrays.asList( values ).iterator() );
+   {
+      return new IteratorEnumeration( Arrays.asList( headers.get(header) ).iterator() );
    }
 
    public Enumeration getHeaderNames()



More information about the seam-commits mailing list