commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1456809 - /commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
Date Fri, 15 Mar 2013 08:56:14 GMT
Author: simonetripodi
Date: Fri Mar 15 08:56:13 2013
New Revision: 1456809

URL: http://svn.apache.org/r1456809
Log:
PMD: These nested if statements could be combined

Modified:
    commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java

Modified: commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java?rev=1456809&r1=1456808&r2=1456809&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
(original)
+++ commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload/FileUploadBase.java
Fri Mar 15 08:56:13 2013
@@ -959,13 +959,11 @@ public abstract class FileUploadBase {
                                      : ctx.getContentLength();
 
             if (sizeMax >= 0) {
-                if (requestSize != -1) {
-                    if (requestSize > sizeMax) {
-                        throw new SizeLimitExceededException(
-                            format("the request was rejected because its size (%s) exceeds
the configured maximum (%s)",
-                                   requestSize, sizeMax),
-                                   requestSize, sizeMax);
-                    }
+                if (requestSize != -1 && requestSize > sizeMax) {
+                    throw new SizeLimitExceededException(
+                        format("the request was rejected because its size (%s) exceeds the
configured maximum (%s)",
+                               requestSize, sizeMax),
+                               requestSize, sizeMax);
                 }
                 input = new LimitedInputStream(input, sizeMax) {
                     @Override



Mime
View raw message