You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Akira AJISAKA (JIRA)" <ji...@apache.org> on 2015/04/15 21:00:59 UTC
[jira] [Updated] (YARN-3005) [JDK7] Use switch statement for String
instead of if-else statement in RegistrySecurity.java
[ https://issues.apache.org/jira/browse/YARN-3005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Akira AJISAKA updated YARN-3005:
--------------------------------
Assignee: Kengo Seki
> [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
> Assignee: Kengo Seki
> 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)