From 51843d8e8ee43ab3918521421d4bc91a4642056f Mon Sep 17 00:00:00 2001 From: jimin Date: Fri, 28 Jun 2019 03:55:02 +0800 Subject: [PATCH] MqttConnectPayload.toString() should use Arrays.toString() instead of [].toString() (#9292) Motivation: The toString() method should use Arrays.toString() to produce a meaningful String representation for arrays. Modification: Use Arrays.toString() Result: More useful toString() implementation --- .../io/netty/handler/codec/mqtt/MqttConnectPayload.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java index b7a4d99d27..93f63e507b 100644 --- a/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java +++ b/codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttConnectPayload.java @@ -16,6 +16,8 @@ package io.netty.handler.codec.mqtt; +import java.util.Arrays; + import io.netty.util.CharsetUtil; import io.netty.util.internal.StringUtil; @@ -103,9 +105,9 @@ public final class MqttConnectPayload { .append('[') .append("clientIdentifier=").append(clientIdentifier) .append(", willTopic=").append(willTopic) - .append(", willMessage=").append(willMessage) + .append(", willMessage=").append(Arrays.toString(willMessage)) .append(", userName=").append(userName) - .append(", password=").append(password) + .append(", password=").append(Arrays.toString(password)) .append(']') .toString(); }