jbertram commented on a change in pull request #3948:
URL: https://github.com/apache/activemq-artemis/pull/3948#discussion_r803931330
##########
File path:
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JsonUtil.java
##########
@@ -338,6 +338,9 @@ public static String truncateString(final String str, final
int valueSizeLimit)
}
public static Object truncate(final Object value, final int valueSizeLimit)
{
+ if (value == null) {
+ return "";
Review comment:
This method is used to deal with message data which is sent back to the
web console for visual inspection. Given that it didn't handle `null` property
values properly means that the web console wasn't actually getting any `null`
property values either so it wasn't clear to me that it could actually handle
them. I didn't want to fix this NPE only to create another one somewhere else.
Also, there was a precedent for using a blank string for a `null` value
already in
`org.apache.activemq.artemis.core.message.impl.CoreMessage.TextMessageOpenTypeFactory#getFields`.
I decided to carry that behavior forward here.
Lastly, a `null` property value is perfectly valid so I don't think that
throwing an exception here would be proper.
--
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]