MyFaces Core
  1. MyFaces Core
  2. MYFACES-2920

UISelectOne/UISelectMany validateValue: Before comparing each option, coerce the option value type to the type of component's value

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2-SNAPSHOT
    • Fix Version/s: 2.0.4
    • Component/s: JSR-314
    • Labels:
      None
    • Environment:
      myfaces trunk

      Description

      From JavaDoc UISelectOne/UISelectMany validateValue:

      " ... Before comparing each option, coerce the option value type to the type of this component's value following the Expression Language coercion rules ..."

      More here:
      http://markmail.org/message/mfhyyiogaz73yfr4

      1. MYFACES-2920.patch
        14 kB
        Martin Kočí
      2. MYFACES-2920-v2.patch
        17 kB
        Martin Kočí

        Issue Links

          Activity

          Hide
          Leonardo Uribe added a comment -

          I did some changes on the tests provided and set myfaces-test version to 1.0.1-SNAPSHOT. I did other tests using the test-webapp, to check if everything is correct. An explanation for this issue is on MYFACES-3010, but I commit the changes here to allow follow them easily using subversion commits tab.

          Show
          Leonardo Uribe added a comment - I did some changes on the tests provided and set myfaces-test version to 1.0.1-SNAPSHOT. I did other tests using the test-webapp, to check if everything is correct. An explanation for this issue is on MYFACES-3010 , but I commit the changes here to allow follow them easily using subversion commits tab.
          Hide
          Martin Kočí added a comment -

          There is a test for enum javax.faces.component._SelectItemsUtilTest.testMatchValueWithEnums(), but it is currently @Ignored because requires myfaces-test 1.0.1-SNAPSHOT.

          Leonardo, can you please add there a test for problems MYFACES-3010 and MYFACES-3011? I don't fully understand the problem yet.

          And also please note that myfaces-test has own coercion implementation in MockExpressionFactory.coerceToType(Object, Class) and that can limit capabilities of testing in cases which heavily depend on EL implementation.

          Show
          Martin Kočí added a comment - There is a test for enum javax.faces.component._SelectItemsUtilTest.testMatchValueWithEnums(), but it is currently @Ignored because requires myfaces-test 1.0.1-SNAPSHOT. Leonardo, can you please add there a test for problems MYFACES-3010 and MYFACES-3011 ? I don't fully understand the problem yet. And also please note that myfaces-test has own coercion implementation in MockExpressionFactory.coerceToType(Object, Class) and that can limit capabilities of testing in cases which heavily depend on EL implementation.
          Hide
          Leonardo Uribe added a comment -

          Reopening this issue, since later tests revealed problems (see MYFACES-3010 and MYFACES-3011).

          Show
          Leonardo Uribe added a comment - Reopening this issue, since later tests revealed problems (see MYFACES-3010 and MYFACES-3011 ).
          Hide
          Martin Kočí added a comment -

          patch applied in rev. 1030636

          Show
          Martin Kočí added a comment - patch applied in rev. 1030636
          Hide
          Jakob Korherr added a comment -

          Yes, it looks really good. +1 on committing it from me too!

          Show
          Jakob Korherr added a comment - Yes, it looks really good. +1 on committing it from me too!
          Hide
          Leonardo Uribe added a comment -

          The patch looks good, +1 to commit it!

          Show
          Leonardo Uribe added a comment - The patch looks good, +1 to commit it!
          Hide
          Martin Kočí added a comment -

          If no objections, I will commit the attached patch soon!

          Show
          Martin Kočí added a comment - If no objections, I will commit the attached patch soon!
          Hide
          Martin Kočí added a comment -

          Attached MYFACES-2920-v2.patch with explicit test for Enum vs. String value combination.

          Show
          Martin Kočí added a comment - Attached MYFACES-2920 -v2.patch with explicit test for Enum vs. String value combination.

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              Martin Kočí
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development