diff --git a/src/main/java/org/meeuw/i18n/languages/ISO_639.java b/src/main/java/org/meeuw/i18n/languages/ISO_639.java index 566f229..ba88952 100644 --- a/src/main/java/org/meeuw/i18n/languages/ISO_639.java +++ b/src/main/java/org/meeuw/i18n/languages/ISO_639.java @@ -206,7 +206,7 @@ public static ISO_639_Code iso639(String code) { * @since 3.3 */ @JsonCreator - static @PolyNull ISO_639_Code lenientIso639(@PolyNull String code) { + public static @PolyNull ISO_639_Code lenientIso639(@PolyNull String code) { if (code == null || code.isEmpty()) { return null; } diff --git a/src/main/java/org/meeuw/i18n/languages/jaxb/LanguageCodeAdapter.java b/src/main/java/org/meeuw/i18n/languages/jaxb/LanguageCodeAdapter.java index be59164..cc1e36c 100644 --- a/src/main/java/org/meeuw/i18n/languages/jaxb/LanguageCodeAdapter.java +++ b/src/main/java/org/meeuw/i18n/languages/jaxb/LanguageCodeAdapter.java @@ -1,20 +1,19 @@ package org.meeuw.i18n.languages.jaxb; import jakarta.xml.bind.annotation.adapters.XmlAdapter; -import org.meeuw.i18n.languages.*; -import static org.meeuw.i18n.languages.ISO_639.iso639; + +import org.meeuw.i18n.languages.ISO_639_Code; + +import static org.meeuw.i18n.languages.ISO_639.lenientIso639; public class LanguageCodeAdapter extends XmlAdapter { @Override - public ISO_639_Code unmarshal(String v) throws Exception { - if (v == null || v.isEmpty()) { - return null; - } - return iso639(v); + public ISO_639_Code unmarshal(String v) { + return lenientIso639(v); } @Override - public String marshal(ISO_639_Code v) throws Exception { + public String marshal(ISO_639_Code v) { return v.code(); } }