[ https://issues.apache.org/jira/browse/ARTEMIS-5266?focusedWorklogId=954451&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-954451 ]
ASF GitHub Bot logged work on ARTEMIS-5266: ------------------------------------------- Author: ASF GitHub Bot Created on: 29/Jan/25 15:40 Start Date: 29/Jan/25 15:40 Worklog Time Spent: 10m Work Description: 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()`. Issue Time Tracking ------------------- Worklog Id: (was: 954451) Time Spent: 0.5h (was: 20m) > Code gardening after move to Java 17 > ------------------------------------ > > Key: ARTEMIS-5266 > URL: https://issues.apache.org/jira/browse/ARTEMIS-5266 > Project: ActiveMQ Artemis > Issue Type: Task > Reporter: Justin Bertram > Assignee: Justin Bertram > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > With the recent move to Java 17 now is a good time to do some code gardening > to leverage new language features (e.g. text blocks) and deal with old issue > (e.g. unused variables, etc.). -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@activemq.apache.org For additional commands, e-mail: issues-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact