From 822b50b8d7ab19ad56d9806cff8d144250226d32 Mon Sep 17 00:00:00 2001 From: patrick-werner Date: Sun, 1 Mar 2020 22:44:28 +0100 Subject: [PATCH] replaced Exception controll flow --- .../java/org/hl7/fhir/validation/BaseValidator.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java index 8016e14bb..ce35adbc3 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java @@ -146,18 +146,15 @@ public class BaseValidator { return thePass; } - + protected String formatMessage(String theMessage, Object... theMessageArguments) { String message; if (theMessageArguments != null && theMessageArguments.length > 0) { message = MessageFormat.format(messages.getString(theMessage), theMessageArguments); + } else if (messages.containsKey(theMessage)) { + message = messages.getString(theMessage); } else { - try { - message = messages.getString(theMessage); - } catch (MissingResourceException e) { - // non-internationalized String - message = theMessage; - } + message = theMessage; } return message; }