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/10/29 15:41:55 UTC

[GitHub] [activemq-artemis] jbertram commented on a change in pull request #3824: ARTEMIS-3535 bytes messages not obeying management limit

jbertram commented on a change in pull request #3824:
URL: https://github.com/apache/activemq-artemis/pull/3824#discussion_r739340378



##########
File path: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
##########
@@ -1345,7 +1345,13 @@ protected void init() throws OpenDataException {
          rc.put(CompositeDataConstants.TYPE, m.getType());
          if (!m.isLargeMessage()) {
             ActiveMQBuffer bodyCopy = m.getReadOnlyBodyBuffer();
-            byte[] bytes = new byte[bodyCopy.readableBytes() <= valueSizeLimit ? bodyCopy.readableBytes() : valueSizeLimit + 1];
+            int arraySize;
+            if (valueSizeLimit == -1 || bodyCopy.readableBytes() <= valueSizeLimit) {
+               arraySize = bodyCopy.readableBytes();
+            } else {
+               arraySize = valueSizeLimit + 1;

Review comment:
       To be honest I'm not sure why the `+ 1` is there. That's the way it was originally so I just left it. However, I removed the `+ 1` and all the tests still pass. I'll go ahead and remove it.




-- 
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: gitbox-unsubscribe@activemq.apache.org

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