Enum.valueOf(String) should used hash table instead of linear search

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 5.0
    • Affects Version/s: 1.4.0
    • Component/s: core-libs
    • b40
    • generic
    • generic

      The current implementation of Enum.valueOf(String) is unnecessarily slow, and could easily be sped up from O(n) to O(k). There is a small space penalty (one little HashMap per enum type) but it's worth it.

            Assignee:
            Josh Bloch (Inactive)
            Reporter:
            Josh Bloch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: