You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/06/11 21:50:09 UTC

[commons-fileupload] branch master updated: Use ternary

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git


The following commit(s) were added to refs/heads/master by this push:
     new dc19122  Use ternary
dc19122 is described below

commit dc19122ba51db36ffeca25e99d34f9332e96d22c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 11 17:49:50 2023 -0400

    Use ternary
---
 .../java/org/apache/commons/fileupload2/AbstractFileUpload.java   | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/AbstractFileUpload.java b/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/AbstractFileUpload.java
index 5bbf239..18569c9 100644
--- a/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/AbstractFileUpload.java
+++ b/commons-fileupload2-core/src/main/java/org/apache/commons/fileupload2/AbstractFileUpload.java
@@ -153,13 +153,7 @@ public abstract class AbstractFileUpload {
         // Parameter parser can handle null input
         final Map<String, String> params = parser.parse(contentType, new char[] { ';', ',' });
         final String boundaryStr = params.get(BOUNDARY_KEY);
-
-        if (boundaryStr == null) {
-            return null;
-        }
-        final byte[] boundary;
-        boundary = boundaryStr.getBytes(StandardCharsets.ISO_8859_1);
-        return boundary;
+        return boundaryStr != null ? boundaryStr.getBytes(StandardCharsets.ISO_8859_1) : null;
     }
 
     /**