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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]