This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 1.x in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git
commit 7c1f37be3b95921d2b8b7f883024427e101ead73 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Sep 15 19:25:08 2023 +0100 Clean-up imports --- src/main/java/org/apache/commons/fileupload/MultipartStream.java | 8 +++----- .../java/org/apache/commons/fileupload/disk/DiskFileItem.java | 9 +++------ .../apache/commons/fileupload/servlet/ServletRequestContext.java | 7 ++----- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/apache/commons/fileupload/MultipartStream.java b/src/main/java/org/apache/commons/fileupload/MultipartStream.java index 30e08dda..69052cf4 100644 --- a/src/main/java/org/apache/commons/fileupload/MultipartStream.java +++ b/src/main/java/org/apache/commons/fileupload/MultipartStream.java @@ -16,8 +16,6 @@ */ package org.apache.commons.fileupload; -import static java.lang.String.format; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -570,9 +568,9 @@ public class MultipartStream { throw new MalformedStreamException("Stream ended unexpectedly"); } if (++size > HEADER_PART_SIZE_MAX) { - throw new MalformedStreamException( - format("Header section has more than %s bytes (maybe it is not properly terminated)", - Integer.valueOf(HEADER_PART_SIZE_MAX))); + throw new MalformedStreamException(String.format( + "Header section has more than %s bytes (maybe it is not properly terminated)", + Integer.valueOf(HEADER_PART_SIZE_MAX))); } if (b == HEADER_SEPARATOR[i]) { i++; diff --git a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java index f07fef4f..d255b054 100644 --- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java +++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java @@ -16,8 +16,6 @@ */ package org.apache.commons.fileupload.disk; -import static java.lang.String.format; - import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -567,7 +565,7 @@ public class DiskFileItem tempDir = new File(System.getProperty("java.io.tmpdir")); } - final String tempFileName = format("upload_%s_%s.tmp", UID, getUniqueId()); + final String tempFileName = String.format("upload_%s_%s.tmp", UID, getUniqueId()); tempFile = new File(tempDir, tempFileName); } @@ -602,9 +600,8 @@ public class DiskFileItem */ @Override public String toString() { - return format("name=%s, StoreLocation=%s, size=%s bytes, isFormField=%s, FieldName=%s", - getName(), getStoreLocation(), Long.valueOf(getSize()), - Boolean.valueOf(isFormField()), getFieldName()); + return String.format("name=%s, StoreLocation=%s, size=%s bytes, isFormField=%s, FieldName=%s", + getName(), getStoreLocation(), Long.valueOf(getSize()), Boolean.valueOf(isFormField()), getFieldName()); } /** diff --git a/src/main/java/org/apache/commons/fileupload/servlet/ServletRequestContext.java b/src/main/java/org/apache/commons/fileupload/servlet/ServletRequestContext.java index 7c3799de..2f3abc97 100644 --- a/src/main/java/org/apache/commons/fileupload/servlet/ServletRequestContext.java +++ b/src/main/java/org/apache/commons/fileupload/servlet/ServletRequestContext.java @@ -16,8 +16,6 @@ */ package org.apache.commons.fileupload.servlet; -import static java.lang.String.format; - import java.io.IOException; import java.io.InputStream; @@ -122,9 +120,8 @@ public class ServletRequestContext implements UploadContext { */ @Override public String toString() { - return format("ContentLength=%s, ContentType=%s", - Long.valueOf(this.contentLength()), - this.getContentType()); + return String.format("ContentLength=%s, ContentType=%s", + Long.valueOf(this.contentLength()), this.getContentType()); } }