Commons OGNL
  1. Commons OGNL
  2. OGNL-6

When setting fields type conversion returning null falsly reports a NoSuchPropertyException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.6.9
    • Fix Version/s: 2.7
    • Component/s: PropertyAccessors
    • Labels:
      None

      Description

      When calling a method, if type conversion fails (returns null), a parameter is just set to null and then the method is called.

      When setting a field, if type conversion (returns null), the field set is skipped altogether and a NoSuchPropertyException is thrown. Instead, the field should be set to null to be parallel with method calling and not report a false exception.

        Activity

        Stephen Haberman created issue -
        Stephen Haberman made changes -
        Field Original Value New Value
        Attachment fieldSetNull.diff [ 11932 ]
        Jesse Kuhnert made changes -
        Fix Version/s 2.6.11 [ 21685 ]
        Affects Version/s 2.6.9 [ 21687 ]
        Jesse Kuhnert made changes -
        Component/s PropertyAccessors [ 21250 ]
        Hide
        Jesse Kuhnert added a comment -

        Need more time to confirm this behavior.

        Show
        Jesse Kuhnert added a comment - Need more time to confirm this behavior.
        Jesse Kuhnert made changes -
        Fix Version/s 3.0 [ 21686 ]
        Fix Version/s 2.6.11 [ 21685 ]
        Hide
        Jesse Kuhnert added a comment -

        I changed this recently so that if type conversion fails a catchable exception is thrown.

        Show
        Jesse Kuhnert added a comment - I changed this recently so that if type conversion fails a catchable exception is thrown.
        Jesse Kuhnert made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Erik Jõgi added a comment -

        I just stumbled on this issue when using OGNL in Struts2. I have a custom TypeConverter that returns null sometimes. This returned value is ignored and a NoSuchPropertyException is thrown.

        I agree with the original description that possibility to set null values to a field shoud be supported.

        Can you please comment as to why won't you fix this?

        Show
        Erik Jõgi added a comment - I just stumbled on this issue when using OGNL in Struts2. I have a custom TypeConverter that returns null sometimes. This returned value is ignored and a NoSuchPropertyException is thrown. I agree with the original description that possibility to set null values to a field shoud be supported. Can you please comment as to why won't you fix this?
        Tony Stevenson made changes -
        Project Import Mon Jun 18 09:00:45 UTC 2012 [ 1340010045016 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Stephen Haberman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development