Skip to content

Commit

Permalink
Port fix missing reasonCode in MqttMessages from master
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Nov 20, 2023
1 parent 3f2b6cb commit b937b4d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public MqttAuth(

@Override
protected @NotNull String toAttributeString() {
return "reasonCode= " + getReasonCode() + ", method=" + method +
return "reasonCode=" + getReasonCode() + ", method=" + method +
((data == null) ? "" : ", data=" + data.remaining() + "byte") +
StringUtil.prepend(", ", super.toAttributeString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.hivemq.mqtt.client2.internal.datatypes.MqttUserPropertiesImpl;
import com.hivemq.mqtt.client2.internal.datatypes.MqttUtf8StringImpl;
import com.hivemq.mqtt.client2.internal.message.MqttMessageWithUserProperties;
import com.hivemq.mqtt.client2.internal.util.StringUtil;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubAck;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubAckReasonCode;
import org.jetbrains.annotations.NotNull;
Expand All @@ -45,7 +46,7 @@ public MqttPubAck(

@Override
public @NotNull String toString() {
return "MqttPubAck{" + toAttributeString() + "}";
return "MqttPubAck{reasonCode=" + getReasonCode() + StringUtil.prepend(", ", super.toAttributeString()) + "}";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.hivemq.mqtt.client2.internal.datatypes.MqttUserPropertiesImpl;
import com.hivemq.mqtt.client2.internal.datatypes.MqttUtf8StringImpl;
import com.hivemq.mqtt.client2.internal.message.MqttMessageWithUserProperties;
import com.hivemq.mqtt.client2.internal.util.StringUtil;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubComp;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubCompReasonCode;
import org.jetbrains.annotations.NotNull;
Expand All @@ -45,7 +46,7 @@ public MqttPubComp(

@Override
public @NotNull String toString() {
return "MqttPubComp{" + toAttributeString() + "}";
return "MqttPubComp{reasonCode=" + getReasonCode() + StringUtil.prepend(", ", super.toAttributeString()) + "}";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.hivemq.mqtt.client2.internal.datatypes.MqttUserPropertiesImpl;
import com.hivemq.mqtt.client2.internal.datatypes.MqttUtf8StringImpl;
import com.hivemq.mqtt.client2.internal.message.MqttMessageWithUserProperties;
import com.hivemq.mqtt.client2.internal.util.StringUtil;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubRec;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubRecReasonCode;
import org.jetbrains.annotations.NotNull;
Expand All @@ -45,7 +46,7 @@ public MqttPubRec(

@Override
public @NotNull String toString() {
return "MqttPubRec{" + toAttributeString() + "}";
return "MqttPubRec{reasonCode=" + getReasonCode() + StringUtil.prepend(", ", super.toAttributeString()) + "}";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.hivemq.mqtt.client2.internal.datatypes.MqttUserPropertiesImpl;
import com.hivemq.mqtt.client2.internal.datatypes.MqttUtf8StringImpl;
import com.hivemq.mqtt.client2.internal.message.MqttMessageWithUserProperties;
import com.hivemq.mqtt.client2.internal.util.StringUtil;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubRel;
import com.hivemq.mqtt.client2.mqtt5.message.publish.Mqtt5PubRelReasonCode;
import org.jetbrains.annotations.NotNull;
Expand All @@ -45,7 +46,7 @@ public MqttPubRel(

@Override
public @NotNull String toString() {
return "MqttPubRel{" + toAttributeString() + "}";
return "MqttPubRel{reasonCode=" + getReasonCode() + StringUtil.prepend(", ", super.toAttributeString()) + "}";
}

@Override
Expand Down

0 comments on commit b937b4d

Please sign in to comment.