When Introspector cannot find a read method for a destination property, an NPE is thrown when an attempt is made to set it. This happens even if the field is configured one-way & the inverse mapping is one-way excluded.
This is because GetterSetterPropertyDescriptor.writeDeepDestinationValue uses PropertyDescriptor.getReadMethod().getReturnType() to determine the value type to set. If no readMethod exists (as may be true for a one-way mapping), this call will throw an NPE. This value should probably be obtained from PropertyDescriptor.getWriteMethod().getParameterTypes() instead. The attached patch works for me to fix this problem via this technique.
Log in to post a comment.