Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2614

EnumConverter uses toString() instead of name()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.8, 2.0.0-beta-3
    • 2.0.0-beta-3
    • None
    • None

    Description

      Hi,

      I have an enum that has overridden the toString method.
      It seems the EnumConverter uses toString to convert an enum to a string (and Enum.valueOf(..) to find it back). However, since my toString is overriden, the value it returns is not valid input for the Enum.valueOf(..) function and the converter raises an exception.

      A better approach is to use .name() as string representation of an Enum.

      Attachments

        Issue Links

          Activity

            People

              jakobkorherr Jakob Korherr
              janssk1 gui
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: