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
This commit is contained in:
jimin 2019-06-28 03:55:02 +08:00 committed by Norman Maurer
parent 7dff856b1f
commit 51843d8e8e
1 changed files with 4 additions and 2 deletions

View File

@ -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();
}