You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/12/04 20:14:25 UTC

[GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #293: HDDS-2530. Sonar : refactor verifyResourceName in HddsClientUtils to fix Sonar errors

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_r353959404
 
 

 ##########
 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]"));
 
 Review comment:
   We can avoid the string conversion and pattern match with the following:
   return Character.isLowerCase(c) || Character.isDigit(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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org