From 90066f87d1713e9d9b996678ff4300981ed61359 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Tue, 30 Jan 2024 15:18:18 +0100 Subject: [PATCH] Sync Checkstyle integration test (#999) Summary of changes: - Update the set of expected changes for compatibility with the latest features, except for the `ErrorProneRuntimeClasspath` check. - Test against version 10.12.7 rather than 10.13.0. - Omit the targeted tag from file names, so that similar upgrade PRs can be tested using an `/integration-test` GitHub comment. --- .github/workflows/run-integration-tests.yml | 4 +- ...atch => checkstyle-expected-changes.patch} | 5532 +++++++++++------ ...s.txt => checkstyle-expected-warnings.txt} | 26 +- ....12.4-init.patch => checkstyle-init.patch} | 60 +- .../{checkstyle-10.12.4.sh => checkstyle.sh} | 12 +- 5 files changed, 3637 insertions(+), 1997 deletions(-) rename integration-tests/{checkstyle-10.12.4-expected-changes.patch => checkstyle-expected-changes.patch} (93%) rename integration-tests/{checkstyle-10.12.4-expected-warnings.txt => checkstyle-expected-warnings.txt} (95%) rename integration-tests/{checkstyle-10.12.4-init.patch => checkstyle-init.patch} (84%) rename integration-tests/{checkstyle-10.12.4.sh => checkstyle.sh} (94%) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 303cb419..b129c2f7 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -28,12 +28,12 @@ jobs: - name: Install project to local Maven repository run: mvn -T1C install -DskipTests -Dverification.skip - name: Run integration test - run: xvfb-run ./integration-tests/checkstyle-10.12.4.sh "${{ runner.temp }}/artifacts" + run: xvfb-run ./integration-tests/checkstyle.sh "${{ runner.temp }}/artifacts" - name: Upload artifacts on failure if: ${{ failure() }} uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: - name: integration-test-checkstyle-10.12.4 + name: integration-test-checkstyle path: "${{ runner.temp }}/artifacts" - name: Remove installed project artifacts run: mvn build-helper:remove-project-artifact diff --git a/integration-tests/checkstyle-10.12.4-expected-changes.patch b/integration-tests/checkstyle-expected-changes.patch similarity index 93% rename from integration-tests/checkstyle-10.12.4-expected-changes.patch rename to integration-tests/checkstyle-expected-changes.patch index 4ef2b9af..d54a795a 100644 --- a/integration-tests/checkstyle-10.12.4-expected-changes.patch +++ b/integration-tests/checkstyle-expected-changes.patch @@ -380,8 +380,8 @@ --- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck; +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationO + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; -public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { @@ -389,7 +389,7 @@ @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes +@@ -33,7 +33,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes } @Test @@ -398,6 +398,15 @@ final Class clazz = OverloadMethodsDeclarationOrderCheck.class; final String messageKey = "overload.methods.declaration"; +@@ -53,7 +53,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes + } + + @Test +- public void testOverloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { ++ void overloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + --- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; @@ -3093,6 +3102,224 @@ runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionBooleanExpressionComplexityTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionBooleanExpressionComplexityTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpathTestSupport { ++final class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat + } + + @Test +- public void testMethodOne() throws Exception { ++ void methodOne() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityOne.java")); + +@@ -51,7 +51,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionBooleanExpressionComplexityOne']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodOne']]/SLIST" +@@ -62,7 +62,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat + } + + @Test +- public void testMethodTwo() throws Exception { ++ void methodTwo() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityTwo.java")); + +@@ -79,7 +79,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionBooleanExpressionComplexityTwo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodTwo']]/SLIST/VARIABLE_DEF" +@@ -89,7 +89,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat + } + + @Test +- public void testMethodThree() throws Exception { ++ void methodThree() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionBoolean" + "ExpressionComplexityThree.java")); + +@@ -106,7 +106,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionBooleanExpressionComplexityThree']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodThree']]/SLIST/LITERAL_IF"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCatchParameterNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCatchParameterNameTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupport { + private final String checkName = CatchParameterNameCheck.class.getSimpleName(); + + @Override +@@ -37,7 +37,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final String pattern = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -50,7 +50,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameSimple']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" +@@ -60,7 +60,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + final String pattern = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -73,7 +73,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameNested']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='NestedClass']]" +@@ -85,7 +85,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testStaticInit() throws Exception { ++ void staticInit() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]+$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -99,7 +99,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameStaticInit']]" + + "/OBJBLOCK/STATIC_INIT/SLIST" +@@ -109,7 +109,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testAnonymous() throws Exception { ++ void anonymous() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]+$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -124,7 +124,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameAnonymous']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" +@@ -137,7 +137,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testLambda() throws Exception { ++ void lambda() throws Exception { + final String pattern = "^[A-Z][a-z]+$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -151,7 +151,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameLambda']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='lambdaFunction']]" +@@ -163,7 +163,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + final String pattern = "^[A-Z][a-z]+$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -178,7 +178,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/ENUM_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameEnum']]" + + "/OBJBLOCK/ENUM_CONSTANT_DEF[./IDENT[@text='VALUE']]" +@@ -190,7 +190,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final String pattern = "^[A-Z][a-z]+$"; + + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); +@@ -204,7 +204,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/INTERFACE_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameInterface']]" + + "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='InnerInterface']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -4003,6 +4230,43 @@ final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsAvoidNullIgnoreCase.java")); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsHashCodeTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsHashCodeTest.java +@@ -26,14 +26,14 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport { ++final class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport { + @Override + protected String getCheckName() { + return EqualsHashCodeCheck.class.getSimpleName(); + } + + @Test +- public void testEqualsOnly() throws Exception { ++ void equalsOnly() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCode1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); +@@ -58,7 +58,7 @@ public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport + } + + @Test +- public void testHashCodeOnly() throws Exception { ++ void hashCodeOnly() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCode2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); +@@ -83,7 +83,7 @@ public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport + } + + @Test +- public void testNestedCase() throws Exception { ++ void nestedCase() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEqualsHashCodeNestedCase.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java @@ -19,14 +19,14 @@ @@ -4116,6 +4380,258 @@ final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass2.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalLocalVariableTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalLocalVariableTest.java +@@ -19,13 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck; + import java.io.File; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupport { ++final class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupport { + + private final String checkName = FinalLocalVariableCheck.class.getSimpleName(); + +@@ -35,7 +36,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable1.java")); + +@@ -47,7 +48,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalLocalVariable1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]" +@@ -57,7 +58,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable2.java")); + +@@ -69,7 +70,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalLocalVariable2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method2']]/SLIST/" +@@ -79,7 +80,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable3.java")); + +@@ -91,7 +92,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalLocalVariable3']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" +@@ -102,7 +103,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable4.java")); + +@@ -115,7 +116,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalLocalVariable4']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" +@@ -126,7 +127,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable5.java")); + +@@ -139,7 +140,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalLocalVariable5']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" +@@ -149,7 +150,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testSix() throws Exception { ++ void six() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable6.java")); + +@@ -162,7 +163,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionFinalLocalVariable6']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method1']]" +@@ -172,7 +173,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testSeven() throws Exception { ++ void seven() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable7.java")); + +@@ -185,7 +186,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionFinalLocalVariable7']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT" +@@ -196,7 +197,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testEight() throws Exception { ++ void eight() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable8.java")); + +@@ -209,7 +210,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalLocalVariable8']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkCodeBlock']]" +@@ -219,7 +220,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + } + + @Test +- public void testNine() throws Exception { ++ void nine() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionFinalLocalVariable9.java")); + +@@ -231,7 +232,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionFinalLocalVariable9']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkCodeBlock']]/SLIST/LITERAL_TRY" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalParametersTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalParametersTest.java +@@ -19,13 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck; + import java.io.File; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport { ++final class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport { + + private final String checkName = FinalParametersCheck.class.getSimpleName(); + +@@ -35,7 +36,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); +@@ -46,7 +47,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalParameters1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" +@@ -72,7 +73,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); +@@ -85,7 +86,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalParameters2']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT[" +@@ -116,7 +117,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters3.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); +@@ -129,7 +130,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionFinalParameters3']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='createClass']]/SLIST/" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java @@ -19,15 +19,15 @@ @@ -4600,6 +5116,62 @@ "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalToken2']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalTokenTextCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIllegalTokenText1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); +@@ -62,7 +62,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIllegalTokenText2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); +@@ -90,7 +90,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIllegalTokenText3.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); +@@ -102,7 +102,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + IllegalTokenTextCheck.class, IllegalTokenTextCheck.MSG_KEY, "invalidIdentifier"), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/INTERFACE_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTokenText3']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='invalidIdentifier']"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java @@ -19,14 +19,14 @@ @@ -4948,6 +5520,90 @@ "/COMPILATION_UNIT/CLASS_DEF" + "[./IDENT[@text='SuppressionXpathRegressionIndentationElseWithoutCurly']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/LITERAL_ELSE" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerAssignmentTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerAssignmentTest.java +@@ -19,6 +19,7 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck; + import java.io.File; +@@ -26,7 +27,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport { ++final class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport { + + private final String checkName = InnerAssignmentCheck.class.getSimpleName(); + +@@ -36,7 +37,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport + } + + @Test +- public void testFile1() throws Exception { ++ void file1() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerAssignment1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class); +@@ -46,7 +47,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInnerAssignment1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]" +@@ -56,7 +57,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport + } + + @Test +- public void testFile2() throws Exception { ++ void file2() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerAssignment2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerTypeLastTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerTypeLastTest.java +@@ -28,7 +28,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { ++final class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { + + private final String checkName = InnerTypeLastCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(InnerTypeLastCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastTwo.java")); + +@@ -99,7 +99,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInnerTypeLastThree.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -5142,6 +5798,79 @@ "/COMPILATION_UNIT/CLASS_DEF" + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionSix']]" + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavaNCSSTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavaNCSSTest.java +@@ -19,6 +19,7 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck; + import java.io.File; +@@ -26,7 +27,7 @@ import java.util.List; + import org.junit.jupiter.api.Test; + + // -@cs[AbbreviationAsWordInName] Test should be named as its main class. +-public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { ++final class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + + private final String checkName = JavaNCSSCheck.class.getSimpleName(); + +@@ -36,7 +37,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); +@@ -46,7 +47,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionJavaNCSSOne']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]", +@@ -61,7 +62,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); +@@ -73,7 +74,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionJavaNCSSTwo']]", + "/COMPILATION_UNIT/CLASS_DEF" +@@ -86,7 +87,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSThree.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); +@@ -98,7 +99,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- List.of("/COMPILATION_UNIT", "/COMPILATION_UNIT/PACKAGE_DEF"); ++ ImmutableList.of("/COMPILATION_UNIT", "/COMPILATION_UNIT/PACKAGE_DEF"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java @@ -19,14 +19,14 @@ @@ -5516,6 +6245,61 @@ "/COMPILATION_UNIT/CLASS_DEF" + "[./IDENT[@text='SuppressionXpathRegressionLeftCurlyThree']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMagicNumberTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMagicNumberTest.java +@@ -19,6 +19,7 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck; + import java.io.File; +@@ -26,7 +27,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { ++final class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +35,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + } + + @Test +- public void testVariable() throws Exception { ++ void variable() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMagicNumberVariable.java")); + +@@ -59,7 +60,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + } + + @Test +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMagicNumberMethodDef.java")); + +@@ -85,7 +86,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + } + + @Test +- public void testAnotherVariable() throws Exception { ++ void anotherVariable() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMagicNumberAnotherVariable.java")); + +@@ -96,7 +97,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionMagicNumberAnotherVariable']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='performOperation']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java @@ -19,16 +19,16 @@ @@ -7313,6 +8097,79 @@ final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression2.java")); final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageNameTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + + private final String checkName = PackageNameCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + + final File fileToProcess = new File(getPath("SuppressionXpathRegressionPackageNameOne.java")); + +@@ -57,7 +57,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/PACKAGE_DEF/DOT" + + "[./IDENT[@text='packagename']]/DOT" + + "[./IDENT[@text='suppressionxpathfilter']]" +@@ -67,7 +67,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPackageName.java")); +@@ -86,7 +86,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/PACKAGE_DEF/DOT[./IDENT" + + "[@text='PACKAGENAME']]/DOT[./IDENT" + + "[@text='suppressionxpathfilter']]" +@@ -96,7 +96,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + + final File fileToProcess = new File(getPath("SuppressionXpathRegressionPackageNameTwo.java")); + +@@ -115,7 +115,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/PACKAGE_DEF/DOT" + + "[./IDENT[@text='packagename']]/DOT" + + "[./IDENT[@text='suppressionxpathfilter']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNameTest.java @@ -19,15 +19,15 @@ @@ -8112,6 +8969,80 @@ "/COMPILATION_UNIT/CLASS_DEF[." + "/IDENT[@text='SuppressionXpathRegressionSingleSpaceSeparatorValidateComments']]" + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStaticVariableNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStaticVariableNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupport { + + private final String checkName = StaticVariableNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + } + + @Test +- public void test1() throws Exception { ++ void test1() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionStaticVariableName1.java")); + +@@ -54,7 +54,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionStaticVariableName1']]" +@@ -63,7 +63,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + } + + @Test +- public void test2() throws Exception { ++ void test2() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionStaticVariableName2.java")); + +@@ -80,7 +80,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionStaticVariableName2']]" +@@ -91,7 +91,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + } + + @Test +- public void test3() throws Exception { ++ void test3() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionStaticVariableName3.java")); + +@@ -108,7 +108,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionStaticVariableName2']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java @@ -19,15 +19,15 @@ @@ -8168,6 +9099,80 @@ "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionStringLiteralEquality2']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuperCloneTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuperCloneTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck; + import com.puppycrawl.tools.checkstyle.checks.coding.SuperCloneCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { ++final class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -35,7 +35,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + } + + @Test +- public void testInnerClone() throws Exception { ++ void innerClone() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionSuperCloneInnerClone.java")); + +@@ -46,7 +46,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpath" + + "RegressionSuperCloneInnerClone']]" +@@ -57,7 +57,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + } + + @Test +- public void testNoSuperClone() throws Exception { ++ void noSuperClone() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionSuperCloneNoSuperClone.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpath" + + "RegressionSuperCloneNoSuperClone']]" +@@ -79,7 +79,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + } + + @Test +- public void testPlainAndSubclasses() throws Exception { ++ void plainAndSubclasses() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionSuperClonePlainAndSubclasses.java")); + +@@ -90,7 +90,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpath" + + "RegressionSuperClonePlainAndSubclasses']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java @@ -19,14 +19,14 @@ @@ -9174,8 +10179,8 @@ package com.puppycrawl.tools.checkstyle; -+import static com.google.common.collect.ImmutableList.toImmutableList; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; ++import static java.util.stream.Collectors.toUnmodifiableList; ++import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.AuditListener; @@ -9192,17 +10197,17 @@ final List targetFiles = files.stream() .filter(file -> CommonUtil.matchesFileExtension(file, fileExtensions)) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); processFiles(targetFiles); // Finish up -@@ -242,7 +244,7 @@ public class Checker extends AbstractAutomaticBean implements MessageDispatcher, - .filter(ExternalResourceHolder.class::isInstance) - .map(ExternalResourceHolder.class::cast) - .flatMap(resource -> resource.getExternalResourceLocations().stream()) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +@@ -244,7 +246,7 @@ public class Checker extends AbstractAutomaticBean implements MessageDispatcher, + resource -> { + return ((ExternalResourceHolder) resource).getExternalResourceLocations().stream(); + }) +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } /** Notify all listeners about the audit start. */ @@ -9295,13 +10300,13 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java -@@ -19,19 +19,21 @@ +@@ -19,20 +19,22 @@ package com.puppycrawl.tools.checkstyle; -+import static com.google.common.collect.ImmutableList.toImmutableList; +import static java.util.Objects.requireNonNullElseGet; +import static java.util.stream.Collectors.toCollection; ++import static java.util.stream.Collectors.toUnmodifiableList; + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -9313,32 +10318,33 @@ -import java.util.Collections; import java.util.Iterator; import java.util.List; --import java.util.Optional; +-import java.util.Objects; + import java.util.Optional; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.stream.Collectors; import org.antlr.v4.runtime.BufferedTokenStream; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.ParserRuleContext; -@@ -406,7 +408,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) -- .collect(Collectors.toList())); -+ .collect(toImmutableList())); +- .collect(Collectors.toUnmodifiableList())); ++ .collect(toUnmodifiableList())); // We add C style array declarator brackets to TYPE ast final DetailAstImpl typeAst = (DetailAstImpl) methodDef.findFirstToken(TokenTypes.TYPE); -@@ -469,7 +471,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor children = ctx.children.stream() .filter(child -> !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); processChildren(methodDef, children); // We add C style array declarator brackets to TYPE ast -@@ -780,7 +782,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) -- .collect(Collectors.toList())); -+ .collect(toImmutableList())); +- .collect(Collectors.toUnmodifiableList())); ++ .collect(toUnmodifiableList())); // We add C style array declarator brackets to TYPE ast final DetailAstImpl typeAst = -@@ -852,7 +854,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !child.equals(ctx.LITERAL_SUPER())) -- .collect(Collectors.toList())); -+ .collect(toImmutableList())); +- .collect(Collectors.toUnmodifiableList())); ++ .collect(toUnmodifiableList())); return primaryCtorCall; } -@@ -1090,7 +1092,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.VariableModifierContext)) -- .collect(Collectors.toList())); -+ .collect(toImmutableList())); +- .collect(Collectors.toUnmodifiableList())); ++ .collect(toUnmodifiableList())); return catchParameterDef; } -@@ -1421,8 +1423,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor children = ctx.children.stream() .filter(child -> !child.equals(ctx.DOUBLE_COLON())) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); processChildren(doubleColon, children); return doubleColon; } -@@ -1520,7 +1520,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !child.equals(ctx.QUESTION())) -- .collect(Collectors.toList())); -+ .collect(toImmutableList())); +- .collect(Collectors.toUnmodifiableList())); ++ .collect(toUnmodifiableList())); return root; } -@@ -1547,7 +1547,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor descendantList = binOpList.parallelStream() .map(this::getInnerBopAst) @@ -9421,7 +10427,7 @@ bop.addChild(descendantList.poll()); DetailAstImpl pointer = bop.getFirstChild(); -@@ -1584,8 +1584,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor buildSimpleStringTemplateArgument(ctx)); + } + +@@ -1773,7 +1772,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor packageName + PACKAGE_SEPARATOR + name) .flatMap(className -> Stream.of(className, className + CHECK_SUFFIX)) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); Object instance = null; for (String possibleName : possibleNames) { instance = createObject(possibleName); --- a/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java -@@ -19,10 +19,11 @@ +@@ -19,10 +19,12 @@ package com.puppycrawl.tools.checkstyle; +import static com.google.common.base.Preconditions.checkArgument; ++import static java.util.function.Function.identity; ++import static java.util.stream.Collectors.toUnmodifiableMap; + -+import com.google.common.collect.Maps; import java.util.Map; import java.util.Properties; -import java.util.function.Function; @@ -9751,18 +10776,18 @@ /** Resolves external properties from an underlying {@code Properties} object. */ public final class PropertiesExpander implements PropertyResolver { -@@ -37,12 +38,8 @@ public final class PropertiesExpander implements PropertyResolver { +@@ -37,12 +39,10 @@ public final class PropertiesExpander implements PropertyResolver { * @throws IllegalArgumentException when properties argument is null */ public PropertiesExpander(Properties properties) { - if (properties == null) { - throw new IllegalArgumentException("cannot pass null"); - } -- values = -- properties.stringPropertyNames().stream() -- .collect(Collectors.toMap(Function.identity(), properties::getProperty)); + checkArgument(properties != null, "cannot pass null"); -+ values = Maps.toMap(properties.stringPropertyNames(), properties::getProperty); + values = + properties.stringPropertyNames().stream() +- .collect(Collectors.toUnmodifiableMap(Function.identity(), properties::getProperty)); ++ .collect(toUnmodifiableMap(identity(), properties::getProperty)); } @Override @@ -9777,7 +10802,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; -@@ -93,12 +95,8 @@ public final class PropertyCacheFile { +@@ -94,12 +96,8 @@ public final class PropertyCacheFile { * @throws IllegalArgumentException when either arguments are null */ public PropertyCacheFile(Configuration config, String fileName) { @@ -9899,9 +10924,9 @@ package com.puppycrawl.tools.checkstyle; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; +import static java.util.Comparator.naturalOrder; +import static java.util.Comparator.nullsLast; ++import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; @@ -9914,16 +10939,16 @@ import java.util.stream.Stream; /** Responsible for walking an abstract syntax tree and notifying interested checks at each node. */ -@@ -369,7 +372,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe - .filter(ExternalResourceHolder.class::isInstance) - .map(ExternalResourceHolder.class::cast) - .flatMap(resource -> resource.getExternalResourceLocations().stream()) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +@@ -371,7 +374,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe + resource -> { + return ((ExternalResourceHolder) resource).getExternalResourceLocations().stream(); + }) +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } /** -@@ -401,8 +404,8 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe +@@ -403,8 +406,8 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe private static SortedSet createNewCheckSortedSet() { return new TreeSet<>( Comparator.comparing(check -> check.getClass().getName()) @@ -10016,7 +11041,7 @@ package com.puppycrawl.tools.checkstyle.ant; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; import com.puppycrawl.tools.checkstyle.Checker; @@ -10033,8 +11058,8 @@ return Arrays.stream(fileNames) .map(name -> scanner.getBasedir() + File.separator + name) .map(File::new) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } /** Poor man enumeration for the formatter types. */ @@ -10291,7 +11316,7 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; -@@ -293,7 +295,7 @@ public class SuppressWarningsHolder extends AbstractCheck { +@@ -296,7 +298,7 @@ public class SuppressWarningsHolder extends AbstractCheck { */ private static List getAllAnnotationValues(DetailAST ast) { // get values of annotation @@ -10300,7 +11325,7 @@ final DetailAST lparenAST = ast.findFirstToken(TokenTypes.LPAREN); if (lparenAST != null) { final DetailAST nextAST = lparenAST.getNextSibling(); -@@ -375,9 +377,7 @@ public class SuppressWarningsHolder extends AbstractCheck { +@@ -378,9 +380,7 @@ public class SuppressWarningsHolder extends AbstractCheck { * @throws IllegalArgumentException if the AST is invalid */ private static String getIdentifier(DetailAST ast) { @@ -10311,7 +11336,7 @@ final String identifier; if (ast.getType() == TokenTypes.IDENT) { identifier = ast.getText(); -@@ -433,7 +433,7 @@ public class SuppressWarningsHolder extends AbstractCheck { +@@ -436,7 +436,7 @@ public class SuppressWarningsHolder extends AbstractCheck { final List annotationValues; switch (ast.getType()) { case TokenTypes.EXPR: @@ -10326,20 +11351,12 @@ package com.puppycrawl.tools.checkstyle.checks; -+import com.google.common.collect.ImmutableSet; -+import com.google.common.collect.Sets; ++import static java.util.stream.Collectors.toUnmodifiableSet; ++ import com.puppycrawl.tools.checkstyle.Definitions; import com.puppycrawl.tools.checkstyle.GlobalStatefulCheck; import com.puppycrawl.tools.checkstyle.LocalizedMessage; -@@ -32,7 +34,6 @@ import java.io.File; - import java.io.InputStream; - import java.nio.file.Files; - import java.nio.file.NoSuchFileException; --import java.util.Arrays; - import java.util.HashSet; - import java.util.Locale; - import java.util.Map; -@@ -46,7 +47,6 @@ import java.util.TreeSet; +@@ -46,7 +48,6 @@ import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -10347,32 +11364,21 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -@@ -226,7 +226,7 @@ public class TranslationCheck extends AbstractFileSetCheck { +@@ -228,7 +229,7 @@ public class TranslationCheck extends AbstractFileSetCheck { * @since 6.11 */ public void setRequiredTranslations(String... translationCodes) { -- requiredTranslations = Arrays.stream(translationCodes).collect(Collectors.toSet()); -+ requiredTranslations = ImmutableSet.copyOf(translationCodes); +- requiredTranslations = Arrays.stream(translationCodes).collect(Collectors.toUnmodifiableSet()); ++ requiredTranslations = Arrays.stream(translationCodes).collect(toUnmodifiableSet()); validateUserSpecifiedLanguageCodes(requiredTranslations); } -@@ -394,7 +394,7 @@ public class TranslationCheck extends AbstractFileSetCheck { - final ResourceBundle newBundle = new ResourceBundle(baseName, path, extension); - final Optional bundle = findBundle(resourceBundles, newBundle); - if (bundle.isPresent()) { -- bundle.get().addFile(currentFile); -+ bundle.orElseThrow().addFile(currentFile); - } else { - newBundle.addFile(currentFile); - resourceBundles.add(newBundle); -@@ -497,9 +497,7 @@ public class TranslationCheck extends AbstractFileSetCheck { - for (Entry> fileKey : fileKeys.entrySet()) { - final Set currentFileKeys = fileKey.getValue(); +@@ -501,7 +502,7 @@ public class TranslationCheck extends AbstractFileSetCheck { final Set missingKeys = -- keysThatMustExist.stream() -- .filter(key -> !currentFileKeys.contains(key)) -- .collect(Collectors.toSet()); -+ Sets.difference(keysThatMustExist, currentFileKeys).immutableCopy(); + keysThatMustExist.stream() + .filter(key -> !currentFileKeys.contains(key)) +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); if (!missingKeys.isEmpty()) { final MessageDispatcher dispatcher = getMessageDispatcher(); final String path = fileKey.getKey().getAbsolutePath(); @@ -10416,14 +11422,6 @@ } else { startNode = ast.findFirstToken(TokenTypes.TYPE); } -@@ -164,6 +165,6 @@ public final class MissingOverrideCheck extends AbstractCheck { - .map(DetailAST::getText) - .filter(JavadocUtil::isJavadocComment) - .findFirst(); -- return javadoc.isPresent() && MATCH_INHERIT_DOC.matcher(javadoc.get()).find(); -+ return javadoc.isPresent() && MATCH_INHERIT_DOC.matcher(javadoc.orElseThrow()).find(); - } - } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java @@ -19,13 +19,14 @@ @@ -10476,26 +11474,6 @@ + .isPresent(); } } ---- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java -+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java -@@ -207,7 +207,7 @@ public class FinalLocalVariableCheck extends AbstractCheck { - if (isAssignOperator(parentType) && isFirstChild(ast)) { - final Optional candidate = getFinalCandidate(ast); - if (candidate.isPresent()) { -- determineAssignmentConditions(ast, candidate.get()); -+ determineAssignmentConditions(ast, candidate.orElseThrow()); - currentScopeAssignedVariables.peek().add(ast); - } - removeFinalVariableCandidateFromStack(ast); -@@ -705,7 +705,7 @@ public class FinalLocalVariableCheck extends AbstractCheck { - final Optional candidate = - Optional.ofNullable(scope.get(ast.getText())); - if (candidate.isPresent()) { -- storedVariable = candidate.get().variableIdent; -+ storedVariable = candidate.orElseThrow().variableIdent; - } - if (storedVariable != null && isSameVariables(storedVariable, ast)) { - result = candidate; --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java @@ -19,6 +19,8 @@ @@ -10526,30 +11504,29 @@ * Setter to specify exception class names to reject. --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java -@@ -19,16 +19,15 @@ +@@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.coding; -+import com.google.common.collect.ImmutableSet; ++import static java.util.stream.Collectors.toUnmodifiableSet; ++ import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; - import com.puppycrawl.tools.checkstyle.api.FullIdent; - import com.puppycrawl.tools.checkstyle.api.TokenTypes; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; --import java.util.Arrays; +@@ -28,7 +30,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.util.Arrays; import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; /** * Checks for illegal instantiations where a factory method is preferred. -@@ -314,6 +313,6 @@ public class IllegalInstantiationCheck extends AbstractCheck { +@@ -314,6 +315,6 @@ public class IllegalInstantiationCheck extends AbstractCheck { * @since 3.0 */ public void setClasses(String... names) { -- classes = Arrays.stream(names).collect(Collectors.toSet()); -+ classes = ImmutableSet.copyOf(names); +- classes = Arrays.stream(names).collect(Collectors.toUnmodifiableSet()); ++ classes = Arrays.stream(names).collect(toUnmodifiableSet()); } } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java @@ -10607,7 +11584,7 @@ import java.util.regex.Pattern; /** -@@ -124,7 +126,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { +@@ -125,7 +127,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { * @since 3.2 */ public void setMessage(String message) { @@ -10616,7 +11593,7 @@ } /** -@@ -156,7 +158,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { +@@ -157,7 +159,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { private void updateRegexp() { final int compileFlags; if (ignoreCase) { @@ -10631,7 +11608,7 @@ package com.puppycrawl.tools.checkstyle.checks.coding; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -10648,22 +11625,23 @@ final List matchingItems = xpathExpression.evaluate(xpathDynamicContext); return matchingItems.stream() .map(item -> (DetailAST) ((AbstractNode) item).getUnderlyingNode()) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } catch (XPathException ex) { throw new IllegalStateException("Evaluation of Xpath query failed: " + query, ex); } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java -@@ -19,6 +19,7 @@ +@@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.coding; -+import com.google.common.collect.Sets; ++import static java.util.stream.Collectors.toUnmodifiableSet; ++ import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; -@@ -31,7 +32,6 @@ import java.util.HashSet; +@@ -31,7 +33,6 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -10671,14 +11649,12 @@ /** * Checks that for loop control variables are not modified inside the for block. An example is: -@@ -293,9 +293,7 @@ public final class ModifiedControlVariableCheck extends AbstractCheck { - private static Set getVariablesManagedByForLoop(DetailAST ast) { - final Set initializedVariables = getForInitVariables(ast); +@@ -295,7 +296,7 @@ public final class ModifiedControlVariableCheck extends AbstractCheck { final Set iteratingVariables = getForIteratorVariables(ast); -- return initializedVariables.stream() -- .filter(iteratingVariables::contains) -- .collect(Collectors.toSet()); -+ return Sets.intersection(initializedVariables, iteratingVariables).immutableCopy(); + return initializedVariables.stream() + .filter(iteratingVariables::contains) +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } /** @@ -10715,7 +11691,7 @@ package com.puppycrawl.tools.checkstyle.checks.coding; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -10728,21 +11704,12 @@ /** * Checks that a local variable is declared and/or assigned, but not used. Doesn't support typeDeclWithSameName = typeDeclWithSameName(shortNameOfClass); @@ -480,7 +481,7 @@ public class UnusedLocalVariableCheck extends AbstractCheck { typeDeclDesc -> { return hasSameNameAsSuperClass(superClassName, typeDeclDesc); }) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } /** @@ -10753,16 +11720,15 @@ package com.puppycrawl.tools.checkstyle.checks.design; +import static java.util.Objects.requireNonNullElse; ++import static java.util.stream.Collectors.toUnmodifiableSet; + -+import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; -@@ -27,14 +30,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; - import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; +@@ -28,13 +31,11 @@ import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; import com.puppycrawl.tools.checkstyle.utils.ScopeUtil; import com.puppycrawl.tools.checkstyle.utils.TokenUtil; --import java.util.Arrays; + import java.util.Arrays; -import java.util.Objects; import java.util.Optional; import java.util.Set; @@ -10773,32 +11739,26 @@ /** * Checks that classes are designed for extension (subclass creation). -@@ -176,11 +176,10 @@ public class DesignForExtensionCheck extends AbstractCheck { - - /** Specify annotations which allow the check to skip the method from validation. */ - private Set ignoredAnnotations = -- Arrays.stream( -- new String[] { -- "Test", "Before", "After", "BeforeClass", "AfterClass", -- }) -- .collect(Collectors.toSet()); -+ ImmutableSet.copyOf( -+ new String[] { -+ "Test", "Before", "After", "BeforeClass", "AfterClass", -+ }); +@@ -180,7 +181,7 @@ public class DesignForExtensionCheck extends AbstractCheck { + new String[] { + "Test", "Before", "After", "BeforeClass", "AfterClass", + }) +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); /** * Specify the comment text pattern which qualifies a method as designed for extension. Supports -@@ -195,7 +194,7 @@ public class DesignForExtensionCheck extends AbstractCheck { +@@ -195,8 +196,7 @@ public class DesignForExtensionCheck extends AbstractCheck { * @since 7.2 */ public void setIgnoredAnnotations(String... ignoredAnnotations) { -- this.ignoredAnnotations = Arrays.stream(ignoredAnnotations).collect(Collectors.toSet()); -+ this.ignoredAnnotations = ImmutableSet.copyOf(ignoredAnnotations); +- this.ignoredAnnotations = +- Arrays.stream(ignoredAnnotations).collect(Collectors.toUnmodifiableSet()); ++ this.ignoredAnnotations = Arrays.stream(ignoredAnnotations).collect(toUnmodifiableSet()); } /** -@@ -396,7 +395,7 @@ public class DesignForExtensionCheck extends AbstractCheck { +@@ -397,7 +397,7 @@ public class DesignForExtensionCheck extends AbstractCheck { */ private static String getAnnotationName(DetailAST annotation) { final DetailAST dotAst = annotation.findFirstToken(TokenTypes.DOT); @@ -10969,7 +11929,7 @@ import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; -@@ -648,10 +650,10 @@ public class CustomImportOrderCheck extends AbstractCheck { +@@ -649,10 +651,10 @@ public class CustomImportOrderCheck extends AbstractCheck { } else if (ruleStr.startsWith(SAME_PACKAGE_RULE_GROUP)) { final String rule = ruleStr.substring(ruleStr.indexOf('(') + 1, ruleStr.indexOf(')')); samePackageMatchingDepth = Integer.parseInt(rule); @@ -10981,7 +11941,7 @@ + samePackageMatchingDepth > 0, + "SAME_PACKAGE rule parameter should be positive integer: %s", + ruleStr); - customOrderRules.add(SAME_PACKAGE_RULE_GROUP); + customImportOrderRules.add(SAME_PACKAGE_RULE_GROUP); } else { throw new IllegalStateException("Unexpected rule: " + ruleStr); --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java @@ -11049,7 +12009,7 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser; import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseErrorMessage; @@ -11062,26 +12022,29 @@ /** * Base class for Checks that process Javadoc comments. -@@ -177,7 +178,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { +@@ -182,9 +183,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { validateDefaultJavadocTokens(); if (javadocTokens.isEmpty()) { javadocTokens.addAll( -- Arrays.stream(getDefaultJavadocTokens()).boxed().collect(Collectors.toList())); -+ Arrays.stream(getDefaultJavadocTokens()).boxed().collect(toImmutableList())); +- Arrays.stream(getDefaultJavadocTokens()) +- .boxed() +- .collect(Collectors.toUnmodifiableList())); ++ Arrays.stream(getDefaultJavadocTokens()).boxed().collect(toUnmodifiableList())); } else { final int[] acceptableJavadocTokens = getAcceptableJavadocTokens(); Arrays.sort(acceptableJavadocTokens); --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheck.java -@@ -19,14 +19,13 @@ +@@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; -+import com.google.common.collect.ImmutableSet; ++import static java.util.stream.Collectors.toUnmodifiableSet; ++ import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.DetailNode; import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; --import java.util.Arrays; +@@ -26,7 +28,6 @@ import java.util.Arrays; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -11089,12 +12052,12 @@ /** * Checks that a * block tags which are ignored by the check. */ @@ -11389,8 +12341,8 @@ package com.puppycrawl.tools.checkstyle.checks.metrics; +import static com.google.common.base.Preconditions.checkArgument; -+import static com.google.common.collect.ImmutableList.toImmutableList; +import static java.util.function.Predicate.not; ++import static java.util.stream.Collectors.toUnmodifiableList; + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -11423,18 +12375,18 @@ /** Pattern to match brackets in a full type name. */ private static final Pattern BRACKET_PATTERN = Pattern.compile("\\[[^]]*]"); -@@ -211,13 +213,11 @@ public abstract class AbstractClassCouplingCheck extends AbstractCheck { - */ +@@ -208,12 +210,12 @@ public abstract class AbstractClassCouplingCheck extends AbstractCheck { public final void setExcludedPackages(String... excludedPackages) { final List invalidIdentifiers = -- Arrays.stream(excludedPackages) + Arrays.stream(excludedPackages) - .filter(Predicate.not(CommonUtil::isName)) -- .collect(Collectors.toList()); +- .collect(Collectors.toUnmodifiableList()); - if (!invalidIdentifiers.isEmpty()) { - throw new IllegalArgumentException( - "the following values are not valid identifiers: " + invalidIdentifiers); - } -+ Arrays.stream(excludedPackages).filter(not(CommonUtil::isName)).collect(toImmutableList()); ++ .filter(not(CommonUtil::isName)) ++ .collect(toUnmodifiableList()); + checkArgument( + invalidIdentifiers.isEmpty(), + "the following values are not valid identifiers: %s", @@ -11444,19 +12396,16 @@ } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java -@@ -19,18 +19,17 @@ +@@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.checks.naming; -+import com.google.common.collect.ImmutableSet; ++import static java.util.stream.Collectors.toUnmodifiableSet; ++ import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; - import com.puppycrawl.tools.checkstyle.api.TokenTypes; - import com.puppycrawl.tools.checkstyle.utils.CheckUtil; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; --import java.util.Arrays; - import java.util.HashSet; +@@ -30,7 +32,6 @@ import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -11464,12 +12413,13 @@ /** * Validates abbreviations (consecutive capital letters) length in identifier name, it also allows -@@ -199,7 +198,7 @@ public class AbbreviationAsWordInNameCheck extends AbstractCheck { +@@ -199,8 +200,7 @@ public class AbbreviationAsWordInNameCheck extends AbstractCheck { */ public void setAllowedAbbreviations(String... allowedAbbreviations) { if (allowedAbbreviations != null) { -- this.allowedAbbreviations = Arrays.stream(allowedAbbreviations).collect(Collectors.toSet()); -+ this.allowedAbbreviations = ImmutableSet.copyOf(allowedAbbreviations); +- this.allowedAbbreviations = +- Arrays.stream(allowedAbbreviations).collect(Collectors.toUnmodifiableSet()); ++ this.allowedAbbreviations = Arrays.stream(allowedAbbreviations).collect(toUnmodifiableSet()); } } @@ -11492,19 +12442,6 @@ final DetailAST parametersNode = ast.findFirstToken(TokenTypes.PARAMETERS); TokenUtil.forEachChild(parametersNode, TokenTypes.PARAMETER_DEF, super::visitToken); } else if (!isInSwitchRule) { ---- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java -+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java -@@ -152,8 +152,8 @@ public class ParameterNameCheck extends AbstractNameCheck { - - if (annotation.isPresent()) { - final Optional overrideToken = -- Optional.ofNullable(annotation.get().findFirstToken(TokenTypes.IDENT)); -- if (overrideToken.isPresent() && "Override".equals(overrideToken.get().getText())) { -+ Optional.ofNullable(annotation.orElseThrow().findFirstToken(TokenTypes.IDENT)); -+ if (overrideToken.isPresent() && "Override".equals(overrideToken.orElseThrow().getText())) { - overridden = true; - } - } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java @@ -19,6 +19,9 @@ @@ -11596,8 +12533,8 @@ public void beginTree(DetailAST rootAST) { matcher = format.matcher(getFileContents().getText().getFullText()); matchCount = 0; -@@ -320,7 +323,7 @@ public class RegexpCheck extends AbstractCheck { - private void logMessage(int lineNumber) { +@@ -336,7 +339,7 @@ public class RegexpCheck extends AbstractCheck { + private String getMessage() { String msg; - if (message == null || message.isEmpty()) { @@ -11648,57 +12585,17 @@ public void beginTree(DetailAST rootAST) { MatchSuppressor suppressor = null; if (ignoreComments) { ---- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java -+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java -@@ -254,7 +254,7 @@ public class EmptyLineSeparatorCheck extends AbstractCheck { - private void checkCommentInModifiers(DetailAST packageDef) { - final Optional comment = findCommentUnder(packageDef); - if (comment.isPresent()) { -- log(comment.get(), MSG_SHOULD_BE_SEPARATED, comment.get().getText()); -+ log(comment.orElseThrow(), MSG_SHOULD_BE_SEPARATED, comment.orElseThrow().getText()); - } - } - -@@ -302,7 +302,7 @@ public class EmptyLineSeparatorCheck extends AbstractCheck { - // The first child is DOT in case of POSTFIX which have at least 2 children - // First child of DOT again puts us back to normal AST tree which will - // recurse down below from here -- final DetailAST firstChildAfterPostFix = postFixNode.get(); -+ final DetailAST firstChildAfterPostFix = postFixNode.orElseThrow(); - result = getLastElementBeforeEmptyLines(firstChildAfterPostFix, line); - } - } ---- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java -+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java -@@ -383,7 +383,7 @@ public class NoWhitespaceAfterCheck extends AbstractCheck { - typeLastNode = - parent.findFirstToken(TokenTypes.TYPE_ARGUMENTS).findFirstToken(TokenTypes.GENERIC_END); - } else if (objectArrayType.isPresent()) { -- typeLastNode = objectArrayType.get(); -+ typeLastNode = objectArrayType.orElseThrow(); - } else { - typeLastNode = parent.getFirstChild(); - } -@@ -449,7 +449,7 @@ public class NoWhitespaceAfterCheck extends AbstractCheck { - } - // qualified name case - else { -- result = dot.get().getFirstChild().getNextSibling(); -+ result = dot.orElseThrow().getFirstChild().getNextSibling(); - } - return result; - } --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilter.java -@@ -377,7 +377,7 @@ public class SuppressWithPlainTextCommentFilter extends AbstractAutomaticBean im +@@ -356,7 +356,7 @@ public class SuppressWithPlainTextCommentFilter extends AbstractAutomaticBean im + } final Suppression suppression = (Suppression) other; return Objects.equals(lineNo, suppression.lineNo) - && Objects.equals(columnNo, suppression.columnNo) - && Objects.equals(suppressionType, suppression.suppressionType) + && suppressionType == suppression.suppressionType - && Objects.equals(text, suppression.text) && Objects.equals(eventSourceRegexp, suppression.eventSourceRegexp) && Objects.equals(eventMessageRegexp, suppression.eventMessageRegexp) + && Objects.equals(eventIdRegexp, suppression.eventIdRegexp); --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java @@ -483,7 +483,7 @@ public class SuppressionCommentFilter extends AbstractAutomaticBean implements T @@ -11742,7 +12639,7 @@ package com.puppycrawl.tools.checkstyle.filters; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; import com.puppycrawl.tools.checkstyle.TreeWalkerFilter; @@ -11755,12 +12652,14 @@ import net.sf.saxon.Configuration; import net.sf.saxon.om.Item; import net.sf.saxon.sxpath.XPathDynamicContext; -@@ -190,7 +191,7 @@ public class XpathFilterElement implements TreeWalkerFilter { +@@ -163,9 +164,7 @@ public class XpathFilterElement implements TreeWalkerFilter { } else { isMatching = false; final List nodes = -- getItems(event).stream().map(AbstractNode.class::cast).collect(Collectors.toList()); -+ getItems(event).stream().map(AbstractNode.class::cast).collect(toImmutableList()); +- getItems(event).stream() +- .map(AbstractNode.class::cast) +- .collect(Collectors.toUnmodifiableList()); ++ getItems(event).stream().map(AbstractNode.class::cast).collect(toUnmodifiableList()); for (AbstractNode abstractNode : nodes) { isMatching = abstractNode.getTokenType() == event.getTokenType() @@ -11840,42 +12739,6 @@ "null", "the charset property of the parent Checker module"); -@@ -271,7 +273,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { - final Optional propertyNameNode = - getFirstChildOfType(nodeLi, JavadocTokenTypes.JAVADOC_INLINE_TAG, 0); - if (propertyNameNode.isPresent()) { -- final DetailNode propertyNameTag = propertyNameNode.get(); -+ final DetailNode propertyNameTag = propertyNameNode.orElseThrow(); - final String propertyName = getTextFromTag(propertyNameTag); - - final DetailNode propertyType = -@@ -295,7 +297,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { - final Optional validationTypeNodeOpt = - getFirstChildOfMatchingText(nodeLi, VALIDATION_TYPE_TAG); - if (validationTypeNodeOpt.isPresent()) { -- final DetailNode validationTypeNode = validationTypeNodeOpt.get(); -+ final DetailNode validationTypeNode = validationTypeNodeOpt.orElseThrow(); - modulePropertyDetails.setValidationType(getTagTextFromProperty(nodeLi, validationTypeNode)); - } - -@@ -327,7 +329,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { - nodeLi, JavadocTokenTypes.JAVADOC_INLINE_TAG, propertyMeta.getIndex() + 1); - DetailNode tagNode = null; - if (tagNodeOpt.isPresent()) { -- tagNode = tagNodeOpt.get(); -+ tagNode = tagNodeOpt.orElseThrow(); - } - return getTextFromTag(tagNode); - } -@@ -420,7 +422,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { - nodeLi, JavadocTokenTypes.JAVADOC_INLINE_TAG, defaultValueNode.getIndex() + 1); - final String result; - if (propertyDefaultValueTag.isPresent()) { -- result = getTextFromTag(propertyDefaultValueTag.get()); -+ result = getTextFromTag(propertyDefaultValueTag.orElseThrow()); - } else { - final String tokenText = - constructSubTreeText(nodeLi, defaultValueNode.getIndex(), nodeLi.getChildren().length); @@ -477,7 +479,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { return Arrays.stream(parentNode.getChildren()) .filter(child -> child.getType() == JavadocTokenTypes.TEXT) @@ -11894,15 +12757,6 @@ } /** Reset the module detail store of any previous information. */ -@@ -617,7 +619,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { - return parent.getType() == TokenTypes.CLASS_DEF - && child.getType() == TokenTypes.IDENT; - }); -- return className.isPresent() && getModuleSimpleName().equals(className.get().getText()); -+ return className.isPresent() && getModuleSimpleName().equals(className.orElseThrow().getText()); - } - - /** @@ -673,7 +675,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { return getFirstChildOfType(ast, JavadocTokenTypes.TEXT, 0) .map(DetailNode::getText) @@ -11919,7 +12773,7 @@ package com.puppycrawl.tools.checkstyle.meta; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; import com.puppycrawl.tools.checkstyle.Checker; @@ -11936,8 +12790,8 @@ || fileName.endsWith("Check.java") || fileName.endsWith("Filter.java"); }) -- .collect(Collectors.toList())); -+ .collect(toImmutableList())); +- .collect(Collectors.toUnmodifiableList())); ++ .collect(toUnmodifiableList())); } } @@ -12039,69 +12893,104 @@ /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/PropertiesMacro.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/PropertiesMacro.java -@@ -19,6 +19,8 @@ +@@ -19,6 +19,10 @@ package com.puppycrawl.tools.checkstyle.site; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.Collections.unmodifiableSet; ++import static java.util.stream.Collectors.toUnmodifiableList; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.PropertyType; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailNode; - import com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck; -@@ -32,7 +34,6 @@ import java.util.List; +@@ -29,14 +33,12 @@ import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.io.File; + import java.lang.reflect.Field; + import java.util.Arrays; +-import java.util.Collections; + import java.util.LinkedList; + import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; + import java.util.regex.Pattern; -import java.util.stream.Collectors; import org.apache.maven.doxia.macro.AbstractMacro; import org.apache.maven.doxia.macro.Macro; import org.apache.maven.doxia.macro.MacroExecutionException; -@@ -251,7 +252,7 @@ public class PropertiesMacro extends AbstractMacro { +@@ -54,16 +56,15 @@ public class PropertiesMacro extends AbstractMacro { + + /** Set of properties not inherited from the base token configuration. */ + public static final Set NON_BASE_TOKEN_PROPERTIES = +- Collections.unmodifiableSet( +- Arrays.stream( +- new String[] { +- "AtclauseOrder - target", +- "DescendantToken - limitedTokens", +- "IllegalType - memberModifiers", +- "MagicNumber - constantWaiverParentToken", +- "MultipleStringLiterals - ignoreOccurrenceContext", +- }) +- .collect(Collectors.toSet())); ++ unmodifiableSet( ++ ImmutableSet.copyOf( ++ new String[] { ++ "AtclauseOrder - target", ++ "DescendantToken - limitedTokens", ++ "IllegalType - memberModifiers", ++ "MagicNumber - constantWaiverParentToken", ++ "MultipleStringLiterals - ignoreOccurrenceContext", ++ })); + + /** The precompiled pattern for a comma followed by a space. */ + private static final Pattern COMMA_SPACE_PATTERN = Pattern.compile(", "); +@@ -334,7 +335,7 @@ public class PropertiesMacro extends AbstractMacro { final List configurableTokens = SiteUtil.getDifference(check.getAcceptableTokens(), check.getRequiredTokens()).stream() .map(TokenUtil::getTokenName) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); sink.text("subset of tokens"); - writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_TOKEN_TYPES); - } -@@ -262,7 +263,7 @@ public class PropertiesMacro extends AbstractMacro { + + writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_TOKEN_TYPES, true); +@@ -346,7 +347,7 @@ public class PropertiesMacro extends AbstractMacro { check.getAcceptableJavadocTokens(), check.getRequiredJavadocTokens()) .stream() .map(JavadocUtil::getTokenName) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); sink.text("subset of javadoc tokens"); - writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_JAVADOC_TOKEN_TYPES); + writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_JAVADOC_TOKEN_TYPES, true); } else { -@@ -342,7 +343,7 @@ public class PropertiesMacro extends AbstractMacro { +@@ -473,7 +474,7 @@ public class PropertiesMacro extends AbstractMacro { final List configurableTokens = SiteUtil.getDifference(check.getDefaultTokens(), check.getRequiredTokens()).stream() .map(TokenUtil::getTokenName) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); - writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_TOKEN_TYPES); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_TOKEN_TYPES, true); } } else if (SiteUtil.JAVADOC_TOKENS.equals(propertyName)) { -@@ -351,7 +352,7 @@ public class PropertiesMacro extends AbstractMacro { +@@ -482,7 +483,7 @@ public class PropertiesMacro extends AbstractMacro { SiteUtil.getDifference(check.getDefaultJavadocTokens(), check.getRequiredJavadocTokens()) .stream() .map(JavadocUtil::getTokenName) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); - writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_JAVADOC_TOKEN_TYPES); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_JAVADOC_TOKEN_TYPES, true); } else { - final String defaultValue = + final String defaultValue = getDefaultValue(propertyName, field, instance); --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java @@ -19,6 +19,14 @@ package com.puppycrawl.tools.checkstyle.site; -+import static com.google.common.collect.ImmutableList.toImmutableList; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; +import static java.util.stream.Collectors.joining; -+import static java.util.stream.Collectors.toSet; ++import static java.util.stream.Collectors.toCollection; ++import static java.util.stream.Collectors.toUnmodifiableList; ++import static java.util.stream.Collectors.toUnmodifiableSet; + +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; @@ -12116,8 +13005,8 @@ -import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; - import org.apache.commons.beanutils.PropertyUtils; -@@ -146,7 +153,7 @@ public final class SiteUtil { + import javax.annotation.Nullable; +@@ -156,7 +163,7 @@ public final class SiteUtil { /** Set of properties that are undocumented. Those are internal properties. */ private static final Set UNDOCUMENTED_PROPERTIES = @@ -12126,25 +13015,16 @@ "SuppressWithNearbyCommentFilter.fileContents", "SuppressionCommentFilter.fileContents"); /** Properties that can not be gathered from class instance. */ -@@ -179,7 +186,7 @@ public final class SiteUtil { - - /** List of files who are superclasses and contain certain properties that checks inherit. */ - private static final List MODULE_SUPER_CLASS_FILES = -- List.of( -+ ImmutableList.of( - new File( - Paths.get(MAIN_FOLDER_PATH, CHECKS, NAMING, "AbstractAccessControlNameCheck.java") - .toString()), -@@ -359,7 +366,7 @@ public final class SiteUtil { +@@ -480,7 +487,7 @@ public final class SiteUtil { (path, attr) -> { return attr.isRegularFile() && path.toString().endsWith(".xml.template"); })) { -- return stream.collect(Collectors.toSet()); -+ return stream.collect(toImmutableSet()); +- return stream.collect(Collectors.toUnmodifiableSet()); ++ return stream.collect(toUnmodifiableSet()); } catch (IOException ioException) { throw new MacroExecutionException("Failed to find xdocs templates", ioException); } -@@ -386,7 +393,7 @@ public final class SiteUtil { +@@ -507,7 +514,7 @@ public final class SiteUtil { } // If parent class is not found, check interfaces @@ -12153,7 +13033,7 @@ final Class[] interfaces = moduleClass.getInterfaces(); for (Class interfaceClass : interfaces) { parentModuleName = CLASS_TO_PARENT_MODULE.get(interfaceClass); -@@ -396,7 +403,7 @@ public final class SiteUtil { +@@ -517,7 +524,7 @@ public final class SiteUtil { } } @@ -12162,16 +13042,16 @@ final String message = String.format( Locale.ROOT, "Failed to find parent module for %s", moduleClass.getSimpleName()); -@@ -424,7 +431,7 @@ public final class SiteUtil { +@@ -545,7 +552,7 @@ public final class SiteUtil { prop -> { return !isGlobalProperty(clss, prop) && !isUndocumentedProperty(clss, prop); }) -- .collect(Collectors.toSet()); -+ .collect(toSet()); +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); properties.addAll(getNonExplicitProperties(instance, clss)); return new TreeSet<>(properties); } -@@ -543,7 +550,7 @@ public final class SiteUtil { +@@ -664,7 +671,7 @@ public final class SiteUtil { treeWalkerConfig.addChild(scraperCheckConfig); try { checker.configure(defaultConfiguration); @@ -12180,7 +13060,7 @@ checker.process(filesToProcess); checker.destroy(); } catch (CheckstyleException checkstyleException) { -@@ -855,9 +862,7 @@ public final class SiteUtil { +@@ -987,9 +994,7 @@ public final class SiteUtil { if (value != null && Array.getLength(value) > 0) { result = removeSquareBrackets( @@ -12191,7 +13071,7 @@ } if (result.isEmpty()) { -@@ -889,8 +894,7 @@ public final class SiteUtil { +@@ -1021,8 +1026,7 @@ public final class SiteUtil { result = ""; } else { try (Stream valuesStream = getValuesStream(value)) { @@ -12201,7 +13081,7 @@ } } -@@ -931,10 +935,7 @@ public final class SiteUtil { +@@ -1063,10 +1067,7 @@ public final class SiteUtil { private static String getIntArrayPropertyValue(Object value) { try (IntStream stream = getIntStream(value)) { String result = @@ -12213,17 +13093,17 @@ if (result.isEmpty()) { result = CURLY_BRACKETS; } -@@ -1024,11 +1025,11 @@ public final class SiteUtil { +@@ -1172,11 +1173,11 @@ public final class SiteUtil { */ public static List getDifference(int[] tokens, int... subtractions) { final Set subtractionsSet = -- Arrays.stream(subtractions).boxed().collect(Collectors.toSet()); -+ Arrays.stream(subtractions).boxed().collect(toImmutableSet()); +- Arrays.stream(subtractions).boxed().collect(Collectors.toUnmodifiableSet()); ++ Arrays.stream(subtractions).boxed().collect(toUnmodifiableSet()); return Arrays.stream(tokens) .boxed() .filter(token -> !subtractionsSet.contains(token)) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } /** @@ -12432,7 +13312,7 @@ package com.puppycrawl.tools.checkstyle.utils; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; ++import static java.util.stream.Collectors.toUnmodifiableSet; + import com.google.common.reflect.ClassPath; import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean; @@ -12449,8 +13329,8 @@ .flatMap(pkg -> classPath.getTopLevelClasses(pkg).stream()) .map(ClassPath.ClassInfo::load) .filter(ModuleReflectionUtil::isCheckstyleModule) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } /** @@ -12465,32 +13345,30 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.Scope; import com.puppycrawl.tools.checkstyle.api.TokenTypes; -@@ -80,8 +82,8 @@ public final class ScopeUtil { +@@ -78,8 +80,7 @@ public final class ScopeUtil { * @see #getDefaultScope(DetailAST) */ public static Scope getScopeFromMods(DetailAST aMods) { - return Optional.ofNullable(getDeclaredScopeFromMods(aMods)) -- .orElseGet(() -> getDefaultScope(aMods.getParent())); -+ return requireNonNullElseGet( -+ getDeclaredScopeFromMods(aMods), () -> getDefaultScope(aMods.getParent())); +- .orElseGet(() -> getDefaultScope(aMods)); ++ return requireNonNullElseGet(getDeclaredScopeFromMods(aMods), () -> getDefaultScope(aMods)); } /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java -@@ -19,6 +19,11 @@ +@@ -19,6 +19,10 @@ package com.puppycrawl.tools.checkstyle.utils; +import static com.google.common.base.Preconditions.checkArgument; -+import static com.google.common.collect.ImmutableMap.toImmutableMap; +import static java.util.function.Predicate.not; +import static java.util.stream.Collectors.toUnmodifiableMap; + import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.lang.reflect.Field; -@@ -31,7 +36,6 @@ import java.util.Optional; +@@ -31,7 +35,6 @@ import java.util.Optional; import java.util.ResourceBundle; import java.util.function.Consumer; import java.util.function.Predicate; @@ -12498,28 +13376,25 @@ import java.util.stream.IntStream; /** Contains utility methods for tokens. */ -@@ -91,9 +95,7 @@ public final class TokenUtil { +@@ -91,7 +94,7 @@ public final class TokenUtil { public static Map nameToValueMapFromPublicIntFields(Class cls) { return Arrays.stream(cls.getDeclaredFields()) .filter(fld -> Modifier.isPublic(fld.getModifiers()) && fld.getType() == Integer.TYPE) -- .collect( -- Collectors.toUnmodifiableMap( -- Field::getName, fld -> getIntFromField(fld, fld.getName()))); -+ .collect(toUnmodifiableMap(Field::getName, fld -> getIntFromField(fld, fld.getName()))); +- .collect(Collectors.toUnmodifiableMap(Field::getName, fld -> getIntFromField(fld, null))); ++ .collect(toUnmodifiableMap(Field::getName, fld -> getIntFromField(fld, null))); } /** -@@ -103,8 +105,7 @@ public final class TokenUtil { - * @return inverted map +@@ -102,7 +105,7 @@ public final class TokenUtil { */ public static Map invertMap(Map map) { -- return map.entrySet().stream() -- .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); -+ return map.entrySet().stream().collect(toImmutableMap(Map.Entry::getValue, Map.Entry::getKey)); + return map.entrySet().stream() +- .collect(Collectors.toUnmodifiableMap(Map.Entry::getValue, Map.Entry::getKey)); ++ .collect(toUnmodifiableMap(Map.Entry::getValue, Map.Entry::getKey)); } /** -@@ -136,9 +137,7 @@ public final class TokenUtil { +@@ -134,9 +137,7 @@ public final class TokenUtil { */ public static String getTokenName(int id) { final String name = TOKEN_VALUE_TO_NAME.get(id); @@ -12530,7 +13405,7 @@ return name; } -@@ -151,10 +150,7 @@ public final class TokenUtil { +@@ -149,10 +150,7 @@ public final class TokenUtil { */ public static int getTokenId(String name) { final Integer id = TOKEN_NAME_TO_VALUE.get(name); @@ -12542,7 +13417,7 @@ return id; } -@@ -166,10 +162,9 @@ public final class TokenUtil { +@@ -164,10 +162,9 @@ public final class TokenUtil { * @throws IllegalArgumentException when name is unknown */ public static String getShortDescription(String name) { @@ -12556,7 +13431,7 @@ final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes"; final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes, Locale.ROOT); -@@ -334,7 +329,7 @@ public final class TokenUtil { +@@ -332,7 +329,7 @@ public final class TokenUtil { public static BitSet asBitSet(String... tokens) { return Arrays.stream(tokens) .map(String::trim) @@ -12567,15 +13442,33 @@ } --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtil.java -@@ -19,6 +19,7 @@ +@@ -19,13 +19,15 @@ package com.puppycrawl.tools.checkstyle.utils; ++import static java.util.stream.Collectors.toUnmodifiableList; ++ +import com.google.common.collect.ImmutableSet; import java.util.Arrays; + import java.util.Collection; import java.util.Collections; import java.util.List; -@@ -88,6 +89,6 @@ public final class UnmodifiableCollectionUtil { + import java.util.Map; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Note: it simply wraps the existing JDK methods to provide a workaround for Pitest survival on +@@ -68,7 +70,7 @@ public final class UnmodifiableCollectionUtil { + * @return An unmodifiable List containing elements of the specified type. + */ + public static List unmodifiableList(Collection items, Class elementType) { +- return items.stream().map(elementType::cast).collect(Collectors.toUnmodifiableList()); ++ return items.stream().map(elementType::cast).collect(toUnmodifiableList()); + } + + /** +@@ -103,6 +105,6 @@ public final class UnmodifiableCollectionUtil { * @return immutable set */ public static Set singleton(T obj) { @@ -12585,17 +13478,16 @@ } --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java -@@ -19,6 +19,9 @@ +@@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.utils; +import static java.util.stream.Collectors.joining; -+import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.AstTreeStringPrinter; import com.puppycrawl.tools.checkstyle.JavaParser; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -34,7 +37,6 @@ import java.util.BitSet; +@@ -34,7 +36,6 @@ import java.util.BitSet; import java.util.List; import java.util.Locale; import java.util.regex.Pattern; @@ -12603,7 +13495,7 @@ import net.sf.saxon.Configuration; import net.sf.saxon.om.Item; import net.sf.saxon.om.NodeInfo; -@@ -194,7 +196,7 @@ public final class XpathUtil { +@@ -194,7 +195,7 @@ public final class XpathUtil { return matchingItems.stream() .map(item -> ((ElementNode) item).getUnderlyingNode()) .map(AstTreeStringPrinter::printBranch) @@ -12612,14 +13504,6 @@ } catch (XPathException ex) { final String errMsg = String.format( -@@ -220,6 +222,6 @@ public final class XpathUtil { - final XPathExpression xpathExpression = xpathEvaluator.createExpression(xpath); - final XPathDynamicContext xpathDynamicContext = xpathExpression.createDynamicContext(rootNode); - final List items = xpathExpression.evaluate(xpathDynamicContext); -- return items.stream().map(NodeInfo.class::cast).collect(Collectors.toUnmodifiableList()); -+ return items.stream().map(NodeInfo.class::cast).collect(toUnmodifiableList()); - } - } --- a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java @@ -19,7 +19,8 @@ @@ -12647,7 +13531,7 @@ package com.puppycrawl.tools.checkstyle.xpath; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -12664,8 +13548,8 @@ public List generate() { return getMatchingAstElements().stream() .map(XpathQueryGenerator::generateXpathQuery) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } /** @@ -12775,14 +13659,13 @@ config.addProperty("uri", "BAD"); --- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java -@@ -19,8 +19,12 @@ - +@@ -20,7 +20,11 @@ package com.puppycrawl.tools.checkstyle; -+import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.stream.Collectors.toCollection; ++import static java.util.stream.Collectors.toUnmodifiableList; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -12796,30 +13679,31 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport { -@@ -421,7 +424,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -422,8 +425,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport */ protected final void execute(Configuration config, String... filenames) throws Exception { final Checker checker = createChecker(config); -- final List files = Arrays.stream(filenames).map(File::new).collect(Collectors.toList()); -+ final List files = Arrays.stream(filenames).map(File::new).collect(toImmutableList()); +- final List files = +- Arrays.stream(filenames).map(File::new).collect(Collectors.toUnmodifiableList()); ++ final List files = Arrays.stream(filenames).map(File::new).collect(toUnmodifiableList()); checker.process(files); checker.destroy(); } -@@ -442,11 +445,9 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -444,11 +446,11 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport actualViolations.stream() .map(violation -> violation.substring(0, violation.indexOf(':'))) .map(Integer::valueOf) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); final List expectedViolationLines = -- testInputViolations.stream() -- .map(TestInputViolation::getLineNo) -- .collect(Collectors.toList()); -+ testInputViolations.stream().map(TestInputViolation::getLineNo).collect(toImmutableList()); + testInputViolations.stream() + .map(TestInputViolation::getLineNo) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); assertWithMessage("Violation lines for %s differ.", file) .that(actualViolationLines) .isEqualTo(expectedViolationLines); -@@ -469,7 +470,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -471,7 +473,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport throws Exception { stream.flush(); stream.reset(); @@ -12828,7 +13712,7 @@ final Checker checker = createChecker(config); final Map> actualViolations = getActualViolations(checker.process(files)); checker.destroy(); -@@ -488,8 +489,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -490,8 +492,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport private Map> getActualViolations(int errorCount) throws IOException { // process each of the lines try (ByteArrayInputStream inputStream = new ByteArrayInputStream(stream.toByteArray()); @@ -12838,7 +13722,7 @@ final Map> actualViolations = new HashMap<>(); for (String line = lnr.readLine(); line != null && lnr.getLineNumber() <= errorCount; -@@ -592,7 +592,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -594,7 +595,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport protected static String[] removeSuppressed( String[] actualViolations, String... suppressedViolations) { final List actualViolationsList = @@ -12849,7 +13733,7 @@ } --- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java -@@ -19,12 +19,13 @@ +@@ -19,13 +19,14 @@ package com.puppycrawl.tools.checkstyle; @@ -12859,13 +13743,14 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; ++import java.util.Arrays; + import java.util.Locale; -import java.util.stream.Collectors; -import java.util.stream.Stream; -+import java.util.Arrays; + import org.junit.jupiter.api.BeforeEach; public abstract class AbstractPathTestSupport { - -@@ -95,7 +96,7 @@ public abstract class AbstractPathTestSupport { +@@ -103,7 +104,7 @@ public abstract class AbstractPathTestSupport { * @return joined strings */ public static String addEndOfLine(String... strings) { @@ -13073,19 +13958,13 @@ 1, 1, "messages.properties", "key", null, SeverityLevel.ERROR, null, getClass(), null); --- a/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java -@@ -19,13 +19,17 @@ - - package com.puppycrawl.tools.checkstyle; - -+import static com.google.common.collect.ImmutableList.toImmutableList; - import static com.google.common.truth.Truth.assertWithMessage; - import static com.puppycrawl.tools.checkstyle.Checker.EXCEPTION_MSG; - import static com.puppycrawl.tools.checkstyle.DefaultLogger.AUDIT_FINISHED_MESSAGE; +@@ -25,7 +25,11 @@ import static com.puppycrawl.tools.checkstyle.DefaultLogger.AUDIT_FINISHED_MESSA import static com.puppycrawl.tools.checkstyle.DefaultLogger.AUDIT_STARTED_MESSAGE; import static com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.MSG_KEY_NO_NEWLINE_EOF; import static com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.MSG_KEY; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Collections.unmodifiableList; ++import static java.util.stream.Collectors.toUnmodifiableList; +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; @@ -13605,8 +14484,8 @@ .filter(line -> !getCheckMessage(AUDIT_FINISHED_MESSAGE).equals(line)) .limit(expected.length) .sorted() -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); Arrays.sort(expected); for (int i = 0; i < expected.length; i++) { @@ -13637,7 +14516,16 @@ final String[] expected = { "4: " + getCheckMessage(LineLengthCheck.class, MSG_KEY, 75, 238), }; -@@ -1918,7 +1916,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1652,7 +1650,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testViolationMessageOnIoException() throws Exception { ++ void violationMessageOnIoException() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); + + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); +@@ -1939,7 +1937,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } public List getMethodCalls() { @@ -13648,7 +14536,23 @@ public boolean isInitCalled() { --- a/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java -@@ -74,7 +74,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; + import static org.mockito.Mockito.mockConstruction; + import static org.mockito.Mockito.when; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.ConfigurationLoader.IgnoredModulesOptions; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.Configuration; +@@ -34,7 +35,6 @@ import java.lang.reflect.Method; + import java.nio.file.Files; + import java.nio.file.Paths; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Properties; + import org.junit.jupiter.api.Test; +@@ -75,7 +75,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13657,7 +14561,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -92,7 +92,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -93,7 +93,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13666,7 +14570,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -112,7 +112,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -113,7 +113,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13675,7 +14579,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -133,14 +133,14 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -134,14 +134,14 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13692,7 +14596,7 @@ final DefaultConfiguration config = (DefaultConfiguration) loadConfiguration("InputConfigurationLoaderEmpty.xml", new Properties()); -@@ -148,7 +148,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -149,7 +149,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13701,7 +14605,7 @@ try { loadConfiguration("InputConfigurationLoaderMissingPropertyName.xml"); assertWithMessage("missing property name").fail(); -@@ -166,7 +166,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -167,7 +167,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13710,7 +14614,7 @@ try { final String fName = getPath("InputConfigurationLoaderMissingPropertyName.xml"); ConfigurationLoader.loadConfiguration( -@@ -187,7 +187,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -188,7 +188,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13719,7 +14623,7 @@ try { loadConfiguration("InputConfigurationLoaderMissingPropertyValue.xml"); assertWithMessage("missing property value").fail(); -@@ -205,7 +205,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -206,7 +206,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13728,7 +14632,7 @@ try { loadConfiguration("InputConfigurationLoaderMissingConfigName.xml"); assertWithMessage("missing module name").fail(); -@@ -223,7 +223,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -224,7 +224,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13737,7 +14641,7 @@ try { loadConfiguration("InputConfigurationLoaderMissingConfigParent.xml"); assertWithMessage("missing module parent").fail(); -@@ -241,7 +241,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -242,7 +242,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13746,7 +14650,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -279,7 +279,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -280,7 +280,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13755,7 +14659,17 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -316,7 +316,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -293,8 +293,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + final List messages = new ArrayList<>(grandchildren[0].getMessages().values()); + final String expectedKey = "name.invalidPattern"; + final List expectedMessages = +- Collections.singletonList( +- "Member ''{0}'' must start with ''m'' (checked pattern ''{1}'')."); ++ ImmutableList.of("Member ''{0}'' must start with ''m'' (checked pattern ''{1}'')."); + assertWithMessage("Messages should contain key: " + expectedKey) + .that(grandchildren[0].getMessages()) + .containsKey(expectedKey); +@@ -321,7 +320,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13764,7 +14678,7 @@ final String[] testValues = { "", "a", "$a", "{a", "{a}", "a}", "$a}", "$", "a$b", }; -@@ -331,7 +331,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -336,7 +335,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13773,7 +14687,7 @@ final Properties props = initProperties(); try { final String value = -@@ -348,7 +348,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -353,7 +352,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13782,7 +14696,7 @@ final Properties props = initProperties(); try { final String value = -@@ -366,7 +366,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -371,7 +370,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13791,7 +14705,16 @@ final String[][] testValues = { {"${a}", "A"}, {"x${a}", "xA"}, -@@ -399,7 +399,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -404,7 +403,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testSystemEntity() throws Exception { ++ void systemEntity() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -419,7 +418,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13800,7 +14723,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -416,7 +416,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -436,7 +435,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13809,7 +14732,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -433,7 +433,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -453,7 +452,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13818,7 +14741,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); -@@ -452,7 +452,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -472,7 +471,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13827,7 +14750,7 @@ final Class aClassParent = ConfigurationLoader.class; final Constructor ctorParent = aClassParent.getDeclaredConstructor( -@@ -481,7 +481,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -501,7 +500,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13836,7 +14759,7 @@ try { loadConfiguration("InputConfigurationLoaderNonexistentProperty.xml"); assertWithMessage("exception in expected").fail(); -@@ -505,7 +505,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -525,7 +524,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13845,7 +14768,7 @@ final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( -@@ -519,7 +519,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -539,7 +538,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13854,7 +14777,7 @@ final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( -@@ -536,7 +536,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -556,7 +555,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13863,7 +14786,7 @@ final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( -@@ -549,7 +549,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -569,7 +568,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13872,7 +14795,7 @@ try { ConfigurationLoader.loadConfiguration( ";InputConfigurationLoaderModuleIgnoreSeverity.xml", -@@ -565,7 +565,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -585,7 +584,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13881,7 +14804,7 @@ final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( -@@ -581,7 +581,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -601,7 +600,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13890,7 +14813,7 @@ final Properties props = new Properties(); final String defaultValue = "defaultValue"; -@@ -594,7 +594,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -614,7 +613,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13899,7 +14822,7 @@ final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( -@@ -608,7 +608,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -628,7 +627,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13908,7 +14831,7 @@ final List propertyRefs = new ArrayList<>(); final List fragments = new ArrayList<>(); -@@ -618,7 +618,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -638,7 +637,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13917,7 +14840,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); final String fName = getPath("InputConfigurationLoaderChecks.xml"); -@@ -643,7 +643,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -663,7 +662,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13926,7 +14849,7 @@ try (MockedConstruction mocked = mockConstruction( DefaultConfiguration.class, -@@ -671,7 +671,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -691,7 +690,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -13935,6 +14858,15 @@ final String[] configFiles = { "InputConfigurationLoaderOldConfig0.xml", "InputConfigurationLoaderOldConfig1.xml", +@@ -739,7 +738,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testDefaultValuesForNonDefinedProperties() throws Exception { ++ void defaultValuesForNonDefinedProperties() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.charset.base", "UTF"); + --- a/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java @@ -26,10 +26,10 @@ import java.util.Map; @@ -14045,7 +14977,7 @@ -public class DefaultLoggerTest { +final class DefaultLoggerTest { - private static final Locale DEFAULT_LOCALE = Locale.getDefault(); + private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; @AfterEach - public void tearDown() { @@ -14192,7 +15124,7 @@ - public void testNewCtor() throws Exception { + void newCtor() throws Exception { final ResourceBundle bundle = - ResourceBundle.getBundle(Definitions.CHECKSTYLE_BUNDLE, Locale.ROOT); + ResourceBundle.getBundle(Definitions.CHECKSTYLE_BUNDLE, Locale.ENGLISH); final String auditStartedMessage = bundle.getString(DefaultLogger.AUDIT_STARTED_MESSAGE); @@ -284,8 +284,8 @@ public class DefaultLoggerTest { dl.auditStarted(null); @@ -14239,7 +15171,7 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; -@@ -29,7 +30,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -28,7 +29,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.File; import java.io.Writer; import java.lang.reflect.Method; @@ -14247,7 +15179,7 @@ import java.nio.file.Files; import java.text.MessageFormat; import java.util.ArrayList; -@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test; +@@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; /** TestCase to check DetailAST. */ @@ -14256,7 +15188,7 @@ // Ignores file which are not meant to have root node intentionally. public static final Set NO_ROOT_FILES = -@@ -75,7 +75,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -74,7 +74,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14265,7 +15197,7 @@ final DetailAstImpl ast = new DetailAstImpl(); ast.setText("test"); ast.setType(1); -@@ -95,7 +95,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -94,7 +94,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14274,7 +15206,7 @@ final CommonToken token = new CommonToken(1); token.setText("test"); token.setLine(2); -@@ -111,7 +111,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -110,7 +110,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14283,7 +15215,7 @@ final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl firstLevelA = new DetailAstImpl(); final DetailAstImpl firstLevelB = new DetailAstImpl(); -@@ -147,7 +147,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -146,7 +146,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14292,7 +15224,7 @@ final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); root.setFirstChild(child); -@@ -157,7 +157,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -156,7 +156,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14301,7 +15233,7 @@ final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl firstLevelA = new DetailAstImpl(); final DetailAstImpl firstLevelB = new DetailAstImpl(); -@@ -186,7 +186,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -185,7 +185,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14310,7 +15242,7 @@ final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl firstLevelA = new DetailAstImpl(); -@@ -202,7 +202,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -201,7 +201,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14319,7 +15251,7 @@ final DetailAST previousSibling = new DetailAstImpl(); final DetailAstImpl instance = new DetailAstImpl(); final DetailAstImpl parent = new DetailAstImpl(); -@@ -251,7 +251,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -250,7 +250,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14328,7 +15260,7 @@ final DetailAstImpl child = new DetailAstImpl(); final DetailAST newSibling = new DetailAstImpl(); -@@ -262,7 +262,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -261,7 +261,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14337,7 +15269,7 @@ final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl firstLevelA = new DetailAstImpl(); final DetailAST firstLevelB = new DetailAstImpl(); -@@ -292,7 +292,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -291,7 +291,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14346,7 +15278,7 @@ final DetailAstImpl root = createToken(null, TokenTypes.CLASS_DEF); final DetailAstImpl modifiers = createToken(root, TokenTypes.MODIFIERS); createToken(modifiers, TokenTypes.LITERAL_PUBLIC); -@@ -313,7 +313,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -312,7 +312,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14355,7 +15287,7 @@ final DetailAstImpl parent = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); parent.setFirstChild(child); -@@ -349,7 +349,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -348,7 +348,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14364,7 +15296,7 @@ final DetailAST root = new DetailAstImpl(); final BitSet bitSet = new BitSet(); bitSet.set(999); -@@ -359,7 +359,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -358,7 +358,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14373,7 +15305,7 @@ final DetailAstImpl parent = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); parent.setFirstChild(child); -@@ -385,7 +385,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -384,7 +384,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14382,7 +15314,7 @@ final DetailAST root = new DetailAstImpl(); TestUtil.setInternalState(root, "childCount", 999); -@@ -393,7 +393,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -392,7 +392,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14391,7 +15323,7 @@ final DetailAstImpl parent = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); final DetailAstImpl sibling = new DetailAstImpl(); -@@ -426,7 +426,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -425,7 +425,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14400,7 +15332,7 @@ final DetailAstImpl parent = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); parent.setFirstChild(child); -@@ -444,7 +444,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -443,7 +443,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14409,7 +15341,7 @@ final DetailAstImpl parent = new DetailAstImpl(); final DetailAstImpl child = new DetailAstImpl(); final DetailAstImpl sibling = new DetailAstImpl(); -@@ -457,7 +457,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -456,7 +456,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14418,7 +15350,7 @@ final DetailAstImpl parent = new DetailAstImpl(); parent.setText("Parent"); final DetailAstImpl child = new DetailAstImpl(); -@@ -471,7 +471,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -470,7 +470,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14427,7 +15359,7 @@ final DetailAstImpl child = new DetailAstImpl(); final DetailAstImpl newSibling = new DetailAstImpl(); final DetailAstImpl oldParent = new DetailAstImpl(); -@@ -484,7 +484,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -483,7 +483,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14436,7 +15368,7 @@ final DetailAstImpl root1 = new DetailAstImpl(); root1.setLineNo(1); assertWithMessage("Invalid line number").that(root1.getLineNo()).isEqualTo(1); -@@ -510,7 +510,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -509,7 +509,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14445,7 +15377,7 @@ final DetailAstImpl root1 = new DetailAstImpl(); root1.setColumnNo(1); assertWithMessage("Invalid column number").that(root1.getColumnNo()).isEqualTo(1); -@@ -538,7 +538,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -537,7 +537,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14454,7 +15386,7 @@ final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl firstChild = new DetailAstImpl(); firstChild.setType(TokenTypes.IDENT); -@@ -560,10 +560,10 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -559,10 +559,10 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14464,10 +15396,10 @@ - try (Writer bw = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { + try (Writer bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { + bw.write("/*\ncom.puppycrawl.tools.checkstyle.checks.TodoCommentCheck\n\n\n\n*/\n"); bw.write("class C {\n"); for (int i = 0; i <= 30000; i++) { - bw.write("// " + i + "\n"); -@@ -578,7 +578,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -576,7 +576,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14476,7 +15408,7 @@ final List files = getAllFiles(new File("src/test/resources/com/puppycrawl/tools/checkstyle")); -@@ -594,7 +594,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -592,7 +592,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14485,7 +15417,7 @@ final DetailAstImpl ast = new DetailAstImpl(); ast.setText("text"); ast.setColumnNo(1); -@@ -603,7 +603,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -601,7 +601,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14494,7 +15426,7 @@ final DetailAstImpl parent = new DetailAstImpl(); final DetailAstImpl child1 = new DetailAstImpl(); parent.setFirstChild(child1); -@@ -616,7 +616,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { +@@ -614,7 +614,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } @Test @@ -14621,7 +15553,15 @@ try { --- a/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java -@@ -39,13 +39,12 @@ import java.util.ArrayList; +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableSet; + + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.FileContents; +@@ -37,13 +38,12 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; @@ -14636,7 +15576,7 @@ /** * If a visit method is not overridden, we should explain why we do not 'visit' the parse tree at -@@ -94,7 +93,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -97,7 +97,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } @Test @@ -14645,16 +15585,25 @@ final Method[] baseVisitMethods = JavaLanguageParserBaseVisitor.class.getDeclaredMethods(); final Method[] visitMethods = JavaAstVisitor.class.getDeclaredMethods(); -@@ -104,7 +103,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -107,7 +107,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { .filter(method -> method.getName().contains("visit")) .filter(method -> method.getModifiers() == Modifier.PUBLIC) .map(Method::getName) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); - final ImmutableSet filteredVisitMethodNames = + final Set filteredVisitMethodNames = Arrays.stream(visitMethods) -@@ -128,7 +127,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -117,7 +117,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + .filter(method -> !"visit".equals(method.getName())) + .filter(method -> method.getModifiers() == Modifier.PUBLIC) + .map(Method::getName) +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); + + final String message = + "Visit methods in 'JavaLanguageParserBaseVisitor' generated from " +@@ -131,7 +131,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } @Test @@ -14663,7 +15612,7 @@ // Order of BaseVisitor's generated 'visit' methods match the order of // production rules in 'JavaLanguageParser.g4'. final String baseVisitorFilename = -@@ -197,7 +196,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -200,7 +200,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } @Test @@ -14672,7 +15621,7 @@ final Method addLastSibling = JavaAstVisitor.class.getDeclaredMethod( "addLastSibling", DetailAstImpl.class, DetailAstImpl.class); -@@ -224,7 +223,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -227,7 +227,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { * @throws Exception if input file does not exist */ @Test @@ -15027,24 +15976,45 @@ final String path = getNonCompilablePath("InputJavadocPropertiesGeneratorParseError.java"); try { JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); +@@ -315,8 +309,8 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetFirstJavadocSentence( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { ++ void getFirstJavadocSentence(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws Exception { + final String expectedContent = "EOF1=First Javadoc Sentence."; + + JavadocPropertiesGenerator.main( +@@ -325,7 +319,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + DESTFILE_ABSOLUTE_PATH); + assertWithMessage("Unexpected error log").that(systemErr.getCapturedData()).isEqualTo(""); + assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); +- final String fileContent = FileUtils.readFileToString(DESTFILE, StandardCharsets.UTF_8); ++ final String fileContent = FileUtils.readFileToString(DESTFILE, UTF_8); + assertWithMessage("File content is not expected") + .that(fileContent.trim()) + .isEqualTo(expectedContent.trim()); --- a/src/test/java/com/puppycrawl/tools/checkstyle/LocalizedMessageTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/LocalizedMessageTest.java -@@ -44,12 +44,12 @@ import org.junitpioneer.jupiter.DefaultLocale; +@@ -44,13 +44,13 @@ import org.junitpioneer.jupiter.DefaultLocale; * @noinspectionreason ClassLoaderInstantiation - Custom class loader is needed to pass URLs for * testing */ -public class LocalizedMessageTest { +final class LocalizedMessageTest { - private static final Locale DEFAULT_LOCALE = Locale.getDefault(); + private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; + @DefaultLocale("en") @Test - public void testNullArgs() { + void nullArgs() { final LocalizedMessage messageClass = new LocalizedMessage( Definitions.CHECKSTYLE_BUNDLE, -@@ -70,7 +70,7 @@ public class LocalizedMessageTest { +@@ -71,7 +71,7 @@ public class LocalizedMessageTest { } @Test @@ -15053,7 +16023,7 @@ final Utf8Control control = new Utf8Control(); final ResourceBundle bundle = control.newBundle( -@@ -92,7 +92,7 @@ public class LocalizedMessageTest { +@@ -93,7 +93,7 @@ public class LocalizedMessageTest { * @noinspectionreason IOResourceOpenedButNotSafelyClosed - no need to close resources in testing */ @Test @@ -15062,7 +16032,7 @@ final AtomicBoolean closed = new AtomicBoolean(); final InputStream inputStream = -@@ -156,7 +156,7 @@ public class LocalizedMessageTest { +@@ -157,7 +157,7 @@ public class LocalizedMessageTest { * @noinspectionreason IOResourceOpenedButNotSafelyClosed - no need to close resources in testing */ @Test @@ -15071,7 +16041,7 @@ final AtomicBoolean closed = new AtomicBoolean(); final InputStream inputStream = -@@ -213,7 +213,7 @@ public class LocalizedMessageTest { +@@ -214,7 +214,7 @@ public class LocalizedMessageTest { } @Test @@ -15080,7 +16050,7 @@ final URL url = new URL( "test", -@@ -240,7 +240,7 @@ public class LocalizedMessageTest { +@@ -241,7 +241,7 @@ public class LocalizedMessageTest { /** Verifies that the language specified with the system property {@code user.language} exists. */ @Test @@ -15089,7 +16059,7 @@ final String language = DEFAULT_LOCALE.getLanguage(); assumeFalse(language.isEmpty(), "Locale not set"); assertWithMessage("Invalid language") -@@ -251,14 +251,14 @@ public class LocalizedMessageTest { +@@ -252,14 +252,14 @@ public class LocalizedMessageTest { /** Verifies that the country specified with the system property {@code user.country} exists. */ @Test @@ -15106,7 +16076,7 @@ final LocalizedMessage violation = createSampleViolation(); LocalizedMessage.setLocale(Locale.FRENCH); -@@ -269,7 +269,7 @@ public class LocalizedMessageTest { +@@ -270,7 +270,7 @@ public class LocalizedMessageTest { @DefaultLocale("fr") @Test @@ -15115,7 +16085,7 @@ LocalizedMessage.setLocale(Locale.US); final LocalizedMessage violation = createSampleViolation(); -@@ -280,7 +280,7 @@ public class LocalizedMessageTest { +@@ -281,7 +281,7 @@ public class LocalizedMessageTest { @DefaultLocale("fr") @Test @@ -15124,7 +16094,7 @@ LocalizedMessage.setLocale(Locale.ROOT); final LocalizedMessage violation = createSampleViolation(); -@@ -297,7 +297,7 @@ public class LocalizedMessageTest { +@@ -298,7 +298,7 @@ public class LocalizedMessageTest { } @AfterEach @@ -15972,15 +16942,6 @@ final ByteArrayOutputStream out = new ByteArrayOutputStream(); final AuditListener listener = Main.OutputFormat.PLAIN.createListener(out, OutputStreamOptions.CLOSE); -@@ -2006,7 +1988,7 @@ public class MainTest { - * avoid VM termination. - */ - private static void assertMainReturnCode(int expectedExitCode, String... arguments) { -- final Runtime mock = mock(Runtime.class); -+ final Runtime mock = mock(); - try (MockedStatic runtime = mockStatic(Runtime.class)) { - runtime.when(Runtime::getRuntime).thenReturn(mock); - Main.main(arguments); @@ -2025,7 +2007,7 @@ public class MainTest { private boolean isClosed; @@ -16486,7 +17447,19 @@ final PackageObjectFactory objectFactory = new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); -@@ -557,9 +558,9 @@ public class PackageObjectFactoryTest { +@@ -562,9 +563,9 @@ public class PackageObjectFactoryTest { + * It ensures that ModuleReflectionUtil.getCheckstyleModules is not executed in this case. + */ + @Test +- public void testCreateObjectWithNameContainingPackageSeparatorWithoutSearch() throws Exception { ++ void createObjectWithNameContainingPackageSeparatorWithoutSearch() throws Exception { + final ClassLoader classLoader = ClassLoader.getSystemClassLoader(); +- final Set packages = Collections.singleton(BASE_PACKAGE); ++ final Set packages = ImmutableSet.of(BASE_PACKAGE); + final PackageObjectFactory objectFactory = + new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); + +@@ -588,9 +589,9 @@ public class PackageObjectFactoryTest { } @Test @@ -16498,6 +17471,15 @@ final PackageObjectFactory objectFactory = new PackageObjectFactory(packages, classLoader, SEARCH_REGISTERED_PACKAGES); final CheckstyleException ex = +@@ -611,7 +612,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testExceptionMessage() { ++ void exceptionMessage() { + final String barPackage = BASE_PACKAGE + ".packageobjectfactory.bar"; + final String fooPackage = BASE_PACKAGE + ".packageobjectfactory.foo"; + final String zooPackage = BASE_PACKAGE + ".packageobjectfactory.zoo"; --- a/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java @@ -24,10 +24,10 @@ import static com.google.common.truth.Truth.assertWithMessage; @@ -16524,7 +17506,7 @@ final String propertiesUserHome = properties.getProperty("user.home"); --- a/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java -@@ -52,7 +52,7 @@ import org.junit.jupiter.params.ParameterizedTest; +@@ -54,7 +54,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.mockito.MockedStatic; @@ -16533,7 +17515,7 @@ @TempDir public File temporaryFolder; -@@ -62,7 +62,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -64,7 +64,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16542,7 +17524,7 @@ try { final Object test = new PropertyCacheFile(null, ""); assertWithMessage("exception expected but got " + test).fail(); -@@ -83,7 +83,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -85,7 +85,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16551,7 +17533,7 @@ final Configuration config = new DefaultConfiguration("myName"); final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); -@@ -100,7 +100,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -102,7 +102,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16560,7 +17542,7 @@ final Configuration config = new DefaultConfiguration("myName"); final PropertyCacheFile cache = new PropertyCacheFile(config, "fileDoesNotExist.txt"); -@@ -112,7 +112,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -114,7 +114,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16569,7 +17551,7 @@ final Configuration config = new DefaultConfiguration("myName"); final PropertyCacheFile cache = new PropertyCacheFile(config, getPath("InputPropertyCacheFile")); -@@ -134,7 +134,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -136,7 +136,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16578,7 +17560,7 @@ final Configuration config = new DefaultConfiguration("myName"); final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); -@@ -152,7 +152,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -154,7 +154,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16587,7 +17569,7 @@ final Configuration config = new DefaultConfiguration("myName"); final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); -@@ -178,7 +178,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -180,7 +180,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16596,7 +17578,7 @@ final Configuration config = new DefaultConfiguration("myName"); final String externalResourcePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -@@ -207,7 +207,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -209,7 +209,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16605,7 +17587,16 @@ final Configuration config = new DefaultConfiguration("myName"); final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); -@@ -235,7 +235,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -223,7 +223,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + + final MessageDigest digest = MessageDigest.getInstance("SHA-1"); + final URI uri = CommonUtil.getUriByFilename(pathToResource); +- final byte[] input = ByteStreams.toByteArray(new BufferedInputStream(uri.toURL().openStream())); ++ final byte[] input = new BufferedInputStream(uri.toURL().openStream()).readAllBytes(); + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + try (ObjectOutputStream oos = new ObjectOutputStream(out)) { + oos.writeObject(input); +@@ -237,7 +237,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16613,8 +17604,8 @@ + void cacheDirectoryDoesNotExistAndShouldBeCreated() throws IOException { final Configuration config = new DefaultConfiguration("myName"); final String filePath = - String.format( -@@ -249,7 +249,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + String.format(Locale.ENGLISH, "%s%2$stemp%2$scache.temp", temporaryFolder, File.separator); +@@ -250,7 +250,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16623,7 +17614,55 @@ final Configuration config = new DefaultConfiguration("myName"); final String fileName = "temp.cache"; final Path filePath = Paths.get(fileName); -@@ -262,7 +262,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -263,9 +263,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + Files.delete(filePath); + } + +- @Test + @DisabledOnOs(OS.WINDOWS) +- public void testPersistWithSymbolicLinkToDirectory() throws IOException { ++ @Test ++ void persistWithSymbolicLinkToDirectory() throws IOException { + final Path tempDirectory = Files.createTempDirectory("tempDir"); + final Path symbolicLinkDirectory = + Files.createTempDirectory("symbolicLinkDir").resolve("symbolicLink"); +@@ -283,9 +283,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + .isTrue(); + } + +- @Test + @DisabledOnOs(OS.WINDOWS) +- public void testSymbolicLinkResolution() throws IOException { ++ @Test ++ void symbolicLinkResolution() throws IOException { + final Path tempDirectory = Files.createTempDirectory("tempDir"); + final Path symbolicLinkDirectory = + Files.createTempDirectory("symbolicLinkDir").resolve("symbolicLink"); +@@ -303,9 +303,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + .isTrue(); + } + +- @Test + @DisabledOnOs(OS.WINDOWS) +- public void testSymbolicLinkToNonDirectory() throws IOException { ++ @Test ++ void symbolicLinkToNonDirectory() throws IOException { + final Path tempFile = Files.createTempFile("tempFile", null); + final Path symbolicLinkDirectory = Files.createTempDirectory("symbolicLinkDir"); + final Path symbolicLink = symbolicLinkDirectory.resolve("symbolicLink"); +@@ -325,9 +325,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + .contains(expectedMessage); + } + +- @Test + @DisabledOnOs(OS.WINDOWS) +- public void testMultipleSymbolicLinkResolution() throws IOException { ++ @Test ++ void multipleSymbolicLinkResolution() throws IOException { + final Path actualDirectory = Files.createTempDirectory("actualDir"); + final Path firstSymbolicLink = Files.createTempDirectory("firstLinkDir").resolve("firstLink"); + Files.createSymbolicLink(firstSymbolicLink, actualDirectory); +@@ -349,7 +349,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16632,16 +17671,22 @@ final DefaultConfiguration config = new DefaultConfiguration("myConfig"); config.addProperty("attr", "value"); -@@ -315,7 +315,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -401,11 +401,11 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + * @noinspectionreason ResultOfMethodCallIgnored - Setup for mockito to only mock toByteArray to * throw exception. */ - @Test +- @Test ++ @SuppressWarnings("InputStreamReadAllBytes") + // XXX: Drop suppression once + // https://github.com/checkstyle/checkstyle/pull/14362 is resolved. +- @SuppressWarnings("InputStreamReadAllBytes") - public void testNonExistentResource() throws IOException { ++ @Test + void nonExistentResource() throws IOException { final Configuration config = new DefaultConfiguration("myName"); final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); -@@ -350,7 +350,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -440,7 +440,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -16650,7 +17695,7 @@ final Configuration config = new DefaultConfiguration("myName"); final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); -@@ -389,8 +389,8 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -479,8 +479,8 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { * @param rawMessages exception messages separated by ';' */ @ParameterizedTest @@ -16936,7 +17981,7 @@ final ThreadModeSettings singleThreadModeSettings = --- a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java -@@ -21,10 +21,13 @@ package com.puppycrawl.tools.checkstyle; +@@ -21,11 +21,15 @@ package com.puppycrawl.tools.checkstyle; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; @@ -16948,9 +17993,19 @@ +import static org.mockito.Mockito.mockConstruction; +import static org.mockito.Mockito.mockStatic; ++import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -89,10 +92,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + import com.puppycrawl.tools.checkstyle.api.Configuration; +@@ -59,7 +63,6 @@ import java.nio.file.Files; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.HashSet; + import java.util.List; + import java.util.Set; +@@ -91,10 +94,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -16963,7 +18018,7 @@ final String content = "public class Main { public static final int k = 5 + 4; }"; writer.write(content); } -@@ -130,7 +133,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -132,7 +135,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * @throws Exception if an error occurs */ @Test @@ -16972,7 +18027,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(OneTopLevelClassCheck.class); final String[] expected = { "5:1: " -@@ -138,7 +141,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -140,7 +143,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { OneTopLevelClassCheck.class, OneTopLevelClassCheck.MSG_KEY, "InputTreeWalkerInner"), }; try (MockedConstruction mocked = @@ -16981,7 +18036,7 @@ TreeWalkerAuditEvent.class, (mock, context) -> { throw new CheckstyleException("No audit events expected"); -@@ -152,7 +155,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -154,7 +157,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * that the {@code if (!ordinaryChecks.isEmpty())} condition cannot be removed. */ @Test @@ -16990,13 +18045,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(JavadocParagraphCheck.class); final String[] expected = { "3: " -@@ -160,12 +163,12 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { - JavadocParagraphCheck.class, JavadocParagraphCheck.MSG_REDUNDANT_PARAGRAPH), - }; - final String path = getPath("InputTreeWalkerJavadoc.java"); -- final DetailAST mockAst = mock(DetailAST.class); -+ final DetailAST mockAst = mock(); - final DetailAST realAst = +@@ -167,7 +170,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { JavaParser.parseFile(new File(path), JavaParser.Options.WITH_COMMENTS); // Ensure that there is no calls to walk(..., AstState.ORDINARY) doThrow(IllegalStateException.class).when(mockAst).getFirstChild(); @@ -17005,7 +18054,7 @@ parser.when(() -> JavaParser.parse(any(FileContents.class))).thenReturn(mockAst); // This will re-enable walk(..., AstState.WITH_COMMENTS) parser.when(() -> JavaParser.appendHiddenCommentNodes(mockAst)).thenReturn(realAst); -@@ -179,15 +182,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -181,15 +184,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * that the {@code if (!commentChecks.isEmpty())} condition cannot be removed. */ @Test @@ -17023,7 +18072,7 @@ // Ensure that there is no calls to walk(..., AstState.WITH_COMMENTS) parser .when(() -> JavaParser.appendHiddenCommentNodes(any(DetailAST.class))) -@@ -198,10 +200,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -200,10 +202,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17036,7 +18085,7 @@ final String content = "public class Main { public static final int k = 5 + 4; }"; writer.write(content); } -@@ -210,7 +212,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -212,7 +214,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17045,7 +18094,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); checkConfig.addProperty("tokens", "VARIABLE_DEF, ENUM_DEF, CLASS_DEF, METHOD_DEF," + "IMPORT"); try { -@@ -235,7 +237,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -237,7 +239,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17054,7 +18103,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -244,7 +246,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -246,7 +248,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17063,7 +18112,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(JavadocPackageCheck.class); try { -@@ -262,7 +264,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -264,7 +266,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17072,7 +18121,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -283,7 +285,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -285,7 +287,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17081,7 +18130,7 @@ final TreeWalker treeWalker = new TreeWalker(); final DefaultConfiguration config = new DefaultConfiguration("default config"); treeWalker.setTabWidth(1); -@@ -296,7 +298,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -298,7 +300,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17090,7 +18139,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(BadJavaDocCheck.class); final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -@@ -320,7 +322,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -322,7 +324,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17099,7 +18148,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -348,7 +350,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -350,7 +352,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17108,7 +18157,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.setTabWidth(1); treeWalker.configure(new DefaultConfiguration("default config")); -@@ -360,7 +362,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -362,7 +364,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17117,7 +18166,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); final Checker checker = createChecker(checkConfig); final PackageObjectFactory factory = -@@ -373,7 +375,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -375,7 +377,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17126,7 +18175,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.configure(createModuleConfig(TypeNameCheck.class)); final PackageObjectFactory factory = -@@ -396,7 +398,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -398,7 +400,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17135,7 +18184,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.configure(createModuleConfig(TypeNameCheck.class)); final PackageObjectFactory factory = -@@ -419,7 +421,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -421,7 +423,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17144,7 +18193,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(RequiredTokenIsEmptyIntArray.class); final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -@@ -428,7 +430,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -430,7 +432,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17153,7 +18202,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -443,7 +445,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -445,7 +447,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17162,7 +18211,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.configure(createModuleConfig(TypeNameCheck.class)); treeWalker.configure(createModuleConfig(CommentsIndentationCheck.class)); -@@ -470,7 +472,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -472,7 +474,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17171,7 +18220,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -490,7 +492,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -492,7 +494,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17180,7 +18229,7 @@ final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); filterConfig.addProperty("checkCPP", "false"); -@@ -511,7 +513,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -513,7 +515,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17189,7 +18238,16 @@ final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); treeWalkerConfig.addChild(createModuleConfig(WhitespaceAroundCheck.class)); treeWalkerConfig.addChild(createModuleConfig(WhitespaceAfterCheck.class)); -@@ -525,7 +527,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -527,7 +529,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiCheckOfSameTypeNoIdResultsInOrderingByHash() throws Exception { ++ void multiCheckOfSameTypeNoIdResultsInOrderingByHash() throws Exception { + + final DefaultConfiguration configuration1 = createModuleConfig(ParameterNameCheck.class); + configuration1.addProperty("format", "^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"); +@@ -557,7 +559,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17198,7 +18256,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.setSeverity("error"); treeWalker.setTabWidth(100); -@@ -541,7 +543,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -573,7 +575,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17207,7 +18265,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(VerifyInitCheck.class); final File file = File.createTempFile("file", ".pdf", temporaryFolder); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -550,7 +552,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -582,7 +584,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17216,7 +18274,7 @@ VerifyDestroyCheck.resetDestroyWasCalled(); final DefaultConfiguration checkConfig = createModuleConfig(VerifyDestroyCheck.class); final File file = File.createTempFile("file", ".pdf", temporaryFolder); -@@ -562,7 +564,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -594,7 +596,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17225,7 +18283,7 @@ VerifyDestroyCheck.resetDestroyWasCalled(); final DefaultConfiguration checkConfig = createModuleConfig(VerifyDestroyCommentCheck.class); final File file = File.createTempFile("file", ".pdf", temporaryFolder); -@@ -574,7 +576,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -606,7 +608,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17234,7 +18292,7 @@ final DefaultConfiguration filterConfig = createModuleConfig(SuppressionXpathFilter.class); filterConfig.addProperty("file", getPath("InputTreeWalkerSuppressionXpathFilter.xml")); final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); -@@ -597,7 +599,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -629,7 +631,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17243,7 +18301,7 @@ final DefaultConfiguration filterConfig = createModuleConfig(SuppressionXpathFilter.class); filterConfig.addProperty("file", getPath("InputTreeWalkerSuppressionXpathFilterAbsolute.xml")); final DefaultConfiguration checkConfig = createModuleConfig(LeftCurlyCheck.class); -@@ -617,7 +619,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -649,7 +651,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -17252,6 +18310,24 @@ final DefaultConfiguration checkConfig = createModuleConfig(EmptyStatementCheck.class); final DefaultConfiguration filterConfig = createModuleConfig(SuppressWithNearbyCommentFilter.class); +@@ -673,7 +675,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + * @throws Exception if file is not found + */ + @Test +- public void testOrderOfCheckExecution() throws Exception { ++ void orderOfCheckExecution() throws Exception { + + final DefaultConfiguration configuration1 = createModuleConfig(AaCheck.class); + configuration1.addProperty("id", "2"); +@@ -684,7 +686,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + treeWalkerConfig.addChild(configuration2); + treeWalkerConfig.addChild(configuration1); + +- final List files = Collections.singletonList(new File(getPath("InputTreeWalker2.java"))); ++ final List files = ImmutableList.of(new File(getPath("InputTreeWalker2.java"))); + final Checker checker = createChecker(treeWalkerConfig); + + try { --- a/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; @@ -17454,14 +18530,14 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java -@@ -19,6 +19,7 @@ - +@@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle; -+import static com.google.common.collect.Sets.toImmutableEnumSet; import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableSet; import com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck; + import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; @@ -28,14 +29,13 @@ import java.io.IOException; import java.util.Arrays; import java.util.Objects; @@ -17483,8 +18559,8 @@ .map(field -> field.getAnnotation(XdocsPropertyType.class)) .filter(Objects::nonNull) .map(XdocsPropertyType::value) -- .collect(Collectors.toSet()); -+ .collect(toImmutableEnumSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); assertWithMessage("All property types should be used") .that(propertyTypes) @@ -18269,10 +19345,10 @@ @Test - public void testCheck() throws Exception { + void check() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(ViolationAstCheck.class); - final String[] expected = { -@@ -377,10 +377,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + "6:1: Violation.", + }; +@@ -375,10 +375,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { * file as none of the checks try to modify the tokens. */ @Test @@ -18412,7 +19488,7 @@ + void lineColumnLog() throws Exception { final ViolationFileSetCheck check = new ViolationFileSetCheck(); check.configure(new DefaultConfiguration("filesetcheck")); - final File file = new File(getPath("InputAbstractFileSetLineColumn.txt")); + final File file = new File(getPath("InputAbstractFileSetLineColumn.java")); @@ -174,7 +174,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } @@ -18428,10 +19504,10 @@ @Test - public void testCheck() throws Exception { + void check() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(ViolationFileSetCheck.class); - final String[] expected = { -@@ -195,7 +195,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + "1:1: Violation.", + }; +@@ -193,7 +193,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } @Test @@ -18440,7 +19516,7 @@ final MultiFileViolationFileSetCheck check = new MultiFileViolationFileSetCheck(); check.configure(new DefaultConfiguration("filesetcheck")); final ViolationDispatcher dispatcher = new ViolationDispatcher(); -@@ -229,7 +229,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { +@@ -227,7 +227,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { * as none of the checks try to modify the fileExtensions. */ @Test @@ -19010,17 +20086,17 @@ @Test - public void testTranslation() throws Exception { + void translation() throws Exception { - final Configuration checkConfig = createModuleConfig(TestFileSetCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verify(checkConfig, getPath("InputFileSetIllegalTokens.java"), expected); -@@ -45,7 +45,7 @@ public class FileSetCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser(getPath("InputFileSetIllegalTokens.java"), expected); + +@@ -44,7 +44,7 @@ public class FileSetCheckTest extends AbstractModuleTestSupport { } @Test - public void testProcessCallsFinishBeforeCallingDestroy() throws Exception { + void processCallsFinishBeforeCallingDestroy() throws Exception { - final Configuration checkConfig = createModuleConfig(TestFileSetCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFileSetIllegalTokens.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java @@ -19627,13 +20703,11 @@ .isEqualTo(SeverityLevel.IGNORE); --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java -@@ -19,22 +19,22 @@ +@@ -21,20 +21,20 @@ package com.puppycrawl.tools.checkstyle.api; - package com.puppycrawl.tools.checkstyle.api; - -+import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; ++import static java.util.stream.Collectors.toUnmodifiableSet; +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.utils.TokenUtil; @@ -19658,8 +20732,8 @@ Arrays.stream(TokenUtil.getAllTokenIds()) .mapToObj(TokenUtil::getTokenName) .filter(name -> name.charAt(0) != '$') -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); final Set actual = bundle.keySet(); assertWithMessage("TokenTypes without description").that(actual).isEqualTo(expected); } @@ -19673,8 +20747,8 @@ .filter(name -> name.charAt(0) != '$') .map(TokenUtil::getShortDescription) .filter(desc -> desc.charAt(desc.length() - 1) != '.') -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); assertWithMessage("Malformed TokenType descriptions") .that(badDescriptions) - .isEqualTo(Collections.emptySet()); @@ -19814,12 +20888,12 @@ package com.puppycrawl.tools.checkstyle.bdd; -+import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.ConfigurationLoader; import com.puppycrawl.tools.checkstyle.PropertiesExpander; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -40,7 +42,6 @@ import java.util.Properties; +@@ -41,7 +43,6 @@ import java.util.Properties; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -19827,12 +20901,12 @@ import org.xml.sax.InputSource; public final class InlineConfigParser { -@@ -231,7 +232,7 @@ public final class InlineConfigParser { +@@ -241,7 +242,7 @@ public final class InlineConfigParser { return lines.stream() .skip(1) .takeWhile(line -> !line.startsWith("*/")) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } private static void handleXmlConfig( @@ -19891,7 +20965,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -@@ -73,15 +74,15 @@ public final class TestInputConfiguration { +@@ -75,15 +76,15 @@ public final class TestInputConfiguration { } public List getChildrenModules() { @@ -19910,7 +20984,7 @@ } public DefaultConfiguration createConfiguration() { -@@ -156,7 +157,7 @@ public final class TestInputConfiguration { +@@ -162,7 +163,7 @@ public final class TestInputConfiguration { } public List getChildrenModules() { @@ -21880,21 +22954,39 @@ } @Test -- public void testIncorrect() throws Exception { -+ void incorrect() throws Exception { +- public void testIncorrectOne() throws Exception { ++ void incorrectOne() throws Exception { final String[] expected = { "15:11: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnn"), "20:15: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation1"), -@@ -83,7 +83,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -82,7 +82,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test -- public void testIncorrectAllTokens() throws Exception { -+ void incorrectAllTokens() throws Exception { +- public void testIncorrectTwo() throws Exception { ++ void incorrectTwo() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnn_21", 0, 3), + }; +@@ -90,7 +90,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrectAllTokensOne() throws Exception { ++ void incorrectAllTokensOne() throws Exception { final String[] expected = { "15:11: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnn3"), "20:15: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation_13"), -@@ -114,7 +114,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -120,7 +120,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrectAllTokensTwo() throws Exception { ++ void incorrectAllTokensTwo() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnn_23", 0, 3), + }; +@@ -128,7 +128,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21903,7 +22995,7 @@ final AnnotationLocationCheck constantNameCheckObj = new AnnotationLocationCheck(); final int[] actual = constantNameCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -135,13 +135,13 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -149,13 +149,13 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21914,12 +23006,21 @@ } @Test -- public void testWithParameters() throws Exception { -+ void withParameters() throws Exception { +- public void testWithParametersOne() throws Exception { ++ void withParametersOne() throws Exception { final String[] expected = { "25:9: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnnotation_12", 8, 4), "33:9: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnnotation_12", 8, 4), -@@ -161,7 +161,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -174,7 +174,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithParametersTwo() throws Exception { ++ void withParametersTwo() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnn_22", 0, 3), + }; +@@ -182,7 +182,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21928,7 +23029,7 @@ final String[] expected = { "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation11"), "14:17: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation12"), -@@ -172,14 +172,14 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -193,14 +193,14 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21945,7 +23046,7 @@ final String[] expected = { "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "AnnotationAnnotation", 2, 0), "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "AnnotationAnnotation"), -@@ -190,7 +190,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -211,7 +211,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21954,7 +23055,7 @@ final String[] expected = { "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "ClassAnnotation", 2, 0), "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "ClassAnnotation"), -@@ -203,7 +203,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -224,7 +224,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21963,7 +23064,7 @@ final String[] expected = { "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "EnumAnnotation", 2, 0), "19:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "EnumAnnotation"), -@@ -214,7 +214,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -235,7 +235,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21972,7 +23073,7 @@ final String[] expected = { "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "InterfaceAnnotation", 2, 0), "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "InterfaceAnnotation"), -@@ -225,7 +225,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -246,7 +246,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -21981,7 +23082,7 @@ final String[] expected = { "12:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "PackageAnnotation", 2, 0), "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "PackageAnnotation"), -@@ -234,20 +234,20 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -255,20 +255,20 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -22005,7 +23106,7 @@ final String[] expected = { "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), -@@ -261,7 +261,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -282,7 +282,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -22014,7 +23115,7 @@ final String[] expected = { "23:17: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), "25:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), -@@ -276,7 +276,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +@@ -297,7 +297,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } @Test @@ -24962,12 +26063,48 @@ } @Test -- public void testDefault() throws Exception { -+ void testDefault() throws Exception { +- public void testInputFinalLocalVariableOne() throws Exception { ++ void inputFinalLocalVariableOne() throws Exception { final String[] expected = { "17:13: " + getCheckMessage(MSG_KEY, "i"), -@@ -82,7 +82,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -59,7 +59,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariableTwo() throws Exception { ++ void inputFinalLocalVariableTwo() throws Exception { + final String[] expected = { + "24:17: " + getCheckMessage(MSG_KEY, "weird"), + "25:17: " + getCheckMessage(MSG_KEY, "j"), +@@ -69,7 +69,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariableThree() throws Exception { ++ void inputFinalLocalVariableThree() throws Exception { + final String[] expected = { + "14:17: " + getCheckMessage(MSG_KEY, "x"), + "20:21: " + getCheckMessage(MSG_KEY, "x"), +@@ -86,7 +86,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariableFour() throws Exception { ++ void inputFinalLocalVariableFour() throws Exception { + final String[] expected = { + "16:17: " + getCheckMessage(MSG_KEY, "shouldBeFinal"), + "28:17: " + getCheckMessage(MSG_KEY, "shouldBeFinal"), +@@ -98,7 +98,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalLocalVariableFive() throws Exception { ++ void finalLocalVariableFive() throws Exception { + final String[] expected = { + "15:17: " + getCheckMessage(MSG_KEY, "shouldBeFinal"), + "26:17: " + getCheckMessage(MSG_KEY, "shouldBeFinal"), +@@ -110,7 +110,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -24976,16 +26113,52 @@ final String[] expected = { "20:17: " + getCheckMessage(MSG_KEY, "b"), }; -@@ -91,7 +91,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -119,7 +119,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test -- public void testParameter() throws Exception { -+ void parameter() throws Exception { +- public void testInputFinalLocalVariable2One() throws Exception { ++ void inputFinalLocalVariable2One() throws Exception { final String[] expected = { - "53:28: " + getCheckMessage(MSG_KEY, "aArg"), -@@ -102,21 +102,21 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + "52:28: " + getCheckMessage(MSG_KEY, "aArg"), +@@ -128,7 +128,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariable2Two() throws Exception { ++ void inputFinalLocalVariable2Two() throws Exception { + + final String[] excepted = { + "78:36: " + getCheckMessage(MSG_KEY, "_o"), "83:37: " + getCheckMessage(MSG_KEY, "_o1"), +@@ -137,7 +137,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariable2Three() throws Exception { ++ void inputFinalLocalVariable2Three() throws Exception { + + final String[] excepted = {}; + +@@ -145,7 +145,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariable2Four() throws Exception { ++ void inputFinalLocalVariable2Four() throws Exception { + + final String[] excepted = {}; + +@@ -153,7 +153,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputFinalLocalVariable2Five() throws Exception { ++ void inputFinalLocalVariable2Five() throws Exception { + + final String[] excepted = {}; + +@@ -161,21 +161,21 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25010,7 +26183,7 @@ final String[] expected = { "16:20: " + getCheckMessage(MSG_KEY, "a"), "23:13: " + getCheckMessage(MSG_KEY, "x"), -@@ -131,7 +131,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -190,7 +190,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25019,7 +26192,7 @@ final String[] expected = { "23:13: " + getCheckMessage(MSG_KEY, "x"), "29:66: " + getCheckMessage(MSG_KEY, "snippets"), -@@ -143,7 +143,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -202,7 +202,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25028,7 +26201,7 @@ final String[] expected = { "40:16: " + getCheckMessage(MSG_KEY, "result"), }; -@@ -151,7 +151,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -210,7 +210,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25037,7 +26210,7 @@ final String[] expected = { "12:28: " + getCheckMessage(MSG_KEY, "text"), "25:13: " + getCheckMessage(MSG_KEY, "x"), -@@ -160,7 +160,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -219,7 +219,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25046,7 +26219,7 @@ final FinalLocalVariableCheck check = new FinalLocalVariableCheck(); final DetailAstImpl lambdaAst = new DetailAstImpl(); -@@ -175,7 +175,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -234,7 +234,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25055,7 +26228,7 @@ final String[] expected = { "57:13: " + getCheckMessage(MSG_KEY, "i"), -@@ -190,7 +190,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -249,7 +249,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25064,7 +26237,7 @@ final String[] expected = { "39:13: " + getCheckMessage(MSG_KEY, "b"), }; -@@ -199,7 +199,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -258,7 +258,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25073,7 +26246,7 @@ final String[] expected = { "352:16: " + getCheckMessage(MSG_KEY, "c2"), "2195:16: " + getCheckMessage(MSG_KEY, "b"), }; -@@ -207,27 +207,27 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -266,27 +266,27 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25105,7 +26278,7 @@ final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY, "e"), }; -@@ -235,7 +235,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -294,7 +294,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25114,7 +26287,7 @@ final String[] expected = { "13:16: " + getCheckMessage(MSG_KEY, "testSupport"), }; -@@ -243,14 +243,14 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -302,14 +302,14 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25131,7 +26304,7 @@ final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY, "e"), "53:19: " + getCheckMessage(MSG_KEY, "e"), -@@ -262,7 +262,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -321,7 +321,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25140,7 +26313,7 @@ final String[] expected = { "21:13: " + getCheckMessage(MSG_KEY, "a"), "44:13: " + getCheckMessage(MSG_KEY, "b"), -@@ -275,13 +275,13 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -334,13 +334,13 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25156,7 +26329,7 @@ final String[] expected = { "14:44: " + getCheckMessage(MSG_KEY, "a"), "18:44: " + getCheckMessage(MSG_KEY, "a"), -@@ -293,7 +293,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -352,7 +352,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -25318,7 +26491,25 @@ final String[] expected = { "23:26: " + getCheckMessage(MSG_KEY, "a"), -@@ -452,7 +452,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { +@@ -446,7 +446,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHiddenFieldInnerRecordsImplicitlyStatic() throws Exception { ++ void hiddenFieldInnerRecordsImplicitlyStatic() throws Exception { + + final String[] expected = { + "35:30: " + getCheckMessage(MSG_KEY, "pointer"), +@@ -457,7 +457,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHiddenFieldRecordsImplicitlyStaticClassComparison() throws Exception { ++ void hiddenFieldRecordsImplicitlyStaticClassComparison() throws Exception { + + final String[] expected = { + "49:27: " + getCheckMessage(MSG_KEY, "x"), +@@ -475,7 +475,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @Test @@ -25327,7 +26518,7 @@ final HiddenFieldCheck check = new HiddenFieldCheck(); final DetailAST root = JavaParser.parseFile( -@@ -464,7 +464,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { +@@ -487,7 +487,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { assertWithMessage("State is not cleared on beginTree") .that( TestUtil.isStatefulFieldClearedDuringBeginTree( @@ -25734,7 +26925,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.TokenTypes; -@@ -32,7 +33,7 @@ import java.util.List; +@@ -31,7 +32,7 @@ import java.util.List; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; @@ -25743,7 +26934,7 @@ @Override protected String getPackageLocation() { -@@ -40,7 +41,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -39,7 +40,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25752,7 +26943,7 @@ final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), }; -@@ -48,7 +49,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -47,7 +48,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25761,7 +26952,7 @@ final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), "35:32: " + getCheckMessage(MSG_KEY, "a href"), -@@ -57,7 +58,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -56,7 +57,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25770,7 +26961,7 @@ final String[] expected = { "34:28: " + "My custom message", -@@ -66,7 +67,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -65,7 +66,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25779,7 +26970,7 @@ final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), -@@ -75,7 +76,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -74,7 +75,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25788,7 +26979,7 @@ final String[] expected = { "16:28: " + getCheckMessage(MSG_KEY, "a href"), -@@ -89,7 +90,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -88,7 +89,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25797,7 +26988,7 @@ final String[] expected = { "16:28: " + getCheckMessage(MSG_KEY, "\""), -@@ -105,7 +106,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -104,7 +105,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25806,7 +26997,7 @@ final IllegalTokenTextCheck check = new IllegalTokenTextCheck(); assertWithMessage("Acceptable tokens should not be null") .that(check.getAcceptableTokens()) -@@ -122,7 +123,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -121,7 +122,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25815,7 +27006,16 @@ final String[] expected = { "1:3: " + getCheckMessage(MSG_KEY, "a href"), "45:28: " + getCheckMessage(MSG_KEY, "a href"), -@@ -131,19 +132,19 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -130,7 +131,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStringTemplate() throws Exception { ++ void stringTemplate() throws Exception { + + final String[] expected = { + "29:28: " + getCheckMessage(MSG_KEY, "x"), +@@ -146,19 +147,19 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25835,10 +27035,10 @@ @Test - public void testAcceptableTokensMakeSense() { + void acceptableTokensMakeSense() { - final int expectedTokenTypesTotalNumber = 188; + final int expectedTokenTypesTotalNumber = 194; assertWithMessage( "Total number of TokenTypes has changed, acceptable tokens in" -@@ -176,7 +177,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -192,7 +193,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -25983,7 +27183,7 @@ + void starImports() throws Exception { final String[] expected = { - "25:5: " + getCheckMessage(MSG_KEY, "List"), + "24:5: " + getCheckMessage(MSG_KEY, "List"), @@ -237,7 +237,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } @@ -26146,7 +27346,25 @@ final String[] expected = { "22:15: " + getCheckMessage(MSG_KEY), "22:19: " + getCheckMessage(MSG_KEY), -@@ -59,13 +59,13 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { +@@ -46,7 +46,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final String[] expected = { + "73:22: " + getCheckMessage(MSG_KEY), + }; +@@ -54,7 +54,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDemoBug1195047Comment3() throws Exception { ++ void demoBug1195047Comment3() throws Exception { + final String[] expected = { + "18:16: " + getCheckMessage(MSG_KEY), + "19:24: " + getCheckMessage(MSG_KEY), +@@ -74,13 +74,13 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } @Test @@ -26162,7 +27380,7 @@ final String[] expected = { "12:28: " + getCheckMessage(MSG_KEY), }; -@@ -73,7 +73,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { +@@ -88,7 +88,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } @Test @@ -26721,7 +27939,15 @@ final String[] expected = { "14:9: " + getCheckMessage(MSG_KEY, "default"), }; -@@ -68,7 +68,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { +@@ -68,14 +68,14 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullCaseLabel() throws Exception { ++ void nullCaseLabel() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputMissingSwitchDefaultCheckNullCaseLabel.java"), expected); } @Test @@ -26730,7 +27956,7 @@ final String[] expected = { "14:9: " + getCheckMessage(MSG_KEY, "default"), "26:9: " + getCheckMessage(MSG_KEY, "default"), -@@ -78,7 +78,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { +@@ -85,7 +85,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } @Test @@ -26739,7 +27965,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( getNonCompilablePath("InputMissingSwitchDefaultCheckSwitchExpressionsThree.java"), -@@ -86,7 +86,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { +@@ -93,7 +93,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } @Test @@ -27178,12 +28404,30 @@ } @Test -- public void testDefault() throws Exception { -+ void testDefault() throws Exception { +- public void testDefaultOne() throws Exception { ++ void defaultOne() throws Exception { final String[] expected = { "23:12: " + getCheckMessage(MSG_KEY), "28:12: " + getCheckMessage(MSG_KEY), -@@ -62,7 +62,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { +@@ -48,7 +48,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultTwo() throws Exception { ++ void defaultTwo() throws Exception { + final String[] expected = { + "20:55: " + getCheckMessage(MSG_KEY), + "24:14: " + getCheckMessage(MSG_KEY), +@@ -64,7 +64,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultThree() throws Exception { ++ void defaultThree() throws Exception { + final String[] expected = { + "13:21: " + getCheckMessage(MSG_KEY), + "33:10: " + getCheckMessage(MSG_KEY), +@@ -76,7 +76,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { } @Test @@ -27346,8 +28590,8 @@ } --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java -@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDecla - import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; -public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTestSupport { @@ -27355,7 +28599,7 @@ @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest +@@ -34,7 +34,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } @Test @@ -27364,7 +28608,7 @@ final String[] expected = { "32:5: " + getCheckMessage(MSG_KEY, 21), -@@ -45,7 +45,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest +@@ -46,7 +46,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } @Test @@ -27373,7 +28617,16 @@ final String[] expected = { "21:9: " + getCheckMessage(MSG_KEY, 15), -@@ -57,7 +57,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest +@@ -58,7 +58,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest + } + + @Test +- public void testOverloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { ++ void overloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -67,7 +67,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } @Test @@ -30612,9 +31865,9 @@ - public void testDefaultOperation() throws Exception { + void defaultOperation() throws Exception { final String[] expected = { - "12:54: " + getCheckMessage(MSG_KEY, "com.puppycrawl." + "tools.checkstyle.checks.imports.*"), - "14:15: " + getCheckMessage(MSG_KEY, "java.io.*"), -@@ -48,7 +48,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + "12:15: " + getCheckMessage(MSG_KEY, "java.io.*"), + "13:17: " + getCheckMessage(MSG_KEY, "java.lang.*"), +@@ -47,7 +47,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } @Test @@ -30622,8 +31875,8 @@ + void excludes() throws Exception { // allow the java.io/java.lang,javax.swing.WindowConstants star imports final String[] expected2 = { - "12:54: " + getCheckMessage(MSG_KEY, "com.puppycrawl." + "tools.checkstyle.checks.imports.*"), -@@ -58,7 +58,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + "31:27: " + getCheckMessage(MSG_KEY, "java.io.File.*"), +@@ -56,7 +56,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } @Test @@ -30631,8 +31884,8 @@ + void allowClassImports() throws Exception { // allow all class star imports final String[] expected2 = { - "30:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), -@@ -69,7 +69,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), +@@ -67,7 +67,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } @Test @@ -30640,8 +31893,8 @@ + void allowStaticMemberImports() throws Exception { // allow all static star imports final String[] expected2 = { - "12:54: " + getCheckMessage(MSG_KEY, "com.puppycrawl." + "tools.checkstyle.checks.imports.*"), -@@ -80,7 +80,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + "12:15: " + getCheckMessage(MSG_KEY, "java.io.*"), +@@ -77,7 +77,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } @Test @@ -30650,7 +31903,7 @@ final AvoidStarImportCheck testCheckObject = new AvoidStarImportCheck(); final int[] actual = testCheckObject.getAcceptableTokens(); final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; -@@ -88,7 +88,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { +@@ -85,7 +85,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } @Test @@ -30686,8 +31939,8 @@ - public void testDefaultOperation() throws Exception { + void defaultOperation() throws Exception { final String[] expected = { - "26:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), - "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), + "24:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), + "26:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -67,7 +67,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } @@ -30696,7 +31949,7 @@ + void starExcludes() throws Exception { // allow the "java.io.File.*" AND "sun.net.ftpclient.FtpClient.*" star imports final String[] expected = { - "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), + "26:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -88,7 +88,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } @@ -30705,7 +31958,7 @@ + void memberExcludes() throws Exception { // allow the java.io.File.listRoots and java.lang.Math.E member imports final String[] expected = { - "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), + "26:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -110,7 +110,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } @@ -30714,7 +31967,7 @@ + void bogusMemberExcludes() throws Exception { // should NOT mask anything final String[] expected = { - "28:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), + "26:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), @@ -134,7 +134,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } @@ -30804,7 +32057,34 @@ final String[] expected = { "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), -@@ -110,7 +110,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -109,7 +109,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticStandardThirdListCustomRules() throws Exception { ++ void staticStandardThirdListCustomRules() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), + "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), +@@ -128,7 +128,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticStandardThirdListCustomRulesWhitespace() throws Exception { ++ void staticStandardThirdListCustomRulesWhitespace() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -136,7 +136,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderSingleLineList() throws Exception { ++ void inputCustomImportOrderSingleLineList() throws Exception { + final String[] expected = { + "14:112: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), + "15:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.google.common.annotations.Beta"), +@@ -148,7 +148,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { /** Checks different combinations for same_package group. */ @Test @@ -30813,7 +32093,7 @@ final String[] expected = { "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), -@@ -128,7 +128,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -166,7 +166,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30822,7 +32102,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.List"), }; -@@ -137,7 +137,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -175,7 +175,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30831,7 +32111,7 @@ final String[] expected = { "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), "19:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.List"), -@@ -167,7 +167,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -207,7 +207,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30840,7 +32120,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_LEX, "java.util.*", "java.util.StringTokenizer"), "18:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), -@@ -186,7 +186,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -226,7 +226,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30849,7 +32129,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_LEX, "java.util.*", "java.util.StringTokenizer"), "18:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), -@@ -205,7 +205,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -245,7 +245,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30858,7 +32138,7 @@ final String[] expected = { "16:1: " + getCheckMessage( -@@ -221,14 +221,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -261,14 +261,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30875,7 +32155,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, THIRD, "org.w3c.dom.Node"), }; -@@ -238,7 +238,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -278,7 +278,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30884,7 +32164,7 @@ final String[] expected = { "19:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), -@@ -261,7 +261,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -301,7 +301,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30893,7 +32173,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -269,7 +269,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -309,7 +309,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30902,7 +32182,7 @@ final String[] expected = { "23:1: " + getCheckMessage(MSG_ORDER, THIRD, SPECIAL, "com.google.common.collect.HashMultimap"), -@@ -280,7 +280,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -320,7 +320,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30911,7 +32191,7 @@ final String[] expected = { "16:1: " + getCheckMessage(MSG_LEX, "java.util.Map", "java.util.Map.Entry"), }; -@@ -289,7 +289,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -329,7 +329,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30920,7 +32200,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MSG_ORDER, THIRD, SPECIAL, "com.google.common.annotations.Beta"), }; -@@ -299,7 +299,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -339,7 +339,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30929,16 +32209,16 @@ final DefaultConfiguration checkConfig = createModuleConfig(CustomImportOrderCheck.class); checkConfig.addProperty("specialImportsRegExp", "com"); checkConfig.addProperty("separateLineBetweenGroups", "false"); -@@ -315,7 +315,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -355,7 +355,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test - public void testImportsContainingJava() throws Exception { + void importsContainingJava() throws Exception { final String[] expected = { - "17:1: " - + getCheckMessage( -@@ -328,7 +328,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + "17:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.google.errorprone.annotations.*"), + }; +@@ -365,7 +365,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30947,7 +32227,7 @@ final CustomImportOrderCheck testCheckObject = new CustomImportOrderCheck(); final int[] actual = testCheckObject.getAcceptableTokens(); final int[] expected = { -@@ -341,7 +341,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -378,7 +378,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { @Test // UT uses Reflection to avoid removing null-validation from static method, // which is a candidate for utility method in the future @@ -30956,7 +32236,7 @@ final Class clazz = CustomImportOrderCheck.class; final Object t = clazz.getConstructor().newInstance(); final Method method = clazz.getDeclaredMethod("getFullImportIdent", DetailAST.class); -@@ -353,7 +353,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -390,7 +390,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30965,7 +32245,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.*"), "21:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.List"), -@@ -373,7 +373,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -410,7 +410,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30974,7 +32254,7 @@ final String[] expected = { "23:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), "24:1: " -@@ -388,7 +388,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -425,7 +425,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30983,7 +32263,7 @@ final String[] expected = { "25:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.locks.LockSupport"), -@@ -399,7 +399,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -436,7 +436,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -30992,7 +32272,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -407,7 +407,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -444,7 +444,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31001,7 +32281,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -432,7 +432,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -469,7 +469,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31010,7 +32290,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -455,7 +455,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -492,7 +492,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31019,7 +32299,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -477,7 +477,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -514,7 +514,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31028,7 +32308,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -499,14 +499,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -536,14 +536,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31044,8 +32324,8 @@ + void defaultConfiguration() throws Exception { final String[] expected = { "20:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.awt.Button"), - "32:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "com.puppycrawl.tools.checkstyle.*"), -@@ -516,7 +516,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + "32:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.*"), +@@ -553,7 +553,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31054,7 +32334,7 @@ final String[] expected = { "23:1: " + getCheckMessage( -@@ -559,28 +559,28 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -596,28 +596,28 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31087,7 +32367,7 @@ final String[] expected = { "16:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "org.junit.Test"), }; -@@ -589,7 +589,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -626,7 +626,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31096,7 +32376,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.*"), "19:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.HashMap"), -@@ -601,7 +601,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -638,7 +638,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31105,7 +32385,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.sun.accessibility.internal.resources.*"), "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Arrays"), -@@ -614,7 +614,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -651,7 +651,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31114,7 +32394,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), "25:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "org.apache.*"), -@@ -625,7 +625,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -662,7 +662,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31123,7 +32403,7 @@ final String[] expected = { "14:112: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), "15:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.google.common.annotations.Beta"), -@@ -636,7 +636,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -673,7 +673,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31132,7 +32412,7 @@ final String[] expected = { "14:118: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), }; -@@ -645,7 +645,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -682,7 +682,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31141,7 +32421,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.WindowConstants.*"), "24:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.awt.Button"), -@@ -664,7 +664,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -701,7 +701,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31150,7 +32430,7 @@ final String[] expected = { "17:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STATIC, "java.util.Collections.*"), "18:1: " -@@ -678,7 +678,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -715,7 +715,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31159,7 +32439,7 @@ final String[] expected = { "30:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.BitSet"), "45:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.HashSet"), -@@ -691,7 +691,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -728,7 +728,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31168,7 +32448,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "java.awt.Button"), "23:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "java.awt.Dialog"), -@@ -707,7 +707,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -744,7 +744,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31233,8 +32513,8 @@ - public void testWithSupplied() throws Exception { + void withSupplied() throws Exception { final String[] expected = { - "14:1: " + getCheckMessage(MSG_KEY, "java.io.*"), - "28:1: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), + "12:1: " + getCheckMessage(MSG_KEY, "java.io.*"), + "26:1: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), @@ -53,13 +53,13 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } @@ -31267,8 +32547,8 @@ - public void testIllegalClasses() throws Exception { + void illegalClasses() throws Exception { final String[] expected = { - "16:1: " + getCheckMessage(MSG_KEY, "java.sql.Connection"), - "20:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), + "14:1: " + getCheckMessage(MSG_KEY, "java.sql.Connection"), + "18:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), @@ -86,7 +86,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } @@ -31276,8 +32556,8 @@ - public void testIllegalClassesStarImport() throws Exception { + void illegalClassesStarImport() throws Exception { final String[] expected = { - "14:1: " + getCheckMessage(MSG_KEY, "java.io.*"), - "20:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), + "12:1: " + getCheckMessage(MSG_KEY, "java.io.*"), + "18:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), @@ -96,7 +96,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } @@ -31285,8 +32565,8 @@ - public void testIllegalPackagesRegularExpression() throws Exception { + void illegalPackagesRegularExpression() throws Exception { final String[] expected = { - "17:1: " + getCheckMessage(MSG_KEY, "java.util.List"), - "18:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "15:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "16:1: " + getCheckMessage(MSG_KEY, "java.util.List"), @@ -110,7 +110,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } @@ -31294,8 +32574,8 @@ - public void testIllegalClassesRegularExpression() throws Exception { + void illegalClassesRegularExpression() throws Exception { final String[] expected = { - "17:1: " + getCheckMessage(MSG_KEY, "java.util.List"), - "18:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "15:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "16:1: " + getCheckMessage(MSG_KEY, "java.util.List"), @@ -120,7 +120,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } @@ -31303,8 +32583,8 @@ - public void testIllegalPackagesAndClassesRegularExpression() throws Exception { + void illegalPackagesAndClassesRegularExpression() throws Exception { final String[] expected = { - "17:1: " + getCheckMessage(MSG_KEY, "java.util.List"), - "18:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "15:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "16:1: " + getCheckMessage(MSG_KEY, "java.util.List"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java @@ -39,7 +39,7 @@ import java.util.List; @@ -31629,7 +32909,15 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), }; -@@ -408,7 +408,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -408,14 +408,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportControlFileName2() throws Exception { ++ void importControlFileName2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputImportControlTestRegexpInFile2.java"), expected); } @Test @@ -31693,23 +32981,15 @@ final InputSource source = new InputSource(); try { final Class clazz = ImportControlLoader.class; -@@ -135,12 +135,12 @@ public class ImportControlLoaderTest { +@@ -135,7 +135,7 @@ public class ImportControlLoaderTest { } @Test - public void testInputStreamFailsOnRead() throws Exception { -- try (InputStream inputStream = mock(InputStream.class)) { + void inputStreamFailsOnRead() throws Exception { -+ try (InputStream inputStream = mock()) { + try (InputStream inputStream = mock()) { final int available = doThrow(IOException.class).when(inputStream).available(); -- final URL url = mock(URL.class); -+ final URL url = mock(); - when(url.openStream()).thenReturn(inputStream); -- final URI uri = mock(URI.class); -+ final URI uri = mock(); - when(uri.toURL()).thenReturn(url); - - final CheckstyleException ex = + final URL url = mock(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java @@ -38,7 +38,7 @@ import java.util.Optional; @@ -31939,7 +33219,7 @@ - public void testWildcard() throws Exception { + void wildcard() throws Exception { final String[] expected = { - "25:1: " + getCheckMessage(MSG_ORDERING, "javax.crypto.Cipher"), + "24:1: " + getCheckMessage(MSG_ORDERING, "javax.crypto.Cipher"), }; @@ -324,7 +324,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @@ -31948,9 +33228,9 @@ - public void testWildcardUnspecified() throws Exception { + void wildcardUnspecified() throws Exception { final String[] expected = { - "23:1: " - + getCheckMessage( -@@ -336,14 +336,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.crypto.Cipher"), + }; +@@ -333,14 +333,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31967,7 +33247,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), -@@ -353,7 +353,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -350,7 +350,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31976,7 +33256,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), -@@ -362,7 +362,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -359,7 +359,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31985,7 +33265,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), -@@ -371,7 +371,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -368,7 +368,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -31994,7 +33274,7 @@ final String[] expected = { "24:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), }; -@@ -383,7 +383,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -380,7 +380,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { * Tests that a non-static import after a static import correctly gives an error if order=bottom. */ @Test @@ -32003,7 +33283,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_ORDERING, "java.lang.Math.PI"), }; -@@ -395,7 +395,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -392,7 +392,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { * Tests that a non-static import before a static import correctly gives an error if order=top. */ @Test @@ -32012,7 +33292,7 @@ final String[] expected = { "24:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), }; -@@ -404,7 +404,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -401,7 +401,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32021,7 +33301,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), -@@ -413,19 +413,19 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -410,19 +410,19 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32044,7 +33324,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MSG_SEPARATION, "org.antlr.v4.runtime.CommonToken.*"), "23:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), -@@ -434,7 +434,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -431,7 +431,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32053,7 +33333,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), -@@ -445,7 +445,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -442,7 +442,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32062,7 +33342,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), -@@ -456,7 +456,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -453,7 +453,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32071,7 +33351,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), -@@ -467,7 +467,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -464,7 +464,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32080,7 +33360,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), -@@ -477,7 +477,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -474,7 +474,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32089,7 +33369,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), -@@ -487,7 +487,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -484,7 +484,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32098,7 +33378,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), -@@ -499,7 +499,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -496,7 +496,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32107,7 +33387,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); checkConfig.addProperty("groups", "/^javax"); -@@ -521,7 +521,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -518,7 +518,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32116,7 +33396,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), "23:1: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), -@@ -530,7 +530,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -527,7 +527,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32125,7 +33405,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.*"), }; -@@ -546,7 +546,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -543,7 +543,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { * given, so there is no other way to cover this code. */ @Test @@ -32134,7 +33414,7 @@ // Create mock ast final DetailAstImpl astImport = mockAST(TokenTypes.IMPORT, "import", 0, 0); final DetailAstImpl astIdent = mockAST(TokenTypes.IDENT, "myTestImport", 0, 0); -@@ -587,7 +587,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -584,7 +584,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32143,7 +33423,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -595,14 +595,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -592,14 +592,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32160,7 +33440,7 @@ final String[] expected = { "28:1: " + getCheckMessage(MSG_SEPARATION, "javax.swing.JComponent"), "33:1: " + getCheckMessage(MSG_ORDERING, "org.junit.Test"), -@@ -613,14 +613,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -610,14 +610,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32177,7 +33457,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.codec.http.HttpHeaders.Names.addDate"), -@@ -630,7 +630,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -627,7 +627,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32186,7 +33466,7 @@ final String[] expected = { "23:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.codec.http.HttpHeaders.Names.DATE"), -@@ -640,7 +640,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -637,7 +637,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32195,7 +33475,7 @@ final String[] expected = { "22:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.Codec.HTTP.HttpHeaders.tmp.same"), "23:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.Codec.HTTP.HttpHeaders.TKN.same"), -@@ -650,7 +650,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -647,7 +647,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32204,7 +33484,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.*"), }; -@@ -659,7 +659,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -656,7 +656,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32213,7 +33493,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -667,7 +667,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -664,7 +664,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32222,7 +33502,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -675,7 +675,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -672,7 +672,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32231,7 +33511,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -683,7 +683,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -680,7 +680,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32240,7 +33520,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -691,7 +691,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -688,7 +688,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32249,7 +33529,7 @@ final String[] expected = { "21:1: " + getCheckMessage(MSG_ORDERING, "org.junit.Assert.fail"), "23:1: " + getCheckMessage(MSG_ORDERING, "org.infinispan.test.TestingUtil.extract"), -@@ -702,7 +702,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -699,7 +699,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32258,7 +33538,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -710,7 +710,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -707,7 +707,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32267,7 +33547,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -718,7 +718,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -715,7 +715,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32276,7 +33556,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -726,7 +726,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -723,7 +723,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32285,7 +33565,7 @@ final String[] expected = { "25:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), }; -@@ -742,7 +742,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -739,7 +739,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @Test @@ -32294,7 +33574,7 @@ final ImportOrderCheck check = new ImportOrderCheck(); final DetailAST root = JavaParser.parseFile( -@@ -756,7 +756,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { +@@ -753,7 +753,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { .that( TestUtil.isStatefulFieldClearedDuringBeginTree( check, @@ -32625,8 +33905,8 @@ + void withoutProcessJavadoc() throws Exception { final String[] expected = { "11:8: " - + getCheckMessage( -@@ -111,7 +112,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + + getCheckMessage(MSG_KEY, "com.google.errorprone.annotations." + "concurrent.GuardedBy"), +@@ -106,7 +107,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32634,8 +33914,8 @@ + void processJavadoc() throws Exception { final String[] expected = { "11:8: " - + getCheckMessage( -@@ -133,27 +134,27 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + + getCheckMessage(MSG_KEY, "com.google.errorprone.annotations." + "concurrent.GuardedBy"), +@@ -125,27 +126,27 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32667,7 +33947,7 @@ final String[] expected = { "13:8: " + getCheckMessage(MSG_KEY, "java.util.ArrayList"), }; -@@ -161,20 +162,20 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -153,20 +154,20 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32691,7 +33971,7 @@ final UnusedImportsCheck testCheckObject = new UnusedImportsCheck(); final int[] actual = testCheckObject.getRequiredTokens(); final int[] expected = { -@@ -202,7 +203,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -194,7 +195,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32700,7 +33980,7 @@ final UnusedImportsCheck testCheckObject = new UnusedImportsCheck(); final int[] actual = testCheckObject.getAcceptableTokens(); final int[] expected = { -@@ -230,7 +231,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -222,7 +223,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32709,7 +33989,7 @@ final String[] expected = { "12:8: " + getCheckMessage(MSG_KEY, "java.util.Arrays"), "13:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), -@@ -240,7 +241,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -232,7 +233,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32718,7 +33998,7 @@ final String[] expected = { "10:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), "11:8: " + getCheckMessage(MSG_KEY, "java.lang.Math"), -@@ -258,7 +259,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -250,7 +251,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32727,7 +34007,7 @@ final String[] expected = { "11:8: " + getCheckMessage(MSG_KEY, "java.util.List"), }; -@@ -266,7 +267,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -258,7 +259,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32736,7 +34016,7 @@ final String[] expected = { "10:8: " + getCheckMessage(MSG_KEY, "module"), }; -@@ -275,7 +276,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -267,7 +268,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32745,7 +34025,7 @@ final String[] expected = { "19:8: " + getCheckMessage(MSG_KEY, "javax.swing.JToolBar"), "20:8: " + getCheckMessage(MSG_KEY, "javax.swing.JToggleButton"), -@@ -285,7 +286,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -277,7 +278,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32754,7 +34034,7 @@ final String[] expected = { "12:8: " + getCheckMessage(MSG_KEY, "java.util.Map"), "13:8: " + getCheckMessage(MSG_KEY, "java.util.Set"), -@@ -299,7 +300,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -291,7 +292,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32763,7 +34043,7 @@ final String[] expected = { "11:8: " + getCheckMessage(MSG_KEY, "java.awt.Rectangle"), "13:8: " + getCheckMessage(MSG_KEY, "java.awt.event.KeyEvent"), -@@ -308,14 +309,15 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -300,14 +301,15 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -32797,21 +34077,93 @@ } @Test -- public void testCommentIsAtTheEndOfBlock() throws Exception { -+ void commentIsAtTheEndOfBlock() throws Exception { +- public void testCommentIsAtTheEndOfBlockOne() throws Exception { ++ void commentIsAtTheEndOfBlockOne() throws Exception { final String[] expected = { "25:26: " + getCheckMessage(MSG_KEY_SINGLE, 24, 25, 8), "40:6: " + getCheckMessage(MSG_KEY_SINGLE, 42, 5, 4), -@@ -92,7 +92,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -54,7 +54,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test -- public void testCommentIsInsideSwitchBlock() throws Exception { -+ void commentIsInsideSwitchBlock() throws Exception { +- public void testCommentIsAtTheEndOfBlockTwo() throws Exception { ++ void commentIsAtTheEndOfBlockTwo() throws Exception { + final String[] expected = { + "22:30: " + getCheckMessage(MSG_KEY_SINGLE, 23, 29, 12), + "45:27: " + getCheckMessage(MSG_KEY_SINGLE, 38, 26, 8), +@@ -68,7 +68,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsAtTheEndOfBlockThree() throws Exception { ++ void commentIsAtTheEndOfBlockThree() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_KEY_SINGLE, 20, 0, 8), + "35:13: " + getCheckMessage(MSG_KEY_SINGLE, 32, 12, 8), +@@ -84,7 +84,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsAtTheEndOfBlockFour() throws Exception { ++ void commentIsAtTheEndOfBlockFour() throws Exception { + final String[] expected = { + "22:10: " + getCheckMessage(MSG_KEY_SINGLE, 21, 9, 8), + "28:1: " + getCheckMessage(MSG_KEY_SINGLE, 29, 0, 4), +@@ -100,7 +100,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsAtTheEndOfBlockFive() throws Exception { ++ void commentIsAtTheEndOfBlockFive() throws Exception { + final String[] expected = { + "61:1: " + getCheckMessage(MSG_KEY_SINGLE, 59, 0, 8), + "77:11: " + getCheckMessage(MSG_KEY_BLOCK, 73, 10, 8), +@@ -114,7 +114,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsAtTheEndOfBlockSix() throws Exception { ++ void commentIsAtTheEndOfBlockSix() throws Exception { + final String[] expected = { + "26:11: " + getCheckMessage(MSG_KEY_SINGLE, 19, 10, 8), + "33:1: " + getCheckMessage(MSG_KEY_SINGLE, 30, 0, 8), +@@ -132,7 +132,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsInsideSwitchBlockOne() throws Exception { ++ void commentIsInsideSwitchBlockOne() throws Exception { final String[] expected = { "27:13: " + getCheckMessage(MSG_KEY_BLOCK, 28, 12, 16), "33:20: " + getCheckMessage(MSG_KEY_SINGLE, "32, 34", 19, "16, 12"), -@@ -120,7 +120,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -148,7 +148,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsInsideSwitchBlockTwo() throws Exception { ++ void commentIsInsideSwitchBlockTwo() throws Exception { + final String[] expected = { + "18:25: " + getCheckMessage(MSG_KEY_SINGLE, 19, 24, 20), + "43:16: " + getCheckMessage(MSG_KEY_SINGLE, "42, 44", 15, "17, 12"), +@@ -161,7 +161,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsInsideSwitchBlockThree() throws Exception { ++ void commentIsInsideSwitchBlockThree() throws Exception { + final String[] expected = { + "18:25: " + getCheckMessage(MSG_KEY_SINGLE, 19, 24, 20), + "45:5: " + getCheckMessage(MSG_KEY_SINGLE, "44, 46", 4, "12, 12"), +@@ -175,7 +175,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsInsideSwitchBlockFour() throws Exception { ++ void commentIsInsideSwitchBlockFour() throws Exception { + final String[] expected = { + "18:25: " + getCheckMessage(MSG_KEY_SINGLE, 19, 24, 20), + "34:12: " + getCheckMessage(MSG_KEY_BLOCK, "33, 37", 11, "16, 12"), +@@ -187,7 +187,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32820,16 +34172,25 @@ final String[] expected = { "16:20: " + getCheckMessage(MSG_KEY_SINGLE, 19, 19, 31), "17:24: " + getCheckMessage(MSG_KEY_BLOCK, 19, 23, 31), -@@ -135,7 +135,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -202,7 +202,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test -- public void testSurroundingCode() throws Exception { -+ void surroundingCode() throws Exception { +- public void testSurroundingCodeOne() throws Exception { ++ void surroundingCodeOne() throws Exception { final String[] expected = { "20:15: " + getCheckMessage(MSG_KEY_SINGLE, 21, 14, 12), "31:17: " + getCheckMessage(MSG_KEY_BLOCK, 32, 16, 12), -@@ -155,14 +155,14 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -218,7 +218,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSurroundingCodeTwo() throws Exception { ++ void surroundingCodeTwo() throws Exception { + final String[] expected = { + "20:34: " + getCheckMessage(MSG_KEY_SINGLE, 21, 33, 8), + "42:13: " + getCheckMessage(MSG_KEY_BLOCK, 43, 12, 8), +@@ -230,14 +230,14 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32846,16 +34207,25 @@ final String[] expected = { "20:15: " + getCheckMessage(MSG_KEY_SINGLE, 21, 14, 12), "57:28: " + getCheckMessage(MSG_KEY_SINGLE, 60, 27, 36), -@@ -175,7 +175,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -250,7 +250,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test -- public void testCheckOnlyBlockComments() throws Exception { -+ void checkOnlyBlockComments() throws Exception { +- public void testCheckOnlyBlockCommentsOne() throws Exception { ++ void checkOnlyBlockCommentsOne() throws Exception { final String[] expected = { "30:17: " + getCheckMessage(MSG_KEY_BLOCK, 31, 16, 12), "32:17: " + getCheckMessage(MSG_KEY_BLOCK, 34, 16, 12), -@@ -190,7 +190,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -262,7 +262,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckOnlyBlockCommentsTwo() throws Exception { ++ void checkOnlyBlockCommentsTwo() throws Exception { + final String[] expected = { + "40:13: " + getCheckMessage(MSG_KEY_BLOCK, 41, 12, 8), + "46:5: " + getCheckMessage(MSG_KEY_BLOCK, 47, 4, 8), +@@ -273,7 +273,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32864,7 +34234,7 @@ final CommentsIndentationCheck check = new CommentsIndentationCheck(); final DetailAstImpl methodDef = new DetailAstImpl(); methodDef.setType(TokenTypes.METHOD_DEF); -@@ -207,7 +207,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -290,7 +290,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32873,16 +34243,25 @@ final String[] expected = { "10:3: " + getCheckMessage(MSG_KEY_BLOCK, 13, 2, 0), "16:1: " + getCheckMessage(MSG_KEY_BLOCK, 17, 0, 4), -@@ -219,7 +219,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -302,7 +302,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test -- public void testMultiblockStructures() throws Exception { -+ void multiblockStructures() throws Exception { +- public void testMultiblockStructuresOne() throws Exception { ++ void multiblockStructuresOne() throws Exception { final String[] expected = { "19:9: " + getCheckMessage(MSG_KEY_SINGLE, 18, 8, 12), "25:17: " + getCheckMessage(MSG_KEY_SINGLE, "24, 26", 16, "12, 8"), -@@ -245,7 +245,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -325,7 +325,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiblockStructuresTwo() throws Exception { ++ void multiblockStructuresTwo() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(MSG_KEY_SINGLE, 19, 8, 12), + "26:17: " + getCheckMessage(MSG_KEY_SINGLE, "25, 27", 16, "12, 8"), +@@ -336,7 +336,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32891,7 +34270,7 @@ final String[] expected = { "21:5: " + getCheckMessage(MSG_KEY_SINGLE, 22, 4, 0), "25:9: " + getCheckMessage(MSG_KEY_SINGLE, 26, 8, 4), -@@ -258,7 +258,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -349,7 +349,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32900,7 +34279,7 @@ final String[] expected = { "23:7: " + getCheckMessage(MSG_KEY_SINGLE, 24, 6, 4), "30:11: " + getCheckMessage(MSG_KEY_SINGLE, 31, 10, 4), -@@ -268,7 +268,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -359,7 +359,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32909,7 +34288,7 @@ final String[] expected = { "14:9: " + getCheckMessage(MSG_KEY_SINGLE, 15, 8, 16), "25:13: " + getCheckMessage(MSG_KEY_SINGLE, 24, 12, 8), -@@ -285,7 +285,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -376,7 +376,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32918,7 +34297,7 @@ final String[] expected = { "8:1: " + getCheckMessage(MSG_KEY_BLOCK, 11, 0, 1), }; -@@ -294,7 +294,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -385,7 +385,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -32927,7 +34306,7 @@ final String[] expected = { "15:17: " + getCheckMessage(MSG_KEY_SINGLE, 16, 16, 20), "28:1: " + getCheckMessage(MSG_KEY_SINGLE, 29, 0, 4), -@@ -307,7 +307,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +@@ -398,7 +398,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33428,7 +34807,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("basicOffset", "4"); -@@ -1120,7 +1118,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1131,7 +1129,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33437,7 +34816,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1137,7 +1135,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1148,7 +1146,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33446,7 +34825,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "8"); -@@ -1154,7 +1152,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1165,7 +1163,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33455,7 +34834,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "2"); -@@ -1171,7 +1169,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1182,7 +1180,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33464,7 +34843,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "2"); -@@ -1201,7 +1199,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1212,7 +1210,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33473,7 +34852,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "2"); -@@ -1218,7 +1216,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1229,7 +1227,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33482,7 +34861,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1280,7 +1278,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1291,7 +1289,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33491,7 +34870,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "2"); -@@ -1304,7 +1302,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1315,7 +1313,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33500,7 +34879,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "2"); -@@ -1326,7 +1324,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1337,7 +1335,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33509,7 +34888,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1388,7 +1386,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1399,7 +1397,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33518,7 +34897,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1405,7 +1403,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1416,7 +1414,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33527,7 +34906,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1451,7 +1449,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1462,7 +1460,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33536,7 +34915,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1503,7 +1501,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1514,7 +1512,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33545,7 +34924,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1567,7 +1565,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1578,7 +1576,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33554,7 +34933,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1659,7 +1657,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1670,7 +1668,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33563,7 +34942,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1705,7 +1703,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1716,7 +1714,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33572,7 +34951,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1722,7 +1720,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1733,7 +1731,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33581,7 +34960,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1770,7 +1768,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1781,7 +1779,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33590,7 +34969,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1787,7 +1785,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1798,7 +1796,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33599,7 +34978,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1804,7 +1802,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1815,7 +1813,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33608,7 +34987,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1839,7 +1837,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1850,7 +1848,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33617,7 +34996,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1856,7 +1854,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1867,7 +1865,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33626,7 +35005,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1873,7 +1871,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1884,7 +1882,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33635,7 +35014,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1893,7 +1891,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1904,7 +1902,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33644,7 +35023,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1910,7 +1908,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1921,7 +1919,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33653,7 +35032,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1927,7 +1925,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1938,7 +1936,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33662,7 +35041,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1945,7 +1943,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1956,7 +1954,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33671,7 +35050,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1963,7 +1961,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1974,7 +1972,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33680,7 +35059,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -1979,7 +1977,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -1990,7 +1988,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33689,7 +35068,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("basicOffset", "1"); -@@ -2006,7 +2004,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2017,7 +2015,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33698,7 +35077,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2024,7 +2022,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2035,7 +2033,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33707,7 +35086,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2046,7 +2044,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2057,7 +2055,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33716,7 +35095,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2067,7 +2065,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2078,7 +2076,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33725,7 +35104,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("basicOffset", "8"); checkConfig.addProperty("tabWidth", "4"); -@@ -2079,7 +2077,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2090,7 +2088,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33734,7 +35113,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2095,7 +2093,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2106,7 +2104,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33743,7 +35122,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2111,7 +2109,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2122,7 +2120,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33752,7 +35131,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2127,7 +2125,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2138,7 +2136,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33761,7 +35140,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2143,7 +2141,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2154,7 +2152,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33770,7 +35149,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2161,7 +2159,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2172,7 +2170,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33779,7 +35158,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2176,7 +2174,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2187,7 +2185,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33788,7 +35167,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "8"); checkConfig.addProperty("basicOffset", "2"); -@@ -2197,7 +2195,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2208,7 +2206,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33797,7 +35176,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2222,7 +2220,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2233,7 +2231,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33806,7 +35185,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -2230,7 +2228,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2241,7 +2239,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33815,7 +35194,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2240,7 +2238,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2251,7 +2249,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33824,7 +35203,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2250,7 +2248,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2261,7 +2259,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33833,7 +35212,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -2258,7 +2256,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2269,7 +2267,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33842,7 +35221,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2269,7 +2267,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2280,7 +2278,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33851,7 +35230,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "2"); checkConfig.addProperty("basicOffset", "2"); -@@ -2289,7 +2287,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2300,7 +2298,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33860,7 +35239,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2299,7 +2297,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2310,7 +2308,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33869,7 +35248,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2316,7 +2314,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2327,7 +2325,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33878,7 +35257,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2326,7 +2324,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2337,7 +2335,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33887,7 +35266,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "3"); checkConfig.addProperty("basicOffset", "3"); -@@ -2337,7 +2335,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2348,7 +2346,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33896,7 +35275,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2356,7 +2354,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2367,7 +2365,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33905,7 +35284,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2385,7 +2383,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2396,7 +2394,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33914,7 +35293,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "3"); -@@ -2398,7 +2396,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2409,7 +2407,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33923,7 +35302,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String fileName = getPath("InputIndentationSeparatedStatements.java"); -@@ -2407,7 +2405,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2418,7 +2416,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33932,7 +35311,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String fileName = getPath("InputIndentationSeparatedStatementWithSpaces.java"); -@@ -2416,7 +2414,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2427,7 +2425,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33941,7 +35320,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2426,7 +2424,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2437,7 +2435,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33950,7 +35329,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2436,7 +2434,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2447,7 +2445,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33959,7 +35338,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2448,7 +2446,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2459,7 +2457,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33968,7 +35347,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "2"); -@@ -2464,7 +2462,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2475,7 +2473,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33977,7 +35356,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2480,7 +2478,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2491,7 +2489,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33986,7 +35365,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2494,7 +2492,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2505,7 +2503,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -33995,7 +35374,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("arrayInitIndent", "4"); -@@ -2539,7 +2537,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2550,7 +2548,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34004,7 +35383,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("forceStrictCondition", "true"); -@@ -2574,7 +2572,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2585,7 +2583,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34013,7 +35392,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("braceAdjustment", "0"); -@@ -2613,7 +2611,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2624,7 +2622,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { * @see IndentComment#getExpectedMessagePostfix(String) */ @Test @@ -34022,7 +35401,7 @@ final Object[] arguments = {"##0##", "##1##", "##2##"}; final String[] messages = { getCheckMessage(MSG_ERROR, arguments), -@@ -2640,7 +2638,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2651,7 +2649,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34031,7 +35410,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -2648,7 +2646,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2659,7 +2657,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34040,7 +35419,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2661,7 +2659,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2673,7 +2671,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34049,7 +35428,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("braceAdjustment", "0"); -@@ -2672,7 +2670,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2684,7 +2682,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34058,7 +35437,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("braceAdjustment", "0"); -@@ -2686,7 +2684,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2698,7 +2696,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34067,7 +35446,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("arrayInitIndent", "2"); -@@ -2710,7 +2708,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2722,7 +2720,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34076,7 +35455,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2734,7 +2732,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2746,7 +2744,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34085,7 +35464,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2750,7 +2748,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2762,7 +2760,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34094,7 +35473,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -2761,7 +2759,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2773,7 +2771,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34103,7 +35482,16 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("caseIndent", "4"); -@@ -2783,7 +2781,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2795,7 +2793,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationSwitchExpressionDeclarationLeftCurlyNewLine() throws Exception { ++ void indentationSwitchExpressionDeclarationLeftCurlyNewLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2811,7 +2809,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34112,7 +35500,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2800,7 +2798,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2828,7 +2826,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34121,7 +35509,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2817,7 +2815,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2845,7 +2843,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34130,7 +35518,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2832,7 +2830,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2860,7 +2858,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34139,7 +35527,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2844,7 +2842,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2872,7 +2870,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34148,7 +35536,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); final String[] expected = { -@@ -2857,7 +2855,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2885,7 +2883,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34157,7 +35545,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2896,7 +2894,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2924,7 +2922,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34166,7 +35554,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); checkConfig.addProperty("basicOffset", "4"); -@@ -2916,7 +2914,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2944,7 +2942,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34175,7 +35563,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); -@@ -2926,7 +2924,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { +@@ -2954,7 +2952,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } @Test @@ -34186,19 +35574,16 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java -@@ -26,9 +26,9 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec +@@ -26,7 +26,7 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.MSG_JAVADOC_WRONG_SINGLETON_TAG; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck.MSG_TAG_FORMAT; import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.MSG_SUMMARY_FIRST_SENTENCE; - import static java.util.Arrays.asList; --import static java.util.Collections.singletonList; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.assertj.core.api.Assertions.assertThatCode; -+import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; - import com.puppycrawl.tools.checkstyle.api.DetailNode; -@@ -48,7 +48,7 @@ import org.junit.jupiter.api.extension.ExtendWith; +@@ -44,7 +44,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.io.TempDir; @ExtendWith(SystemErrGuard.class) @@ -34207,7 +35592,7 @@ @TempDir public File temporaryFolder; -@@ -67,12 +67,12 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -63,12 +63,12 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { * @param systemErr wrapper for {@code System.err} */ @BeforeEach @@ -34219,51 +35604,57 @@ @Test - public void testJavadocTagsWithoutArgs() throws Exception { + void javadocTagsWithoutArgs() throws Exception { - final DefaultConfiguration checkconfig = createModuleConfig(TempCheck.class); final String[] expected = { - "14: " -@@ -113,7 +113,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + "16: " + + getCheckMessage( +@@ -109,7 +109,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testNumberFormatException() throws Exception { + void numberFormatException() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = { - "7: " -@@ -127,14 +127,14 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + "8: " + + getCheckMessage( +@@ -123,13 +123,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testCustomTag() throws Exception { + void customTag() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verify(checkConfig, getPath("InputAbstractJavadocCustomTag.java"), expected); + verifyWithInlineConfigParser(getPath("InputAbstractJavadocCustomTag.java"), expected); } @Test - public void testParsingErrors(@SysErr Capturable systemErr) throws Exception { + void parsingErrors(@SysErr Capturable systemErr) throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = { - "8: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), -@@ -145,13 +145,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + "9: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "16: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), +@@ -139,19 +139,19 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test -- public void testWithMultipleChecks() throws Exception { -+ void withMultipleChecks() throws Exception { +- public void testWithMultipleChecksOne() throws Exception { ++ void withMultipleChecksOne() throws Exception { verifyWithInlineConfigParser( - getPath("InputAbstractJavadocCorrectParagraph.java"), CommonUtil.EMPTY_STRING_ARRAY); + getPath("InputAbstractJavadocCorrectParagraphOne.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testWithMultipleChecksTwo() throws Exception { ++ void withMultipleChecksTwo() throws Exception { + verifyWithInlineConfigParser( + getPath("InputAbstractJavadocCorrectParagraphTwo.java"), CommonUtil.EMPTY_STRING_ARRAY); } @Test - public void testAntlrError(@SysErr Capturable systemErr) throws Exception { + void antlrError(@SysErr Capturable systemErr) throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = { - "8: " + "9: " + + getCheckMessage( @@ -163,8 +163,8 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @@ -34272,55 +35663,91 @@ - @SysErr Capturable systemErr) throws Exception { + void checkReuseAfterParseErrorWithFollowingAntlrErrorInTwoFiles(@SysErr Capturable systemErr) + throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); - final Map> expectedMessages = new LinkedHashMap<>(2); - expectedMessages.put( -@@ -174,7 +174,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { - "13: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"))); - expectedMessages.put( - getPath("InputAbstractJavadocInvalidAtSeeReference2.java"), -- singletonList( -+ ImmutableList.of( - "8: " - + getCheckMessage( - MSG_JAVADOC_PARSE_RULE_ERROR, -@@ -192,7 +192,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + final String[] expectedMessagesForFile1 = { + "9: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "16: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), +@@ -184,7 +184,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testCheckReuseAfterParseErrorWithFollowingAntlrErrorInSingleFile() throws Exception { + void checkReuseAfterParseErrorWithFollowingAntlrErrorInSingleFile() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = { - "8: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "9: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), + "16: " +@@ -196,7 +196,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCache() throws Exception { ++ void cache() throws Exception { + final String[] expected = { + "12: " + getCheckMessage(SummaryJavadocCheck.class, MSG_SUMMARY_FIRST_SENTENCE), + }; @@ -207,7 +207,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test -- public void testPosition() throws Exception { -+ void position() throws Exception { +- public void testPositionOne() throws Exception { ++ void positionOne() throws Exception { JavadocCatchCheck.clearCounter(); - final DefaultConfiguration checkConfig = createModuleConfig(JavadocCatchCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -218,7 +218,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionOne.java"), expected); +@@ -219,7 +219,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test -- public void testPositionWithSinglelineComments() throws Exception { -+ void positionWithSinglelineComments() throws Exception { +- public void testPositionTwo() throws Exception { ++ void positionTwo() throws Exception { JavadocCatchCheck.clearCounter(); - final DefaultConfiguration checkConfig = createModuleConfig(JavadocCatchCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -230,7 +230,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionTwo.java"), expected); +@@ -231,7 +231,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPositionThree() throws Exception { ++ void positionThree() throws Exception { + JavadocCatchCheck.clearCounter(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionThree.java"), expected); +@@ -243,7 +243,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPositionWithSinglelineCommentsOne() throws Exception { ++ void positionWithSinglelineCommentsOne() throws Exception { + JavadocCatchCheck.clearCounter(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -256,7 +256,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPositionWithSinglelineCommentsTwo() throws Exception { ++ void positionWithSinglelineCommentsTwo() throws Exception { + JavadocCatchCheck.clearCounter(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -269,7 +269,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPositionWithSinglelineCommentsThree() throws Exception { ++ void positionWithSinglelineCommentsThree() throws Exception { + JavadocCatchCheck.clearCounter(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -282,7 +282,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testPositionOnlyComments() throws Exception { + void positionOnlyComments() throws Exception { JavadocCatchCheck.clearCounter(); - final DefaultConfiguration checkConfig = createModuleConfig(JavadocCatchCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -241,7 +241,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser( +@@ -293,7 +293,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -34329,7 +35756,7 @@ final int[] defaultJavadocTokens = {JavadocTokenTypes.JAVADOC}; final AbstractJavadocCheck check = new AbstractJavadocCheck() { -@@ -277,7 +277,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -329,7 +329,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -34338,7 +35765,7 @@ final int[] defaultJavadocTokens = { JavadocTokenTypes.JAVADOC, JavadocTokenTypes.AREA_HTML_TAG_NAME, -@@ -299,11 +299,11 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -351,11 +351,11 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } }; check.setJavadocTokens("RETURN_LITERAL"); @@ -34349,19 +35776,17 @@ @Test - public void testAcceptableTokensFail() throws Exception { + void acceptableTokensFail() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(TokenIsNotInAcceptablesJavadocCheck.class); - checkConfig.addProperty("javadocTokens", "RETURN_LITERAL"); -@@ -325,7 +325,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + final String path = getPath("InputAbstractJavadocTokensFail.java"); + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -374,13 +374,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testAcceptableTokensPass() throws Exception { + void acceptableTokensPass() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(TokenIsNotInAcceptablesJavadocCheck.class); - checkConfig.addProperty("javadocTokens", "DEPRECATED_LITERAL"); -@@ -335,7 +335,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAbstractJavadocTokensPass.java"), expected); } @Test @@ -34370,69 +35795,121 @@ final DefaultConfiguration checkConfig = createModuleConfig(RequiredTokenIsNotInDefaultsJavadocCheck.class); final String pathToEmptyFile = File.createTempFile("empty", ".java", temporaryFolder).getPath(); -@@ -357,7 +357,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -402,7 +402,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test -- public void testVisitLeaveToken() throws Exception { -+ void visitLeaveToken() throws Exception { +- public void testVisitLeaveTokenOne() throws Exception { ++ void visitLeaveTokenOne() throws Exception { JavadocVisitLeaveCheck.clearCounter(); - final DefaultConfiguration checkConfig = createModuleConfig(JavadocVisitLeaveCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -371,7 +371,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenOne.java"), expected); +@@ -415,7 +415,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitLeaveTokenTwo() throws Exception { ++ void visitLeaveTokenTwo() throws Exception { + JavadocVisitLeaveCheck.clearCounter(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenTwo.java"), expected); +@@ -428,7 +428,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitLeaveTokenThree() throws Exception { ++ void visitLeaveTokenThree() throws Exception { + JavadocVisitLeaveCheck.clearCounter(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenThree.java"), expected); +@@ -441,7 +441,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testNoWsBeforeDescriptionInJavadocTags() throws Exception { + void noWsBeforeDescriptionInJavadocTags() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = { - "17: " -@@ -424,7 +424,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + "18: " + + getCheckMessage( +@@ -491,7 +491,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testWrongSingletonTagInJavadoc() throws Exception { + void wrongSingletonTagInJavadoc() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); final String[] expected = { - "9: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "embed"), -@@ -437,7 +437,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + "10: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "embed"), + "17: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "keygen"), +@@ -504,7 +504,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test -- public void testNonTightHtmlTagIntolerantCheck() throws Exception { -+ void nonTightHtmlTagIntolerantCheck() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(NonTightHtmlTagIntolerantCheck.class); - checkConfig.addProperty("violateExecutionOnNonTightHtml", "true"); -@@ -457,7 +457,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +- public void testNonTightHtmlTagIntolerantCheckOne() throws Exception { ++ void nonTightHtmlTagIntolerantCheckOne() throws Exception { + final String[] expected = { + "12: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), + "19: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), +@@ -518,7 +518,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test -- public void testNonTightHtmlTagIntolerantCheckReportingNoViolation() throws Exception { -+ void nonTightHtmlTagIntolerantCheckReportingNoViolation() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(NonTightHtmlTagIntolerantCheck.class); +- public void testNonTightHtmlTagIntolerantCheckTwo() throws Exception { ++ void nonTightHtmlTagIntolerantCheckTwo() throws Exception { + final String[] expected = { + "12: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), + "19: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), +@@ -530,21 +530,21 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonTightHtmlTagIntolerantCheckReportingNoViolationOne() throws Exception { ++ void nonTightHtmlTagIntolerantCheckReportingNoViolationOne() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -465,7 +465,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser( + getPath("InputAbstractJavadocNonTightHtmlTagsNoViolationOne.java"), expected); } @Test -- public void testNonTightHtmlTagIntolerantCheckVisitCount() throws Exception { -+ void nonTightHtmlTagIntolerantCheckVisitCount() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(NonTightHtmlTagIntolerantCheck.class); - checkConfig.addProperty("violateExecutionOnNonTightHtml", "true"); -@@ -491,7 +491,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +- public void testNonTightHtmlTagIntolerantCheckReportingNoViolationTwo() throws Exception { ++ void nonTightHtmlTagIntolerantCheckReportingNoViolationTwo() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputAbstractJavadocNonTightHtmlTagsNoViolationTwo.java"), expected); + } + + @Test +- public void testNonTightHtmlTagIntolerantCheckVisitCountOne() throws Exception { ++ void nonTightHtmlTagIntolerantCheckVisitCountOne() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), + "20: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), +@@ -560,7 +560,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonTightHtmlTagIntolerantCheckVisitCountTwo() throws Exception { ++ void nonTightHtmlTagIntolerantCheckVisitCountTwo() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), + "20: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), +@@ -577,7 +577,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testVisitCountForCheckAcceptingJavadocWithNonTightHtml() throws Exception { + void visitCountForCheckAcceptingJavadocWithNonTightHtml() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(NonTightHtmlTagTolerantCheck.class); - checkConfig.addProperty("violateExecutionOnNonTightHtml", "true"); - checkConfig.addProperty("reportVisitJavadocToken", "true"); + final String[] expected = { + "11:4: " + getCheckMessage(NonTightHtmlTagCheck.MSG_KEY, "BODY_TAG_START"), + "12:4: " + getCheckMessage(NonTightHtmlTagCheck.MSG_KEY, "P_TAG_START"), +@@ -619,7 +619,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitCountForCheckAcceptingJavadocWithNonTightHtml3() throws Exception { ++ void visitCountForCheckAcceptingJavadocWithNonTightHtml3() throws Exception { + final String[] expected = { + "29:8: " + getCheckMessage(NonTightHtmlTagCheck.MSG_KEY, "P_TAG_START"), + "36: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -35529,54 +37006,54 @@ - public void testJavadocStyleDefaultSettingsOne() throws Exception { + void javadocStyleDefaultSettingsOne() throws Exception { final String[] expected = { - "23: " + getCheckMessage(MSG_NO_PERIOD), - "48: " + getCheckMessage(MSG_NO_PERIOD), -@@ -88,7 +88,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "24: " + getCheckMessage(MSG_NO_PERIOD), + "50: " + getCheckMessage(MSG_NO_PERIOD), +@@ -84,7 +84,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleDefaultSettingsTwo() throws Exception { + void javadocStyleDefaultSettingsTwo() throws Exception { final String[] expected = { - "61:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
// violation"), - "66: " + getCheckMessage(MSG_NO_PERIOD), -@@ -99,7 +99,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "26:39: " + getCheckMessage(MSG_EXTRA_HTML, ""), + "72:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
"), +@@ -96,7 +96,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleDefaultSettingsThree() throws Exception { + void javadocStyleDefaultSettingsThree() throws Exception { final String[] expected = { - "103:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + "109: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -108,7 +108,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -105,7 +105,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleDefaultSettingsFour() throws Exception { + void javadocStyleDefaultSettingsFour() throws Exception { final String[] expected = { - "29:33: " + getCheckMessage(MSG_UNCLOSED_HTML, " // violation"), - "40: " + getCheckMessage(MSG_NO_PERIOD), -@@ -126,7 +126,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "30:33: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "42: " + getCheckMessage(MSG_NO_PERIOD), +@@ -121,7 +121,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleFirstSentenceOne() throws Exception { + void javadocStyleFirstSentenceOne() throws Exception { final String[] expected = { - "23: " + getCheckMessage(MSG_NO_PERIOD), - "48: " + getCheckMessage(MSG_NO_PERIOD), -@@ -139,7 +139,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "24: " + getCheckMessage(MSG_NO_PERIOD), + "50: " + getCheckMessage(MSG_NO_PERIOD), +@@ -134,7 +134,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleFirstSentenceTwo() throws Exception { + void javadocStyleFirstSentenceTwo() throws Exception { final String[] expected = { - "66: " + getCheckMessage(MSG_NO_PERIOD), "99: " + getCheckMessage(MSG_NO_PERIOD), + "67: " + getCheckMessage(MSG_NO_PERIOD), "101: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -148,14 +148,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -143,14 +143,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35592,26 +37069,26 @@ + void javadocStyleFirstSentenceFour() throws Exception { final String[] expected = { "40: " + getCheckMessage(MSG_NO_PERIOD), - "50: " + getCheckMessage(MSG_NO_PERIOD), -@@ -169,7 +169,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "51: " + getCheckMessage(MSG_NO_PERIOD), +@@ -164,7 +164,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleFirstSentenceFormatOne() throws Exception { + void javadocStyleFirstSentenceFormatOne() throws Exception { final String[] expected = { - "23: " + getCheckMessage(MSG_NO_PERIOD), - "33: " + getCheckMessage(MSG_NO_PERIOD), -@@ -184,7 +184,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "24: " + getCheckMessage(MSG_NO_PERIOD), + "35: " + getCheckMessage(MSG_NO_PERIOD), +@@ -179,7 +179,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleFirstSentenceFormatTwo() throws Exception { + void javadocStyleFirstSentenceFormatTwo() throws Exception { final String[] expected = { - "66: " + getCheckMessage(MSG_NO_PERIOD), "99: " + getCheckMessage(MSG_NO_PERIOD), + "74: " + getCheckMessage(MSG_NO_PERIOD), "108: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -193,7 +193,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -188,7 +188,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35620,7 +37097,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -201,7 +201,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -196,7 +196,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35628,44 +37105,44 @@ + void javadocStyleFirstSentenceFormatFour() throws Exception { final String[] expected = { "40: " + getCheckMessage(MSG_NO_PERIOD), - "50: " + getCheckMessage(MSG_NO_PERIOD), -@@ -216,7 +216,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "51: " + getCheckMessage(MSG_NO_PERIOD), +@@ -211,7 +211,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testHtml1() throws Exception { + void html1() throws Exception { final String[] expected = { - "55:11: " - + getCheckMessage( -@@ -236,7 +236,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "59:11: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "62:7: " + getCheckMessage(MSG_EXTRA_HTML, ""), +@@ -228,7 +228,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testHtml2() throws Exception { + void html2() throws Exception { final String[] expected = { - "67:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
// violation"), + "68:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
"), }; -@@ -245,7 +245,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -237,7 +237,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testHtml3() throws Exception { + void html3() throws Exception { final String[] expected = { - "102:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + "103:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -254,7 +254,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -246,7 +246,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testHtml4() throws Exception { + void html4() throws Exception { final String[] expected = { - "28:33: " + getCheckMessage(MSG_UNCLOSED_HTML, " // violation"), - "45:11: " -@@ -266,28 +266,28 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "29:33: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "47:11: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), +@@ -256,28 +256,28 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35696,9 +37173,9 @@ - public void testScopePublic1() throws Exception { + void scopePublic1() throws Exception { final String[] expected = { - "75: " + getCheckMessage(MSG_NO_PERIOD), - "76:31: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), -@@ -297,7 +297,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "78: " + getCheckMessage(MSG_NO_PERIOD), + "79:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), +@@ -288,7 +288,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35706,79 +37183,79 @@ + void scopePublic2() throws Exception { final String[] expected = { "83: " + getCheckMessage(MSG_EMPTY), - "101: " + getCheckMessage(MSG_EMPTY), -@@ -307,7 +307,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "102: " + getCheckMessage(MSG_EMPTY), +@@ -299,7 +299,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopePublic3() throws Exception { + void scopePublic3() throws Exception { final String[] expected = { - "103:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + "104:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -315,7 +315,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -308,7 +308,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopePublic4() throws Exception { + void scopePublic4() throws Exception { final String[] expected = { - "50: " + getCheckMessage(MSG_NO_PERIOD), - "54: " + getCheckMessage(MSG_NO_PERIOD), -@@ -325,7 +325,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "51: " + getCheckMessage(MSG_NO_PERIOD), + "56: " + getCheckMessage(MSG_NO_PERIOD), +@@ -319,7 +319,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopeProtected1() throws Exception { + void scopeProtected1() throws Exception { final String[] expected = { - "65: " + getCheckMessage(MSG_NO_PERIOD), - "66:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail // violation"), -@@ -337,7 +337,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "67: " + getCheckMessage(MSG_NO_PERIOD), + "68:23: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), +@@ -332,7 +332,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopeProtected2() throws Exception { + void scopeProtected2() throws Exception { final String[] expected = { - "76: " + getCheckMessage(MSG_EMPTY), - "80: " + getCheckMessage(MSG_EMPTY), -@@ -348,7 +348,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "83: " + getCheckMessage(MSG_EMPTY), + "87: " + getCheckMessage(MSG_EMPTY), +@@ -344,7 +344,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopeProtected3() throws Exception { + void scopeProtected3() throws Exception { final String[] expected = { - "103:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + "104:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -356,7 +356,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -353,7 +353,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopeProtected4() throws Exception { + void scopeProtected4() throws Exception { final String[] expected = { - "50: " + getCheckMessage(MSG_NO_PERIOD), - "54: " + getCheckMessage(MSG_NO_PERIOD), -@@ -366,7 +366,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "51: " + getCheckMessage(MSG_NO_PERIOD), + "56: " + getCheckMessage(MSG_NO_PERIOD), +@@ -364,7 +364,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopePackage1() throws Exception { + void scopePackage1() throws Exception { final String[] expected = { - "65: " + getCheckMessage(MSG_NO_PERIOD), - "66:24: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail // violation"), -@@ -380,7 +380,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "67: " + getCheckMessage(MSG_NO_PERIOD), + "68:24: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), +@@ -379,7 +379,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopePackage2() throws Exception { + void scopePackage2() throws Exception { final String[] expected = { - "76: " + getCheckMessage(MSG_EMPTY), - "80: " + getCheckMessage(MSG_EMPTY), + "83: " + getCheckMessage(MSG_EMPTY), + "87: " + getCheckMessage(MSG_EMPTY), @@ -392,7 +392,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @@ -35786,18 +37263,18 @@ - public void testScopePackage3() throws Exception { + void scopePackage3() throws Exception { final String[] expected = { - "103:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + "104:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -400,7 +400,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -401,7 +401,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testScopePackage4() throws Exception { + void scopePackage4() throws Exception { final String[] expected = { - "50: " + getCheckMessage(MSG_NO_PERIOD), - "54: " + getCheckMessage(MSG_NO_PERIOD), -@@ -412,14 +412,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "51: " + getCheckMessage(MSG_NO_PERIOD), + "56: " + getCheckMessage(MSG_NO_PERIOD), +@@ -414,14 +414,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35814,7 +37291,7 @@ final String[] expected = { "75: " + getCheckMessage(MSG_EMPTY), "79: " + getCheckMessage(MSG_EMPTY), -@@ -432,21 +432,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -434,21 +434,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35837,8 +37314,8 @@ - public void testExcludeScope1() throws Exception { + void excludeScope1() throws Exception { final String[] expected = { - "23: " + getCheckMessage(MSG_NO_PERIOD), - "48: " + getCheckMessage(MSG_NO_PERIOD), + "24: " + getCheckMessage(MSG_NO_PERIOD), + "50: " + getCheckMessage(MSG_NO_PERIOD), @@ -465,7 +465,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @@ -35846,9 +37323,9 @@ - public void testExcludeScope2() throws Exception { + void excludeScope2() throws Exception { final String[] expected = { - "68:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
// violation"), - "73: " + getCheckMessage(MSG_NO_PERIOD), -@@ -474,14 +474,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "69:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
"), + "75: " + getCheckMessage(MSG_NO_PERIOD), +@@ -475,14 +475,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35863,8 +37340,8 @@ - public void testExcludeScope4() throws Exception { + void excludeScope4() throws Exception { final String[] expected = { - "29:33: " + getCheckMessage(MSG_UNCLOSED_HTML, " // violation"), - "40: " + getCheckMessage(MSG_NO_PERIOD), + "30:33: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), + "42: " + getCheckMessage(MSG_NO_PERIOD), @@ -495,7 +495,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @@ -35881,7 +37358,7 @@ - public void packageInfoInvalid() throws Exception { + void packageInfoInvalid() throws Exception { final String[] expected = { - "16: " + getCheckMessage(MSG_NO_PERIOD), + "17: " + getCheckMessage(MSG_NO_PERIOD), }; @@ -519,7 +519,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @@ -35934,9 +37411,9 @@ - public void testRestrictedTokenSet1() throws Exception { + void restrictedTokenSet1() throws Exception { final String[] expected = { - "73: " + getCheckMessage(MSG_NO_PERIOD), + "74: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -570,21 +570,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -571,21 +571,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35959,18 +37436,18 @@ - public void testRestrictedTokenSet4() throws Exception { + void restrictedTokenSet4() throws Exception { final String[] expected = { - "59: " + getCheckMessage(MSG_NO_PERIOD), "91: " + getCheckMessage(MSG_NO_PERIOD), + "53: " + getCheckMessage(MSG_NO_PERIOD), "86: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -592,7 +592,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -594,7 +594,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocStyleRecordsAndCompactCtors() throws Exception { + void javadocStyleRecordsAndCompactCtors() throws Exception { final String[] expected = { - "23: " + getCheckMessage(MSG_NO_PERIOD), - "43: " + getCheckMessage(MSG_NO_PERIOD), -@@ -615,7 +615,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "24: " + getCheckMessage(MSG_NO_PERIOD), + "45: " + getCheckMessage(MSG_NO_PERIOD), +@@ -614,7 +614,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35979,7 +37456,7 @@ final HtmlTag tag = new HtmlTag("id", 3, 5, true, false, ""); assertWithMessage("Invalid toString result") .that(tag.toString()) -@@ -625,14 +625,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -624,14 +624,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -35994,18 +37471,18 @@ - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { final String[] expected = { - "20: " + getCheckMessage(MSG_EMPTY), "23: " + getCheckMessage(MSG_EMPTY), + "21: " + getCheckMessage(MSG_EMPTY), "25: " + getCheckMessage(MSG_EMPTY), }; -@@ -642,7 +642,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -641,7 +641,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test - public void testEnumCtorScopeIsPrivate() throws Exception { + void enumCtorScopeIsPrivate() throws Exception { final String[] expected = { - "20: " + getCheckMessage(MSG_EMPTY), - "23: " + getCheckMessage(MSG_EMPTY), -@@ -653,7 +653,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + "21: " + getCheckMessage(MSG_EMPTY), + "25: " + getCheckMessage(MSG_EMPTY), +@@ -652,7 +652,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -36014,7 +37491,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -661,7 +661,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -660,7 +660,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -36032,7 +37509,7 @@ final String[] expected = { "16: " + getCheckMessage(MSG_NO_PERIOD), "18:16: " -@@ -681,7 +681,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -682,7 +682,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -36041,7 +37518,7 @@ final String[] expected = { "21:4: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -689,7 +689,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -691,7 +691,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -36050,7 +37527,7 @@ final String[] expected = { "11: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -697,7 +697,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -700,7 +700,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -37314,21 +38791,48 @@ } @Test -- public void testTags() throws Exception { -+ void tags() throws Exception { +- public void testTagsOne() throws Exception { ++ void tagsOne() throws Exception { final String[] expected = { "14:1: " + getCheckMessage(MSG_JAVADOC_MISSING), - "308:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "44:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -70,7 +70,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } + @Test +- public void testTagsTwo() throws Exception { ++ void tagsTwo() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -78,7 +78,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTagsThree() throws Exception { ++ void tagsThree() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -86,7 +86,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTagsFour() throws Exception { ++ void tagsFour() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -94,7 +94,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testInner() throws Exception { + void inner() throws Exception { final String[] expected = { "19:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -80,7 +80,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -104,7 +104,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37337,7 +38841,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -91,7 +91,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -115,7 +115,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37346,7 +38850,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), }; -@@ -99,7 +99,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -123,7 +123,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37355,7 +38859,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), "44:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -109,7 +109,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -133,7 +133,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37364,7 +38868,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), "35:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -121,7 +121,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -145,7 +145,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37373,7 +38877,7 @@ final String[] expected = { "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "24:9: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -132,7 +132,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -156,7 +156,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37382,16 +38886,25 @@ final String[] expected = { "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), }; -@@ -141,7 +141,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -165,7 +165,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test -- public void testScopes() throws Exception { -+ void scopes() throws Exception { +- public void testScopesOne() throws Exception { ++ void scopesOne() throws Exception { final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -158,7 +158,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -176,7 +176,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopesTwo() throws Exception { ++ void scopesTwo() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "15:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -190,7 +190,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37400,7 +38913,7 @@ final String[] expected = { "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), }; -@@ -167,7 +167,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -199,7 +199,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37409,7 +38922,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -176,7 +176,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -208,7 +208,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37418,7 +38931,7 @@ final String[] expected = { "37:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "49:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -191,14 +191,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -223,14 +223,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37435,7 +38948,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -209,7 +209,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -241,7 +241,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37444,7 +38957,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), "17:1: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -219,14 +219,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -251,14 +251,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37461,7 +38974,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -237,7 +237,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -269,7 +269,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37470,7 +38983,7 @@ final String[] expected = { "14:1: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -253,7 +253,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -285,7 +285,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37479,7 +38992,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -265,7 +265,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -297,7 +297,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37488,7 +39001,7 @@ final String[] expected = { "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -276,7 +276,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -308,7 +308,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37497,7 +39010,7 @@ final String[] expected = { "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "23:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -286,7 +286,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -318,7 +318,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37506,7 +39019,7 @@ final String[] expected = { "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -296,7 +296,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -328,7 +328,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37515,7 +39028,7 @@ final String[] expected = { "17:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "21:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -306,14 +306,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -338,14 +338,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37532,7 +39045,7 @@ final String[] expected = { "29:5: " + getCheckMessage(MSG_JAVADOC_MISSING), "38:5: " + getCheckMessage(MSG_JAVADOC_MISSING), -@@ -323,7 +323,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -355,7 +355,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -37879,16 +39392,24 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -288,7 +288,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -288,14 +288,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test - public void testSummaryJavaDoc() throws Exception { + void summaryJavaDoc() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSummaryJavadoc1.java"), expected); + } + + @Test +- public void testSummaryJavaDoc2() throws Exception { ++ void summaryJavaDoc2() throws Exception { final String[] expected = { "15: " + getCheckMessage(MSG_SUMMARY_JAVADOC), }; -@@ -297,7 +297,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -304,7 +304,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -38290,7 +39811,7 @@ - public void testExcludedPackageDirectPackages() throws Exception { + void excludedPackageDirectPackages() throws Exception { final String[] expected = { - "30:1: " + getCheckMessage(MSG_KEY, 2, 0, "[AAClass, ABClass]"), + "28:1: " + getCheckMessage(MSG_KEY, 2, 0, "[BasicHttpContext, TlsCiphers]"), }; @@ -78,7 +78,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } @@ -38299,8 +39820,8 @@ - public void testExcludedPackageCommonPackages() throws Exception { + void excludedPackageCommonPackages() throws Exception { final String[] expected = { - "28:1: " + getCheckMessage(MSG_KEY, 2, 0, "[AAClass, ABClass]"), - "32:5: " + getCheckMessage(MSG_KEY, 2, 0, "[BClass, CClass]"), + "28:1: " + getCheckMessage(MSG_KEY, 2, 0, "[BasicHttpContext, TlsCiphers]"), + "32:5: " + getCheckMessage(MSG_KEY, 2, 0, "[BasicClientTlsStrategy, CommandSupport]"), @@ -89,7 +89,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } @@ -39460,7 +40981,7 @@ final String[] expected = { "22:17: " + getCheckMessage(MSG_KEY, "public"), -@@ -129,7 +129,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -127,7 +127,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39469,7 +40990,7 @@ final RedundantModifierCheck redundantModifierCheckObj = new RedundantModifierCheck(); final int[] actual = redundantModifierCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -148,7 +148,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -146,7 +146,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39478,7 +40999,7 @@ final RedundantModifierCheck obj = new RedundantModifierCheck(); final DetailAstImpl ast = new DetailAstImpl(); ast.initialize(TokenTypes.LITERAL_NULL, "null"); -@@ -167,7 +167,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -165,7 +165,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39487,7 +41008,7 @@ final RedundantModifierCheck redundantModifierCheckObj = new RedundantModifierCheck(); final int[] actual = redundantModifierCheckObj.getRequiredTokens(); final int[] expected = CommonUtil.EMPTY_INT_ARRAY; -@@ -175,7 +175,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -173,7 +173,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39496,7 +41017,7 @@ final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY, "static"), "16:9: " + getCheckMessage(MSG_KEY, "static"), -@@ -186,7 +186,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -184,7 +184,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39505,7 +41026,7 @@ final String[] expected = { "22:20: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -195,7 +195,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -193,7 +193,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39514,7 +41035,7 @@ final String[] expected = { "38:14: " + getCheckMessage(MSG_KEY, "final"), "43:14: " + getCheckMessage(MSG_KEY, "final"), -@@ -206,7 +206,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -204,7 +204,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39523,7 +41044,7 @@ final String[] expected = { "12:33: " + getCheckMessage(MSG_KEY, "final"), "16:49: " + getCheckMessage(MSG_KEY, "final"), -@@ -219,7 +219,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -217,7 +217,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39532,7 +41053,7 @@ final String[] expected = { "15:16: " + getCheckMessage(MSG_KEY, "final"), "30:16: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -228,7 +228,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -226,7 +226,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39541,7 +41062,7 @@ final String[] expected = { "20:23: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -237,7 +237,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -235,7 +235,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39550,7 +41071,7 @@ final String[] expected = { "22:5: " + getCheckMessage(MSG_KEY, "private"), }; -@@ -246,7 +246,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -244,7 +244,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39559,7 +41080,7 @@ final String[] expected = { "13:17: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -255,7 +255,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -253,7 +253,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39568,7 +41089,7 @@ final String[] expected = { "18:19: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -263,7 +263,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -261,7 +261,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -39577,7 +41098,7 @@ final String[] expected = { "10:5: " + getCheckMessage(MSG_KEY, "public"), "11:5: " + getCheckMessage(MSG_KEY, "static"), -@@ -293,7 +293,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -291,7 +291,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -41094,13 +42615,12 @@ "23:10: " + getCheckMessage(MSG_INVALID_PATTERN, "Third_Name", DEFAULT_PATTERN), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java -@@ -24,13 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_DUPL +@@ -24,12 +24,13 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_DUPL import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_ILLEGAL_REGEXP; import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_REQUIRED_REGEXP; +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; - import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.util.List; import org.junit.jupiter.api.Test; @@ -41110,7 +42630,7 @@ @Override protected String getPackageLocation() { -@@ -38,7 +39,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -37,7 +38,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41119,7 +42639,7 @@ final RegexpCheck regexpCheck = new RegexpCheck(); assertWithMessage("RegexpCheck#getAcceptableTokens should return empty array by default") .that(regexpCheck.getAcceptableTokens()) -@@ -46,7 +47,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -45,7 +46,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41128,7 +42648,7 @@ final RegexpCheck checkObj = new RegexpCheck(); assertWithMessage("RegexpCheck#getRequiredTokens should return empty array by default") .that(checkObj.getRequiredTokens()) -@@ -54,13 +55,13 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -53,13 +54,13 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41141,10 +42661,17 @@ @Test - public void testRequiredFail() throws Exception { + void requiredFail() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); - checkConfig.addProperty("format", "This\\stext is not in the file"); final String[] expected = { -@@ -70,19 +71,19 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + "1: " + getCheckMessage(MSG_REQUIRED_REGEXP, "This\\stext is not in the file"), + }; +@@ -67,25 +68,25 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpCheckDefault.java"), expected); } @Test @@ -41167,7 +42694,7 @@ final String[] expected = { "27: " + getCheckMessage(MSG_DUPLICATE_REGEXP, "Boolean x = new Boolean"), "32: " + getCheckMessage(MSG_DUPLICATE_REGEXP, "Boolean x = new Boolean"), -@@ -91,19 +92,19 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -94,19 +95,19 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41190,7 +42717,7 @@ final String[] expected = { "15: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "^import"), "16: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "^import"), -@@ -113,7 +114,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -116,7 +117,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41199,52 +42726,52 @@ final String error = "The error limit has been exceeded, " + "the check is aborting, there may be more unreported errors."; -@@ -125,7 +126,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -128,7 +129,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test - public void testMessagePropertyGood() throws Exception { + void messagePropertyGood() throws Exception { final String[] expected = { - "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "Bad line :("), + "78: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "Bad line :("), }; -@@ -133,7 +134,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -136,7 +137,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test - public void testMessagePropertyBad() throws Exception { + void messagePropertyBad() throws Exception { final String[] expected = { - "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "System\\.(out)|(err)\\.print(ln)?\\("), + "78: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "System\\.(out)|(err)\\.print(ln)?\\("), }; -@@ -141,7 +142,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -144,7 +145,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test - public void testMessagePropertyBad2() throws Exception { + void messagePropertyBad2() throws Exception { final String[] expected = { - "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "System\\.(out)|(err)\\.print(ln)?\\("), + "78: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "System\\.(out)|(err)\\.print(ln)?\\("), }; -@@ -149,7 +150,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -152,7 +153,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test - public void testIgnoreCaseTrue() throws Exception { + void ignoreCaseTrue() throws Exception { final String[] expected = { - "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "(?i)SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), + "78: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "(?i)SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), }; -@@ -157,7 +158,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -160,7 +161,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test - public void testIgnoreCaseFalse() throws Exception { + void ignoreCaseFalse() throws Exception { final String[] expectedTrue = { - "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "(?i)SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), + "78: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "(?i)SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), }; -@@ -168,14 +169,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -171,14 +172,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41261,7 +42788,7 @@ // See if the comment is removed properly final String[] expected = { "16: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "don't\\suse trailing comments"), -@@ -184,14 +185,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -187,14 +188,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41278,7 +42805,7 @@ final String[] expected = { "31: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "c-style\\s1"), }; -@@ -199,26 +200,26 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -202,26 +203,26 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41309,7 +42836,7 @@ final String[] expected = { "34: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "int z"), }; -@@ -226,7 +227,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -229,7 +230,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41318,7 +42845,7 @@ final String[] expected = { "35: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "int y"), }; -@@ -234,21 +235,21 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -237,20 +238,20 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41332,18 +42859,17 @@ @Test - public void testOnFileStartingWithEmptyLine() throws Exception { + void onFileStartingWithEmptyLine() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verify(checkConfig, getPath("InputRegexpStartingWithEmptyLine.java"), expected); + verifyWithInlineConfigParser(getPath("InputRegexpStartingWithEmptyLine.java"), expected); } @Test - public void testIgnoreCommentsCppStyleWithIllegalPatternFalse() throws Exception { + void ignoreCommentsCppStyleWithIllegalPatternFalse() throws Exception { // See if the comment is removed properly - final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); - checkConfig.addProperty("format", "don't use trailing comments"); -@@ -261,18 +262,18 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + final String[] expected = { + "1: " + getCheckMessage(MSG_REQUIRED_REGEXP, "don't use trailing comments"), +@@ -259,18 +260,18 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -41366,7 +42892,7 @@ final String file1 = getPath("InputRegexpCheckB3.java"); final String file2 = getPath("InputRegexpCheckB4.java"); final List expectedFirstInput = List.of(CommonUtil.EMPTY_STRING_ARRAY); -@@ -281,7 +282,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { +@@ -279,7 +280,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } @Test @@ -42516,12 +44042,21 @@ } @Test -- public void testThrees() throws Exception { -+ void threes() throws Exception { +- public void testThreesOne() throws Exception { ++ void threesOne() throws Exception { final String[] expected = { - "15:1: " + getCheckMessage(MSG_PACKAGE_METHODS, 5, 3), -@@ -91,7 +91,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + "15:1: " + getCheckMessage(MSG_PACKAGE_METHODS, 4, 3), +@@ -87,7 +87,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThreesTwo() throws Exception { ++ void threesTwo() throws Exception { + + final String[] expected = { + "14:1: " + getCheckMessage(MSG_PACKAGE_METHODS, 4, 3), +@@ -103,7 +103,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42530,7 +44065,7 @@ final String[] expected = { "21:5: " + getCheckMessage(MSG_PRIVATE_METHODS, 1, 0), -@@ -102,7 +102,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -114,7 +114,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42539,7 +44074,7 @@ final String[] expected = { "15:1: " + getCheckMessage(MSG_MANY_METHODS, 5, 2), -@@ -112,7 +112,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -124,7 +124,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42548,7 +44083,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -120,7 +120,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -132,7 +132,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42557,7 +44092,7 @@ final String[] expected = { "15:1: " + getCheckMessage(MSG_MANY_METHODS, 2, 1), -@@ -130,7 +130,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -142,7 +142,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42566,7 +44101,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -138,7 +138,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -150,7 +150,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42575,7 +44110,7 @@ final String[] expected = { "22:5: " + getCheckMessage(MSG_MANY_METHODS, 2, 1), -@@ -148,7 +148,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -160,7 +160,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42584,7 +44119,7 @@ final String[] expected = { "17:5: " + getCheckMessage(MSG_PUBLIC_METHODS, 2, 1), -@@ -160,7 +160,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { +@@ -172,7 +172,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } @Test @@ -42622,16 +44157,23 @@ final MethodLengthCheck methodLengthCheckObj = new MethodLengthCheck(); final int[] actual = methodLengthCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -55,7 +55,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { +@@ -55,13 +55,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } @Test -- public void testIt() throws Exception { -+ void it() throws Exception { +- public void testItOne() throws Exception { ++ void itOne() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodLengthSimpleOne.java"), expected); + } + + @Test +- public void testItTwo() throws Exception { ++ void itTwo() throws Exception { final String[] expected = { - "76:5: " + getCheckMessage(MSG_KEY, 20, 19, "longMethod"), + "16:5: " + getCheckMessage(MSG_KEY, 20, 19, "longMethod"), }; -@@ -63,13 +63,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { +@@ -69,13 +69,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } @Test @@ -42647,7 +44189,7 @@ final String[] expected = { "34:5: " + getCheckMessage(MSG_KEY, 8, 7, "visit"), }; -@@ -77,7 +77,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { +@@ -83,7 +83,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } @Test @@ -42656,14 +44198,21 @@ final int max = 2; final String[] expected = { "24:5: " + getCheckMessage(MSG_KEY, 3, max, "AA"), -@@ -90,13 +90,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { +@@ -96,19 +96,19 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } @Test -- public void testAbstract() throws Exception { -+ void testAbstract() throws Exception { +- public void testAbstractOne() throws Exception { ++ void abstractOne() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("InputMethodLengthModifier.java"), expected); + verifyWithInlineConfigParser(getPath("InputMethodLengthModifierOne.java"), expected); + } + + @Test +- public void testAbstractTwo() throws Exception { ++ void abstractTwo() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodLengthModifierTwo.java"), expected); } @Test @@ -42672,7 +44221,7 @@ final int max = 2; final String[] expected = { -@@ -111,7 +111,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { +@@ -123,7 +123,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } @Test @@ -42681,7 +44230,7 @@ final int max = 2; -@@ -128,7 +128,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { +@@ -140,7 +140,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } @Test @@ -46405,7 +47954,7 @@ new AuditEvent( --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java -@@ -42,7 +42,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; +@@ -51,7 +51,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; @@ -46414,7 +47963,7 @@ private static final String[] ALL_MESSAGES = { "45:17: " -@@ -87,7 +87,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -96,7 +96,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46423,7 +47972,7 @@ final String[] messages = { "35:17: " + getCheckMessage( -@@ -139,7 +139,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -148,7 +148,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { // Suppress all checks between default comments @Test @@ -46432,7 +47981,7 @@ final String[] suppressed = { "48:17: " + getCheckMessage( -@@ -155,7 +155,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -164,7 +164,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46441,7 +47990,7 @@ final String[] suppressed = { "75:17: " + getCheckMessage( -@@ -167,7 +167,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -176,7 +176,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46450,7 +47999,7 @@ final String[] suppressed = { "48:17: " + getCheckMessage( -@@ -179,7 +179,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -188,7 +188,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { // Suppress all checks between CS_OFF and CS_ON @Test @@ -46459,7 +48008,7 @@ final String[] suppressed = { "64:17: " + getCheckMessage( -@@ -200,7 +200,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -209,7 +209,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { // Test suppression of checks of only one type // Suppress only ConstantNameCheck between CS_OFF and CS_ON @Test @@ -46468,7 +48017,7 @@ final String[] suppressed = { "71:30: " + getCheckMessage( -@@ -210,7 +210,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -219,7 +219,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46477,7 +48026,7 @@ final String[] suppressed = { "110:11: " + getCheckMessage(IllegalCatchCheck.class, IllegalCatchCheck.MSG_KEY, "Exception"), }; -@@ -218,7 +218,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -227,7 +227,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46486,7 +48035,7 @@ final String[] suppressed = { "54:17: " + getCheckMessage( -@@ -234,7 +234,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -243,7 +243,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46495,7 +48044,7 @@ final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser("InputSuppressionCommentFilter9.java", suppressed); } -@@ -250,7 +250,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -259,7 +259,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46504,7 +48053,7 @@ final Object tag = getTagsAfterExecutionOnDefaultFilter("//CHECKSTYLE:OFF").get(0); final EqualsVerifierReport ev = EqualsVerifier.forClass(tag.getClass()).usingGetClass().report(); -@@ -258,7 +258,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -267,7 +267,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46513,7 +48062,7 @@ final Object tag = getTagsAfterExecutionOnDefaultFilter("//CHECKSTYLE:OFF").get(0); assertWithMessage("Invalid toString result") .that(tag.toString()) -@@ -268,7 +268,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -277,7 +277,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46522,7 +48071,7 @@ final SuppressionCommentFilter filter = new SuppressionCommentFilter(); filter.setMessageFormat(".*"); final Object tag = getTagsAfterExecution(filter, "filename", "//CHECKSTYLE:ON").get(0); -@@ -280,7 +280,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -289,7 +289,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46531,7 +48080,7 @@ final List> tags1 = getTagsAfterExecutionOnDefaultFilter("//CHECKSTYLE:OFF", " //CHECKSTYLE:ON"); final Comparable tag1 = tags1.get(0); -@@ -302,7 +302,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -311,7 +311,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46540,7 +48089,7 @@ final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); filterConfig.addProperty("checkFormat", "e[l"); -@@ -323,7 +323,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -332,7 +332,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46549,7 +48098,7 @@ final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); filterConfig.addProperty("messageFormat", "e[l"); -@@ -344,7 +344,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -353,7 +353,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46558,7 +48107,7 @@ final SuppressionCommentFilter filter = new SuppressionCommentFilter(); final FileContents contents = new FileContents( -@@ -358,7 +358,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -367,7 +367,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46567,7 +48116,7 @@ final SuppressionCommentFilter filter = new SuppressionCommentFilter(); final FileContents contents = null; final TreeWalkerAuditEvent auditEvent = -@@ -368,7 +368,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -377,7 +377,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46576,7 +48125,7 @@ final String[] suppressedViolation = { "42:17: " + getCheckMessage( -@@ -405,7 +405,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -414,7 +414,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46585,7 +48134,7 @@ final String[] suppressedViolation = { "42:17: " + getCheckMessage( -@@ -442,7 +442,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -451,7 +451,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46594,7 +48143,7 @@ final String[] suppressedViolation = { "42:17: " + getCheckMessage( -@@ -479,7 +479,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -488,7 +488,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46603,7 +48152,7 @@ final String[] suppressedViolation = { "54:17: " + getCheckMessage( -@@ -513,7 +513,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -522,7 +522,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46612,7 +48161,7 @@ final String[] suppressedViolation = { "54:17: " + getCheckMessage( -@@ -547,7 +547,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -556,7 +556,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46621,7 +48170,7 @@ final SuppressionCommentFilter suppressionCommentFilter = new SuppressionCommentFilter(); final FileContents contents = new FileContents( -@@ -566,7 +566,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +@@ -575,7 +575,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } @Test @@ -46630,6 +48179,15 @@ final SuppressionCommentFilter suppressionCommentFilter = new SuppressionCommentFilter(); final List tags1 = getTagsAfterExecution(suppressionCommentFilter, "filename1", "//CHECKSTYLE:OFF", "line2"); +@@ -615,7 +615,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCachingByFileContentsInstance() throws Exception { ++ void cachingByFileContentsInstance() throws Exception { + + final File file = new File(getPath("InputSuppressionCommentFilterSuppressById6.java")); + final DetailAST rootAst = JavaParser.parseFile(file, JavaParser.Options.WITH_COMMENTS); --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java @@ -39,7 +39,7 @@ import java.net.URL; @@ -47022,7 +48580,7 @@ + getCheckMessage(ConstantNameCheck.class, MSG_INVALID_PATTERN, "bad_name", PATTERN), --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterTest.java -@@ -39,7 +39,7 @@ import java.nio.charset.StandardCharsets; +@@ -41,7 +41,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.junit.jupiter.api.Test; @@ -47031,7 +48589,7 @@ @Override protected String getPackageLocation() { -@@ -47,7 +47,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -49,7 +49,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47040,7 +48598,7 @@ final String[] expected = { "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -63,7 +63,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -65,7 +65,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47049,7 +48607,7 @@ final String[] expected = { "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -77,7 +77,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -79,7 +79,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47058,7 +48616,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), "21:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), -@@ -94,7 +94,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -96,7 +96,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47067,7 +48625,7 @@ final String[] expected = { "23:11: " + getCheckMessage( -@@ -112,7 +112,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -114,7 +114,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47076,7 +48634,7 @@ final String[] expected = { "27:21: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "3.14"), "28:16: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "123"), -@@ -128,7 +128,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -130,7 +130,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47085,7 +48643,7 @@ final String xpath = "1@#"; try { final Object test = -@@ -143,7 +143,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -145,7 +145,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47094,7 +48652,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -159,7 +159,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -161,7 +161,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47103,7 +48661,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -173,7 +173,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -175,7 +175,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47112,7 +48670,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -187,7 +187,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -189,7 +189,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47121,7 +48679,7 @@ final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); try { filter.setFiles("e[l"); -@@ -200,7 +200,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -202,7 +202,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47130,7 +48688,7 @@ final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); try { filter.setChecks("e[l"); -@@ -213,7 +213,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -215,7 +215,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47139,7 +48697,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; -@@ -224,7 +224,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -226,7 +226,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47148,7 +48706,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -238,7 +238,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -240,7 +240,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47157,7 +48715,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -254,7 +254,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -256,7 +256,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47166,7 +48724,7 @@ final String[] expected = { "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -268,7 +268,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -270,7 +270,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47175,7 +48733,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -281,7 +281,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -283,7 +283,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47184,7 +48742,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -294,7 +294,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -296,7 +296,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47193,7 +48751,7 @@ final String[] expected = { "28:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), "30:21: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "3.14"), -@@ -313,7 +313,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -315,7 +315,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47202,7 +48760,7 @@ final String xpath = "//CLASS_DEF[@text='InputSuppressionXpathSingleFilterComplexQuery']"; final SuppressionXpathSingleFilter filter = createSuppressionXpathSingleFilter( -@@ -339,7 +339,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -341,7 +341,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47211,7 +48769,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -353,7 +353,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -355,7 +355,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47220,7 +48778,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -369,7 +369,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -371,7 +371,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47229,7 +48787,7 @@ final String[] expected = { "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -385,7 +385,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -387,7 +387,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47238,7 +48796,7 @@ final String[] expected = { "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; -@@ -401,7 +401,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport +@@ -403,7 +403,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } @Test @@ -47247,6 +48805,15 @@ final String[] expected = { "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), }; +@@ -427,7 +427,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + * @throws Exception when there is problem to load Input file + */ + @Test +- public void testUpdateFilterSettingsInRunTime() throws Exception { ++ void updateFilterSettingsInRunTime() throws Exception { + final File file = new File(getPath("InputSuppressionXpathSingleFilterComplexQuery.java")); + + final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; @@ -48028,13 +49595,12 @@ getNonCompilablePath("InputSemicolonBetweenImports.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java -@@ -19,16 +19,16 @@ - +@@ -20,15 +20,15 @@ package com.puppycrawl.tools.checkstyle.grammar; -+import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.Collections.lastIndexOfSubList; ++import static java.util.stream.Collectors.toUnmodifiableList; import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageLexer; import java.lang.reflect.Field; @@ -48065,7 +49631,7 @@ final String message = "A token's number has changed. Please open" + " 'GeneratedJavaTokenTypesTest' and confirm which token is at fault.\n" -@@ -298,11 +298,11 @@ public class GeneratedJavaTokenTypesTest { +@@ -305,13 +305,11 @@ public class GeneratedJavaTokenTypesTest { * unused tokens and cause Collections#lastIndexOfSubList to return a -1 and fail the test. */ @Test @@ -48074,12 +49640,14 @@ final VocabularyImpl vocabulary = (VocabularyImpl) JavaLanguageLexer.VOCABULARY; final String[] nullableSymbolicNames = vocabulary.getSymbolicNames(); final List allTokenNames = -- Arrays.stream(nullableSymbolicNames).filter(Objects::nonNull).collect(Collectors.toList()); -+ Arrays.stream(nullableSymbolicNames).filter(Objects::nonNull).collect(toImmutableList()); +- Arrays.stream(nullableSymbolicNames) +- .filter(Objects::nonNull) +- .collect(Collectors.toUnmodifiableList()); ++ Arrays.stream(nullableSymbolicNames).filter(Objects::nonNull).collect(toUnmodifiableList()); // Since the following tokens are not declared in the 'tokens' block, // they will always appear last in the list of symbolic names provided -@@ -326,7 +326,7 @@ public class GeneratedJavaTokenTypesTest { +@@ -335,7 +333,7 @@ public class GeneratedJavaTokenTypesTest { // Get the starting index of the sublist of tokens, or -1 if sublist // is not present. @@ -48802,10 +50370,10 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -@@ -28,13 +29,12 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -27,13 +28,12 @@ import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; -import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.LinkedHashSet; @@ -48817,7 +50385,7 @@ private static final Set ALL_COMMENTS = new LinkedHashSet<>(); -@@ -46,10 +46,10 @@ public class AllBlockCommentsTest extends AbstractModuleTestSupport { +@@ -45,10 +45,10 @@ public class AllBlockCommentsTest extends AbstractModuleTestSupport { } @Test @@ -48827,9 +50395,9 @@ final String path = getPath("InputFullOfBlockComments.java"); - lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); + lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verify(checkConfig, path, expected); + execute(checkConfig, path); assertWithMessage("All comments should be empty").that(ALL_COMMENTS).isEmpty(); + } --- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllSinglelineCommentsTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllSinglelineCommentsTest.java @@ -20,6 +20,7 @@ @@ -49060,6 +50628,35 @@ verifyAst( getNonCompilablePath("ExpectedJava20RecordDecompositionEnhancedForLoopTricky.txt"), getNonCompilablePath("InputJava20RecordDecompositionEnhancedForLoopTricky.java")); +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java21/Java21AstRegressionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java21/Java21AstRegressionTest.java +@@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.java21; + import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; + import org.junit.jupiter.api.Test; + +-public class Java21AstRegressionTest extends AbstractTreeTestSupport { ++final class Java21AstRegressionTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -30,7 +30,7 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testBasicStringTemplate() throws Exception { ++ void basicStringTemplate() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedStringTemplateBasic.txt"), + getNonCompilablePath("InputStringTemplateBasic.java")); +@@ -42,7 +42,7 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { + * vs. four spaces. + */ + @Test +- public void testBasicStringTemplateWithTabs() throws Exception { ++ void basicStringTemplateWithTabs() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedStringTemplateBasicWithTabs.txt"), + getNonCompilablePath("InputStringTemplateBasicWithTabs.java")); --- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationTest.java @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -50137,17 +51734,15 @@ final File nonCompilableFile = new File(getNonCompilablePath(FILE_NAME_NON_COMPILABLE)); try { -@@ -196,8 +196,8 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { +@@ -196,7 +196,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } @Test - public void testShouldAcceptDirectory() { -- final File directory = mock(File.class); + void shouldAcceptDirectory() { -+ final File directory = mock(); + final File directory = mock(); when(directory.isDirectory()).thenReturn(true); assertWithMessage("MainFrame should accept directory") - .that(MainFrameModel.shouldAcceptFile(directory)) @@ -205,7 +205,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } @@ -50157,17 +51752,15 @@ final File javaFile = new File(getPath(FILE_NAME_TEST_DATA)); assertWithMessage("MainFrame should accept java file") .that(MainFrameModel.shouldAcceptFile(javaFile)) -@@ -213,8 +213,8 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { +@@ -213,7 +213,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } @Test - public void testShouldNotAcceptNonJavaFile() { -- final File nonJavaFile = mock(File.class); + void shouldNotAcceptNonJavaFile() { -+ final File nonJavaFile = mock(); + final File nonJavaFile = mock(); when(nonJavaFile.isDirectory()).thenReturn(false); when(nonJavaFile.getName()).thenReturn(FILE_NAME_NON_JAVA); - assertWithMessage("MainFrame should not accept non-Java file") @@ -223,7 +223,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } @@ -50177,18 +51770,15 @@ final File nonExistentFile = new File(getPath(FILE_NAME_NON_EXISTENT)); assertWithMessage("MainFrame should not accept non-existent file") .that(MainFrameModel.shouldAcceptFile(nonExistentFile)) -@@ -231,9 +231,9 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { +@@ -231,7 +231,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } @Test - public void testOpenFileForUnknownParseMode() throws IOException { + void openFileForUnknownParseMode() throws IOException { final File javaFile = new File(getPath(FILE_NAME_TEST_DATA)); -- final ParseMode mock = mock(ParseMode.class); -+ final ParseMode mock = mock(); + final ParseMode mock = mock(); model.setParseMode(mock); - final IllegalArgumentException ex = - assertThrows( --- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameTest.java @@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test; @@ -50731,14 +52321,14 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java -@@ -19,6 +19,7 @@ - +@@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.internal; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableSet; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -53,11 +54,10 @@ import java.util.Map.Entry; import java.util.Properties; import java.util.Set; @@ -50756,23 +52346,23 @@ Stream.of( // we use GenericWhitespace for this behavior "GENERIC_START", "GENERIC_END") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "AbbreviationAsWordInName", Stream.of( // enum values should be uppercase, we use EnumValueNameCheck instead "ENUM_CONSTANT_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "FinalLocalVariable", Stream.of( // we prefer all parameters be effectively final as to not damage readability // we use ParameterAssignmentCheck to enforce this "PARAMETER_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); // we have no need to block these specific tokens CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "IllegalToken", @@ -50780,182 +52370,182 @@ "TEXT_BLOCK_LITERAL_END", "LITERAL_YIELD", "SWITCH_RULE") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); // we have no need to block specific token text CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "IllegalTokenText", -@@ -294,7 +294,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { - "STRING_LITERAL", +@@ -295,7 +295,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "CHAR_LITERAL", - "TEXT_BLOCK_CONTENT") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); + "TEXT_BLOCK_CONTENT", + "STRING_TEMPLATE_CONTENT") +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); // we do not use this check as it is deprecated CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "WriteTag", -@@ -305,7 +305,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -306,7 +306,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "ANNOTATION_FIELD_DEF", "RECORD_DEF", "COMPACT_CTOR_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); // state of the configuration when test was made until reason found in // https://github.com/checkstyle/checkstyle/issues/3730 CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( -@@ -319,7 +319,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -320,7 +320,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "VARIABLE_DEF", "RECORD_DEF", "COMPACT_CTOR_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoLineWrap", Stream.of( -@@ -334,33 +334,33 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -335,33 +335,33 @@ public class AllChecksTest extends AbstractModuleTestSupport { "ENUM_DEF", "INTERFACE_DEF", "RECORD_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoWhitespaceAfter", Stream.of( // whitespace after is preferred "TYPECAST", "LITERAL_SYNCHRONIZED") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "SeparatorWrap", Stream.of( // needs context to decide what type of parentheses should be separated or not // which this check does not provide "LPAREN", "RPAREN") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NeedBraces", Stream.of( // we prefer no braces here as it looks unusual even though they help avoid sharing // scope of variables "LITERAL_DEFAULT", "LITERAL_CASE") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "FinalParameters", Stream.of( // we prefer these to be effectively final as to not damage readability "FOR_EACH_CLAUSE", "LITERAL_CATCH") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "WhitespaceAround", Stream.of( -@@ -371,7 +371,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -372,7 +372,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "WILDCARD_TYPE", "GENERIC_END", "GENERIC_START") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); // google GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( -@@ -380,13 +380,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -381,13 +381,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { // state of the configuration when test was made until reason found in // https://github.com/checkstyle/checkstyle/issues/3730 "ANNOTATION_DEF", "ANNOTATION_FIELD_DEF", "ENUM_CONSTANT_DEF", "PACKAGE_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "AbbreviationAsWordInName", Stream.of( // enum values should be uppercase "ENUM_CONSTANT_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoLineWrap", Stream.of( -@@ -399,7 +399,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -400,7 +400,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "INTERFACE_DEF", "RECORD_DEF", "COMPACT_CTOR_DEF") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "SeparatorWrap", Stream.of( -@@ -416,13 +416,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -417,13 +417,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { // which this check does not provide "LPAREN", "RPAREN") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NeedBraces", Stream.of( // google doesn't require or prevent braces on these "LAMBDA", "LITERAL_DEFAULT", "LITERAL_CASE") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "EmptyBlock", Stream.of( -@@ -441,7 +441,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -442,7 +442,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "LITERAL_SYNCHRONIZED", "LITERAL_WHILE", "STATIC_INIT") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "WhitespaceAround", Stream.of( -@@ -453,7 +453,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -454,7 +454,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "GENERIC_START", "GENERIC_END", "WILDCARD_TYPE") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "IllegalTokenText", Stream.of( -@@ -467,7 +467,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { - "STRING_LITERAL", +@@ -469,7 +469,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "CHAR_LITERAL", - "TEXT_BLOCK_CONTENT") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); + "TEXT_BLOCK_CONTENT", + "STRING_TEMPLATE_CONTENT") +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "OperatorWrap", Stream.of( -@@ -488,7 +488,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -490,7 +490,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { // COLON token ignored in check config, explained in // https://github.com/checkstyle/checkstyle/issues/4122 "COLON") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoWhitespaceBefore", Stream.of( -@@ -498,7 +498,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -500,7 +500,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { // whitespace is necessary between a type annotation and ellipsis // according '4.6.2 Horizontal whitespace point 9' "ELLIPSIS") -- .collect(Collectors.toSet())); -+ .collect(toImmutableSet())); +- .collect(Collectors.toUnmodifiableSet())); ++ .collect(toUnmodifiableSet())); INTERNAL_MODULES = Definitions.INTERNAL_MODULES.stream() .map( -@@ -506,7 +506,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -508,7 +508,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { final String[] packageTokens = moduleName.split("\\."); return packageTokens[packageTokens.length - 1]; }) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } @Override -@@ -515,7 +515,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -517,7 +517,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -50964,7 +52554,7 @@ final String inputFilePath = getPath("InputAllChecksDefaultConfig.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -535,7 +535,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -537,7 +537,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -50973,7 +52563,7 @@ for (Class check : CheckUtil.getCheckstyleChecks()) { if (AbstractCheck.class.isAssignableFrom(check)) { final AbstractCheck testedCheck = -@@ -552,7 +552,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -554,7 +554,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -50982,7 +52572,7 @@ for (Class check : CheckUtil.getCheckstyleChecks()) { if (AbstractCheck.class.isAssignableFrom(check)) { final AbstractCheck testedCheck = -@@ -569,7 +569,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -571,7 +571,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -50991,7 +52581,7 @@ for (Class check : CheckUtil.getCheckstyleChecks()) { if (AbstractCheck.class.isAssignableFrom(check)) { final AbstractCheck testedCheck = -@@ -586,7 +586,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -588,7 +588,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51000,7 +52590,7 @@ for (Class module : CheckUtil.getCheckstyleModules()) { if (ModuleReflectionUtil.isRootModule(module) || ModuleReflectionUtil.isFilterModule(module) -@@ -606,7 +606,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -608,7 +608,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51009,7 +52599,7 @@ final Set modulesReferencedInConfig = CheckUtil.getConfigCheckStyleModules(); final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); -@@ -623,7 +623,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -625,7 +625,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51018,7 +52608,7 @@ final Configuration configuration = ConfigurationUtil.loadConfiguration("config/checkstyle-checks.xml"); -@@ -632,7 +632,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -634,7 +634,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51027,7 +52617,7 @@ final Configuration configuration = ConfigurationUtil.loadConfiguration("src/main/resources/google_checks.xml"); -@@ -730,7 +730,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -732,7 +732,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51036,7 +52626,7 @@ final Set checkstyleModulesNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); final Set modulesNamesWhichHaveXdocs = XdocUtil.getModulesNamesWhichHaveXdoc(); -@@ -752,7 +752,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -754,7 +754,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51045,7 +52635,7 @@ final Set configChecks = CheckUtil.getConfigCheckStyleModules(); final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); moduleNames.removeAll(INTERNAL_MODULES); -@@ -764,7 +764,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -766,7 +766,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51054,7 +52644,7 @@ for (Class module : CheckUtil.getCheckstyleChecks()) { final String name = module.getSimpleName(); final Set messages = CheckUtil.getCheckMessages(module, false); -@@ -783,7 +783,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -785,7 +785,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -51087,38 +52677,18 @@ final Map> allTests = new HashMap<>(); walk( ---- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitCyclesCheckTest.java -+++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitCyclesCheckTest.java -@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Disabled; - import org.junit.jupiter.api.Test; - - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13544") --public class ArchUnitCyclesCheckTest { -+final class ArchUnitCyclesCheckTest { - - /** - * This test checks that The frozen violations are present in {@code config/archunit-store} directory. - */ - @Test -- public void testSlicesShouldBeFreeOfCycles() { -+ void slicesShouldBeFreeOfCycles() { - final JavaClasses importedClasses = - new ClassFileImporter() - .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java -@@ -43,7 +43,7 @@ import org.junit.jupiter.api.Disabled; +@@ -41,7 +41,7 @@ import java.util.Optional; + import java.util.Set; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13544") -public class ArchUnitSuperClassTest { +final class ArchUnitSuperClassTest { /** * Classes not abiding to {@link #testChecksShouldHaveAllowedAbstractClassAsSuperclass()} rule. -@@ -92,7 +92,7 @@ public class ArchUnitSuperClassTest { +@@ -90,7 +90,7 @@ public class ArchUnitSuperClassTest { * AbstractJavadocCheck} as their super class. */ @Test @@ -51127,7 +52697,7 @@ final JavaClasses checksPackage = new ClassFileImporter() .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) -@@ -136,7 +136,7 @@ public class ArchUnitSuperClassTest { +@@ -134,7 +134,7 @@ public class ArchUnitSuperClassTest { public void check(JavaClass item, ConditionEvents events) { final Optional superclassOptional = item.getSuperclass(); if (superclassOptional.isPresent()) { @@ -51138,16 +52708,16 @@ final String message = --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitTest.java -@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Disabled; +@@ -32,7 +32,7 @@ import com.tngtech.archunit.lang.EvaluationResult; + import java.util.List; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13544") -public class ArchUnitTest { +final class ArchUnitTest { /** * Suppression list containing violations from {@code classShouldNotDependOnUtilPackages} -@@ -88,7 +88,7 @@ public class ArchUnitTest { +@@ -92,7 +92,7 @@ public class ArchUnitTest { * we need to make checkstyle's Check on this. */ @Test @@ -51156,7 +52726,7 @@ // This list contains methods which have been overridden and are set to ignore in this test. final String[] methodsWithOverrideAnnotation = { "processFiltered", -@@ -125,7 +125,7 @@ public class ArchUnitTest { +@@ -129,7 +129,7 @@ public class ArchUnitTest { * Therefore classes in api should not depend on them. */ @Test @@ -51167,14 +52737,14 @@ .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java -@@ -19,6 +19,7 @@ - +@@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.internal; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableSet; import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; + import java.nio.file.Files; @@ -32,7 +33,6 @@ import java.util.Map; import java.util.Set; import java.util.regex.Matcher; @@ -51209,14 +52779,14 @@ final Set shortParamsMain = commandLine.getCommandSpec().options().stream() .map(OptionSpec::shortestName) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); final Set longParamsMain = commandLine.getCommandSpec().options().stream() .map(OptionSpec::longestName) .filter(names -> names.length() != 2) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); assertWithMessage("Short parameters in Main.java and cmdline" + ".xml.vm should match") .that(shortParamsMain) @@ -51224,20 +52794,19 @@ result = XmlUtil.getChildrenElements(node).stream() .map(Node::getTextContent) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } return result; } --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java -@@ -19,17 +19,18 @@ - +@@ -20,16 +20,17 @@ package com.puppycrawl.tools.checkstyle.internal; -+import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.Collections.emptyIterator; ++import static java.util.stream.Collectors.toUnmodifiableList; +import com.google.common.collect.ImmutableList; import java.io.IOException; @@ -51331,8 +52900,8 @@ Spliterators.spliteratorUnknownSize(previousCommitsIterator, Spliterator.ORDERED); return StreamSupport.stream(spliterator, false) .limit(PREVIOUS_COMMITS_TO_CHECK_COUNT) -- .collect(Collectors.toList()); -+ .collect(toImmutableList()); +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); } private static List getCommitsByLastCommitAuthor( @@ -51349,16 +52918,18 @@ private RevCommitsPair(Iterator first, Iterator second) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java -@@ -26,6 +26,8 @@ import static com.tngtech.archunit.lang.conditions.ArchPredicates.have; +@@ -25,7 +25,10 @@ import static com.tngtech.archunit.lang.conditions.ArchPredicates.are; + import static com.tngtech.archunit.lang.conditions.ArchPredicates.have; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.fields; ++import static java.util.function.Function.identity; ++import static java.util.stream.Collectors.toUnmodifiableMap; +import com.google.common.collect.ImmutableSet; -+import com.google.common.collect.Maps; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.GlobalStatefulCheck; import com.puppycrawl.tools.checkstyle.StatelessCheck; -@@ -51,11 +53,9 @@ import java.util.List; +@@ -51,11 +54,9 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -51371,7 +52942,7 @@ /** Immutable types canonical names. */ private static final Set IMMUTABLE_TYPES = -@@ -99,7 +99,7 @@ public class ImmutabilityTest { +@@ -99,7 +100,7 @@ public class ImmutabilityTest { /** List of fields not following {@link #testUtilClassesImmutability()} rule. */ private static final Set SUPPRESSED_FIELDS_IN_UTIL_CLASSES = @@ -51380,7 +52951,7 @@ "com.puppycrawl.tools.checkstyle.utils.TokenUtil.TOKEN_IDS", "com.puppycrawl.tools.checkstyle.utils.XpathUtil.TOKEN_TYPES_WITH_TEXT_ATTRIBUTE"); -@@ -164,7 +164,7 @@ public class ImmutabilityTest { +@@ -164,7 +165,7 @@ public class ImmutabilityTest { /** List of classes not following {@link #testClassesWithMutableFieldsShouldBeStateful()} rule. */ private static final Set SUPPRESSED_CLASSES_FOR_STATEFUL_CHECK_RULE = @@ -51389,15 +52960,14 @@ private static final JavaClasses CHECKSTYLE_CHECKS = new ClassFileImporter() -@@ -190,12 +190,13 @@ public class ImmutabilityTest { - +@@ -191,13 +192,11 @@ public class ImmutabilityTest { /** Map of module full name to module details. */ private static final Map MODULE_DETAILS_MAP = -- XmlMetaReader.readAllModulesIncludingThirdPartyIfAny().stream() -- .collect(Collectors.toMap(ModuleDetails::getFullQualifiedName, Function.identity())); -+ Maps.uniqueIndex( -+ XmlMetaReader.readAllModulesIncludingThirdPartyIfAny(), -+ ModuleDetails::getFullQualifiedName); + XmlMetaReader.readAllModulesIncludingThirdPartyIfAny().stream() +- .collect( +- Collectors.toUnmodifiableMap( +- ModuleDetails::getFullQualifiedName, Function.identity())); ++ .collect(toUnmodifiableMap(ModuleDetails::getFullQualifiedName, identity())); /** Test to ensure that fields in util classes are immutable. */ @Test @@ -51406,7 +52976,7 @@ final JavaClasses utilClasses = new ClassFileImporter() .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) -@@ -223,7 +224,7 @@ public class ImmutabilityTest { +@@ -225,7 +224,7 @@ public class ImmutabilityTest { /** Test to ensure modules annotated with {@link StatelessCheck} contain immutable fields. */ @Test @@ -51415,7 +52985,7 @@ final DescribedPredicate moduleProperties = new ModulePropertyPredicate(); final ArchCondition beSuppressedField = -@@ -245,7 +246,7 @@ public class ImmutabilityTest { +@@ -247,7 +246,7 @@ public class ImmutabilityTest { /** Test to ensure classes with immutable fields are annotated with {@link StatelessCheck}. */ @Test @@ -51424,7 +52994,7 @@ final ArchCondition beSuppressedClass = new SuppressionArchCondition<>( SUPPRESSED_CLASSES_FOR_STATELESS_CHECK_RULE, "be suppressed"); -@@ -267,7 +268,7 @@ public class ImmutabilityTest { +@@ -269,7 +268,7 @@ public class ImmutabilityTest { * {@link GlobalStatefulCheck}. */ @Test @@ -51433,7 +53003,7 @@ final ArchCondition beSuppressedClass = new SuppressionArchCondition<>(SUPPRESSED_CLASSES_FOR_STATEFUL_CHECK_RULE, "be suppressed"); -@@ -350,7 +351,7 @@ public class ImmutabilityTest { +@@ -352,7 +351,7 @@ public class ImmutabilityTest { "Field <%s> should %s in %s", item.getFullName(), getDescription(), @@ -51444,33 +53014,7 @@ } --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java -@@ -20,8 +20,10 @@ - package com.puppycrawl.tools.checkstyle.internal; - - import static com.google.common.truth.Truth.assertWithMessage; -+import static java.util.Collections.unmodifiableSet; - - import com.google.common.collect.ImmutableMap; -+import com.google.common.collect.ImmutableSet; - import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; - import com.puppycrawl.tools.checkstyle.Checker; - import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -@@ -55,14 +57,11 @@ import java.nio.file.Files; - import java.nio.file.Path; - import java.nio.file.Paths; - import java.util.ArrayList; --import java.util.Arrays; --import java.util.Collections; - import java.util.HashMap; - import java.util.List; - import java.util.Map; - import java.util.Set; - import java.util.regex.Pattern; --import java.util.stream.Collectors; - import javax.xml.parsers.ParserConfigurationException; - import org.junit.jupiter.api.BeforeEach; - import org.junit.jupiter.api.Test; -@@ -71,7 +70,7 @@ import org.w3c.dom.NamedNodeMap; +@@ -68,7 +68,7 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -51479,33 +53023,7 @@ private static final Map> FULLY_QUALIFIED_CLASS_NAMES = ImmutableMap.>builder() .put("int", int.class) -@@ -103,16 +102,15 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { - .build(); - - private static final Set NON_BASE_TOKEN_PROPERTIES = -- Collections.unmodifiableSet( -- Arrays.stream( -- new String[] { -- "AtclauseOrder - target", -- "DescendantToken - limitedTokens", -- "IllegalType - memberModifiers", -- "MagicNumber - constantWaiverParentToken", -- "MultipleStringLiterals - ignoreOccurrenceContext", -- }) -- .collect(Collectors.toSet())); -+ unmodifiableSet( -+ ImmutableSet.copyOf( -+ new String[] { -+ "AtclauseOrder - target", -+ "DescendantToken - limitedTokens", -+ "IllegalType - memberModifiers", -+ "MagicNumber - constantWaiverParentToken", -+ "MultipleStringLiterals - ignoreOccurrenceContext", -+ })); - - private static final List> CHECK_PROPERTIES = new ArrayList<>(); - private static final Map CHECK_PROPERTY_DOC = new HashMap<>(); -@@ -130,7 +128,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { +@@ -115,7 +115,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { } @BeforeEach @@ -51514,7 +53032,7 @@ final DefaultConfiguration checkConfig = new DefaultConfiguration(JavaDocCapture.class.getName()); checker = createChecker(checkConfig); -@@ -144,7 +142,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { +@@ -129,7 +129,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { * method */ @Test @@ -51551,16 +53069,14 @@ final String fileName = file.getName(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java -@@ -19,8 +19,12 @@ +@@ -21,6 +21,10 @@ package com.puppycrawl.tools.checkstyle.internal; - package com.puppycrawl.tools.checkstyle.internal; - -+import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertWithMessage; import static java.lang.Integer.parseInt; +import static java.util.Collections.unmodifiableSet; +import static java.util.regex.Pattern.DOTALL; +import static java.util.stream.Collectors.joining; ++import static java.util.stream.Collectors.toUnmodifiableSet; import com.puppycrawl.tools.checkstyle.Checker; import com.puppycrawl.tools.checkstyle.ConfigurationLoader; @@ -51687,7 +53203,7 @@ final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); final Path path = Paths.get(XdocUtil.DIRECTORY_PATH + "/config.xml"); -@@ -1370,7 +1372,7 @@ public class XdocsPagesTest { +@@ -1364,7 +1366,7 @@ public class XdocsPagesTest { final Object[] array = (Object[]) value; valuesStream = Arrays.stream(array); } @@ -51696,7 +53212,7 @@ } if (result.isEmpty()) { -@@ -1399,8 +1401,7 @@ public class XdocsPagesTest { +@@ -1393,8 +1395,7 @@ public class XdocsPagesTest { } else { stream = Arrays.stream((int[]) value); } @@ -51706,16 +53222,16 @@ if (result.isEmpty()) { result = "{}"; } -@@ -1476,7 +1477,7 @@ public class XdocsPagesTest { +@@ -1470,7 +1471,7 @@ public class XdocsPagesTest { result = XmlUtil.getChildrenElements(node).stream() .map(Node::getTextContent) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } return result; } -@@ -1690,7 +1691,7 @@ public class XdocsPagesTest { +@@ -1684,7 +1685,7 @@ public class XdocsPagesTest { } @Test @@ -51724,7 +53240,7 @@ for (Path path : XdocUtil.getXdocsStyleFilePaths(XdocUtil.getXdocsFilePaths())) { final String fileName = path.getFileName().toString(); final String styleName = fileName.substring(0, fileName.lastIndexOf('_')); -@@ -1995,7 +1996,7 @@ public class XdocsPagesTest { +@@ -1989,7 +1990,7 @@ public class XdocsPagesTest { } @Test @@ -51735,14 +53251,14 @@ final String input = Files.readString(path); --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java -@@ -19,6 +19,7 @@ - +@@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.internal; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableSet; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; @@ -35,14 +36,13 @@ import java.util.List; import java.util.Locale; import java.util.Map; @@ -51763,8 +53279,8 @@ return AbstractCheck.class.isAssignableFrom(clazz) || AbstractFileSetCheck.class.isAssignableFrom(clazz); }) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); for (Class check : treeWalkerOrFileSetCheckSet) { final String checkName = check.getSimpleName(); if (!TREE_WORKER.equals(checkName)) { @@ -51779,20 +53295,20 @@ final DummyHandler checkHandler = new DummyHandler(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java -@@ -19,8 +19,12 @@ - +@@ -20,7 +20,12 @@ package com.puppycrawl.tools.checkstyle.internal; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.function.Function.identity; +import static java.util.stream.Collectors.toCollection; ++import static java.util.stream.Collectors.toUnmodifiableMap; ++import static java.util.stream.Collectors.toUnmodifiableSet; +import com.google.common.collect.ImmutableSet; -+import com.google.common.collect.Maps; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.Definitions; import com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck; -@@ -38,18 +42,16 @@ import java.util.HashSet; +@@ -38,18 +43,16 @@ import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -51813,7 +53329,7 @@ "NoCodeInFile (reason is that AST is not generated for a file not containing code)", "Regexp (reason is at #7759)", "RegexpSinglelineJava (reason is at #7759)"); -@@ -79,7 +81,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -79,7 +82,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { // Older regex-based checks that are under INCOMPATIBLE_JAVADOC_CHECK_NAMES // but not subclasses of AbstractJavadocCheck. private static final Set> REGEXP_JAVADOC_CHECKS = @@ -51822,7 +53338,7 @@ JavadocStyleCheck.class, JavadocMethodCheck.class, JavadocTypeCheck.class, -@@ -128,7 +130,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -115,7 +118,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { "VisibilityModifier"); // Modules that will never have xpath support ever because they not report violations @@ -51831,22 +53347,23 @@ private static final Set SIMPLE_CHECK_NAMES = getSimpleCheckNames(); private static final Map ALLOWED_DIRECTORY_AND_CHECKS = -@@ -148,8 +150,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { - } +@@ -136,9 +139,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { private static Map getAllowedDirectoryAndChecks() { -- return SIMPLE_CHECK_NAMES.stream() -- .collect(Collectors.toMap(id -> id.toLowerCase(Locale.ENGLISH), Function.identity())); -+ return Maps.uniqueIndex(SIMPLE_CHECK_NAMES, id -> id.toLowerCase(Locale.ENGLISH)); + return SIMPLE_CHECK_NAMES.stream() +- .collect( +- Collectors.toUnmodifiableMap( +- id -> id.toLowerCase(Locale.ENGLISH), Function.identity())); ++ .collect(toUnmodifiableMap(id -> id.toLowerCase(Locale.ENGLISH), identity())); } private static Set getInternalModules() { -@@ -159,11 +160,11 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -148,11 +149,11 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { final String[] packageTokens = moduleName.split("\\."); return packageTokens[packageTokens.length - 1]; }) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } @BeforeEach @@ -51855,7 +53372,7 @@ javaDir = Paths.get("src/it/java/" + getPackageLocation()); inputDir = Paths.get(getPath("")); } -@@ -179,12 +180,12 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -168,12 +169,12 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } @Test @@ -51870,7 +53387,7 @@ // add the extra checks abstractJavadocCheckNames.addAll(REGEXP_JAVADOC_CHECKS); final Set abstractJavadocCheckSimpleNames = -@@ -198,7 +199,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -187,7 +188,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } @Test @@ -51879,7 +53396,7 @@ final Set compatibleChecks = new HashSet<>(); final Pattern pattern = Pattern.compile("^XpathRegression(.+)Test\\.java$"); try (DirectoryStream javaPaths = Files.newDirectoryStream(javaDir)) { -@@ -242,7 +243,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -231,7 +232,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { final Set allChecks = new HashSet<>(SIMPLE_CHECK_NAMES); allChecks.removeAll(INCOMPATIBLE_JAVADOC_CHECK_NAMES); allChecks.removeAll(INCOMPATIBLE_CHECK_NAMES); @@ -51888,7 +53405,7 @@ allChecks.removeAll(MISSING_CHECK_NAMES); allChecks.removeAll(NO_VIOLATION_MODULES); allChecks.removeAll(compatibleChecks); -@@ -257,7 +258,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -246,7 +247,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } @Test @@ -51973,8 +53490,8 @@ package com.puppycrawl.tools.checkstyle.internal.utils; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; +import static java.util.stream.Collectors.toCollection; ++import static java.util.stream.Collectors.toUnmodifiableSet; + import com.google.common.reflect.ClassPath; import com.puppycrawl.tools.checkstyle.api.FileText; @@ -52000,8 +53517,8 @@ final String packageName = "com.puppycrawl.tools.checkstyle"; return getCheckstyleModulesRecursive(packageName, loader).stream() .filter(ModuleReflectionUtil::isCheckstyleTreeWalkerCheck) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } /** @@ -52009,8 +53526,8 @@ .map(ClassPath.ClassInfo::load) .filter(ModuleReflectionUtil::isCheckstyleModule) .filter(CheckUtil::isFromAllowedPackages) -- .collect(Collectors.toSet()); -+ .collect(toImmutableSet()); +- .collect(Collectors.toUnmodifiableSet()); ++ .collect(toUnmodifiableSet()); } /** @@ -52027,17 +53544,15 @@ import java.io.File; import java.io.Reader; -import java.nio.charset.StandardCharsets; + import java.nio.file.Files; import java.nio.file.Path; - import java.util.Set; - import org.apache.maven.doxia.parser.Parser; -@@ -55,13 +56,10 @@ public final class XdocGenerator { + import java.nio.file.StandardCopyOption; +@@ -57,11 +58,10 @@ public final class XdocGenerator { (XdocsTemplateSinkFactory) plexus.lookup(SinkFactory.ROLE, XDOCS_TEMPLATE_HINT); final Sink sink = sinkFactory.createSink( -- outputFile.getParentFile(), -- outputFile.getName(), -- String.valueOf(StandardCharsets.UTF_8)); -+ outputFile.getParentFile(), outputFile.getName(), String.valueOf(UTF_8)); +- tempFile.getParentFile(), tempFile.getName(), String.valueOf(StandardCharsets.UTF_8)); ++ tempFile.getParentFile(), tempFile.getName(), String.valueOf(UTF_8)); final XdocsTemplateParser parser = (XdocsTemplateParser) plexus.lookup(Parser.ROLE, XDOCS_TEMPLATE_HINT); - try (Reader reader = @@ -52052,7 +53567,7 @@ package com.puppycrawl.tools.checkstyle.internal.utils; -+import static com.google.common.collect.ImmutableSet.toImmutableSet; ++import static java.util.stream.Collectors.toUnmodifiableSet; + import java.io.IOException; import java.nio.file.Files; @@ -52068,8 +53583,8 @@ return attr.isRegularFile() && (path.toString().endsWith(".xml") || path.toString().endsWith(".xml.vm")); })) { -- return stream.collect(Collectors.toSet()); -+ return stream.collect(toImmutableSet()); +- return stream.collect(Collectors.toUnmodifiableSet()); ++ return stream.collect(toUnmodifiableSet()); } } @@ -52077,8 +53592,8 @@ (path, attr) -> { return attr.isRegularFile() && path.toString().endsWith(".xml.template"); })) { -- return stream.collect(Collectors.toSet()); -+ return stream.collect(toImmutableSet()); +- return stream.collect(Collectors.toUnmodifiableSet()); ++ return stream.collect(toUnmodifiableSet()); } } @@ -52970,7 +54485,7 @@ final String[] fileExtensions = {"java"}; final File pdfFile = new File("file.pdf"); assertWithMessage("Invalid file extension") -@@ -170,42 +171,42 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -174,42 +175,42 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53000,7 +54515,7 @@ @Test - public void testRelativeNormalizedPath() { + void relativeNormalizedPath() { - final String relativePath = CommonUtil.relativizeAndNormalizePath("/home", "/home/test"); + final String relativePath = CommonUtil.relativizePath("/home", "/home/test"); assertWithMessage("Invalid relative path").that(relativePath).isEqualTo("test"); } @@ -53008,7 +54523,7 @@ @Test - public void testRelativeNormalizedPathWithNullBaseDirectory() { + void relativeNormalizedPathWithNullBaseDirectory() { - final String relativePath = CommonUtil.relativizeAndNormalizePath(null, "/tmp"); + final String relativePath = CommonUtil.relativizePath(null, "/tmp"); assertWithMessage("Invalid relative path").that(relativePath).isEqualTo("/tmp"); } @@ -53019,7 +54534,7 @@ final String sampleAbsolutePath = new File("src/main/java").getCanonicalPath(); final String absoluteFilePath = sampleAbsolutePath + "/SampleFile.java"; final String basePath = sampleAbsolutePath + PATH_DENORMALIZER; -@@ -216,19 +217,19 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -220,19 +221,19 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53042,7 +54557,7 @@ final Constructor constructor = CommonUtil.getConstructor(String.class, String.class); assertWithMessage("Invalid constructor") -@@ -237,7 +238,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -241,7 +242,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53051,7 +54566,7 @@ final IllegalStateException ex = assertThrows( IllegalStateException.class, -@@ -251,7 +252,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -255,7 +256,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53060,7 +54575,7 @@ final Constructor constructor = String.class.getConstructor(String.class); final String constructedString = CommonUtil.invokeConstructor(constructor, "string"); -@@ -261,7 +262,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -265,7 +266,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { @SuppressWarnings("rawtypes") @Test @@ -53069,7 +54584,7 @@ final Constructor constructor = Dictionary.class.getConstructor(); final IllegalStateException ex = assertThrows( -@@ -276,7 +277,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -280,7 +281,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53078,7 +54593,7 @@ final TestCloseable closeable = new TestCloseable(); CommonUtil.close(null); -@@ -286,7 +287,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -290,7 +291,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53087,7 +54602,7 @@ final IllegalStateException ex = assertThrows( IllegalStateException.class, -@@ -303,7 +304,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -307,7 +308,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53096,7 +54611,7 @@ assertWithMessage("invalid result") .that( CommonUtil.fillTemplateWithStringsByRegexp( -@@ -324,7 +325,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -328,7 +329,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53105,7 +54620,7 @@ assertWithMessage("invalid result") .that(CommonUtil.getFileNameWithoutExtension("filename")) .isEqualTo("filename"); -@@ -337,7 +338,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -341,7 +342,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53114,7 +54629,7 @@ assertWithMessage("Invalid extension") .that(CommonUtil.getFileExtension("filename")) .isEqualTo(""); -@@ -350,133 +351,133 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -354,133 +355,133 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53267,7 +54782,7 @@ final String filename = "/" + getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; final URI uri = CommonUtil.getUriByFilename(filename); -@@ -487,7 +488,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -491,7 +492,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53276,7 +54791,7 @@ final String filename = getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; final URI uri = CommonUtil.getUriByFilename(filename); -@@ -503,7 +504,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -507,7 +508,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { * interpreted relative to the current package "com/puppycrawl/tools/checkstyle/utils/" */ @Test @@ -53285,7 +54800,7 @@ final String filename = getPackageLocation() + "/InputCommonUtilTest_resource.txt"; final URI uri = CommonUtil.getUriByFilename(filename); assertWithMessage("URI is null for: " + filename).that(uri).isNotNull(); -@@ -514,12 +515,12 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -518,12 +519,12 @@ public class CommonUtilTest extends AbstractPathTestSupport { assertWithMessage("URI is relative to package " + uriRelativeToPackage) .that(uri.toString()) .doesNotContain(uriRelativeToPackage); @@ -53300,7 +54815,7 @@ final String filename = CommonUtil.CLASSPATH_URL_PROTOCOL + getPackageLocation() -@@ -533,7 +534,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -537,7 +538,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53309,7 +54824,7 @@ final String filename = CommonUtil.CLASSPATH_URL_PROTOCOL + getPackageLocation() -@@ -547,15 +548,15 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -551,14 +552,14 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -53322,12 +54837,10 @@ @Test - public void testLoadSuppressionsUriSyntaxException() throws Exception { -- final URL configUrl = mock(URL.class); + void loadSuppressionsUriSyntaxException() throws Exception { -+ final URL configUrl = mock(); + final URL configUrl = mock(); when(configUrl.toURI()).thenThrow(URISyntaxException.class); try (MockedStatic utilities = mockStatic(CommonUtil.class, CALLS_REAL_METHODS)) { - final String fileName = "/suppressions_none.xml"; --- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java @@ -26,19 +26,19 @@ import java.io.File; @@ -54007,7 +55520,7 @@ + void getTokenTypesTotalNumber() { final int tokenTypesTotalNumber = TokenUtil.getTokenTypesTotalNumber(); - assertWithMessage("Invalid token total number").that(tokenTypesTotalNumber).isEqualTo(188); + assertWithMessage("Invalid token total number").that(tokenTypesTotalNumber).isEqualTo(194); } @Test @@ -54515,7 +56028,7 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java -@@ -35,7 +35,7 @@ import net.sf.saxon.tree.iter.EmptyIterator; +@@ -36,7 +36,7 @@ import net.sf.saxon.tree.iter.EmptyIterator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -54524,7 +56037,7 @@ private static RootNode rootNode; -@@ -45,14 +45,14 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -46,14 +46,14 @@ public class RootNodeTest extends AbstractPathTestSupport { } @BeforeEach @@ -54541,7 +56054,7 @@ try { rootNode.compareOrder(null); assertWithMessage("Exception is excepted").fail(); -@@ -64,7 +64,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -65,7 +65,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54550,7 +56063,7 @@ final String xpath = "/"; final List nodes = getXpathItems(xpath, rootNode); assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); -@@ -78,34 +78,34 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -79,24 +79,24 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54579,6 +56092,18 @@ assertWithMessage("Invalid column number").that(rootNode.getColumnNumber()).isEqualTo(0); } +@@ -106,7 +106,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + * Test exists until https://github.com/checkstyle/checkstyle/issues/4997 + */ + @Test +- public void testNonRealGetColumnNumber() { ++ void nonRealGetColumnNumber() { + final DetailAstImpl nonRealNode = new DetailAstImpl(); + nonRealNode.setType(TokenTypes.PACKAGE_DEF); + nonRealNode.setLineNo(555); +@@ -119,12 +119,12 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + @Test - public void testGetLocalPart() { + void getLocalPart() { @@ -54591,7 +56116,7 @@ try (AxisIterator following = rootNode.iterateAxis(AxisInfo.FOLLOWING)) { assertWithMessage("Result iterator does not match expected") .that(following) -@@ -139,7 +139,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -158,7 +158,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54600,7 +56125,7 @@ final RootNode emptyRootNode = new RootNode(null); assertWithMessage("Empty node should not have children") .that(emptyRootNode.hasChildNodes()) -@@ -158,7 +158,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -177,7 +177,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54609,7 +56134,7 @@ try { rootNode.getStringValue(); assertWithMessage("Exception is excepted").fail(); -@@ -170,7 +170,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -189,7 +189,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54618,7 +56143,7 @@ try { rootNode.getAttributeValue("", ""); assertWithMessage("Exception is excepted").fail(); -@@ -182,7 +182,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -201,7 +201,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54627,7 +56152,7 @@ try { rootNode.getDeclaredNamespaces(null); assertWithMessage("Exception is excepted").fail(); -@@ -194,7 +194,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -213,7 +213,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54636,7 +56161,7 @@ try { rootNode.isId(); assertWithMessage("Exception is excepted").fail(); -@@ -206,7 +206,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -225,7 +225,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54645,7 +56170,7 @@ try { rootNode.isIdref(); assertWithMessage("Exception is excepted").fail(); -@@ -218,7 +218,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -237,7 +237,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54654,7 +56179,7 @@ try { rootNode.isNilled(); assertWithMessage("Exception is excepted").fail(); -@@ -230,7 +230,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -249,7 +249,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54663,7 +56188,7 @@ try { rootNode.isStreamed(); assertWithMessage("Exception is excepted").fail(); -@@ -242,7 +242,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -261,7 +261,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54672,7 +56197,7 @@ try { rootNode.getConfiguration(); assertWithMessage("Exception is excepted").fail(); -@@ -254,7 +254,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -273,7 +273,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54681,7 +56206,7 @@ try { rootNode.setSystemId("1"); assertWithMessage("Exception is excepted").fail(); -@@ -266,7 +266,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -285,7 +285,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54690,7 +56215,7 @@ try { rootNode.getSystemId(); assertWithMessage("Exception is excepted").fail(); -@@ -278,7 +278,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -297,7 +297,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54699,7 +56224,7 @@ try { rootNode.getPublicId(); assertWithMessage("Exception is excepted").fail(); -@@ -290,7 +290,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -309,7 +309,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54708,7 +56233,7 @@ try { rootNode.getBaseURI(); assertWithMessage("Exception is excepted").fail(); -@@ -302,7 +302,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -321,7 +321,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54717,7 +56242,7 @@ try { rootNode.saveLocation(); assertWithMessage("Exception is excepted").fail(); -@@ -314,7 +314,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -333,7 +333,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54726,7 +56251,7 @@ try { rootNode.getUnicodeStringValue(); assertWithMessage("Exception is excepted").fail(); -@@ -326,7 +326,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -345,7 +345,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54735,7 +56260,7 @@ try { rootNode.getFingerprint(); assertWithMessage("Exception is excepted").fail(); -@@ -338,7 +338,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -357,7 +357,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54744,7 +56269,7 @@ try { rootNode.getDisplayName(); assertWithMessage("Exception is excepted").fail(); -@@ -350,7 +350,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -369,7 +369,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54753,7 +56278,7 @@ try { rootNode.getPrefix(); assertWithMessage("Exception is excepted").fail(); -@@ -362,7 +362,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -381,7 +381,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54762,7 +56287,7 @@ try { rootNode.getSchemaType(); assertWithMessage("Exception is excepted").fail(); -@@ -374,7 +374,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -393,7 +393,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54771,7 +56296,7 @@ try { rootNode.atomize(); assertWithMessage("Exception is excepted").fail(); -@@ -386,7 +386,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -405,7 +405,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54780,7 +56305,7 @@ try { rootNode.generateId(null); assertWithMessage("Exception is excepted").fail(); -@@ -398,7 +398,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -417,7 +417,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54789,7 +56314,7 @@ try { rootNode.copy(null, -1, null); assertWithMessage("Exception is excepted").fail(); -@@ -410,7 +410,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -429,7 +429,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -54798,7 +56323,7 @@ try { rootNode.getAllNamespaces(); assertWithMessage("Exception is excepted").fail(); -@@ -422,7 +422,7 @@ public class RootNodeTest extends AbstractPathTestSupport { +@@ -441,7 +441,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } @Test @@ -56103,56 +57628,60 @@ }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharacte + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidEscapedUnicodeCharactersCheckExamplesTest +final class AvoidEscapedUnicodeCharactersCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,35 +32,35 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest +@@ -32,7 +32,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:24: " + getCheckMessage(MSG_KEY), + "18:24: " + getCheckMessage(MSG_KEY), +@@ -45,7 +45,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:24: " + getCheckMessage(MSG_KEY), + "20:24: " + getCheckMessage(MSG_KEY), +@@ -57,7 +57,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "18:24: " + getCheckMessage(MSG_KEY), + "20:24: " + getCheckMessage(MSG_KEY), +@@ -69,7 +69,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "18:24: " + getCheckMessage(MSG_KEY), + "22:24: " + getCheckMessage(MSG_KEY), +@@ -80,7 +80,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "18:24: " + getCheckMessage(MSG_KEY, "unitAbbrev1"), + "20:24: " + getCheckMessage(MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckExamplesTest.java @@ -24,119 +24,119 @@ import org.junit.jupiter.api.Disabled; @@ -56329,10 +57858,10 @@ verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -26,21 +26,21 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56343,25 +57872,53 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + verifyWithInlineConfigParser(getPath("Example1.java"), expected); } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), + }; +@@ -49,7 +49,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_WRONG_ENDING), + }; +@@ -58,7 +58,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT + } - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + @Test +- public void testExample4() throws Exception { ++ void example4() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), + }; +@@ -67,7 +67,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT + } + + @Test +- public void testExample5() throws Exception { ++ void example5() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), + }; +@@ -76,7 +76,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT + } + + @Test +- public void testExample6() throws Exception { ++ void example6() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; @@ -56628,10 +58185,10 @@ verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.MSG_KEY; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UpperEllCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UpperEllCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56642,15 +58199,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "13:15: " + getCheckMessage(MSG_KEY, "L"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocati + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSupport { +final class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56661,9 +58218,10 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "31:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), + "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), +@@ -42,14 +42,14 @@ public class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSu } @Test @@ -56671,23 +58229,24 @@ + void example2() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + verifyWithInlineConfigParser(getPath("Example2.java"), expected); } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "24:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Nonnull"), + "26:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Override"), +@@ -61,7 +61,7 @@ public class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationOnSame @@ -56764,7 +58323,7 @@ "26:37: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckExamplesTest.java -@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecate +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; @@ -56789,7 +58348,7 @@ + void example2() throws Exception { final String[] expected = { "20: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), - "32: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), + "32: " + getCheckMessage(MSG_KEY_UNCLOSED_HTML_TAG, "p"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckExamplesTest.java @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideC @@ -56821,10 +58380,10 @@ "30:3: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE, "test"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotatio + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class PackageAnnotationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class PackageAnnotationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56835,9 +58394,10 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "13:1: " + getCheckMessage(MSG_KEY), + }; +@@ -40,14 +40,14 @@ public class PackageAnnotationCheckExamplesTest extends AbstractExamplesModuleTe } @Test @@ -56845,7 +58405,7 @@ + void example2() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + verifyWithInlineConfigParser(getPath("Example2.java"), expected); } @Test @@ -56853,7 +58413,7 @@ + void example3() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + verifyWithInlineConfigParser(getPath("example3/package-info.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarnings @@ -56884,10 +58444,10 @@ "44:32: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unused"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsHolderExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsHolderExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -27,14 +27,14 @@ import com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck; + import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressWarningsHolderExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressWarningsHolderExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56898,23 +58458,24 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String pattern1 = "^[a-z][a-zA-Z0-9]*$"; + final String pattern2 = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + final String[] expected = { +@@ -55,7 +55,7 @@ public class SuppressWarningsHolderExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "19:15: " + getCheckMessage(ParameterNumberCheck.class, ParameterNumberCheck.MSG_KEY, 7, 8), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksChe + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidNestedBlocksCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidNestedBlocksCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56925,23 +58486,24 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), + "23:15: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), +@@ -41,7 +41,7 @@ public class AvoidNestedBlocksCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "19:5: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.MSG_ + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56952,31 +58514,33 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:34: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "for"), + "17:9: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "try"), +@@ -42,7 +42,7 @@ public class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "21:9: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "try"), + }; +@@ -51,7 +51,7 @@ public class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "24:16: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -56987,33 +58551,45 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:41: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + "31:34: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), +@@ -41,7 +41,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "33:34: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + }; +@@ -50,7 +50,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "18:41: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + "25:39: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), +@@ -61,7 +61,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; + final String[] expected = { + "51:34: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + }; +@@ -70,7 +70,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest + } - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + @Test +- public void testExample5() throws Exception { ++ void example5() throws Exception { + final String[] expected = { + "18:34: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheckExamplesTest.java @@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.MSG_K @@ -57062,10 +58638,10 @@ "17:3: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", "3"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheckExamplesTest.java -@@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -57076,55 +58652,59 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "20:5: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), + "24:7: " + getCheckMessage(MSG_KEY_NEED_BRACES, "else"), +@@ -47,7 +47,7 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), + "26:7: " + getCheckMessage(MSG_KEY_NEED_BRACES, "else"), +@@ -57,7 +57,7 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "33:5: " + getCheckMessage(MSG_KEY_NEED_BRACES, "do"), + "40:5: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), +@@ -67,14 +67,14 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + verifyWithInlineConfigParser(getPath("Example4.java"), expected); } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "39:5: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), + }; +@@ -83,7 +83,7 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample6() throws Exception { + void example6() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example6.txt"), expected); + final String[] expected = { + "24:38: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckExamplesTest.java -@@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.MSG_ + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -57135,47 +58715,51 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "19:5: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", "5"), + "32:23: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "23"), +@@ -43,7 +43,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "22:21: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "21"), + "43:47: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "47"), +@@ -53,7 +53,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "35:16: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "16"), + }; +@@ -62,7 +62,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "5"), + }; +@@ -71,7 +71,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "41:16: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "16"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCh + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -57186,17 +58770,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY), "25:5: " + getCheckMessage(MSG_KEY), + }; +@@ -40,7 +40,7 @@ public class ArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY), + "19:5: " + getCheckMessage(MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; @@ -57371,10 +58956,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck. + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class EmptyStatementCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyStatementCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -57385,9 +58970,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "15:14: " + getCheckMessage(MSG_KEY), "17:28: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; @@ -57744,10 +59329,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -57758,33 +59343,36 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:20: " + getCheckMessage(MSG_KEY, "a href"), + }; +@@ -40,7 +40,7 @@ public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:20: " + getCheckMessage(MSG_KEY, "a href"), + "19:20: " + getCheckMessage(MSG_KEY, "a href"), +@@ -50,7 +50,7 @@ public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "17:29: " + getCheckMessage(MSG_KEY, '"'), + }; +@@ -59,7 +59,7 @@ public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "21:17: " + getCheckMessage(MSG_KEY, "^0[^lx]"), + "23:18: " + getCheckMessage(MSG_KEY, "^0[^lx]"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; @@ -57854,10 +59442,10 @@ verifyWithInlineConfigParser(getPath("Example7.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class InnerAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InnerAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -57868,9 +59456,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "21:11: " + getCheckMessage(MSG_KEY), + "22:11: " + getCheckMessage(MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckExamplesTest.java @@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; @@ -58398,10 +59986,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentC + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ParameterAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ParameterAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -58412,9 +60000,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "21:15: " + getCheckMessage(MSG_KEY, "parameter"), + "34:27: " + getCheckMessage(MSG_KEY, "a"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckExamplesTest.java @@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; @@ -58926,10 +60514,10 @@ verifyWithInlineConfigParser(getPath("Example1.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class InterfaceIsTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InterfaceIsTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -58940,17 +60528,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:3: " + getCheckMessage(MSG_KEY), + }; +@@ -40,7 +40,7 @@ public class InterfaceIsTypeCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "16:3: " + getCheckMessage(MSG_KEY), "21:3: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; @@ -59254,10 +60843,10 @@ verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckExamplesTest.java -@@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59268,55 +60857,60 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "13:15: " + getCheckMessage(MSG_KEY, "java.io.*"), + "14:29: " + getCheckMessage(MSG_KEY, "java.lang.Math.*"), +@@ -43,7 +43,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "17:17: " + getCheckMessage(MSG_KEY, "java.util.*"), + }; +@@ -52,7 +52,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "16:29: " + getCheckMessage(MSG_KEY, "java.lang.Math.*"), + }; +@@ -61,7 +61,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "15:15: " + getCheckMessage(MSG_KEY, "java.io.*"), + "17:17: " + getCheckMessage(MSG_KEY, "java.util.*"), +@@ -72,7 +72,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "17:29: " + getCheckMessage(MSG_KEY, "java.lang.Math.*"), + }; +@@ -81,7 +81,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample6() throws Exception { + void example6() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example6.txt"), expected); + final String[] expected = { + "18:17: " + getCheckMessage(MSG_KEY, "java.util.*"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCh + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidStaticImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidStaticImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59327,17 +60921,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "12:29: " + getCheckMessage(MSG_KEY, "java.lang.Math.pow"), + "13:31: " + getCheckMessage(MSG_KEY, "java.lang.System.*"), +@@ -41,7 +41,7 @@ public class AvoidStaticImportCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "16:32: " + getCheckMessage(MSG_KEY, "java.lang.Integer.parseInt"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckExamplesTest.java @@ -24,112 +24,112 @@ import org.junit.jupiter.api.Disabled; @@ -59661,10 +61256,10 @@ verifyWithInlineConfigParser(getPath("Example12.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RedundantImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RedundantImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59675,15 +61270,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:1: " + + getCheckMessage( --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck. + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59694,17 +61289,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "19:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), + "22:8: " + getCheckMessage(MSG_KEY, "java.util.Map"), +@@ -41,7 +41,7 @@ public class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "21:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), + "24:8: " + getCheckMessage(MSG_KEY, "java.util.Map"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckExamplesTest.java @@ -24,77 +24,77 @@ import org.junit.jupiter.api.Disabled; @@ -59860,10 +61456,10 @@ verifyWithInlineConfigParser(getPath("Example1.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocPositionCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocPositionCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPosit + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class InvalidJavadocPositionCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InvalidJavadocPositionCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59874,15 +61470,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -22,28 +22,28 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocBlockTagLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocBlockTagLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59895,7 +61491,7 @@ + void example1() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + verifyWithInlineConfigParser(getPath("Example1.java"), expected); } @Test @@ -59903,13 +61499,21 @@ + void example2() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + verifyWithInlineConfigParser(getPath("Example2.java"), expected); + } + + @Test +- public void testExample3() throws Exception { ++ void example3() throws Exception { + final String[] expected = {}; + + verifyWithInlineConfigParser(getPath("Example3.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocContentLocat + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocContentLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocContentLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59920,17 +61524,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "15:3: " + getCheckMessage(MSG_JAVADOC_CONTENT_SECOND_LINE), + }; +@@ -41,7 +41,7 @@ public class JavadocContentLocationCheckExamplesTest extends AbstractExamplesMod } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "22:3: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; @@ -61175,37 +62780,39 @@ final String[] expected = { --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCh + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { - @Override - protected String getPackageLocation() { - return "com/puppycrawl/tools/checkstyle/checks/naming/catchparametername"; + + private static final String CATCH_PARAM_NAME_PATTERN_1 = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; + private static final String CATCH_PARAM_NAME_PATTERN_2 = "^[a-z][a-zA-Z0-9]+$"; +@@ -35,7 +35,7 @@ public class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "18:40: " + getCheckMessage(MSG_INVALID_PATTERN, "e123", CATCH_PARAM_NAME_PATTERN_1), + "20:35: " + getCheckMessage(MSG_INVALID_PATTERN, "ab", CATCH_PARAM_NAME_PATTERN_1), +@@ -48,7 +48,7 @@ public class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:34: " + getCheckMessage(MSG_INVALID_PATTERN, "e", CATCH_PARAM_NAME_PATTERN_2), + "26:24: " --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameChe + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61216,25 +62823,27 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String pattern = "^[A-Z]$"; + final String[] expected = { + "14:18: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "t", pattern), +@@ -44,7 +44,7 @@ public class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesMod } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String pattern = "^[A-Z]{2,}$"; + final String[] expected = { + "15:18: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "T", pattern), +@@ -57,7 +57,7 @@ public class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesMod } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String pattern = "(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"; + final String[] expected = { + "16:18: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "t", pattern), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckExamplesTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.MS @@ -61302,10 +62911,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class InterfaceTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InterfaceTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61316,23 +62925,24 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:29: " + getCheckMessage(MSG_INVALID_PATTERN, "t", "^[A-Z]$"), +@@ -41,7 +41,7 @@ public class InterfaceTypeParameterNameCheckExamplesTest extends AbstractExample } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "17:28: " + getCheckMessage(MSG_INVALID_PATTERN, "type", "^[a-zA-Z]$"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61343,23 +62953,24 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:11: " + getCheckMessage(MSG_INVALID_PATTERN, "S", "^[a-z][a-zA-Z0-9]*$"), + }; +@@ -40,7 +40,7 @@ public class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModule } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "20:40: " + getCheckMessage(MSG_INVALID_PATTERN, "_s", "^[a-z]([a-zA-Z]+)*$"), + "25:23: " + getCheckMessage(MSG_INVALID_PATTERN, "Word", "^[a-z]([a-zA-Z]+)*$"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61370,31 +62981,33 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:17: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR1", "^[a-z][a-zA-Z0-9]*$"), + "20:17: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR2", "^[a-z][a-zA-Z0-9]*$"), +@@ -41,7 +41,7 @@ public class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesMod } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:17: " + getCheckMessage(MSG_INVALID_PATTERN, "var1", "^[A-Z][A-Z0-9]*$"), + "21:17: " + getCheckMessage(MSG_INVALID_PATTERN, "var2", "^[A-Z][A-Z0-9]*$"), +@@ -51,7 +51,7 @@ public class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesMod } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "19:17: " + getCheckMessage(MSG_INVALID_PATTERN, "scanner", "^[A-Z][A-Z0-9]*$"), + "23:30: " + getCheckMessage(MSG_INVALID_PATTERN, "ex", "^[A-Z][A-Z0-9]*$"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckExamplesTest.java -@@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61405,41 +63018,45 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + final String[] expected = { + "15:14: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR", pattern), +@@ -42,7 +42,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; + final String[] expected = { + "17:14: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR", pattern), +@@ -52,7 +52,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; + final String[] expected = { + "20:13: " + getCheckMessage(MSG_INVALID_PATTERN, "K", pattern), +@@ -63,7 +63,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String pattern = "^[a-z][_a-zA-Z0-9]+$"; + final String[] expected = { + "21:9: " + getCheckMessage(MSG_INVALID_PATTERN, "g", pattern), +@@ -77,7 +77,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String pattern = "^[a-z][_a-zA-Z0-9]{2,}$"; + final String[] expected = { + "17:9: " + getCheckMessage(MSG_INVALID_PATTERN, "i", pattern), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.MSG_ @@ -61533,10 +63150,10 @@ "20:8: " + getCheckMessage(MSG_INVALID_PATTERN, "Method4", "^[a-z](_?[a-zA-Z0-9]+)*$"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MethodTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MethodTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61547,9 +63164,10 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:11: " + getCheckMessage(MSG_INVALID_PATTERN, "a", "^[A-Z]$"), + "16:11: " + getCheckMessage(MSG_INVALID_PATTERN, "k", "^[A-Z]$"), +@@ -41,7 +41,7 @@ public class MethodTypeParameterNameCheckExamplesTest extends AbstractExamplesMo } @Test @@ -61557,7 +63175,7 @@ + void example2() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + verifyWithInlineConfigParser(getPath("Example2.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; @@ -61587,10 +63205,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckExamplesTest.java -@@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck.M + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61601,41 +63219,45 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:20: " + getCheckMessage(MSG_INVALID_PATTERN, "V2", "^[a-z][a-zA-Z0-9]*$"), + }; +@@ -40,7 +40,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "17:20: " + getCheckMessage(MSG_INVALID_PATTERN, "V3", "^[a-z][_a-zA-Z0-9]+$"), + }; +@@ -49,7 +49,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "16:20: " + getCheckMessage(MSG_INVALID_PATTERN, "V2", "^[a-z][a-zA-Z0-9]*$"), + }; +@@ -58,7 +58,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "16:20: " + getCheckMessage(MSG_INVALID_PATTERN, "v_2", "^[a-z][a-zA-Z0-9]+$"), + "17:20: " + getCheckMessage(MSG_INVALID_PATTERN, "V3", "^[a-z][a-zA-Z0-9]+$"), +@@ -68,7 +68,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "25:26: " + "Parameter name 'V2' must match pattern '^[a-z]([a-z0-9][a-zA-Z0-9]*)?$'", + "27:23: " + "Parameter name 'b' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'", --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; @@ -61727,45 +63349,48 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { - @Override - protected String getPackageLocation() { - return "com/puppycrawl/tools/checkstyle/checks/naming/staticvariablename"; + + public static final String STATIC_VAR_NAME_PATTERN_1 = "^[a-z][a-zA-Z0-9]*$"; + public static final String STATIC_VAR_NAME_PATTERN_2 = "^[a-z](_?[a-zA-Z0-9]+)*$"; +@@ -35,7 +35,7 @@ public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "19:21: " + getCheckMessage(MSG_INVALID_PATTERN, "ItStatic1", STATIC_VAR_NAME_PATTERN_1), + "20:24: " + getCheckMessage(MSG_INVALID_PATTERN, "ItStatic2", STATIC_VAR_NAME_PATTERN_1), +@@ -50,7 +50,7 @@ public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "21:22: " + getCheckMessage(MSG_INVALID_PATTERN, "ItStatic", STATIC_VAR_NAME_PATTERN_1), + "24:22: " + getCheckMessage(MSG_INVALID_PATTERN, "It_Static1", STATIC_VAR_NAME_PATTERN_1), +@@ -61,7 +61,7 @@ public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "19:21: " + getCheckMessage(MSG_INVALID_PATTERN, "ItStatic1", STATIC_VAR_NAME_PATTERN_2), + "20:24: " + getCheckMessage(MSG_INVALID_PATTERN, "ItStatic2", STATIC_VAR_NAME_PATTERN_2), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61776,25 +63401,27 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "15:8: " + getCheckMessage(MSG_INVALID_PATTERN, "Third_Name", "^[A-Z][a-zA-Z0-9]*$"), + "16:17: " + getCheckMessage(MSG_INVALID_PATTERN, "FourthName_", "^[A-Z][a-zA-Z0-9]*$"), +@@ -41,7 +41,7 @@ public class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "16:7: " + getCheckMessage(MSG_INVALID_PATTERN, "Example2", "^[a-z](_?[a-zA-Z0-9]+)*$"), + "18:16: " + getCheckMessage(MSG_INVALID_PATTERN, "SecondName", "^[a-z](_?[a-zA-Z0-9]+)*$"), +@@ -51,7 +51,7 @@ public class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "19:13: " + getCheckMessage(MSG_INVALID_PATTERN, "SecondName", "^I_[a-zA-Z0-9]*$"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckExamplesTest.java @@ -24,98 +24,98 @@ import org.junit.jupiter.api.Disabled; @@ -62234,10 +63861,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,21 +24,21 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.MSG_K + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class FileLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class FileLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -62250,15 +63877,24 @@ + void example1() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + verifyWithInlineConfigParser(getPath("Example1.java"), expected); } @Test - public void testExample2() throws Exception { + void example2() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY, 18, 5), + }; +@@ -47,7 +47,7 @@ public class FileLengthCheckExamplesTest extends AbstractExamplesModuleTestSuppo + } + + @Test +- public void testExample3() throws Exception { ++ void example3() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + verifyWithInlineConfigParser(getPath("Example3.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthExamplesTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck diff --git a/integration-tests/checkstyle-10.12.4-expected-warnings.txt b/integration-tests/checkstyle-expected-warnings.txt similarity index 95% rename from integration-tests/checkstyle-10.12.4-expected-warnings.txt rename to integration-tests/checkstyle-expected-warnings.txt index 283be35a..3ee09654 100644 --- a/integration-tests/checkstyle-10.12.4-expected-warnings.txt +++ b/integration-tests/checkstyle-expected-warnings.txt @@ -10,6 +10,8 @@ src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocat src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java:[40,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java:[41,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCatchParameterNameTest.java:[166,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `enum` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCatchParameterNameTest.java:[193,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `interface` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `equals` is already defined in this class or a supertype) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) @@ -19,7 +21,7 @@ src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest. src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java:[41,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java:[41,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java:[597,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) +src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java:[595,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java:[58,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java:[49,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java:[41,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) @@ -27,10 +29,10 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharacte src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckTest.java:[49,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java:[65,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[193,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[206,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `enum` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[217,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `interface` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[228,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `package` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[214,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[227,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `enum` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[238,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `interface` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java:[249,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `package` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java:[103,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckTest.java:[49,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java:[46,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) @@ -45,7 +47,6 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderChec src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckTest.java:[55,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckTest.java:[38,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java:[105,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java:[48,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) @@ -54,8 +55,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckTes src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckTest.java:[37,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java:[37,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckTest.java:[45,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java:[290,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `static` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java:[373,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `for` is not a valid identifier) @@ -82,8 +82,8 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java:[83,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `protected` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java:[89,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `public` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java:[60,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java:[102,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `public` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java:[94,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `protected` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java:[118,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `protected` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java:[126,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `public` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java:[38,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `extractInlineTags` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java:[189,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `new` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java:[188,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `extends` is not a valid identifier) @@ -100,12 +100,12 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTe src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java:[78,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckTest.java:[47,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java:[44,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java:[71,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java:[120,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java:[195,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java:[56,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthCheckTest.java:[56,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java:[94,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `enum` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java:[93,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `abstract` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java:[106,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `enum` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java:[73,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java:[58,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java:[62,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) @@ -128,7 +128,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.ja src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressFilterElementTest.java:[185,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `equals` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java:[83,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java:[210,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java:[142,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java:[151,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterTest.java:[42,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Antlr4AstRegressionTest.java:[34,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `package` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java:[53,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) diff --git a/integration-tests/checkstyle-10.12.4-init.patch b/integration-tests/checkstyle-init.patch similarity index 84% rename from integration-tests/checkstyle-10.12.4-init.patch rename to integration-tests/checkstyle-init.patch index 482c0f6c..64ceebb2 100644 --- a/integration-tests/checkstyle-10.12.4-init.patch +++ b/integration-tests/checkstyle-init.patch @@ -1,7 +1,7 @@ --- a/pom.xml +++ b/pom.xml -@@ -334,6 +334,12 @@ - 1.1.3 +@@ -362,6 +362,12 @@ + 1.3.0 test + @@ -13,59 +13,45 @@ nl.jqno.equalsverifier equalsverifier -@@ -2397,8 +2403,10 @@ - -Xpkginfo:always - -XDcompilePolicy=simple +@@ -2412,6 +2418,8 @@ -- -Xplugin:ErrorProne -+ -Xplugin:ErrorProne ${error-prone.flags} + -Xplugin:ErrorProne ${error-prone.configuration-args} + -Xmaxwarns + 1000000 -@@ -2406,6 +2414,16 @@ - error_prone_core - ${error-prone.version} +@@ -2424,6 +2432,11 @@ + error-prone-contrib + ${error-prone-support.version} + + tech.picnic.error-prone-support -+ error-prone-contrib -+ ${error-prone-support.version} -+ -+ -+ tech.picnic.error-prone-support + refaster-runner + ${error-prone-support.version} + -@@ -2449,9 +2467,10 @@ - -Xpkginfo:always +@@ -2468,9 +2481,10 @@ -XDcompilePolicy=simple -- -Xplugin:ErrorProne \ -- -XepExcludedPaths:.*[\\/]resources[\\/].* -+ -Xplugin:ErrorProne ${error-prone.flags} + -Xplugin:ErrorProne \ +- -XepExcludedPaths:.*[\\/]resources[\\/].* \ + ${error-prone.configuration-args} + -Xmaxwarns + 1000000 -@@ -2459,6 +2478,16 @@ - error_prone_core - ${error-prone.version} +@@ -2483,6 +2497,11 @@ + error-prone-contrib + ${error-prone-support.version} + + tech.picnic.error-prone-support -+ error-prone-contrib -+ ${error-prone-support.version} -+ -+ -+ tech.picnic.error-prone-support + refaster-runner + ${error-prone-support.version} + @@ -108,7 +94,7 @@ .replace(RESULTS_PLACEHOLDER, String.join(",\n", results)); --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java -@@ -419,6 +419,10 @@ public final class SiteUtil { +@@ -564,6 +564,10 @@ public final class SiteUtil { * @return a set of properties for the given class. */ public static Set getPropertiesForDocumentation(Class clss, Object instance) { @@ -132,7 +118,7 @@ @TempDir --- a/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java -@@ -46,6 +46,8 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; +@@ -47,6 +47,8 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; /** * Unit test for ConfigurationLoader. */ @@ -161,9 +147,21 @@ final Object test = new PackageObjectFactory(Collections.singleton(null), classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); assertWithMessage("Exception is expected but got " + test).fail(); +--- a/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java +@@ -429,6 +429,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + * mock toByteArray to throw exception. + */ + @Test ++ // XXX: Drop suppression once ++ // https://github.com/checkstyle/checkstyle/pull/14362 is resolved. ++ @SuppressWarnings("InputStreamReadAllBytes") + public void testNonExistentResource() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java -@@ -79,6 +79,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -81,6 +81,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; * @noinspectionreason ClassWithTooManyDependencies - complex tests require a * large number of imports */ diff --git a/integration-tests/checkstyle-10.12.4.sh b/integration-tests/checkstyle.sh similarity index 94% rename from integration-tests/checkstyle-10.12.4.sh rename to integration-tests/checkstyle.sh index a6bf87bd..32f2e850 100755 --- a/integration-tests/checkstyle-10.12.4.sh +++ b/integration-tests/checkstyle.sh @@ -9,7 +9,7 @@ repos_root="${integration_test_root}/.repos" test_name="$(basename "${0}" .sh)" project=checkstyle repository=https://github.com/checkstyle/checkstyle.git -revision=checkstyle-10.12.4 +revision=checkstyle-10.13.0 if [ "${#}" -gt 2 ] || ([ "${#}" = 2 ] && [ "${1:---sync}" != '--sync' ]); then echo "Usage: ${0} [--sync] []" @@ -46,16 +46,22 @@ format_goal='com.spotify.fmt:fmt-maven-plugin:2.21.1:format' error_prone_shared_flags='-XepExcludedPaths:(\Q${project.basedir}${file.separator}src${file.separator}\E(it|test|xdocs-examples)\Q${file.separator}resources\E|\Q${project.build.directory}${file.separator}\E).*' +# XXX: Drop the `ErrorProneRuntimeClasspath` exclusion once that check resides +# in a separate Maven module. error_prone_patch_flags="${error_prone_shared_flags} -XepPatchLocation:IN_PLACE -XepPatchChecks:$( find "${error_prone_support_root}" -path "*/META-INF/services/com.google.errorprone.bugpatterns.BugChecker" -print0 \ | xargs -0 grep -hoP '[^.]+$' \ + | grep -v ErrorProneRuntimeClasspath \ | paste -s -d ',' )" +# XXX: Drop the `ErrorProneRuntimeClasspath` exclusion once that check resides +# in a separate Maven module. error_prone_validation_flags="${error_prone_shared_flags} -XepDisableAllChecks $( find "${error_prone_support_root}" -path "*/META-INF/services/com.google.errorprone.bugpatterns.BugChecker" -print0 \ | xargs -0 grep -hoP '[^.]+$' \ | sed -r 's,(.*),-Xep:\1:WARN,' \ + | grep -v ErrorProneRuntimeClasspath \ | paste -s -d ' ' )" @@ -110,7 +116,7 @@ function apply_patch() { mvn ${shared_build_flags} ${extra_build_args} \ package "${format_goal}" \ - -Derror-prone.flags="${error_prone_patch_flags}" \ + -Derror-prone.configuration-args="${error_prone_patch_flags}" \ -DskipTests if ! git diff --exit-code; then @@ -141,7 +147,7 @@ apply_patch '' validation_build_log="${report_directory}/${test_name}-validation-build-log.txt" mvn ${shared_build_flags} \ clean package \ - -Derror-prone.flags="${error_prone_validation_flags}" \ + -Derror-prone.configuration-args="${error_prone_validation_flags}" \ -Dtest=' !MetadataGeneratorUtilTest#metadataFilesGenerationAllFiles, !XdocsJavaDocsTest#allCheckSectionJavaDocs' \