commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1565190 - in /commons/proper/fileupload/trunk/src: main/java/org/apache/commons/fileupload/MultipartStream.java test/java/org/apache/commons/fileupload/MultipartStreamTest.java
Date Thu, 06 Feb 2014 12:01:48 GMT
Author: markt
Date: Thu Feb  6 12:01:48 2014
New Revision: 1565190

URL: http://svn.apache.org/r1565190
Log:
Fix FindBugs warnings

Modified:
    commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/MultipartStream.java
    commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/MultipartStreamTest.java

Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/MultipartStream.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/MultipartStream.java?rev=1565190&r1=1565189&r2=1565190&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/MultipartStream.java
(original)
+++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/MultipartStream.java
Thu Feb  6 12:01:48 2014
@@ -319,6 +319,11 @@ public class MultipartStream {
             byte[] boundary,
             int bufSize,
             ProgressNotifier pNotifier) {
+
+        if (boundary == null) {
+            throw new IllegalArgumentException("boundary may not be null");
+        }
+
         this.input = input;
         this.bufSize = bufSize;
         this.buffer = new byte[bufSize];

Modified: commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/MultipartStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/MultipartStreamTest.java?rev=1565190&r1=1565189&r2=1565190&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/MultipartStreamTest.java
(original)
+++ commons/proper/fileupload/trunk/src/test/java/org/apache/commons/fileupload/MultipartStreamTest.java
Thu Feb  6 12:01:48 2014
@@ -48,6 +48,7 @@ public class MultipartStreamTest {
         assertNotNull(ms);
     }
 
+    @SuppressWarnings("unused")
     @Test(expected=IllegalArgumentException.class)
     public void testSmallBuffer() throws Exception {
         final String strData = "foobar";
@@ -55,8 +56,7 @@ public class MultipartStreamTest {
         InputStream input = new ByteArrayInputStream(contents);
         byte[] boundary = BOUNDARY_TEXT.getBytes();
         int iBufSize = 1;
-        @SuppressWarnings("unused")
-        MultipartStream ms = new MultipartStream(
+        new MultipartStream(
                 input,
                 boundary,
                 iBufSize,



Mime
View raw message