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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 6
    • Affects Version/s: 5.0
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: