ihuzenko commented on a change in pull request #2012: DRILL-7625: Add options 
for SslContextFactory
URL: https://github.com/apache/drill/pull/2012#discussion_r388831691
 
 

 ##########
 File path: 
common/src/main/java/org/apache/drill/common/config/NestedConfig.java
 ##########
 @@ -111,6 +111,14 @@ public String getString(String path) {
     return c.getString(path);
   }
 
+  public String getString(String path, String defaultValue) {
+    String value = hasPath(path) ? getString(path) : null;
+    if (value == null || (value = value.trim()).isEmpty()) {
+      return defaultValue;
+    }
+    return value;
 
 Review comment:
   ```StringUtils.defaultIfBlank``` changes method logic, since in an original 
method was: 
   ```java
     private String getConfigParamWithDefault(String name, String defaultValue) 
{
       String value = "";
       if (config.hasPath(name)) {
         value = config.getString(name);
       }
       if (value.isEmpty()) {
         value = defaultValue;
       }
       value = value.trim();
       return value;
     }
   ```
   Although I don't think that trimming was actually necessary, so I'll try 
your suggestion. 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to