[seam-commits] Seam SVN: r14218 - in branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src: test/unit/org/jboss/seam/test/unit/web and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Oct 6 20:42:43 EDT 2011


Author: tkimura
Date: 2011-10-06 20:42:43 -0400 (Thu, 06 Oct 2011)
New Revision: 14218

Modified:
   branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/main/org/jboss/seam/web/MultipartRequestImpl.java
   branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/test/unit/org/jboss/seam/test/unit/web/MultipartRequestImplTest.java
Log:
JBPAPP-7182 Seam MultipartRequest missing data, integrate 2nd change in CP branch.

Modified: branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/main/org/jboss/seam/web/MultipartRequestImpl.java
===================================================================
--- branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/main/org/jboss/seam/web/MultipartRequestImpl.java	2011-10-06 07:59:55 UTC (rev 14217)
+++ branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/main/org/jboss/seam/web/MultipartRequestImpl.java	2011-10-07 00:42:43 UTC (rev 14218)
@@ -428,40 +428,16 @@
             {
                // move the bytes that weren't read to the start of the buffer
                int bytesNotRead = read - pos;
-               
-               if (buffer.length == bytesNotRead ) 
-               {
-                  //if no end of parameter value can be found in the buffer, we have to increase size of the buffer                                    
-                  
-                  byte[] buffer1 = new byte[buffer.length * 2];
-                  System.arraycopy(buffer, 0, buffer1, 0, buffer.length);
-                  buffer = buffer1;
-                  
-                  read = input.read(buffer, bytesNotRead, buffer.length - bytesNotRead);
-                  if (read == -1) 
-                  {
-                     break;// too bad - nothing more to read (EOF) and last parameter value couldn't be parsed
-                  }
-          
-                  read += bytesNotRead;
-                  } 
-                  else 
-                  {
                      System.arraycopy(buffer, pos, buffer, 0, bytesNotRead);
                      read = input.read(buffer, bytesNotRead, buffer.length - bytesNotRead);
                   
-                     if (read == -1) 
+               // Decrement loopCounter if no data was readable
+               if (read == 0)
                      {
-                        break;
-                        // too bad - nothing more to read (EOF) and last parameter value couldn't be parsed
-                     }
-                     
-                     if(read == 0)
                         loopCounter--;
-                     
-                     read += bytesNotRead;
                   }
                
+               read += bytesNotRead;
             }
             else
             {

Modified: branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/test/unit/org/jboss/seam/test/unit/web/MultipartRequestImplTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/test/unit/org/jboss/seam/test/unit/web/MultipartRequestImplTest.java	2011-10-06 07:59:55 UTC (rev 14217)
+++ branches/enterprise/JBPAPP_5_1_1_JBPAPP-7182/src/test/unit/org/jboss/seam/test/unit/web/MultipartRequestImplTest.java	2011-10-07 00:42:43 UTC (rev 14218)
@@ -2,13 +2,12 @@
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
 
 import java.util.Map;
-import org.testng.annotations.Test;
-import org.jboss.seam.web.MultipartRequestImpl;
+
 import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.web.MultipartRequestImpl;
+import org.testng.annotations.Test;
 
 public class MultipartRequestImplTest
 {



More information about the seam-commits mailing list