From 995ac96f739ffab540b3ab2b4db77fd94712899c Mon Sep 17 00:00:00 2001 From: Nick Goupinets Date: Thu, 20 May 2021 17:21:04 -0400 Subject: [PATCH] Can't think today --- .../src/main/java/ca/uhn/fhir/util/TerserUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TerserUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TerserUtil.java index 058ecfc5603..ab0024bcee9 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TerserUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/TerserUtil.java @@ -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); }