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/12 18:58:55 UTC

[GitHub] [activemq-artemis] brusdev opened a new pull request #3577: ARTEMIS-3294 Fix conversion of messages with a text body

brusdev opened a new pull request #3577:
URL: https://github.com/apache/activemq-artemis/pull/3577


   


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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
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();
   final 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



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

Posted by GitBox <gi...@apache.org>.
gtully commented on pull request #3577:
URL: https://github.com/apache/activemq-artemis/pull/3577#issuecomment-840472779


   that looks correct, good catch. I recall trying to get rid of the simpleString,  learning :-)


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



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

Posted by GitBox <gi...@apache.org>.
brusdev commented on a change in pull request #3577:
URL: https://github.com/apache/activemq-artemis/pull/3577#discussion_r631716865



##########
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:
       @franz1981 thanks, just fixed




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



[GitHub] [activemq-artemis] gtully merged pull request #3577: ARTEMIS-3294 Fix conversion of messages with a text body

Posted by GitBox <gi...@apache.org>.
gtully merged pull request #3577:
URL: https://github.com/apache/activemq-artemis/pull/3577


   


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