diff --git a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Variant.java b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Variant.java index b48bc6b10..663d7e4a5 100644 --- a/jaxrs-api/src/main/java/jakarta/ws/rs/core/Variant.java +++ b/jaxrs-api/src/main/java/jakarta/ws/rs/core/Variant.java @@ -16,7 +16,6 @@ package jakarta.ws.rs.core; -import java.io.StringWriter; import java.util.List; import java.util.Locale; import java.util.Objects; @@ -228,15 +227,13 @@ public boolean equals(final Object obj) { @Override public String toString() { - StringWriter w = new StringWriter(); - w.append("Variant[mediaType="); - w.append(mediaType == null ? "null" : mediaType.toString()); - w.append(", language="); - w.append(language == null ? "null" : language.toString()); - w.append(", encoding="); - w.append(encoding == null ? "null" : encoding); - w.append("]"); - return w.toString(); + return "Variant[mediaType=" + + mediaType + + ", language=" + + language + + ", encoding=" + + encoding + + ']'; } /**