commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tolley Shorn" <Shorn.Tol...@nrm.qld.gov.au>
Subject [beanutils] problem with PropertyUtils.getNestedProperty(Object, name) throwing too many IllegalArgumentExceptions
Date Fri, 09 May 2003 01:53:37 GMT
Hi folks,

Please let me know if I should be posting this message to a different place.

I have a problem with the PropertyUtils.getNestedProperty(Object, name) method.

It documents that it throws an IllegalArgumentException "if a nested reference to a property
returns null".
Which is great, because I want to actually trap that exact situation and deal with it explicitly.
Unfortunately, the method throws IllegalArgumentException  for a number of other situations.
 Also, because it's a runtime exception I have to assume that exception could be thrown from
anywhere in the call stack.

Is there another way to do what I want to do without deplicating the code of the getNestedProperty()
method?

Currently, I'm building my own beanutils jar, and having the getNestedProperty() method throw
an explicitly created subclass of InvocationTargetException (NullNestedReferenceException)
that I can catch in my calling code.

I'd like to use an official build of beanutils though (rather than my own one).
If there's not a better way to do what I want, how do I go about requesting that this functionality
be added to CVS (possibly with my own patch if the developers find it acceptable)?

Thanks,
Shorn Tolley.






************************************************************************
The information in this e-mail together with any attachments is
intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material.

Any form of review, disclosure, modification, distribution
and/or publication of this e-mail message is prohibited.  

If you have received this message in error, you are asked to
inform the sender as quickly as possible and delete this message
and any copies of this message from your computer and/or your
computer system network.  
************************************************************************


Mime
View raw message