You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/02/09 12:44:05 UTC

DO NOT REPLY [Bug 33461] - 1.6.1 cannot determine reader methods for anonymous class

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33461>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33461





------- Additional Comments From niallp@apache.org  2005-02-09 12:44 -------
The reason for the problem lies in the fact that the anonymous class is private.

The BeanUtils's describe method does the following...

   if (descriptors[i].getReadMethod() != null) {
       desription.put(name, getProperty(bean, name);
   }

.. getProperty() is calling getNestedProperty()
.. getNestedProperty() is calling PropertyUtil's getNestedProperty()
.. getNestedProperty() is calling getSimpleProperty()
.. getSimpleProperty() is calling getReadMethod()
.. getReadMethod() is calling MethodUtil's getAccessibleMethod()

MethodUtil's getAccessibleMethod() method checks that the declaring class of 
the method is public, otherwise it returns null rather than the method.

Since it is a private class, if BeanUtils did try to invoke the method it would 
fail. So it looks to me like we need to change the BeanUtils.describe() method 
to check that the bean is a public class and throw an exception if it isnt.

The answer for you though is that you can't use BeanUtils with private classes.

Niall

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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