xiaoyuyao commented on a change in pull request #293: HDDS-2530. Sonar : 
refactor verifyResourceName in HddsClientUtils to fix Sonar errors
URL: https://github.com/apache/hadoop-ozone/pull/293#discussion_r353959507
 
 

 ##########
 File path: 
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
 ##########
 @@ -150,6 +142,49 @@ public static void verifyResourceName(String resName)
       throw new IllegalArgumentException("Bucket or Volume name "
           + "cannot end with a period or dash");
     }
+  }
+
+  private static boolean isLowercaseAlphanumeric(char c) {
+    return (Character.toString(c).matches("[a-z0-9]"));
+  }
+
+  private static boolean isSupportedCharacter(char c) {
+    return (c == '.' || c == '-' || isLowercaseAlphanumeric(c));
+  }
+
+  private static void doCharacterChecks(char currChar, char prev) {
+    if (currChar > 'A' && currChar < 'Z') {
 
 Review comment:
   Can we use Character.isUpperCase(c)

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to