hadoop-ozone-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #293: HDDS-2530. Sonar : refactor verifyResourceName in HddsClientUtils to fix Sonar errors
Date Wed, 04 Dec 2019 20:14:40 GMT
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:
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


Mime
View raw message