From c4cd857425e115d34522720a07ee79c63c2ceb03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 25 Jun 2022 15:08:07 +0200 Subject: [PATCH] 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../data/FinancialsAdminCountrySingletonBean.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java b/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java index 8e7b4dd..c08b3a6 100644 --- a/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java +++ b/src/java/org/mxchange/jcountry/model/data/FinancialsAdminCountrySingletonBean.java @@ -102,20 +102,6 @@ public class FinancialsAdminCountrySingletonBean extends BaseFinancialsEnterpris * @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; -- 2.39.5