You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/09/23 21:19:34 UTC

[GitHub] [bookkeeper] dlg99 commented on a change in pull request #2783: Use try with resource to optimize code

dlg99 commented on a change in pull request #2783:
URL: https://github.com/apache/bookkeeper/pull/2783#discussion_r715163134



##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/util/LocalBookKeeper.java
##########
@@ -123,9 +123,7 @@ public static ZooKeeperServerShim runZookeeper(int maxCC, int zookeeperPort, Fil
 
         boolean b = waitForServerUp(InetAddress.getLoopbackAddress().getHostAddress() + ":" + zookeeperPort,
           CONNECTION_TIMEOUT);
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("ZooKeeper server up: {}", b);
-        }
+        LOG.debug("ZooKeeper server up: {}", b);

Review comment:
       please keep `if (LOG.isDebugEnabled())`
   `b` is boolean, log.debug takes Object as parameter sfo check for isDebugEnabled helps to avoid boxing.
   It is not critical for the boolean per se (only two values/preallocated) but i'd keep it for the consistency with other places. 




-- 
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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org