protected NotReadablePropertyException createNotReadablePropertyException(String propertyName, Exception e) {
if (JdkVersion.isAtLeastJava14()) {
NotReadablePropertyException beanException = new NotReadablePropertyException(getTargetClass(),
propertyName);
beanException.initCause(e);
return beanException;
}
else {
ByteArrayOutputStream stackTrace = new ByteArrayOutputStream();
PrintWriter stackTraceWriter = new PrintWriter(stackTrace);