You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Stuart Brown (JIRA)" <ji...@apache.org> on 2008/02/12 16:47:08 UTC

[jira] Created: (BEANUTILS-305) PropertyUtilsBean.isWritable() returns false when the property is mapped and there is a mapped write method available

PropertyUtilsBean.isWritable() returns false when the property is mapped and there is a mapped write method available 
----------------------------------------------------------------------------------------------------------------------

                 Key: BEANUTILS-305
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-305
             Project: Commons BeanUtils
          Issue Type: Bug
          Components: Bean / Property Utils
    Affects Versions: 1.7.0
         Environment: jdk 1.4.2
            Reporter: Stuart Brown


PropertyUtilsBean.isWritable returns false when there is a mapped property write method. It does not do this on indexed properties, I am not sure why mapped properties would be handled differently, but I do not believe they should be. Also this means there is no method in the class to test for writable mapped properties.

Also PropertyUtilsBean.isReadable has the same issue and the fix is similar.

Following code should work : 

1185                    Method writeMethod = desc.getWriteMethod();
1186                    if ((writeMethod == null) &&
1187                        (desc instanceof IndexedPropertyDescriptor)) {
1188                        writeMethod = ((IndexedPropertyDescriptor) desc).getIndexedWriteMethod();
1189                    }
+                           if (( writeMethod==null) &&
+                              (desc instanceof MappedPropertyDescriptor)) {
+                              writeMethod = ((MappedPropertyDescriptor)desc).getMappedWriteMethod();
+                            }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (BEANUTILS-305) PropertyUtilsBean.isWritable() returns false when the property is mapped and there is a mapped write method available

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BEANUTILS-305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton resolved BEANUTILS-305.
---------------------------------------

       Resolution: Duplicate
    Fix Version/s: 1.8.0-BETA

> PropertyUtilsBean.isWritable() returns false when the property is mapped and there is a mapped write method available 
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-305
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-305
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: jdk 1.4.2
>            Reporter: Stuart Brown
>             Fix For: 1.8.0-BETA
>
>
> PropertyUtilsBean.isWritable returns false when there is a mapped property write method. It does not do this on indexed properties, I am not sure why mapped properties would be handled differently, but I do not believe they should be. Also this means there is no method in the class to test for writable mapped properties.
> Also PropertyUtilsBean.isReadable has the same issue and the fix is similar.
> Following code should work : 
> 1185                    Method writeMethod = desc.getWriteMethod();
> 1186                    if ((writeMethod == null) &&
> 1187                        (desc instanceof IndexedPropertyDescriptor)) {
> 1188                        writeMethod = ((IndexedPropertyDescriptor) desc).getIndexedWriteMethod();
> 1189                    }
> +                           if (( writeMethod==null) &&
> +                              (desc instanceof MappedPropertyDescriptor)) {
> +                              writeMethod = ((MappedPropertyDescriptor)desc).getMappedWriteMethod();
> +                            }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.