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.

Reply via email to