commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Amicabile <>
Subject getMappedProperty in PropertyUtils
Date Fri, 18 Jan 2002 12:30:18 GMT
Hi people, 

I am using Mapped Properties from the BeanUtils
project in my web application. I have a bean which has
both indexed properties and mapped Properties which
have the same names, that is these are his public
methods signatures :

  public Object getObject(int index)
  public Object getObject(String key)
  public void setObject(int index, Object param)
  public void setObject(String key, Object param)

when I call the method




the result is null, because in the method retrieves
first the PropertyDescriptors without the mapped
The property descriptor for the indexed property is
found first and returned and since the method checks
whether the descriptor is an instance of
MappedPropertyDescriptor (which is not) the
getObject(String) method is not called and null is
returned (even if something is available)
So the workaround  is giving the mapped properties
names which do not conflict with the other properties.
But I think the getMappedProperty should get FIRST the
mapped property, so that 

property(key) and
property[index] are both available when methods like
the above described are defined in an object.

How do you see it? Shouldn't the method
getMappedProperty be modified?



Iscriviti al gruppo ufficiale di Tomb Raider:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message