You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/12/16 06:27:26 UTC

[GitHub] [rocketmq] zongtanghu commented on a change in pull request #1572: [ISSUE #1558]module `acl` compatible with 1.6

zongtanghu commented on a change in pull request #1572: [ISSUE #1558]module `acl` compatible with 1.6
URL: https://github.com/apache/rocketmq/pull/1572#discussion_r358068621
 
 

 ##########
 File path: acl/src/main/java/org/apache/rocketmq/acl/common/Permission.java
 ##########
 @@ -59,19 +59,19 @@ public static byte parsePermFromString(String permString) {
         if (permString == null) {
             return Permission.DENY;
         }
-        switch (permString.trim()) {
-            case "PUB":
-                return Permission.PUB;
-            case "SUB":
-                return Permission.SUB;
-            case "PUB|SUB":
-                return Permission.PUB | Permission.SUB;
-            case "SUB|PUB":
-                return Permission.PUB | Permission.SUB;
-            case "DENY":
-                return Permission.DENY;
-            default:
-                return Permission.DENY;
+        String permTrimString = permString.trim();
+        if ("PUB".equals(permTrimString)) {
+            return Permission.PUB;
+        } else if ("SUB".equals(permTrimString)) {
+            return Permission.SUB;
+        } else if ("PUB|SUB".equals(permTrimString)) {
+            return Permission.PUB | Permission.SUB;
+        } else if ("SUB|PUB".equals(permTrimString)) {
+            return Permission.PUB | Permission.SUB;
+        } else if ("DENY".equals(permTrimString)) {
+            return Permission.DENY;
 
 Review comment:
   The same question as above.

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