Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4984908

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0
    • 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.

            jjb Josh Bloch
            jjb Josh Bloch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: