]> git.mxchange.org Git - jcountry-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 6 Oct 2022 12:45:59 +0000 (14:45 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 6 Oct 2022 12:45:59 +0000 (14:45 +0200)
- countryExternalDialPrefix might also be NULL or empty string but is required

src/org/mxchange/jcountry/model/data/CountryData.java

index 8d2cb812b2179e01cfae1b6a8fbbfc587f51358a..c15948db0e9719c796936a677687eade90114d89 100644 (file)
@@ -159,6 +159,12 @@ public class CountryData implements Country {
                } else if (countryCode.isEmpty()) {
                        // Throw IAE
                        throw new IllegalArgumentException("countryCode is empty"); //NOI18N
+               } else if (null == countryExternalDialPrefix) {
+                       // Throw NPE
+                       throw new NullPointerException("countryExternalDialPrefix is null"); //NOI18N
+               } else if (countryExternalDialPrefix.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("countryExternalDialPrefix is empty"); //NOI18N
                } else if (null == countryI18nKey) {
                        // Throw NPE
                        throw new NullPointerException("countryI18nKey is null"); //NOI18N
@@ -202,7 +208,7 @@ public class CountryData implements Country {
                        StringUtils.compare(this.getCountryCode(), country.getCountryCode()),
                        // ... and phone code, too
                        this.getCountryPhoneCode().compareTo(country.getCountryPhoneCode()),
-                       // ... then last i18n key
+                       // ... then i18n key
                        StringUtils.compare(this.getCountryI18nKey(), country.getCountryI18nKey()),
                        // ... abroad dial prefix
                        StringUtils.compare(this.getCountryAbroadDialPrefix(), country.getCountryAbroadDialPrefix()),