try {
return clazz.cast(javaBeanDescriptor.invokeReadMethod(descriptor, target));
} catch (ClassCastException e) {
String msg = format("Unable to obtain the value of the property <'%s'> from <%s> - wrong property type specified <%s>",
propertyName, target, clazz);
throw new IntrospectionError(msg, e);
} catch (Throwable unexpected) {
String msg = format("Unable to obtain the value of the property <'%s'> from <%s>", propertyName, target);
throw new IntrospectionError(msg, unexpected);
}
}