--- Comment #14 from Christopher Schultz <> ---
The fromLookupAndSwitch technique seems to be implemented in an awkward way.
Why bother converting from String -> Enum and then using a switch on the enum,
instead of just (a) implementing a getScopeNumber() method in each enum
instance or (b) just using convenient ordinal values which match the value you
actually want?

I would think this would be the best implementation if you wanted to use Enums:

enum Scope {
    applicationScope(0), cookie(1), header(2), ...

  public static int fromLookupAndSwitch(String scope) {
    Scope scope = lookupMap.get(scope);
    if(null == scope) {
    } else {
      return scope.ordinal();

I understand that this test is no longer "from lookup and switch" but I decided
to keep the method name the same.

I guess the point is if you use a hash, you don't have to use a switch at all.

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to