From ad73a3f65c4a4f5e595b37e578aa7548a36aa0c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 6 Oct 2022 14:45:59 +0200 Subject: [PATCH] Continued: - countryExternalDialPrefix might also be NULL or empty string but is required --- src/org/mxchange/jcountry/model/data/CountryData.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/mxchange/jcountry/model/data/CountryData.java b/src/org/mxchange/jcountry/model/data/CountryData.java index 8d2cb81..c15948d 100644 --- a/src/org/mxchange/jcountry/model/data/CountryData.java +++ b/src/org/mxchange/jcountry/model/data/CountryData.java @@ -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()), -- 2.39.5