You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/08/10 06:13:21 UTC

[GitHub] [pulsar] skyguard1 commented on a change in pull request #11497: Use equals instead of == to compare strings (#11462)

skyguard1 commented on a change in pull request #11497:
URL: https://github.com/apache/pulsar/pull/11497#discussion_r685718996



##########
File path: managed-ledger/src/test/java/org/apache/bookkeeper/test/ZooKeeperUtil.java
##########
@@ -116,7 +116,7 @@ public void startServer(String path) throws Exception {
         // create a zookeeper client
         LOG.debug("Instantiate ZK Client");
         zkc = ZooKeeperClient.newBuilder().connectString(getZooKeeperConnectString()).build();
-        if (path != "") {
+        if (StringUtils.isNotEmpty(path)) {

Review comment:
       In fact, I changed to `StringUtils.isNotEmpty` because of @michaeljmarshall  review.
   https://github.com/apache/pulsar/pull/11497#discussion_r684524851
   In my opinion, we should not use unnecessary third-party libraries. I think `! "".equals(path)` is also ok because `NullPointerException` can be avoided, thanks




-- 
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: commits-unsubscribe@pulsar.apache.org

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