You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ma...@apache.org on 2021/09/02 08:28:54 UTC
[commons-fileupload] branch master updated: Use char rather than
String of length 1.
This is an automated email from the ASF dual-hosted git repository.
markt 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 5855c05 Use char rather than String of length 1.
5855c05 is described below
commit 5855c053f99b00602a239c0cda6bed5e1fa89622
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 2 09:27:54 2021 +0100
Use char rather than String of length 1.
---
src/main/java/org/apache/commons/fileupload2/FileUploadBase.java | 2 +-
.../java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
index 8ed5f72..c6fcbbb 100644
--- a/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
+++ b/src/main/java/org/apache/commons/fileupload2/FileUploadBase.java
@@ -584,7 +584,7 @@ public abstract class FileUploadBase {
}
// Continuation line found
end = parseEndOfLine(headerPart, nonWs);
- header.append(" ").append(headerPart, nonWs, end);
+ header.append(' ').append(headerPart, nonWs, end);
start = end + 2;
}
parseHeaderLine(headers, header.toString());
diff --git a/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java b/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
index fbdea2d..25704b2 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
@@ -71,7 +71,7 @@ public final class RFC2231Utility {
*/
public static boolean hasEncodedValue(final String paramName) {
if (paramName != null) {
- return paramName.lastIndexOf("*") == (paramName.length() - 1);
+ return paramName.lastIndexOf('*') == (paramName.length() - 1);
}
return false;
}
@@ -85,7 +85,7 @@ public final class RFC2231Utility {
public static String stripDelimiter(final String paramName) {
if (hasEncodedValue(paramName)) {
final StringBuilder paramBuilder = new StringBuilder(paramName);
- paramBuilder.deleteCharAt(paramName.lastIndexOf("*"));
+ paramBuilder.deleteCharAt(paramName.lastIndexOf('*'));
return paramBuilder.toString();
}
return paramName;