]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2022 13:08:07 +0000 (15:08 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 25 Jun 2022 13:29:12 +0000 (15:29 +0200)
- 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 <roland@mxchange.org>
src/java/org/mxchange/jcountry/model/data/PizzaAdminCountrySingletonBean.java

index 2e05e149038e5dfd068ac58b00b08618648d382e..6c177cc8909e08b9863b85003eb297e6e69037f0 100644 (file)
@@ -102,20 +102,6 @@ public class PizzaAdminCountrySingletonBean extends BasePizzaEnterpriseBean impl
         * @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;