viktorsomogyi commented on code in PR #14756:
URL: https://github.com/apache/kafka/pull/14756#discussion_r1400948591


##########
clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:
##########
@@ -185,6 +188,18 @@ private SslEngineFactory 
createNewSslEngineFactory(Map<String, ?> newConfigs) {
         }
     }
 
+    private static boolean getBoolean(final Map<String, Object> configs, final 
String key, final boolean defaultValue) {
+        final Object value = configs.getOrDefault(key, defaultValue);
+        if (value instanceof Boolean) {
+            return (boolean) value;
+        } else if (value instanceof String) {
+            return Boolean.parseBoolean((String) value);
+        } else {
+            log.warn("Invalid value (" + value + ") on configuration '" + key 
+ "'. Please specify a true/false value.");

Review Comment:
   Please also mention that in this case the default value is used (and the 
default value itself), otherwise it reads a bit incomplete.



##########
clients/src/main/java/org/apache/kafka/common/security/ssl/SslFactory.java:
##########
@@ -185,6 +188,18 @@ private SslEngineFactory 
createNewSslEngineFactory(Map<String, ?> newConfigs) {
         }
     }
 
+    private static boolean getBoolean(final Map<String, Object> configs, final 
String key, final boolean defaultValue) {

Review Comment:
   This is probably more like a utility-like method, would you please move it 
to `org.apache.kafka.common.utils.ConfigUtils` for now?



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to