Commons BeanUtils
  1. Commons BeanUtils
  2. BEANUTILS-69

[beanutils] MappedPropertyDescriptor wont recognize boolean property accessor

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: 1.8.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      The MappedPropertyDescriptor's constructor does not look for boolean property
      accessors of the form is<PropertyName>(String).

      This common form of boolean property accessor can easily be, and should be,
      supported by MappedPropertyDescriptor

      Thanks
      Chris

        Activity

        Hide
        Niall Pemberton added a comment -

        I have changed MappedPropertyDescriptor to now also check for is<PropertyName>
        if no get<PropertyName> method is found.

        http://svn.apache.org/viewcvs?rev=332503&view=rev

        Closing this as FIXED

        Show
        Niall Pemberton added a comment - I have changed MappedPropertyDescriptor to now also check for is<PropertyName> if no get<PropertyName> method is found. http://svn.apache.org/viewcvs?rev=332503&view=rev Closing this as FIXED
        Hide
        Simon Kitching added a comment -

        This approach sounds fine to me.

        Show
        Simon Kitching added a comment - This approach sounds fine to me.
        Hide
        Travis Zimmerman added a comment -

        I would like to propose the following:

        Change the constructor MappedPropertyDescriptor(String , Class)
        to call newly created findReadMethod and findWriteMethod methods.

        All new methods would have the same signatures as the findMethod methods.

        findReadMethod methods would do much the same as before, except they would try
        to find a "get" and "is" method using the internalFindMethod.

        findWriteMethod would act as before, added only for consistency.

        This change would have the least impact on the current code and avoid having to
        try to find a "is" method after catching an IntrospectionException.

        If this is acceptable I can add the code and test case(s) as a patch.

        Travis Zimmerman

        Show
        Travis Zimmerman added a comment - I would like to propose the following: Change the constructor MappedPropertyDescriptor(String , Class) to call newly created findReadMethod and findWriteMethod methods. All new methods would have the same signatures as the findMethod methods. findReadMethod methods would do much the same as before, except they would try to find a "get" and "is" method using the internalFindMethod. findWriteMethod would act as before, added only for consistency. This change would have the least impact on the current code and avoid having to try to find a "is" method after catching an IntrospectionException. If this is acceptable I can add the code and test case(s) as a patch. Travis Zimmerman

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Audley
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development