From: Roland Häder Date: Sat, 25 Jun 2022 13:08:07 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c3c0c442155692d76d2610491d6caad71184acab;p=addressbook-ejb.git Please cherry-pick: - private methods should not have exceptions thrown because these cases cannot be unit-tested (or very hard) - normally only public, package-level or protected methods throw exceptions and have made sure that e.g. null-references won't get through to private methods Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jcountry/model/data/AddressbookAdminCountrySingletonBean.java b/src/java/org/mxchange/jcountry/model/data/AddressbookAdminCountrySingletonBean.java index 0cfce0f..249307b 100644 --- a/src/java/org/mxchange/jcountry/model/data/AddressbookAdminCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/model/data/AddressbookAdminCountrySingletonBean.java @@ -102,20 +102,6 @@ public class AddressbookAdminCountrySingletonBean extends BaseAddressbookEnterpr * @return Whether the country was found */ private boolean isCountryAdded (final Country country) { - if (null == country) { - // Throw NPE - throw new NullPointerException("country is null"); //NOI18N - } else if (country.getCountryCode().isEmpty()) { - // Code is not set - throw new IllegalArgumentException("country.countryCode is empty"); //NOI18N - } else if (country.getCountryI18nKey().isEmpty()) { - // I18n key is not set - throw new IllegalArgumentException("country.countryI18nKey is empty"); //NOI18N - } else if (country.getCountryId() != null) { - // Should be null - throw new IllegalArgumentException(MessageFormat.format("country.countryId is not null ({0})", country.getCountryId())); //NOI18N - } - // Default is not found boolean isAdded = false;