MyFaces Core
  1. MyFaces Core
  2. MYFACES-1328

UISelectOne and UISelectMany fail with custom converter that returns java.lang.String from getAsObject() method.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.4-SNAPSHOT
    • Fix Version/s: 1.1.5
    • Component/s: None
    • Labels:
      None

      Description

      The problem seems to be in javax.faces.component._SelectItemsUtil.matchValue(FacesContext context, Object value, Iterator selectItemsIter, _ValueConverter converter) method.

      Line 63-72:
      Object itemValue = item.getValue();
      if(converter != null && itemValue instanceof String)

      { itemValue = converter.getConvertedValue(context, (String)itemValue); }

      if (value==itemValue || value.equals(itemValue))

      { return true; }

      If item's value is java.lang.String then this code does duplicate conversion making matchValue() return false and subsequently resulting in error in calling method (validateValue() in javax.faces.component.UISelectOne and javax.faces.component.UISelectMany).

      1. reproducer.zip
        4 kB
        Alexey Maslov

        Activity

        Manfred Geiler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Manfred Geiler made changes -
        Fix Version/s 1.1.5-SNAPSHOT [ 12311960 ]
        Fix Version/s 1.1.5 [ 12312310 ]
        Grant Smith made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Martin Marinschek made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Martin Marinschek made changes -
        Assignee Martin Marinschek [ mmarinschek ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.1.5-SNAPSHOT [ 12311960 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Alexey Maslov made changes -
        Field Original Value New Value
        Attachment reproducer.zip [ 12335156 ]
        Alexey Maslov created issue -

          People

          • Assignee:
            Martin Marinschek
            Reporter:
            Alexey Maslov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development