gemmellr commented on a change in pull request #3854:
URL: https://github.com/apache/activemq-artemis/pull/3854#discussion_r758576080
##########
File path:
artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessage.java
##########
@@ -853,10 +853,14 @@ public boolean waitCompletionOnStream(final long
timeWait) throws JMSException {
@Override
public String toString() {
StringBuffer sb = new StringBuffer("ActiveMQMessage[");
- sb.append(getJMSMessageID());
- sb.append("]:");
- sb.append(message.isDurable() ? "PERSISTENT" : "NON-PERSISTENT");
- sb.append("/" + message.toString());
+ if (message != null) {
Review comment:
The constructor only looks to be directly called by some 'compatible'
subclasses empty constructors (which then arent called directly), and some
tests that could easily use one of the several other constructors. Everything
operates on the delegate ClientMessage instance passed or created in all the
other constructors, thats actually where I'd expect decoding happens rather
than here.
I agree there is no real harm to 'fixing' it this way, I just think its
generally changing the wrong thing and leaving an issue that neednt exist.
Everything else here clearly expects its non-null, enforcing that seems the
appropriate way to go.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]