From d05f4c5c8c861b03487e6e9275172bc9aff16397 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 17 Aug 2024 10:24:37 -0400 Subject: [PATCH] Replace ternary with Objects.toString() --- .../hc/client5/http/entity/mime/MultipartFormEntity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartFormEntity.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartFormEntity.java index 73f91415b..4861f7336 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartFormEntity.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartFormEntity.java @@ -33,6 +33,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.List; +import java.util.Objects; import java.util.Set; import org.apache.hc.core5.function.Supplier; @@ -83,7 +84,7 @@ class MultipartFormEntity implements HttpEntity { @Override public String getContentType() { - return this.contentType != null ? this.contentType.toString() : null; + return Objects.toString(contentType, null); } @Override