You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/05/13 10:03:30 UTC

[GitHub] [activemq-artemis] franz1981 commented on a change in pull request #3577: ARTEMIS-3294 Fix conversion of messages with a text body

franz1981 commented on a change in pull request #3577:
URL: https://github.com/apache/activemq-artemis/pull/3577#discussion_r631702256



##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/openmbean/OpenTypeSupport.java
##########
@@ -293,7 +293,7 @@ protected void init() throws OpenDataException {
             if (m.containsProperty(Message.HDR_LARGE_COMPRESSED)) {
                rc.put(CompositeDataConstants.TEXT_BODY, "[compressed]");
             } else {
-               final String text = m.getReadOnlyBodyBuffer().readString();
+               final String text = m.getReadOnlyBodyBuffer().readNullableSimpleString().toString();

Review comment:
       This shouldn't be
   ```java
   final SimpleString nullableText = m.getReadOnlyBodyBuffer().readNullableSimpleString();
   fina String text = nullableText == null? null : nullableText.toString();
   // ...
   ```
   because of
   ```java
      public static SimpleString readNullableSimpleString(ByteBuf buffer) {
         int b = buffer.readByte();
         if (b == DataConstants.NULL) {
            return null;
         }
         return readSimpleString(buffer);
      }
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org