replaced Exception controll flow

This commit is contained in:
patrick-werner 2020-03-01 22:44:28 +01:00
parent 594d77985d
commit 822b50b8d7
1 changed files with 4 additions and 7 deletions

View File

@ -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;
}