From 1317cbcf88b02addf163655de2ea1114f24876a1 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Sat, 23 Mar 2024 09:41:42 +0900 Subject: [PATCH] Apply UnnecessarySemicolonInEnumeration Checkstyle module This commit also applies it to this project itself and fixes its violations. See gh-408 --- .../io/spring/javaformat/checkstyle/spring-checkstyle.xml | 1 + .../javaformat/checkstyle/SpringConfigurationLoaderTests.java | 4 ++-- .../java/org/eclipse/jdt/internal/formatter/Preparator.java | 2 +- .../java/org/eclipse/jdt/internal/formatter/Preparator.java | 2 +- src/checkstyle/checkstyle.xml | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-javaformat/spring-javaformat-checkstyle/src/main/resources/io/spring/javaformat/checkstyle/spring-checkstyle.xml b/spring-javaformat/spring-javaformat-checkstyle/src/main/resources/io/spring/javaformat/checkstyle/spring-checkstyle.xml index c8838541..ba9026a6 100644 --- a/spring-javaformat/spring-javaformat-checkstyle/src/main/resources/io/spring/javaformat/checkstyle/spring-checkstyle.xml +++ b/spring-javaformat/spring-javaformat-checkstyle/src/main/resources/io/spring/javaformat/checkstyle/spring-checkstyle.xml @@ -70,6 +70,7 @@ + diff --git a/spring-javaformat/spring-javaformat-checkstyle/src/test/java/io/spring/javaformat/checkstyle/SpringConfigurationLoaderTests.java b/spring-javaformat/spring-javaformat-checkstyle/src/test/java/io/spring/javaformat/checkstyle/SpringConfigurationLoaderTests.java index 82e63f1e..58bc2ee7 100644 --- a/spring-javaformat/spring-javaformat-checkstyle/src/test/java/io/spring/javaformat/checkstyle/SpringConfigurationLoaderTests.java +++ b/spring-javaformat/spring-javaformat-checkstyle/src/test/java/io/spring/javaformat/checkstyle/SpringConfigurationLoaderTests.java @@ -48,7 +48,7 @@ public void loadShouldLoadChecks() { assertThat(checks).hasSize(5); TreeWalker treeWalker = (TreeWalker) checks.toArray()[4]; Set ordinaryChecks = (Set) Extractors.byName("ordinaryChecks").extract(treeWalker); - assertThat(ordinaryChecks).hasSize(60); + assertThat(ordinaryChecks).hasSize(61); } @Test @@ -59,7 +59,7 @@ public void loadWithExcludeShouldExcludeChecks() { assertThat(checks).hasSize(5); TreeWalker treeWalker = (TreeWalker) checks.toArray()[4]; Set ordinaryChecks = (Set) Extractors.byName("ordinaryChecks").extract(treeWalker); - assertThat(ordinaryChecks).hasSize(59); + assertThat(ordinaryChecks).hasSize(60); } @Test diff --git a/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk17/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java b/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk17/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java index ff6b0fc6..df66cda6 100644 --- a/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk17/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java +++ b/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk17/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java @@ -54,7 +54,7 @@ enum Phase { /** * Apply the preparator after wrapping. */ - POST_WRAPPING; + POST_WRAPPING } diff --git a/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk8/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java b/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk8/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java index 9873fc96..aaaf3647 100644 --- a/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk8/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java +++ b/spring-javaformat/spring-javaformat-formatter-eclipse-jdt-jdk8/src/main/java/org/eclipse/jdt/internal/formatter/Preparator.java @@ -54,7 +54,7 @@ enum Phase { /** * Apply the preparator after wrapping. */ - POST_WRAPPING; + POST_WRAPPING } diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 0c6b5e96..c13faf85 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -65,6 +65,7 @@ +