Can't think today

This commit is contained in:
Nick Goupinets 2021-05-20 17:21:04 -04:00
parent 2acb3501a5
commit 995ac96f73
1 changed files with 4 additions and 4 deletions

View File

@ -538,14 +538,14 @@ public final class TerserUtil {
IBase newFieldValue = childDefinition.getChildByName(childDefinition.getElementName()).newInstance();
if (theFromFieldValue instanceof IPrimitiveType) {
Method copyMethod = getMethod(theFromFieldValue, "copy");
if (copyMethod != null) {
try {
newFieldValue = (IBase) copyMethod.invoke(theFromFieldValue, new Object[]{});
Method copyMethod = getMethod(theFromFieldValue, "copy");
if (copyMethod != null) {
newFieldValue = (IBase) copyMethod.invoke(theFromFieldValue, new Object[]{});
}
} catch (Throwable t) {
((IPrimitiveType) newFieldValue).setValueAsString(((IPrimitiveType) theFromFieldValue).getValueAsString());
}
}
} else {
theTerser.cloneInto(theFromFieldValue, newFieldValue, true);
}