Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-2647

Replace String comparison if-then-else with switch

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.7.0
    • Component/s: start
    • Labels:

      Description

      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.

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jschwartz73 Jeffrey S Schwartz
                Reporter:
                mdrob Mike Drob
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: