You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2007/05/24 17:39:17 UTC

[jira] Updated: (BEANUTILS-88) PropertyUtilsBean.isReadable/isWriteable always returns false for mapped properties

     [ https://issues.apache.org/jira/browse/BEANUTILS-88?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated BEANUTILS-88:
-------------------------------------

             Assignee: Niall Pemberton
    Affects Version/s: 1.7.0
              Summary: PropertyUtilsBean.isReadable/isWriteable always returns false for mapped properties  (was: [beanutils] PropertyUtilsBean.isReadable/isWriteable always returns false for mapped properties)

> PropertyUtilsBean.isReadable/isWriteable always returns false for mapped properties
> -----------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-88
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-88
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.7.0
>         Environment: Operating System: All
> Platform: All
>            Reporter: Chuck Daniels
>         Assigned To: Niall Pemberton
>             Fix For: 1.8.0
>
>
> PropertyUtilsBean.isReadable/isWriteable always returns false for mapped 
> properties because it does not account for them.  The core logic within the try 
> block of the isReadable method should look as follows (the logic for 
> isWriteable should be updated similarly):
> PropertyDescriptor desc =
>     getPropertyDescriptor(bean, name);
> if (desc != null) {
>     Method readMethod = desc.getReadMethod();
>     if (readMethod == null) {
>         if (desc instanceof IndexedPropertyDescriptor) {
>             readMethod = ((IndexedPropertyDescriptor) desc).getIndexedReadMethod
> ();
>         } else if (desc instanceof MappedPropertyDescriptor) {
>             readMethod = ((MappedPropertyDescriptor) desc).getMappedReadMethod
> ();
>         }
>     }
>     return (readMethod != null);
> } else {
>     return (false);
> }

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org