Trim string attrubutes of JPA entries (#2597)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -99,12 +99,12 @@ public class ObjectCopyUtil {
|
||||
final Order order = toSetterMethod.getAnnotation(Order.class);
|
||||
return new ToSetter((to, value) -> {
|
||||
try {
|
||||
toSetterMethod.invoke(to, value);
|
||||
toSetterMethod.invoke(to, value instanceof String str ? str.trim() : value);
|
||||
} catch (final InvocationTargetException e) {
|
||||
final Throwable targetException = e.getTargetException() == null ? e : e.getTargetException();
|
||||
throw targetException instanceof RuntimeException re
|
||||
? re :
|
||||
new IllegalStateException("Error invoking " + toSetterMethod, targetException);
|
||||
? re
|
||||
: new IllegalStateException("Error invoking " + toSetterMethod, targetException);
|
||||
} catch (final IllegalAccessException | IllegalArgumentException e) {
|
||||
throw new IllegalStateException("Error invoking " + toSetterMethod, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user