accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ACCUMULO-2647) Replace String comparison if-then-else with switch
Date Fri, 13 Jun 2014 00:13:03 GMT

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

ASF subversion and git services commented on ACCUMULO-2647:
-----------------------------------------------------------

Commit 6c30e6b8e2f3da3e4a96dd1d2767712805a4e7c2 in accumulo's branch refs/heads/master from
[~jschwartz73]
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=6c30e6b ]

ACCUMULO-2647 changed if/then/else to switch statement

Signed-off-by: Sean Busbey <busbey@cloudera.com>


> Replace String comparison if-then-else with switch
> --------------------------------------------------
>
>                 Key: ACCUMULO-2647
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-2647
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: start
>    Affects Versions: 1.6.0
>            Reporter: Mike Drob
>            Assignee: Jeffrey S Schwartz
>              Labels: newbie, summit2014
>             Fix For: 1.7.0
>
>         Attachments: ACCUMULO-2647.patch.txt
>
>
> In o.a.a.start.Main we have a giant if-then-else ladder for determining which class to
use. With Java 7, we can replace this with a switch statement.
> bq. The switch statement compares the String object in its expression with the expressions
associated with each case label as if it were using the String.equals method; consequently,
the comparison of String objects in switch statements is case sensitive. The Java compiler
generates generally more efficient bytecode from switch statements that use String objects
than from chained if-then-else statements.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message