nathluu commented on code in PR #6400:
URL: https://github.com/apache/nifi/pull/6400#discussion_r1004109591


##########
nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java:
##########
@@ -1707,6 +1709,17 @@ public boolean isZooKeeperClientSecure() {
         return Boolean.parseBoolean(clientSecure);
     }
 
+    public boolean isZookeeperClientWithEnsembleTracker() {
+        final String defaultValue = 
String.valueOf(DEFAULT_ZOOKEEPER_CLIENT_ENSEMBLE_TRACKER);
+        final String withEnsembleTracker = 
getProperty(ZOOKEEPER_CLIENT_ENSEMBLE_TRACKER, defaultValue).trim();
+
+        if (!"true".equalsIgnoreCase(withEnsembleTracker) && 
!"false".equalsIgnoreCase(withEnsembleTracker)) {

Review Comment:
   Below is the definition of Boolean.valueOf() method. It returns `true` for 
the string "true" and `false` for any other string. I think it would be better 
to keep the validation rule strict so that only "true" or "false" is acceptable.
   ```
       public static Boolean valueOf(String s) {
           return parseBoolean(s) ? TRUE : FALSE;
       }
   
       public static boolean parseBoolean(String s) {
           return ((s != null) && s.equalsIgnoreCase("true"));
       }
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to