Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6
-
None
-
None
-
Operating System: All
Platform: PC
-
27965
Description
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()
/* ... */
}
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.