MyFaces Core
  1. MyFaces Core
  2. MYFACES-2007

Converters are not created properly when target class is both, an enum and implements an interface

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.4
    • Fix Version/s: 1.2.7
    • Component/s: None
    • Labels:
      None

      Description

      This patch fixes the following situation:

      • A converter is bound in faces-config.xml to an interface type (ex. EnumCoded).
      • There is an enum class that implements EnumCoded, like this:

      public enum PickListActionType implements EnumCoded

      { ..... etc... }
      • There is a converter called a GenericEnumTypeConverter, which knows how to deal with these and is declared like this:
        <converter>
        <converter-for-class>EnumCoded</converter-for-class>
        <converter-class>GenericEnumTypeConverter</converter-class>
        </converter>
      • Right now the converter picked by MyFaces is EnumConverter instead of my GenericEnumTypeConverter, b/c the fact that my target class is an enum takes precedence over the fact that it implements EnumCoded interface. This is incorrect.

      This patch fixes the problem.

        Activity

        Hide
        Matthias Weßendorf added a comment -

        can you add this to myfaces 2.0 ?

        Show
        Matthias Weßendorf added a comment - can you add this to myfaces 2.0 ?
        Hide
        Leonardo Uribe added a comment -

        Patch checked and test corrected (EnumCodedTestConverter not included on the patch).

        Thanks to Val Blant for provide this patch.

        Show
        Leonardo Uribe added a comment - Patch checked and test corrected (EnumCodedTestConverter not included on the patch). Thanks to Val Blant for provide this patch.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Val Blant
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development