commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Commented: (BEANUTILS-261) Return null but not throw NestedNullException if the nested property is null
Date Mon, 13 Nov 2006 08:39:38 GMT
    [ ] 
Niall Pemberton commented on BEANUTILS-261:

If we're doing the getNestedProperty() method then should we also create equivalent methods
for setNestedProperty() and getPropertyDescriptor() as well - then there are also the BeanUtils
getNestedtProperty(), setProperty(), getProperty() methods?

My preference is not to do it, since IMO it doesn't add anything of real value to BeanUtils
and just bloats the API - anyone can easily create their own static method that wraps the
PropertyUtils and catches NestedNullException to return null.

> Return null but not throw NestedNullException if the nested property is null
> ----------------------------------------------------------------------------
>                 Key: BEANUTILS-261
>                 URL:
>             Project: Commons BeanUtils
>          Issue Type: New Feature
>          Components: Bean / Property Utils
>            Reporter: Jiemiao Shi
> Can provide a method in PropertyUtils to get nested properties without throwing a NestedNullException
when any of the no-end property is null?
> example:
> /* code begin */
> Employee employee=...
> emplyee.setAddress(null);
> String street=(String) PropertyUtils.getNestedProperty(employee, "address.street");//
> /* code end */
> The statement #### will throws a NestedNullException, but return null will make it easier
to write code in some situation. So can please provide a method only return null?

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


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

View raw message