gemmellr commented on code in PR #5477: URL: https://github.com/apache/activemq-artemis/pull/5477#discussion_r1934123195
########## artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/TypedProperties.java: ########## @@ -174,10 +174,10 @@ public Boolean getBooleanProperty(final SimpleString key) throws ActiveMQPropert Object value = doGetProperty(key); if (value == null) { return Boolean.valueOf(null); - } else if (value instanceof Boolean) { - return (Boolean) value; - } else if (value instanceof SimpleString) { - return Boolean.valueOf(((SimpleString) value).toString()); + } else if (value instanceof Boolean boolean1) { + return boolean1; + } else if (value instanceof SimpleString string) { + return Boolean.valueOf(string.toString()); Review Comment: Things like boolean1 (plus byte1, short1, float1,and double1 etc that follow below) are more than a bit ugly, probably even less readable compared to the casts. Calling the SimpleString _string_ results in the silly reading `string.toString()`. -- 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-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact