From 550930960dba6136cb8a6eafa0a9504a9d8936a4 Mon Sep 17 00:00:00 2001 From: Michiel Meeuwissen Date: Sun, 6 Oct 2024 21:03:30 +0200 Subject: [PATCH] Test case failures. --- .../java/org/meeuw/i18n/languages/ISO_639_3_Code.java | 9 +++++++++ src/main/java/org/meeuw/i18n/languages/LanguageCode.java | 6 +++++- .../org/meeuw/i18n/languages/test/LanguageCodeTest.java | 9 +++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java b/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java index ea519ac..85a0353 100644 --- a/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java +++ b/src/main/java/org/meeuw/i18n/languages/ISO_639_3_Code.java @@ -220,6 +220,7 @@ private ISO_639_3_Code( * @return A 2 or 3 letter language code * @since 0.2 */ + @Override @JsonValue public String code() { return part1 != null ? part1 : part3; @@ -233,6 +234,7 @@ public String toString() { + @Override public String part3() { return part3; } @@ -242,6 +244,7 @@ public String part3() { * code set, if there is one * @return bibliographic id or {@code null} */ + @Override public String part2B() { return part2B; } @@ -251,6 +254,7 @@ public String part2B() { * set, if there is one * @return terminology id or {@code null} */ + @Override public String part2T() { return part2T; } @@ -259,22 +263,27 @@ public String part2T() { * Equivalent 639-1 identifier, if there is one * @return 2 letter id or {@code null} */ + @Override public String part1() { return part1; } + @Override public Scope scope() { return scope; } + @Override public Type languageType() { return languageType; } + @Override public String refName() { return refName; } + @Override public String comment() { return comment; } diff --git a/src/main/java/org/meeuw/i18n/languages/LanguageCode.java b/src/main/java/org/meeuw/i18n/languages/LanguageCode.java index 5ff9e7e..06b6aef 100644 --- a/src/main/java/org/meeuw/i18n/languages/LanguageCode.java +++ b/src/main/java/org/meeuw/i18n/languages/LanguageCode.java @@ -349,10 +349,13 @@ default String getCode() { */ String part1(); + @Override Scope scope(); + @Override Type languageType(); + @Override String refName(); String comment(); @@ -366,7 +369,8 @@ default Locale toLocale() { return new Locale(code()); } - default NameRecord name(Locale locale) { + @Override + default NameRecord nameRecord(Locale locale) { if (locale.getLanguage().equals("en")) { return nameRecords().get(0); } else { diff --git a/src/test/java/org/meeuw/i18n/languages/test/LanguageCodeTest.java b/src/test/java/org/meeuw/i18n/languages/test/LanguageCodeTest.java index 2b2f87f..a13c702 100644 --- a/src/test/java/org/meeuw/i18n/languages/test/LanguageCodeTest.java +++ b/src/test/java/org/meeuw/i18n/languages/test/LanguageCodeTest.java @@ -3,6 +3,7 @@ import java.util.*; import java.util.concurrent.atomic.AtomicLong; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.meeuw.i18n.languages.*; @@ -208,4 +209,12 @@ public void deprecated() { assertThat(LanguageCode.getByPart2T("nld")).contains((LanguageCode) ISO_639.get("nl").get()); assertThat(LanguageCode.getByPart3("nld")).contains((LanguageCode) ISO_639.get("nl").get()); } + + + // TODO + @Disabled + @Test + public void hashCodeStable() { + assertThat(ISO_639.iso639("NL").hashCode()).isEqualTo(320304382); + } }