From 2481a784f3ba7648f4b4322335bd3d4061aa4b01 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Mon, 13 Sep 2021 10:08:24 -0400 Subject: [PATCH] ARTEMIS-3475 avoiding possible recursion on toString and improving overal PacketImpl toString --- .../core/protocol/core/impl/PacketImpl.java | 13 +++++++------ .../wireformat/ActiveMQExceptionMessage.java | 4 ++-- .../wireformat/ActiveMQExceptionMessage_V2.java | 5 ----- .../impl/wireformat/CheckFailoverMessage.java | 5 ++--- .../wireformat/CheckFailoverReplyMessage.java | 5 ++--- .../wireformat/ClusterTopologyChangeMessage.java | 5 ++--- .../ClusterTopologyChangeMessage_V2.java | 5 ++--- .../ClusterTopologyChangeMessage_V3.java | 16 ++-------------- .../ClusterTopologyChangeMessage_V4.java | 9 ++++----- .../impl/wireformat/CreateAddressMessage.java | 5 ++--- .../core/impl/wireformat/CreateQueueMessage.java | 11 ++--------- .../impl/wireformat/CreateQueueMessage_V2.java | 6 ++---- .../impl/wireformat/CreateSessionMessage.java | 16 ++-------------- .../impl/wireformat/CreateSessionMessage_V2.java | 9 ++++----- .../wireformat/CreateSessionResponseMessage.java | 5 ++--- .../wireformat/CreateSharedQueueMessage.java | 5 ++--- .../wireformat/CreateSharedQueueMessage_V2.java | 5 ++--- .../wireformat/DisconnectConsumerMessage.java | 5 ++--- .../DisconnectConsumerWithKillMessage.java | 5 ++--- .../core/impl/wireformat/DisconnectMessage.java | 9 ++++----- .../impl/wireformat/DisconnectMessage_V2.java | 11 +++++------ .../impl/wireformat/DisconnectMessage_V3.java | 5 ++--- .../core/impl/wireformat/MessagePacket.java | 4 ++-- .../impl/wireformat/NullResponseMessage_V2.java | 4 ++-- .../impl/wireformat/PacketsConfirmedMessage.java | 4 ++-- .../core/protocol/core/impl/wireformat/Ping.java | 5 ++--- .../impl/wireformat/ReattachSessionMessage.java | 5 ++--- .../ReattachSessionResponseMessage.java | 5 ++--- .../core/impl/wireformat/RollbackMessage.java | 5 ++--- .../wireformat/SessionAcknowledgeMessage.java | 5 ++--- .../wireformat/SessionAddMetaDataMessage.java | 5 ++--- .../wireformat/SessionAddMetaDataMessageV2.java | 4 ++-- .../wireformat/SessionBindingQueryMessage.java | 4 ++-- .../SessionBindingQueryResponseMessage.java | 11 ++--------- .../SessionBindingQueryResponseMessage_V2.java | 11 ++--------- .../SessionBindingQueryResponseMessage_V3.java | 11 ++--------- .../SessionBindingQueryResponseMessage_V4.java | 11 ++--------- .../wireformat/SessionConsumerCloseMessage.java | 4 ++-- .../SessionConsumerFlowCreditMessage.java | 4 ++-- .../wireformat/SessionContinuationMessage.java | 5 ++--- .../wireformat/SessionCreateConsumerMessage.java | 5 ++--- .../wireformat/SessionDeleteQueueMessage.java | 5 ++--- .../impl/wireformat/SessionExpireMessage.java | 5 ++--- .../wireformat/SessionForceConsumerDelivery.java | 5 ++--- .../SessionIndividualAcknowledgeMessage.java | 5 ++--- .../SessionProducerCreditsFailMessage.java | 5 ++--- .../SessionProducerCreditsMessage.java | 5 ++--- .../wireformat/SessionQueueQueryMessage.java | 5 ++--- .../SessionQueueQueryResponseMessage.java | 11 ++--------- .../SessionQueueQueryResponseMessage_V2.java | 11 ++--------- .../SessionQueueQueryResponseMessage_V3.java | 11 ++--------- .../SessionReceiveContinuationMessage.java | 5 ++--- .../wireformat/SessionReceiveLargeMessage.java | 5 ++--- .../impl/wireformat/SessionReceiveMessage.java | 4 ++-- .../SessionRequestProducerCreditsMessage.java | 5 ++--- .../SessionSendContinuationMessage.java | 5 ++--- .../SessionSendContinuationMessage_V2.java | 4 ++-- .../impl/wireformat/SessionSendLargeMessage.java | 5 ++--- .../core/impl/wireformat/SessionSendMessage.java | 5 ++--- .../impl/wireformat/SessionSendMessage_V2.java | 5 ++--- .../wireformat/SessionXAAfterFailedMessage.java | 5 ++--- .../impl/wireformat/SessionXACommitMessage.java | 4 ++-- .../impl/wireformat/SessionXAEndMessage.java | 4 ++-- .../impl/wireformat/SessionXAForgetMessage.java | 5 ++--- .../SessionXAGetInDoubtXidsResponseMessage.java | 4 ++-- .../SessionXAGetTimeoutResponseMessage.java | 5 ++--- .../impl/wireformat/SessionXAJoinMessage.java | 5 ++--- .../impl/wireformat/SessionXAPrepareMessage.java | 5 ++--- .../wireformat/SessionXAResponseMessage.java | 4 ++-- .../wireformat/SessionXAResponseMessage_V2.java | 5 ++--- .../impl/wireformat/SessionXAResumeMessage.java | 5 ++--- .../wireformat/SessionXARollbackMessage.java | 5 ++--- .../wireformat/SessionXASetTimeoutMessage.java | 5 ++--- .../SessionXASetTimeoutResponseMessage.java | 5 ++--- .../impl/wireformat/SessionXAStartMessage.java | 5 ++--- .../SubscribeClusterTopologyUpdatesMessage.java | 5 ++--- ...SubscribeClusterTopologyUpdatesMessageV2.java | 5 ++--- .../BackupReplicationStartFailedMessage.java | 4 ++-- .../impl/wireformat/NodeAnnounceMessage.java | 11 +++++------ .../core/impl/wireformat/QuorumVoteMessage.java | 12 ++---------- .../wireformat/ReplicationCommitMessage.java | 7 ++++--- .../ReplicationLargeMessageBeginMessage.java | 7 +++---- .../ReplicationLargeMessageEndMessage.java | 7 +++---- .../ReplicationLargeMessageWriteMessage.java | 7 +++---- .../ReplicationLiveIsStoppingMessage.java | 4 ++-- .../wireformat/ReplicationPageEventMessage.java | 7 ++++--- .../wireformat/ReplicationResponseMessageV2.java | 5 ++--- .../wireformat/ReplicationStartSyncMessage.java | 5 ++--- .../wireformat/ReplicationSyncFileMessage.java | 6 +++--- 89 files changed, 201 insertions(+), 349 deletions(-) diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java index 85275bf609..fe82e729cc 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/PacketImpl.java @@ -418,9 +418,14 @@ public class PacketImpl implements Packet { return true; } + /** extensions of this class are supposed to use getPacketString to provide toString functionality */ @Override - public String toString() { - return getParentString() + "]"; + public final String toString() { + return getPacketString() + "]"; + } + + protected String getPacketString() { + return this.getClass().getSimpleName() + "(" + this.getClass().getSimpleName() + ")[type=" + type + ", channelID=" + channelID + ", responseAsync=" + isResponseAsync() + ", requiresResponse=" + isRequiresResponse() + ", correlationID=" + getCorrelationID(); } @Override @@ -446,10 +451,6 @@ public class PacketImpl implements Packet { return (channelID == other.channelID) && (size == other.size) && (type != other.type); } - protected String getParentString() { - return "PACKET(" + this.getClass().getSimpleName() + ")[type=" + type + ", channelID=" + channelID + ", responseAsync=" + isResponseAsync() + ", requiresResponse=" + isRequiresResponse() + ", correlationID=" + getCorrelationID() + ", packetObject=" + this.getClass().getSimpleName(); - } - private int stringEncodeSize(final String str) { return DataConstants.SIZE_INT + str.length() * 2; } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java index 51637f3a63..a38975800b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage.java @@ -65,8 +65,8 @@ public class ActiveMQExceptionMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", exception= " + exception + "]"; + protected String getPacketString() { + return super.getPacketString() + ", exception= " + exception; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage_V2.java index 661a040259..e0ba6d7e2c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ActiveMQExceptionMessage_V2.java @@ -68,11 +68,6 @@ public class ActiveMQExceptionMessage_V2 extends ActiveMQExceptionMessage { return this.correlationID; } - @Override - public String toString() { - return getParentString() + ", exception= " + exception + "]"; - } - @Override public int hashCode() { final int prime = 31; diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverMessage.java index 902ff1f283..327bd532bf 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverMessage.java @@ -43,10 +43,9 @@ public class CheckFailoverMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", nodeID=" + nodeID); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverReplyMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverReplyMessage.java index 1173e10938..f0e00ae880 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverReplyMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CheckFailoverReplyMessage.java @@ -48,10 +48,9 @@ public class CheckFailoverReplyMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", okToFailover=" + okToFailover); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java index a441eee1ca..35aca2c635 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage.java @@ -145,13 +145,12 @@ public class ClusterTopologyChangeMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", exit=" + exit); buff.append(", last=" + last); buff.append(", nodeID=" + nodeID); buff.append(", pair=" + pair); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java index 3a381454d1..b2a7fd84a7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V2.java @@ -140,15 +140,14 @@ public class ClusterTopologyChangeMessage_V2 extends ClusterTopologyChangeMessag } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", exit=" + exit); buff.append(", last=" + last); buff.append(", nodeID=" + nodeID); buff.append(", pair=" + pair); buff.append(", backupGroupName=" + backupGroupName); buff.append(", uniqueEventID=" + uniqueEventID); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V3.java index f3bcfd7416..51b29aa687 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V3.java @@ -90,17 +90,8 @@ public class ClusterTopologyChangeMessage_V3 extends ClusterTopologyChangeMessag } @Override - protected String getParentString() { - return toString(false); - } - - @Override - public String toString() { - return toString(true); - } - - private String toString(boolean closed) { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", exit=" + exit); buff.append(", last=" + last); buff.append(", nodeID=" + nodeID); @@ -108,9 +99,6 @@ public class ClusterTopologyChangeMessage_V3 extends ClusterTopologyChangeMessag buff.append(", backupGroupName=" + backupGroupName); buff.append(", uniqueEventID=" + uniqueEventID); buff.append(", scaleDownGroupName=" + scaleDownGroupName); - if (closed) { - buff.append("]"); - } return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V4.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V4.java index fde8cd88c3..6a356a6b8e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V4.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ClusterTopologyChangeMessage_V4.java @@ -67,11 +67,10 @@ public class ClusterTopologyChangeMessage_V4 extends ClusterTopologyChangeMessag } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); - buf.append(", clientVersion=" + serverVersion); - buf.append("]"); - return buf.toString(); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); + buff.append(", clientVersion=" + serverVersion); + return buff.toString(); } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateAddressMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateAddressMessage.java index 8c84a9bc89..d77e9765ee 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateAddressMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateAddressMessage.java @@ -52,12 +52,11 @@ public class CreateAddressMessage extends PacketImpl { // Public -------------------------------------------------------- @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", routingTypes=" + routingTypes); buff.append(", autoCreated=" + autoCreated); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java index 694848a1b4..0b3950558b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage.java @@ -68,15 +68,8 @@ public class CreateQueueMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", queueName=" + queueName); buff.append(", filterString=" + filterString); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java index aeebbe4b69..f376f82076 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateQueueMessage_V2.java @@ -218,8 +218,8 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", autoCreated=" + autoCreated); buff.append(", routingType=" + routingType); buff.append(", maxConsumers=" + maxConsumers); @@ -239,8 +239,6 @@ public class CreateQueueMessage_V2 extends CreateQueueMessage { buff.append(", autoDeleteMessageCount=" + autoDeleteMessageCount); buff.append(", ringSize=" + ringSize); buff.append(", enabled=" + enabled); - - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage.java index 7f82c83924..d38618c5f3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage.java @@ -215,17 +215,8 @@ public class CreateSessionMessage extends PacketImpl { } @Override - protected String getParentString() { - return toString(false); - } - - @Override - public String toString() { - return toString(true); - } - - private String toString(boolean closed) { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", autoCommitAcks=" + autoCommitAcks); buff.append(", autoCommitSends=" + autoCommitSends); buff.append(", defaultAddress=" + defaultAddress); @@ -238,9 +229,6 @@ public class CreateSessionMessage extends PacketImpl { buff.append(", version=" + version); buff.append(", windowSize=" + windowSize); buff.append(", xa=" + xa); - if (closed) { - buff.append("]"); - } return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage_V2.java index be2f8d343e..aed5e31798 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionMessage_V2.java @@ -66,11 +66,10 @@ public class CreateSessionMessage_V2 extends CreateSessionMessage { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); - buf.append(", metadata=" + clientID); - buf.append("]"); - return buf.toString(); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); + buff.append(", metadata=" + clientID); + return buff.toString(); } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java index 1c56a85cb7..35799cca98 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSessionResponseMessage.java @@ -80,10 +80,9 @@ public class CreateSessionResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", serverVersion=" + serverVersion); - buff.append("]"); return buff.toString(); } } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage.java index 3c072e0bfc..14bc679e70 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage.java @@ -57,14 +57,13 @@ public class CreateSharedQueueMessage extends PacketImpl { // Public -------------------------------------------------------- @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", queueName=" + queueName); buff.append(", filterString=" + filterString); buff.append(", durable=" + durable); buff.append(", requiresResponse=" + requiresResponse); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java index 17bd1adc48..d9105ac296 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/CreateSharedQueueMessage_V2.java @@ -295,8 +295,8 @@ public class CreateSharedQueueMessage_V2 extends CreateSharedQueueMessage { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", queueName=" + queueName); buff.append(", filterString=" + filterString); @@ -320,7 +320,6 @@ public class CreateSharedQueueMessage_V2 extends CreateSharedQueueMessage { buff.append(", ringSize=" + ringSize); buff.append(", enabled=" + enabled); buff.append(", requiresResponse=" + requiresResponse); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerMessage.java index 9eacc1dd2b..b399101ada 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerMessage.java @@ -43,10 +43,9 @@ public class DisconnectConsumerMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerId=" + consumerId); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerWithKillMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerWithKillMessage.java index 3663172a85..e6fe4854da 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerWithKillMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectConsumerWithKillMessage.java @@ -46,10 +46,9 @@ public class DisconnectConsumerWithKillMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", nodeID=" + nodeID); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage.java index eb5f7ccf3b..f09a2de7e0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage.java @@ -62,11 +62,10 @@ public class DisconnectMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); - buf.append(", nodeID=" + nodeID); - buf.append("]"); - return buf.toString(); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); + buff.append(", nodeID=" + nodeID); + return buff.toString(); } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V2.java index 806c913353..5196ef1b71 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V2.java @@ -54,12 +54,11 @@ public class DisconnectMessage_V2 extends DisconnectMessage { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); - buf.append(", nodeID=" + nodeID); - buf.append(", scaleDownNodeID=" + scaleDownNodeID); - buf.append("]"); - return buf.toString(); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); + buff.append(", nodeID=" + nodeID); + buff.append(", scaleDownNodeID=" + scaleDownNodeID); + return buff.toString(); } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V3.java index 671e1aa11b..35c9eaaf7c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/DisconnectMessage_V3.java @@ -88,13 +88,12 @@ public class DisconnectMessage_V3 extends DisconnectMessage { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buf = new StringBuffer(super.getPacketString()); buf.append(", nodeID=" + nodeID); buf.append(", reason=" + reason); buf.append(", targetNodeID=" + targetNodeID); buf.append(", targetConnector=" + targetConnector); - buf.append("]"); return buf.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/MessagePacket.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/MessagePacket.java index cee846ff06..e7f278af56 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/MessagePacket.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/MessagePacket.java @@ -42,8 +42,8 @@ public abstract class MessagePacket extends PacketImpl implements MessagePacketI } @Override - public String getParentString() { - return super.getParentString() + ", message=" + message; + protected String getPacketString() { + return super.getPacketString() + ", message=" + message; } } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NullResponseMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NullResponseMessage_V2.java index 16b6d19a1e..c69b1628a9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NullResponseMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NullResponseMessage_V2.java @@ -74,8 +74,8 @@ public class NullResponseMessage_V2 extends NullResponseMessage { } @Override - public String toString() { - return getParentString() + ", correlationID=" + correlationID + "]"; + protected String getPacketString() { + return super.getPacketString() + ", correlationID=" + correlationID; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java index 6cec0acd82..a909af7f64 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/PacketsConfirmedMessage.java @@ -55,8 +55,8 @@ public class PacketsConfirmedMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", commandID=" + commandID + "]"; + protected String getPacketString() { + return super.getPacketString() + ", commandID=" + commandID; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java index ed6b3e21b6..5478f2aa24 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/Ping.java @@ -63,10 +63,9 @@ public final class Ping extends PacketImpl { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buf = new StringBuffer(super.getPacketString()); buf.append(", connectionTTL=" + connectionTTL); - buf.append("]"); return buf.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionMessage.java index c0627718f6..5d6ac1f0fd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionMessage.java @@ -72,11 +72,10 @@ public class ReattachSessionMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", lastConfirmedCommandID=" + lastConfirmedCommandID); buff.append(", name=" + name); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java index 399e9fb768..9f7e5a9bb1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReattachSessionResponseMessage.java @@ -79,11 +79,10 @@ public class ReattachSessionResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", lastConfirmedCommandID=" + lastConfirmedCommandID); buff.append(", reattached=" + reattached); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java index 26c08ef349..d1ae2a1b1b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/RollbackMessage.java @@ -66,10 +66,9 @@ public class RollbackMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", considerLastMessageAsDelivered=" + considerLastMessageAsDelivered); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java index 67d9f67f39..a8e10bd195 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAcknowledgeMessage.java @@ -85,12 +85,11 @@ public class SessionAcknowledgeMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerID=" + consumerID); buff.append(", messageID=" + messageID); buff.append(", requiresResponse=" + requiresResponse); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java index 1b3faedd5c..b5e7f451cc 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java @@ -74,11 +74,10 @@ public class SessionAddMetaDataMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", key=" + key); buff.append(", data=" + data); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java index 5882fdc9a1..826bc3a2af 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java @@ -98,8 +98,8 @@ public class SessionAddMetaDataMessageV2 extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", key=" + key); buff.append(", data=" + data); buff.append(", requiresConfirmation=" + requiresConfirmation); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java index d33b884935..95b810d024 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryMessage.java @@ -50,8 +50,8 @@ public class SessionBindingQueryMessage extends QueueAbstractPacket { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append("]"); return buff.toString(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java index cb89bdaabc..b376be74d0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage.java @@ -90,15 +90,8 @@ public class SessionBindingQueryResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", exists=" + exists); buff.append(", queueNames=" + queueNames); return buff.toString(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java index b3e226ecd3..4584c4709b 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V2.java @@ -70,15 +70,8 @@ public class SessionBindingQueryResponseMessage_V2 extends SessionBindingQueryRe } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", autoCreateQueues=" + autoCreateQueues); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java index 27df666713..e121b7a319 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V3.java @@ -73,15 +73,8 @@ public class SessionBindingQueryResponseMessage_V3 extends SessionBindingQueryRe } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", autoCreateAddresses=" + autoCreateAddresses); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java index 562a740a8d..ec819b79f4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionBindingQueryResponseMessage_V4.java @@ -161,15 +161,8 @@ public class SessionBindingQueryResponseMessage_V4 extends SessionBindingQueryRe } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", defaultPurgeOnNoConsumers=" + defaultPurgeOnNoConsumers); buff.append(", defaultMaxConsumers=" + defaultMaxConsumers); buff.append(", defaultExclusive=" + defaultExclusive); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java index a3570a245e..df51265f38 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerCloseMessage.java @@ -50,8 +50,8 @@ public class SessionConsumerCloseMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", consumerID=" + consumerID + "]"; + protected String getPacketString() { + return super.getPacketString() + ", consumerID=" + consumerID; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java index 71ab68ae31..8b1aa0e5b7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionConsumerFlowCreditMessage.java @@ -57,8 +57,8 @@ public class SessionConsumerFlowCreditMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", consumerID=" + consumerID + ", credits=" + credits + "]"; + protected String getPacketString() { + return super.getPacketString() + ", consumerID=" + consumerID + ", credits=" + credits; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java index a894594d32..d5e48c5b1d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionContinuationMessage.java @@ -101,11 +101,10 @@ public abstract class SessionContinuationMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", body=" + Arrays.toString(body)); buff.append(", continues=" + continues); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java index 8db65b8d60..db045cdbd4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionCreateConsumerMessage.java @@ -54,15 +54,14 @@ public class SessionCreateConsumerMessage extends QueueAbstractPacket { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", queueName=" + queueName); buff.append(", filterString=" + filterString); buff.append(", id=" + id); buff.append(", browseOnly=" + browseOnly); buff.append(", requiresResponse=" + requiresResponse); buff.append(", priority=" + priority); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java index 49344592ee..d8a719e9c4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionDeleteQueueMessage.java @@ -35,10 +35,9 @@ public class SessionDeleteQueueMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", queueName=" + queueName); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionExpireMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionExpireMessage.java index e48e60d11a..91064d431a 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionExpireMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionExpireMessage.java @@ -78,11 +78,10 @@ public class SessionExpireMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerID=" + consumerID); buff.append(", messageID=" + messageID); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java index 68856270dd..fca1f57a45 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionForceConsumerDelivery.java @@ -59,11 +59,10 @@ public class SessionForceConsumerDelivery extends PacketImpl { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buf = new StringBuffer(super.getPacketString()); buf.append(", consumerID=" + consumerID); buf.append(", sequence=" + sequence); - buf.append("]"); return buf.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionIndividualAcknowledgeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionIndividualAcknowledgeMessage.java index 3164c23f11..72f56b6ab2 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionIndividualAcknowledgeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionIndividualAcknowledgeMessage.java @@ -94,12 +94,11 @@ public class SessionIndividualAcknowledgeMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerID=" + consumerID); buff.append(", messageID=" + messageID); buff.append(", requiresResponse=" + requiresResponse); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsFailMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsFailMessage.java index 68259235b5..9603774db7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsFailMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsFailMessage.java @@ -68,11 +68,10 @@ public class SessionProducerCreditsFailMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", credits=" + credits); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java index d057ad1ccc..993164d5d0 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionProducerCreditsMessage.java @@ -68,11 +68,10 @@ public class SessionProducerCreditsMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", credits=" + credits); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java index 1b8c526cf6..31840864b9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryMessage.java @@ -50,10 +50,9 @@ public class SessionQueueQueryMessage extends QueueAbstractPacket { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", queueName=" + queueName); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java index 7d9c184e20..8a1d9fb5a2 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage.java @@ -157,15 +157,8 @@ public class SessionQueueQueryResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", address=" + address); buff.append(", name=" + name); buff.append(", consumerCount=" + consumerCount); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V2.java index 667ce6ea95..dfa3487548 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V2.java @@ -92,15 +92,8 @@ public class SessionQueueQueryResponseMessage_V2 extends SessionQueueQueryRespon } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", autoCreationEnabled=" + autoCreateQueues); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java index 9deffe1b2e..216fa74bb9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionQueueQueryResponseMessage_V3.java @@ -423,15 +423,8 @@ public class SessionQueueQueryResponseMessage_V3 extends SessionQueueQueryRespon } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", autoCreated=" + autoCreated); buff.append(", purgeOnNoConsumers=" + purgeOnNoConsumers); buff.append(", routingType=" + routingType); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java index 41e786bec3..bbb1261224 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveContinuationMessage.java @@ -107,10 +107,9 @@ public class SessionReceiveContinuationMessage extends SessionContinuationMessag } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerID=" + consumerID); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java index 68b68b5e28..68ae2c59fd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveLargeMessage.java @@ -115,13 +115,12 @@ public class SessionReceiveLargeMessage extends PacketImpl implements MessagePac } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerID=" + consumerID); buff.append(", deliveryCount=" + deliveryCount); buff.append(", largeMessageSize=" + largeMessageSize); buff.append(", message=" + message); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveMessage.java index 0a8d8709fa..32e41e465e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionReceiveMessage.java @@ -91,8 +91,8 @@ public class SessionReceiveMessage extends MessagePacket { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", consumerID=" + consumerID); buff.append(", deliveryCount=" + deliveryCount); buff.append("]"); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java index fc495fee41..38a8d0e35e 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionRequestProducerCreditsMessage.java @@ -75,11 +75,10 @@ public class SessionRequestProducerCreditsMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", credits=" + credits); buff.append(", address=" + address); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java index 4105b11864..40f9721bb1 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage.java @@ -151,13 +151,12 @@ public class SessionSendContinuationMessage extends SessionContinuationMessage { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", continues=" + continues); buff.append(", message=" + message); buff.append(", messageBodySize=" + messageBodySize); buff.append(", requiresResponse=" + requiresResponse); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java index 2a3071c930..3e7629a92c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendContinuationMessage_V2.java @@ -95,8 +95,8 @@ public class SessionSendContinuationMessage_V2 extends SessionSendContinuationMe } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", continues=" + continues); buff.append(", message=" + message); buff.append(", messageBodySize=" + messageBodySize); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java index b936cdc160..73b07d331a 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendLargeMessage.java @@ -74,10 +74,9 @@ public class SessionSendLargeMessage extends PacketImpl implements MessagePacket } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", largeMessage=" + largeMessage); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java index e8dbdc12a7..e3f9766cbd 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage.java @@ -118,10 +118,9 @@ public class SessionSendMessage extends MessagePacket { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", requiresResponse=" + requiresResponse); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java index 63c9a344f6..bcc8f3e2ea 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionSendMessage_V2.java @@ -79,11 +79,10 @@ public class SessionSendMessage_V2 extends SessionSendMessage { @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", correlationID=" + correlationID); buff.append(", requiresResponse=" + super.isRequiresResponse()); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAAfterFailedMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAAfterFailedMessage.java index 32f23a99ff..c74ddae7d9 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAAfterFailedMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAAfterFailedMessage.java @@ -71,10 +71,9 @@ public class SessionXAAfterFailedMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xid=" + xid); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXACommitMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXACommitMessage.java index 29f7a3b973..8f7d3c48f7 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXACommitMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXACommitMessage.java @@ -60,8 +60,8 @@ public class SessionXACommitMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", xid=" + xid + ", onePhase=" + onePhase + "]"; + public String getPacketString() { + return super.getPacketString() + ", xid=" + xid + ", onePhase=" + onePhase + "]"; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAEndMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAEndMessage.java index 991a1f922c..3e52ba668c 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAEndMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAEndMessage.java @@ -61,8 +61,8 @@ public class SessionXAEndMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", xid=" + xid + ", failed=" + failed + "]"; + public String getPacketString() { + return super.getPacketString() + ", xid=" + xid + ", failed=" + failed + "]"; } @Override diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java index df9bf96acc..8a917c502d 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAForgetMessage.java @@ -59,9 +59,8 @@ public class SessionXAForgetMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append(", xid=" + xid); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java index 09a8d89a68..106d81e841 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetInDoubtXidsResponseMessage.java @@ -68,8 +68,8 @@ public class SessionXAGetInDoubtXidsResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xids=" + xids); buff.append("]"); return buff.toString(); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java index f1a702aa04..b98e7a4932 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAGetTimeoutResponseMessage.java @@ -61,10 +61,9 @@ public class SessionXAGetTimeoutResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", timeoutSeconds=" + timeoutSeconds); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java index d31adcdc93..dab46a25f3 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAJoinMessage.java @@ -59,10 +59,9 @@ public class SessionXAJoinMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xid=" + xid); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java index d55747e457..2f85b48403 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAPrepareMessage.java @@ -59,10 +59,9 @@ public class SessionXAPrepareMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xid=" + xid); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java index f88e0c8055..a62425c560 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage.java @@ -85,8 +85,8 @@ public class SessionXAResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", error=" + error); buff.append(", message=" + message); buff.append(", responseCode=" + responseCode); diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage_V2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage_V2.java index 4e949bd405..c157e70e5a 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage_V2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResponseMessage_V2.java @@ -64,13 +64,12 @@ public class SessionXAResponseMessage_V2 extends SessionXAResponseMessage { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", error=" + error); buff.append(", message=" + message); buff.append(", responseCode=" + responseCode); buff.append(", correlationID=" + correlationID); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java index d88e8e322e..7342a9abed 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAResumeMessage.java @@ -61,10 +61,9 @@ public class SessionXAResumeMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xid=" + xid); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java index abfea74134..1ad5db60ef 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXARollbackMessage.java @@ -61,10 +61,9 @@ public class SessionXARollbackMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xid=" + xid); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java index 79406fee3e..63c6718d96 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutMessage.java @@ -58,10 +58,9 @@ public class SessionXASetTimeoutMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", timeoutSeconds=" + timeoutSeconds); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java index 6ec69d4de0..efb26d74ce 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXASetTimeoutResponseMessage.java @@ -63,10 +63,9 @@ public class SessionXASetTimeoutResponseMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", ok=" + ok); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAStartMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAStartMessage.java index d6a8e84d3f..16926c4cce 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAStartMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SessionXAStartMessage.java @@ -68,10 +68,9 @@ public class SessionXAStartMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", xid=" + xid); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessage.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessage.java index 6038577fa9..862d4d65e4 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessage.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessage.java @@ -60,10 +60,9 @@ public class SubscribeClusterTopologyUpdatesMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", clusterConnection=" + clusterConnection); - buff.append("]"); return buff.toString(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java index ac46a2c526..e91f3fc952 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/SubscribeClusterTopologyUpdatesMessageV2.java @@ -62,10 +62,9 @@ public class SubscribeClusterTopologyUpdatesMessageV2 extends SubscribeClusterTo } @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", clientVersion=" + clientVersion); - buff.append("]"); return buff.toString(); } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java index 0564220d51..fc381c26df 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/BackupReplicationStartFailedMessage.java @@ -103,7 +103,7 @@ public final class BackupReplicationStartFailedMessage extends PacketImpl { } @Override - public String toString() { - return getParentString() + ", problem=" + problem.name() + "]"; + protected String getPacketString() { + return super.getPacketString() + ", problem=" + problem.name(); } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java index 074e7b454b..af2d15b193 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/NodeAnnounceMessage.java @@ -144,15 +144,14 @@ public class NodeAnnounceMessage extends PacketImpl { } @Override - public String toString() { - return "NodeAnnounceMessage [backup=" + backup + + protected String getPacketString() { + String baseString = super.getPacketString(); + return baseString + + ", backup=" + backup + ", connector=" + connector + ", nodeID=" + - nodeID + - ", toString()=" + - super.toString() + - "]"; + nodeID; } @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QuorumVoteMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QuorumVoteMessage.java index 2f4e0248ed..3e09fda467 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QuorumVoteMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QuorumVoteMessage.java @@ -68,17 +68,9 @@ public class QuorumVoteMessage extends PacketImpl { vote = voteHandler.decode(voteBuffer); } - @Override - public String toString() { - StringBuffer buff = new StringBuffer(getParentString()); - buff.append("]"); - return buff.toString(); - } - - @Override - public String getParentString() { - StringBuffer buff = new StringBuffer(super.getParentString()); + protected String getPacketString() { + StringBuffer buff = new StringBuffer(super.getPacketString()); buff.append(", vote=" + vote); buff.append(", handler=" + handler); return buff.toString(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java index 245ec18eb4..47d170af16 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationCommitMessage.java @@ -108,9 +108,10 @@ public final class ReplicationCommitMessage extends PacketImpl { } @Override - public String toString() { + protected String getPacketString() { + String baseString = super.getPacketString(); String txOperation = rollback ? "rollback" : "commmit"; - return ReplicationCommitMessage.class.getSimpleName() + "[type=" + getType() + ", channel=" + getChannelID() + - ", journalID=" + journalID + ", txAction='" + txOperation + "']"; + return baseString + "[type=" + getType() + ", channel=" + getChannelID() + + ", journalID=" + journalID + ", txAction='" + txOperation + "'"; } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java index 1ecaa683c0..8f875ba69b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageBeginMessage.java @@ -67,10 +67,9 @@ public class ReplicationLargeMessageBeginMessage extends PacketImpl { } @Override - public String toString() { - return "ReplicationLargeMessageBeginMessage{" + - "messageId=" + messageId + - '}'; + protected String getPacketString() { + return super.getPacketString() + + "messageId=" + messageId; } @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java index 2c1d808ace..4be5ef5078 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageEndMessage.java @@ -86,10 +86,9 @@ public class ReplicationLargeMessageEndMessage extends PacketImpl { } @Override - public String toString() { - return "ReplicationLargeMessageEndMessage{" + - "messageId=" + messageId + ", isDelete=" + isDelete + - '}'; + protected String getPacketString() { + return super.getPacketString() + + "messageId=" + messageId + ", isDelete=" + isDelete; } @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java index ffee14c8ac..cb7f2f2dee 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLargeMessageWriteMessage.java @@ -91,11 +91,10 @@ public final class ReplicationLargeMessageWriteMessage extends PacketImpl { } @Override - public String toString() { - return "ReplicationLargeMessageWriteMessage{" + + protected String getPacketString() { + return super.getPacketString() + "messageId=" + messageId + - ", body.size=" + body.length + - '}'; + ", body.size=" + body.length; } @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLiveIsStoppingMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLiveIsStoppingMessage.java index 456a46bb0c..1bc285f2e9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLiveIsStoppingMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationLiveIsStoppingMessage.java @@ -87,7 +87,7 @@ public final class ReplicationLiveIsStoppingMessage extends PacketImpl { } @Override - public String toString() { - return super.toString() + ":" + liveStopping; + protected String getPacketString() { + return super.getPacketString() + ", liveStopping=" + liveStopping; } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java index ea929e4d70..25e0063864 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationPageEventMessage.java @@ -87,9 +87,10 @@ public class ReplicationPageEventMessage extends PacketImpl { } @Override - public String toString() { - return ReplicationPageEventMessage.class.getSimpleName() + "(channel=" + channelID + ", isDelete=" + isDelete + - ", storeName=" + storeName + ", pageNumber=" + pageNumber + ")"; + protected String getPacketString() { + String baseString = super.getPacketString(); + return baseString + ", channel=" + channelID + ", isDelete=" + isDelete + + ", storeName=" + storeName + ", pageNumber=" + pageNumber; } @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationResponseMessageV2.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationResponseMessageV2.java index c01dd4fff7..393c328fd9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationResponseMessageV2.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationResponseMessageV2.java @@ -62,10 +62,9 @@ public final class ReplicationResponseMessageV2 extends ReplicationResponseMessa } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buf = new StringBuffer(getPacketString()); buf.append(", synchronizationIsFinishedAcknowledgement=" + synchronizationIsFinishedAcknowledgement); - buf.append("]"); return buf.toString(); } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java index ebd5d3603a..e2e3fa463b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationStartSyncMessage.java @@ -228,14 +228,13 @@ public class ReplicationStartSyncMessage extends PacketImpl { } @Override - public String toString() { - StringBuffer buf = new StringBuffer(getParentString()); + protected String getPacketString() { + StringBuffer buf = new StringBuffer(super.getPacketString()); buf.append(", synchronizationIsFinished=" + synchronizationIsFinished); buf.append(", dataType=" + dataType); buf.append(", nodeID=" + nodeID); buf.append(", ids=" + Arrays.toString(ids)); buf.append(", allowsAutoFailBack=" + allowsAutoFailBack); - buf.append("]"); return buf.toString(); } } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java index b81782bcd0..fcc2d0fa45 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ReplicationSyncFileMessage.java @@ -276,8 +276,8 @@ public final class ReplicationSyncFileMessage extends PacketImpl { } @Override - public String toString() { - return ReplicationSyncFileMessage.class.getSimpleName() + "(" + fileType + - (journalType != null ? ", " + journalType : "") + ", id=" + fileId + ")"; + protected String getPacketString() { + return super.getPacketString() + ", fileType=" + fileType + + (journalType != null ? ", " + journalType : "") + ", id=" + fileId; } }