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

        No work has yet been logged on this 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