In the snippet below the three exceptions I declare in the throws
clause are all thrown by BeanUtils.setProperty(), which is a third party library.
Is letting these three exceptions "bubble upwards" with a throws
declaration bad style? Is it better to wrap them in my own RoleBeanException and throw that?
public BeanRole getRoleBean(Request request)
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
String[] arrayOfProperties = {"application", "environment", "role"};
BeanRole roleBean = new BeanRole();
for (String strProperty : arrayOfProperties) {
String strValue = BeanUtils.getProperty(request, strProperty);
BeanUtils.setProperty(roleBean, strProperty, strValue);
}
return roleBean;
}