sebthom commented on a change in pull request #3455:
URL: https://github.com/apache/activemq-artemis/pull/3455#discussion_r576703957
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyAcceptor.java
##########
@@ -863,17 +863,19 @@ public NettyAcceptor setShutdownTimeout(int
shutdownTimeout) {
}
private static String getProtocols(Map<String, ProtocolManager>
protocolManager) {
- StringBuilder sb = new StringBuilder();
- if (protocolManager != null) {
+ if (protocolManager == null) {
Review comment:
I would actually prefer an early exit using `if(protocolManager == null)
return "";` but that would result in more lines being touched. E.g.
```java
private static String getProtocols(final Map<String, ProtocolManager>
protocolManager) {
if (protocolManager == null)
return "";
final StringBuilder sb = new StringBuilder();
final Set<String> strings = protocolManager.keySet();
for (final String string : strings) {
if (sb.length() > 0) {
sb.append(",");
}
sb.append(string);
}
return sb.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.
For queries about this service, please contact Infrastructure at:
[email protected]