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

(enum) poor performance in compiler-generated Enum.valueOf(String)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • tools
    • b12
    • generic, x86
    • solaris_8, windows_xp
    • Verified

      The compiler-generated code for the static method valueOf(String) in every enum
      type scans the list of enumeration constants linearly. Correct but not very
      efficient. Better would be to delegate to Enum.valueOf(Class,String), which
      uses a Map maintained in the class object.

            ahe Peter Ahe
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: