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

Niall Pemberton updated BEANUTILS-68:
-------------------------------------

    Fix Version/s: 1.8.0

> [beanutils] Writing to a mapped property requires a setter for a map, but 
> never uses it
> ---------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-68
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-68
>             Project: Commons BeanUtils
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: Operating System: All
> Platform: PC
>            Reporter: Dmitry Platonoff
>             Fix For: 1.8.0
>
>
> Encountered while using struts 1.1 with beautils 1.6.1.
> When you attempt to set the value of a mapped property, 
> BeanUtils.setProperty() 
> checks if the bean has a write method for a map and fails with a "Skipping 
> read-
> only property" message, even though it would never actually use or need this 
> method.
> The following sample illustrates the problem:
> public class MyBean {
>   private Map myMap;
>   public Map getMyMap() { return myMap; }
>   /* ... */
> }
> If you invoke BeanUtils.setProperty( myBean, "myMap(myKey)", value ) on an 
> instance of MyBean, the invocation fails, as there's no write method for the 
> myMap property (it doesn't throw an exception, it just doesn't do anything, 
> leaving the map unchanged).
> However, if you add setMyMap() to the bean, the setProperty call succedes, 
> even 
> though it never actually calls setMyMap(), using the getMyMap().put( "myKey", 
> value ) chain instead.
> This looks like an unnecessary requirement with negative security 
> implications.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to