From 8239e84116fd6b97b24d2ad20d2224421139c15c Mon Sep 17 00:00:00 2001 From: Michiel Meeuwissen Date: Sun, 16 Jun 2024 20:17:48 +0200 Subject: [PATCH] Details. --- .../java/org/meeuw/i18n/languages/LanguageFamilyCode.java | 2 ++ .../org/meeuw/i18n/languages/test/GenerateEnumsTest.java | 6 +++++- .../org/meeuw/i18n/languages/test/LanguageCodeTest.java | 5 +---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/meeuw/i18n/languages/LanguageFamilyCode.java b/src/main/java/org/meeuw/i18n/languages/LanguageFamilyCode.java index de09c18..00e24a6 100644 --- a/src/main/java/org/meeuw/i18n/languages/LanguageFamilyCode.java +++ b/src/main/java/org/meeuw/i18n/languages/LanguageFamilyCode.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; +import javax.annotation.processing.Generated; /** @@ -15,6 +16,7 @@ * */ @SuppressWarnings("ALL") +@Generated("org.meeuw.i18n.languages.test.GenerateEnumsTest") public enum LanguageFamilyCode implements ISO_639_Code { diff --git a/src/test/java/org/meeuw/i18n/languages/test/GenerateEnumsTest.java b/src/test/java/org/meeuw/i18n/languages/test/GenerateEnumsTest.java index f3d855d..596b4ce 100644 --- a/src/test/java/org/meeuw/i18n/languages/test/GenerateEnumsTest.java +++ b/src/test/java/org/meeuw/i18n/languages/test/GenerateEnumsTest.java @@ -15,6 +15,7 @@ import com.sun.codemodel.writer.FileCodeWriter; +@SuppressWarnings("DataFlowIssue") public class GenerateEnumsTest { String path = "src/main/java"; File file = new File(path); @@ -87,7 +88,7 @@ public void create639_1() throws JClassAlreadyExistsException, IOException { model.build(new FileCodeWriter(new File(absolutePath), false)); } @Test - public void create639_5() throws JClassAlreadyExistsException, IOException, ClassNotFoundException { + public void create639_5() throws JClassAlreadyExistsException, IOException { JCodeModel model = new JCodeModel(); JDefinedClass iso639_5 = model._class("org.meeuw.i18n.languages.LanguageFamilyCode", ClassType.ENUM); @@ -98,6 +99,9 @@ public void create639_5() throws JClassAlreadyExistsException, IOException, Clas .append("An enum with all ISO-639-5 language family codes.\n

\n") .append("This enum is automatically generated by " + GenerateEnumsTest.class + " from a tab separated file found on id.loc.gov."); + iso639_5.annotate(Generated.class).param("value", GenerateEnumsTest.class.getName()); + + JFieldVar uri = iso639_5.field(JMod.PRIVATE | JMod.FINAL, URI.class, "uri"); 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 e4701f9..76d035d 100644 --- a/src/test/java/org/meeuw/i18n/languages/test/LanguageCodeTest.java +++ b/src/test/java/org/meeuw/i18n/languages/test/LanguageCodeTest.java @@ -112,8 +112,8 @@ public void getTokiPona() { public void getByPart1() { assertThat(ISO_639.getByPart1("nl").get().refName()).isEqualTo("Dutch"); assertThat(ISO_639.getByPart1(null)).isEmpty(); - } + @Test public void getByPart2T() { assertThat(ISO_639.getByPart2T("nld").get().refName()).isEqualTo("Dutch"); @@ -143,7 +143,6 @@ public void krm() { assertThat(ISO_639.getByPart3("krm").get().code()).isEqualTo("bmf"); } - @Test public void ppr() { assertThat(ISO_639.getByPart3("ppr").get().code()).isEqualTo("lcq"); @@ -165,8 +164,6 @@ public void XX() { } finally { LanguageCode.resetFallBacks(); } - } - }