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:38:43 UTC

[commons-fileupload] branch master updated: Inline single use local variable

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 93ea7c1  Inline single use local variable
93ea7c1 is described below

commit 93ea7c1b95637c6f7bb0105669e844623a432fda
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 11 17:38:39 2023 -0400

    Inline single use local variable
---
 .../main/java/org/apache/commons/fileupload2/AbstractFileUpload.java   | 3 +--
 1 file changed, 1 insertion(+), 2 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 8097de9..d399916 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
@@ -418,13 +418,12 @@ public abstract class AbstractFileUpload {
                     throw new FileUploadFileCountLimitException(ATTACHMENT, getFileCountMax(), itemList.size());
                 }
                 // Don't use getName() here to prevent an InvalidFileNameException.
-                final String fileName = fileItemInput.getName();
                 // @formatter:off
                 final FileItem fileItem = fileItemFactory.fileItemBuilder()
                     .setFieldName(fileItemInput.getFieldName())
                     .setContentType(fileItemInput.getContentType())
                     .setFormField(fileItemInput.isFormField())
-                    .setFileName(fileName)
+                    .setFileName(fileItemInput.getName())
                     .setFileItemHeaders(fileItemInput.getHeaders())
                     .get();
                 // @formatter:on