rameeshm commented on code in PR #210:
URL: https://github.com/apache/ranger/pull/210#discussion_r1098174354


##########
ugsync/src/main/java/org/apache/ranger/unixusersync/config/UserGroupSyncConfig.java:
##########
@@ -1332,6 +1335,18 @@ public boolean isUserSyncNameValidationEnabled() {
                return isUserSyncNameValidationEnabled;
        }
 
+       public String getRegexSeparator() throws RuntimeException {
+               String val = prop.getProperty(SYNC_MAPPING_SEPARATOR);
+               if(StringUtils.isNotEmpty(val)) {
+                       if (val.length() == 1)
+                               return val;
+                       else{
+                               throw new RuntimeException("More than one 
character found in RegEx Separator");
+                       }
+               }
+               return DEFAULT_MAPPING_SEPARATOR;

Review Comment:
   We follow this pattern with in the Ranger Code for method returns, I would 
recommend to do the same
   String ret = DEFAULT_MAPPING_SEPARATOR;
   String val = prop.getProperty(SYNC_MAPPING_SEPARATOR);
   if (StringUtilts.isNotEmpty(val))  {
         if (val.length() == 1) {
                ret = val;
         } else {
                throw new RuntimeException("More than one character found in 
RegEx Separator");
           }
    }
     return ret;
   }
             



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