hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-3005) [JDK7] Use switch statement for String instead of if-else statement in RegistrySecurity.java
Date Thu, 15 Jan 2015 15:36:43 GMT

    [ https://issues.apache.org/jira/browse/YARN-3005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278811#comment-14278811
] 

Hudson commented on YARN-3005:
------------------------------

SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2025 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2025/])
YARN-3005. [JDK7] Use switch statement for String instead of if-else statement in RegistrySecurity.java
(Contributed by Kengo Seki) (aajisaka: rev 533e551eb42af188535aeb0ab35f8ebf150a0da1)
* hadoop-yarn-project/hadoop-yarn/hadoop-yarn-registry/src/main/java/org/apache/hadoop/registry/client/impl/zk/RegistrySecurity.java
* hadoop-yarn-project/CHANGES.txt


> [JDK7] Use switch statement for String instead of if-else statement in RegistrySecurity.java
> --------------------------------------------------------------------------------------------
>
>                 Key: YARN-3005
>                 URL: https://issues.apache.org/jira/browse/YARN-3005
>             Project: Hadoop YARN
>          Issue Type: Improvement
>    Affects Versions: 2.7.0
>            Reporter: Akira AJISAKA
>            Priority: Trivial
>              Labels: newbie
>             Fix For: 2.7.0
>
>         Attachments: YARN-3005.001.patch, YARN-3005.002.patch
>
>
> Since we have moved to JDK7, we can refactor the below if-else statement for String.
> {code}
>     // TODO JDK7 SWITCH
>     if (REGISTRY_CLIENT_AUTH_KERBEROS.equals(auth)) {
>       access = AccessPolicy.sasl;
>     } else if (REGISTRY_CLIENT_AUTH_DIGEST.equals(auth)) {
>       access = AccessPolicy.digest;
>     } else if (REGISTRY_CLIENT_AUTH_ANONYMOUS.equals(auth)) {
>       access = AccessPolicy.anon;
>     } else {
>       throw new ServiceStateException(E_UNKNOWN_AUTHENTICATION_MECHANISM
>                                       + "\"" + auth + "\"");
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message