Accounted for uninitialized fields
This commit is contained in:
parent
e243674f5d
commit
d0d0ff9890
|
@ -538,14 +538,14 @@ public final class TerserUtil {
|
|||
|
||||
IBase newFieldValue = childDefinition.getChildByName(childDefinition.getElementName()).newInstance();
|
||||
if (theFromFieldValue instanceof IPrimitiveType) {
|
||||
try {
|
||||
Method copyMethod = getMethod(theFromFieldValue, "copy");
|
||||
if (copyMethod != null) {
|
||||
newFieldValue = (IBase) copyMethod.invoke(theFromFieldValue, new Object[]{});
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
((IPrimitiveType) newFieldValue).setValueAsString(((IPrimitiveType) theFromFieldValue).getValueAsString());
|
||||
try {
|
||||
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);
|
||||
}
|
||||
|
@ -636,7 +636,11 @@ public final class TerserUtil {
|
|||
return;
|
||||
}
|
||||
|
||||
values.clear();
|
||||
try {
|
||||
values.clear();
|
||||
} catch (Throwable t) {
|
||||
ourLog.warn("Unable to clear values " + String.valueOf(values), t);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue