From 27e9fe79a586104ed6d0c4c3799fb5d2a44a5903 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Mon, 18 Nov 2024 18:00:39 +0100 Subject: [PATCH] Upgrade Checkstyle integration test target 10.14.0 -> 10.21.1 (#1425) --- .../checkstyle-expected-changes.patch | 12357 ++++++++++------ .../checkstyle-expected-warnings.txt | 55 +- integration-tests/checkstyle-init.patch | 51 +- integration-tests/checkstyle.sh | 2 +- 4 files changed, 7654 insertions(+), 4811 deletions(-) diff --git a/integration-tests/checkstyle-expected-changes.patch b/integration-tests/checkstyle-expected-changes.patch index 2921a45950..d96f8368a0 100644 --- a/integration-tests/checkstyle-expected-changes.patch +++ b/integration-tests/checkstyle-expected-changes.patch @@ -75,564 +75,680 @@ } else if (NONEMPTY_LINE_REGEX.matcher(line).matches()) { throw new IllegalStateException( String.format( ---- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java -@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; - import org.junit.jupiter.api.Test; - --public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { -+final class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { - - @Override - protected String getPackageLocation() { -@@ -35,7 +35,7 @@ public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/FileNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/FileNameTest.java +@@ -32,17 +32,17 @@ public class FileNameTest extends AbstractGoogleModuleTestSupport { } @Test - public void testOuterTypeFilename1() throws Exception { + void outerTypeFilename1() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("OuterTypeFilename"); -@@ -46,7 +46,7 @@ public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputFileName1.java")); } @Test - public void testOuterTypeFilename2() throws Exception { + void outerTypeFilename2() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("OuterTypeFilename"); -@@ -57,7 +57,7 @@ public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputFileName2.java")); } @Test - public void testOuterTypeFilename3() throws Exception { + void outerTypeFilename3() throws Exception { - final String[] expected = { - "3:1: " + getCheckMessage(OuterTypeFilenameCheck.class, MSG_KEY), - }; ---- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck; + verifyWithWholeConfig(getPath("InputFileName3.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/WhitespaceCharactersTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/WhitespaceCharactersTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter2filebasic.rule231filetab; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class FileTabCharacterTest extends AbstractGoogleModuleTestSupport { -+final class FileTabCharacterTest extends AbstractGoogleModuleTestSupport { +-public class WhitespaceCharactersTest extends AbstractGoogleModuleTestSupport { ++final class WhitespaceCharactersTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class FileTabCharacterTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class WhitespaceCharactersTest extends AbstractGoogleModuleTestSupport { } @Test - public void testFileTab() throws Exception { + void fileTab() throws Exception { - final String[] expected = { - "8:25: " + getCheckMessage(FileTabCharacterCheck.class, "containsTab"), - "51:5: " + getCheckMessage(FileTabCharacterCheck.class, "containsTab"), ---- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java -@@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; - import com.puppycrawl.tools.checkstyle.api.Configuration; + verifyWithWholeConfig(getPath("InputWhitespaceCharacters.java")); + } + + @Test +- public void testFileTabFormatted() throws Exception { ++ void fileTabFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedWhitespaceCharacters.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/SpecialEscapeSequencesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/SpecialEscapeSequencesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter2filebasic.rule232specialescape; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class IllegalTokenTextTest extends AbstractGoogleModuleTestSupport { -+final class IllegalTokenTextTest extends AbstractGoogleModuleTestSupport { +-public class SpecialEscapeSequencesTest extends AbstractGoogleModuleTestSupport { ++final class SpecialEscapeSequencesTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -31,7 +31,7 @@ public class IllegalTokenTextTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class SpecialEscapeSequencesTest extends AbstractGoogleModuleTestSupport } @Test - public void testIllegalTokens() throws Exception { + void illegalTokens() throws Exception { - final String message = - "Consider using special escape sequence instead of octal value or " - + "Unicode escaped value."; ---- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java -@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck; + verifyWithWholeConfig(getPath("InputSpecialEscapeSequences.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/NonAsciiCharactersTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/NonAsciiCharactersTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter2filebasic.rule233nonascii; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class AvoidEscapedUnicodeCharactersTest extends AbstractGoogleModuleTestSupport { -+final class AvoidEscapedUnicodeCharactersTest extends AbstractGoogleModuleTestSupport { +-public class NonAsciiCharactersTest extends AbstractGoogleModuleTestSupport { ++final class NonAsciiCharactersTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -34,7 +34,7 @@ public class AvoidEscapedUnicodeCharactersTest extends AbstractGoogleModuleTestS +@@ -30,7 +30,7 @@ public class NonAsciiCharactersTest extends AbstractGoogleModuleTestSupport { } @Test - public void testUnicodeEscapes() throws Exception { + void unicodeEscapes() throws Exception { - final String[] expected = { - "5:42: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), - "15:38: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), ---- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck; + verifyWithWholeConfig(getPath("InputNonAsciiCharacters.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestatement/PackageStatementTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestatement/PackageStatementTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter3filestructure.rule32packagestatement; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class LineLengthTest extends AbstractGoogleModuleTestSupport { -+final class LineLengthTest extends AbstractGoogleModuleTestSupport { +-public class PackageStatementTest extends AbstractGoogleModuleTestSupport { ++final class PackageStatementTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class LineLengthTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class PackageStatementTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testLineLength() throws Exception { -+ void lineLength() throws Exception { - final String[] expected = { - "5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 112), - "29: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 183), ---- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java -@@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; - import com.puppycrawl.tools.checkstyle.api.Configuration; +- public void testPackageStatement() throws Exception { ++ void packageStatement() throws Exception { + verifyWithWholeConfig(getPath("InputPackageStatement.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/NoWildcardImportsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/NoWildcardImportsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter3filestructure.rule331nowildcard; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class AvoidStarImportTest extends AbstractGoogleModuleTestSupport { -+final class AvoidStarImportTest extends AbstractGoogleModuleTestSupport { +-public class NoWildcardImportsTest extends AbstractGoogleModuleTestSupport { ++final class NoWildcardImportsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -31,7 +31,7 @@ public class AvoidStarImportTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class NoWildcardImportsTest extends AbstractGoogleModuleTestSupport { } @Test - public void testStarImport() throws Exception { + void starImport() throws Exception { - final String[] expected = { - "3:15: Using the '.*' form of import should be avoided - java.io.*.", - "4:17: Using the '.*' form of import should be avoided - java.lang.*.", ---- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java -@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + verifyWithWholeConfig(getPath("InputNoWildcardImports.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrappingTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrappingTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter3filestructure.rule332nolinewrap; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { -+final class NoLineWrapTest extends AbstractGoogleModuleTestSupport { +-public class NoLineWrappingTest extends AbstractGoogleModuleTestSupport { ++final class NoLineWrappingTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -34,7 +34,7 @@ public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class NoLineWrappingTest extends AbstractGoogleModuleTestSupport { } @Test - public void testBadLineWrap() throws Exception { + void badLineWrap() throws Exception { - final String[] expected = { - "1:1: " + getCheckMessage(NoLineWrapCheck.class, "no.line.wrap", "package"), - "6:1: " + getCheckMessage(NoLineWrapCheck.class, "no.line.wrap", "import"), -@@ -49,7 +49,7 @@ public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputNoLineWrapping.java")); } @Test -- public void testGoodLineWrap() throws Exception { -+ void goodLineWrap() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("NoLineWrap"); -@@ -60,7 +60,7 @@ public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { +- public void testBadLineWrapFormatted() throws Exception { ++ void badLineWrapFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedNoLineWrapping.java")); } - - @Test -- public void goodLineLength() throws Exception { -+ void goodLineLength() throws Exception { - final int maxLineLength = 100; - final String[] expected = { - "5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", maxLineLength, 112), ---- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/OrderingAndSpacingTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/OrderingAndSpacingTest.java +@@ -22,89 +22,89 @@ package com.google.checkstyle.test.chapter3filestructure.rule333orderingandspaci + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { -+final class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { - - /** Shortcuts to make code more compact. */ - private static final String MSG_LINE_SEPARATOR = CustomImportOrderCheck.MSG_LINE_SEPARATOR; -@@ -45,7 +45,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { +-public class OrderingAndSpacingTest extends AbstractGoogleModuleTestSupport { ++final class OrderingAndSpacingTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing"; } @Test - public void testCustomImport1() throws Exception { + void customImport1() throws Exception { - final String[] expected = { - "4:1: " - + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), -@@ -68,7 +68,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOrderingAndSpacing1.java")); + } + + @Test +- public void testCustomImport1Formatted() throws Exception { ++ void customImport1Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing1.java")); } @Test - public void testCustomImport2() throws Exception { + void customImport2() throws Exception { - final String[] expected = { - "4:1: " - + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), -@@ -113,7 +113,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOrderingAndSpacing2.java")); + } + + @Test +- public void testCustomImport2Formatted() throws Exception { ++ void customImport2Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing2.java")); } @Test - public void testCustomImport3() throws Exception { + void customImport3() throws Exception { - final String[] expected = { - "4:1: " + getCheckMessage(clazz, MSG_LINE_SEPARATOR, "java.awt.Dialog"), - "5:1: " -@@ -155,7 +155,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOrderingAndSpacing3.java")); + } + + @Test +- public void testCustomImport3Formatted() throws Exception { ++ void customImport3Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing3.java")); } @Test - public void testCustomImport4() throws Exception { + void customImport4() throws Exception { - final String[] expected = { - "7:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "javax.swing.WindowConstants.*"), - "15:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "java.util.StringTokenizer"), -@@ -172,7 +172,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOrderingAndSpacing4.java")); + } + + @Test +- public void testCustomImport4Formatted() throws Exception { ++ void customImport4Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing4.java")); } @Test - public void testCustomImport5() throws Exception { + void customImport5() throws Exception { - final String[] expected = { - "9:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "javax.swing.WindowConstants.*"), - "13:1: " -@@ -195,7 +195,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOrderingAndSpacing5.java")); + } + + @Test +- public void testCustomImport5Formatted() throws Exception { ++ void customImport5Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacing5.java")); } @Test - public void testValid() throws Exception { + void valid() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithWholeConfig(getPath("InputOrderingAndSpacingValid.java")); + } - final Configuration checkConfig = getModuleConfig("CustomImportOrder"); -@@ -206,7 +206,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testValidFormatted() throws Exception { ++ void validFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacingValid.java")); } @Test - public void testValid2() throws Exception { + void valid2() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithWholeConfig(getPath("InputOrderingAndSpacingValid2.java")); + } - final Configuration checkConfig = getModuleConfig("CustomImportOrder"); -@@ -217,7 +217,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testValid2Formatted() throws Exception { ++ void valid2Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacingValid2.java")); } @Test - public void testValidGoogleStyleOrderOfImports() throws Exception { + void validGoogleStyleOrderOfImports() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithWholeConfig(getPath("InputOrderingAndSpacingNoImports.java")); + } - final Configuration checkConfig = getModuleConfig("CustomImportOrder"); ---- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + @Test +- public void testValidGoogleStyleOrderOfImportsFormatted() throws Exception { ++ void validGoogleStyleOrderOfImportsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOrderingAndSpacingNoImports.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/ExactlyOneTopLevelClassDeclarationTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/ExactlyOneTopLevelClassDeclarationTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter3filestructure.rule341onetoplevel; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { -+final class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { +-public class ExactlyOneTopLevelClassDeclarationTest extends AbstractGoogleModuleTestSupport { ++final class ExactlyOneTopLevelClassDeclarationTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { +@@ -30,22 +30,22 @@ public class ExactlyOneTopLevelClassDeclarationTest extends AbstractGoogleModule } @Test - public void testBad() throws Exception { + void bad() throws Exception { - final Class clazz = OneTopLevelClassCheck.class; - final String messageKey = "one.top.level.class"; - -@@ -54,7 +54,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOneTopLevelClassBasic.java")); } @Test - public void testGood() throws Exception { + void good() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("OneTopLevelClass"); -@@ -65,7 +65,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOneTopLevelClassGood.java")); } @Test - public void testBad1() throws Exception { + void bad1() throws Exception { - final Class clazz = OneTopLevelClassCheck.class; - final String messageKey = "one.top.level.class"; - -@@ -82,7 +82,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputOneTopLevelClassBad1.java")); } @Test - public void testBad2() throws Exception { + void bad2() throws Exception { - final Class clazz = OneTopLevelClassCheck.class; - final String messageKey = "one.top.level.class"; - ---- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationO - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + verifyWithWholeConfig(getPath("InputOneTopLevelClassBad2.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadsNeverSplitTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadsNeverSplitTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter3filestructure.rule3421overloadsplit; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { -+final class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { +-public class OverloadsNeverSplitTest extends AbstractGoogleModuleTestSupport { ++final class OverloadsNeverSplitTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes +@@ -30,12 +30,12 @@ public class OverloadsNeverSplitTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testOverloadMethods() throws Exception { -+ void overloadMethods() throws Exception { - final Class clazz = - OverloadMethodsDeclarationOrderCheck.class; - final String messageKey = "overload.methods.declaration"; -@@ -53,7 +53,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes +- public void testOverloadConstructors() throws Exception { ++ void overloadConstructors() throws Exception { + verifyWithWholeConfig(getPath("InputOverloadsNeverSplit.java")); } @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; - import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck; - import org.junit.jupiter.api.Test; - --public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { -+final class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { - - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { +- public void testOverloadConstructorsRecords() throws Exception { ++ void overloadConstructorsRecords() throws Exception { + verifyWithWholeConfig(getNonCompilablePath("InputOverloadsNeverSplitRecords.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/SourceFileStructureTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/SourceFileStructureTest.java +@@ -32,12 +32,12 @@ public class SourceFileStructureTest extends AbstractGoogleModuleTestSupport { } @Test - public void testEmptyLineSeparator() throws Exception { + void emptyLineSeparator() throws Exception { - final Class clazz = EmptyLineSeparatorCheck.class; - final String messageKey = "empty.line.separator"; + verifyWithWholeConfig(getPath("InputSourceFileStructure.java")); + } ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck; + @Test +- public void testEmptyLineSeparatorFormatted() throws Exception { ++ void emptyLineSeparatorFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSourceFileStructure.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/toolongpackagetotestcoveragegooglesjavastylerule/PackageStatementTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/toolongpackagetotestcoveragegooglesjavastylerule/PackageStatementTest.java +@@ -33,7 +33,7 @@ public class PackageStatementTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testPackageStatement() throws Exception { ++ void packageStatement() throws Exception { + verifyWithWholeConfig(getPath("InputPackageStatementLongName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411optionalbracesusage/UseOfOptionalBracesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411optionalbracesusage/UseOfOptionalBracesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule411optionalbracesusage + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class NeedBracesTest extends AbstractGoogleModuleTestSupport { -+final class NeedBracesTest extends AbstractGoogleModuleTestSupport { +-public class UseOfOptionalBracesTest extends AbstractGoogleModuleTestSupport { ++final class UseOfOptionalBracesTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class NeedBracesTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class UseOfOptionalBracesTest extends AbstractGoogleModuleTestSupport { } @Test - public void testNeedBraces() throws Exception { + void needBraces() throws Exception { - final Class clazz = NeedBracesCheck.class; - final String messageKey = "needBraces"; - ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java -@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck; + verifyWithWholeConfig(getPath("InputUseOfOptionalBraces.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/NonemptyBlocksKrStyleTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/NonemptyBlocksKrStyleTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule412nonemptyblocks; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { -+final class LeftCurlyTest extends AbstractGoogleModuleTestSupport { +-public class NonemptyBlocksKrStyleTest extends AbstractGoogleModuleTestSupport { ++final class NonemptyBlocksKrStyleTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -34,7 +34,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { +@@ -30,112 +30,112 @@ public class NonemptyBlocksKrStyleTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testLeftCurlyBraces() throws Exception { -+ void leftCurlyBraces() throws Exception { - final String[] expected = { - "4:1: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 1), - "7:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), -@@ -53,7 +53,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { +- public void testLeftAndRightCurlyBraces() throws Exception { ++ void leftAndRightCurlyBraces() throws Exception { + verifyWithWholeConfig(getPath("InputNonemptyBlocksLeftRightCurly.java")); + } + + @Test +- public void testLeftAndRightCurlyBracesFormatted() throws Exception { ++ void leftAndRightCurlyBracesFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedNonemptyBlocksLeftRightCurly.java")); } @Test - public void testLeftCurlyAnnotations() throws Exception { + void leftCurlyAnnotations() throws Exception { - final String[] expected = { - "10:1: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 1), - "14:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), -@@ -70,7 +70,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputLeftCurlyAnnotations.java")); + } + + @Test +- public void testLeftCurlyAnnotationsFormatted() throws Exception { ++ void leftCurlyAnnotationsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedLeftCurlyAnnotations.java")); } @Test - public void testLeftCurlyMethods() throws Exception { + void leftCurlyMethods() throws Exception { - final String[] expected = { - "4:1: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 1), - "9:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java -@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; - import org.junit.jupiter.api.Test; - --public class RightCurlyTest extends AbstractGoogleModuleTestSupport { -+final class RightCurlyTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputLeftCurlyMethod.java")); + } - private static final String[] MODULES = { - "RightCurlySame", "RightCurlyAlone", -@@ -41,7 +41,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testLeftCurlyMethodsFormatted() throws Exception { ++ void leftCurlyMethodsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedLeftCurlyMethod.java")); } @Test - public void testRightCurly() throws Exception { + void rightCurly() throws Exception { - final String[] expected = { - "20:17: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 17), - "32:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), -@@ -58,7 +58,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputRightCurly.java")); } @Test -- public void testRightCurly2() throws Exception { -+ void rightCurly2() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = createTreeWalkerConfig(getModuleConfigsByIds(MODULES)); -@@ -69,7 +69,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { +- public void testRightCurlyFormatted() throws Exception { ++ void rightCurlyFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedRightCurly.java")); } @Test - public void testRightCurlyLiteralDoDefault() throws Exception { + void rightCurlyLiteralDoDefault() throws Exception { - final String[] expected = { - "62:9: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 9), - "67:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), -@@ -84,7 +84,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputRightCurlyDoWhile.java")); + } + + @Test +- public void testRightCurlyLiteralDoDefaultFormatted() throws Exception { ++ void rightCurlyLiteralDoDefaultFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedRightCurlyDoWhile.java")); } @Test - public void testRightCurlyOther() throws Exception { + void rightCurlyOther() throws Exception { - final String[] expected = { - "20:17: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 17), - "32:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), -@@ -101,7 +101,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputRightCurlyOther.java")); + } + + @Test +- public void testRightCurlyOtherFormatted() throws Exception { ++ void rightCurlyOtherFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedRightCurlyOther.java")); } @Test - public void testRightCurlyLiteralDo() throws Exception { + void rightCurlyLiteralDo() throws Exception { - final String[] expected = { - "62:9: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 9), - "67:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), -@@ -116,7 +116,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputRightCurlyDoWhile2.java")); + } + + @Test +- public void testRightCurlyLiteralDoFormatted() throws Exception { ++ void rightCurlyLiteralDoFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedRightCurlyDoWhile2.java")); } @Test - public void testRightCurlySwitch() throws Exception { + void rightCurlySwitch() throws Exception { - final String[] expected = { - "12:24: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_ALONE, "}", 24), - "19:27: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_ALONE, "}", 27), ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; + verifyWithWholeConfig(getPath("InputRightCurlySwitchCase.java")); + } + + @Test +- public void testRightCurlySwitchFormatted() throws Exception { ++ void rightCurlySwitchFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedRightCurlySwitchCase.java")); + } + + @Test +- public void testRightCurlySwitchCases() throws Exception { ++ void rightCurlySwitchCases() throws Exception { + verifyWithWholeConfig(getPath("InputRightCurlySwitchCasesBlocks.java")); + } + + @Test +- public void testRightCurlySwitchCasesFormatted() throws Exception { ++ void rightCurlySwitchCasesFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedRightCurlySwitchCasesBlocks.java")); + } + + @Test +- public void testTryCatchIfElse() throws Exception { ++ void tryCatchIfElse() throws Exception { + verifyWithWholeConfig(getPath("InputTryCatchIfElse.java")); + } + + @Test +- public void testTryCatchIfElseFormatted() throws Exception { ++ void tryCatchIfElseFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedTryCatchIfElse.java")); + } + + @Test +- public void testTryCatchIfElse2() throws Exception { ++ void tryCatchIfElse2() throws Exception { + verifyWithWholeConfig(getPath("InputTryCatchIfElse2.java")); + } + + @Test +- public void testTryCatchIfElse2Formatted() throws Exception { ++ void tryCatchIfElse2Formatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedTryCatchIfElse2.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlocksMayBeConciseTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlocksMayBeConciseTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule413emptyblocks; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { -+final class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +-public class EmptyBlocksMayBeConciseTest extends AbstractGoogleModuleTestSupport { ++final class EmptyBlocksMayBeConciseTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +@@ -30,32 +30,32 @@ public class EmptyBlocksMayBeConciseTest extends AbstractGoogleModuleTestSupport } @Test -- public void testEmptyBlock() throws Exception { -+ void emptyBlock() throws Exception { - final String[] expected = { - "19:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), - "22:34: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), -@@ -77,7 +77,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +- public void testEmptyBlocksAndCatchBlocks() throws Exception { ++ void emptyBlocksAndCatchBlocks() throws Exception { + verifyWithWholeConfig(getPath("InputEmptyBlocksAndCatchBlocks.java")); } @Test -- public void testEmptyBlockCatch() throws Exception { -+ void emptyBlockCatch() throws Exception { - final String[] expected = { - "29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), - "50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +- public void testEmptyBlocksAndCatchBlocksFormatted() throws Exception { ++ void emptyBlocksAndCatchBlocksFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedEmptyBlocksAndCatchBlocks.java")); + } + + @Test +- public void testEmptyFinallyBlocks() throws Exception { ++ void emptyFinallyBlocks() throws Exception { + verifyWithWholeConfig(getPath("InputEmptyFinallyBlocks.java")); + } + + @Test +- public void testEmptyCatchBlockNoViolations() throws Exception { ++ void emptyCatchBlockNoViolations() throws Exception { + verifyWithWholeConfig(getPath("InputEmptyBlocksAndCatchBlocksNoViolations.java")); + } + + @Test +- public void testEmptyCatchBlockViolationsByComment() throws Exception { ++ void emptyCatchBlockViolationsByComment() throws Exception { + verifyWithWholeConfig(getPath("InputEmptyCatchBlockViolationsByComment.java")); + } + + @Test +- public void testEmptyCatchBlockViolationsByVariableName() throws Exception { ++ void emptyCatchBlockViolationsByVariableName() throws Exception { + verifyWithWholeConfig(getPath("InputEmptyCatchBlockViolationsByVariableName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule42blockindentation/BlockIndentation2SpacesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule42blockindentation/BlockIndentation2SpacesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule42blockindentation; + import com.google.checkstyle.test.base.AbstractIndentationTestSupport; import org.junit.jupiter.api.Test; --public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { -+final class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { +-public class BlockIndentation2SpacesTest extends AbstractIndentationTestSupport { ++final class BlockIndentation2SpacesTest extends AbstractIndentationTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { +@@ -30,72 +30,72 @@ public class BlockIndentation2SpacesTest extends AbstractIndentationTestSupport } @Test -- public void testEmptyBlockCatch() throws Exception { -+ void emptyBlockCatch() throws Exception { - final String[] expected = { - "28:31: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), - "49:35: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), -@@ -50,7 +50,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { +- public void testCorrectClass() throws Exception { ++ void correctClass() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectClass.java")); } @Test -- public void testNoViolations() throws Exception { -+ void noViolations() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +- public void testCorrectField() throws Exception { ++ void correctField() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectFieldAndParameter.java")); + } - final Configuration checkConfig = getModuleConfig("EmptyCatchBlock"); -@@ -61,7 +61,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testCorrectFor() throws Exception { ++ void correctFor() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectForAndParameter.java")); } @Test -- public void testViolationsByComment() throws Exception { -+ void violationsByComment() throws Exception { - final String[] expected = { - "20:9: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), - "28:18: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), -@@ -75,7 +75,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { +- public void testCorrectIf() throws Exception { ++ void correctIf() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectIfAndParameter.java")); } @Test -- public void testViolationsByVariableName() throws Exception { -+ void violationsByVariableName() throws Exception { - final String[] expected = { - "20:9: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), - "36:18: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), +- public void testCorrectNewKeyword() throws Exception { ++ void correctNewKeyword() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectNewChildren.java")); + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrect.java")); + } + + @Test +- public void testCorrectReturn() throws Exception { ++ void correctReturn() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectReturnAndParameter.java")); + } + + @Test +- public void testCorrectWhile() throws Exception { ++ void correctWhile() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectWhileDoWhileAndParameter.java")); + } + + @Test +- public void testCorrectChained() throws Exception { ++ void correctChained() throws Exception { + verifyWithWholeConfig(getPath("ClassWithChainedMethodsCorrect.java")); + } + + @Test +- public void testWarnChained() throws Exception { ++ void warnChained() throws Exception { + verifyWithWholeConfig(getPath("ClassWithChainedMethods.java")); + } + + @Test +- public void testCorrectAnnotationArrayInit() throws Exception { ++ void correctAnnotationArrayInit() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectAnnotationArrayInit.java")); + } + + @Test +- public void testCodeBlocks() throws Exception { ++ void codeBlocks() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCodeBlocks.java")); + } + + @Test +- public void testCodeBlocksFormatted() throws Exception { ++ void codeBlocksFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedIndentationCodeBlocks.java")); + } + + @Test +- public void testFastMatcher() throws Exception { ++ void fastMatcher() throws Exception { + verifyWithWholeConfig(getPath("InputFastMatcher.java")); + } + } --- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck; +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule43onestatement; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; -public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { @@ -640,418 +756,527 @@ @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { +@@ -30,17 +30,17 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { } @Test - public void testOneStatement() throws Exception { + void oneStatement() throws Exception { - final String msg = getCheckMessage(OneStatementPerLineCheck.class, "multiple.statements.line"); + verifyWithWholeConfig(getPath("InputOneStatementPerLine.java")); + } - final String[] expected = { -@@ -67,7 +67,7 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testOneStatementFormatted() throws Exception { ++ void oneStatementFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOneStatementPerLine.java")); } @Test - public void testOneStatementNonCompilableInput() throws Exception { + void oneStatementNonCompilableInput() throws Exception { - final String msg = getCheckMessage(OneStatementPerLineCheck.class, "multiple.statements.line"); - - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck; + verifyWithWholeConfig(getNonCompilablePath("InputOneStatementPerLine.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/ColumnLimit100Test.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/ColumnLimit100Test.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule44columnlimit; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class LineLengthTest extends AbstractGoogleModuleTestSupport { -+final class LineLengthTest extends AbstractGoogleModuleTestSupport { +-public class ColumnLimit100Test extends AbstractGoogleModuleTestSupport { ++final class ColumnLimit100Test extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class LineLengthTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class ColumnLimit100Test extends AbstractGoogleModuleTestSupport { } @Test - public void testLineLength() throws Exception { + void lineLength() throws Exception { - final String[] expected = { - "5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 112), - "29: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 113), ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck; - import org.junit.jupiter.api.Test; - --public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { -+final class MethodParamPadTest extends AbstractGoogleModuleTestSupport { - - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputColumnLimit.java")); } @Test -- public void testOperatorWrap() throws Exception { -+ void operatorWrap() throws Exception { - final Class clazz = MethodParamPadCheck.class; - final String messageKeyPrevious = "line.previous"; - final String messageKeyPreceded = "ws.preceded"; ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck; +- public void testLineLengthFormatted() throws Exception { ++ void lineLengthFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedColumnLimit.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/WhereToBreakTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/WhereToBreakTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule451wheretobreak; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class OperatorWrapTest extends AbstractGoogleModuleTestSupport { -+final class OperatorWrapTest extends AbstractGoogleModuleTestSupport { +-public class WhereToBreakTest extends AbstractGoogleModuleTestSupport { ++final class WhereToBreakTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class OperatorWrapTest extends AbstractGoogleModuleTestSupport { +@@ -30,82 +30,82 @@ public class WhereToBreakTest extends AbstractGoogleModuleTestSupport { } @Test - public void testOperatorWrap() throws Exception { + void operatorWrap() throws Exception { - final Class clazz = OperatorWrapCheck.class; - final String messageKey = "line.new"; + verifyWithWholeConfig(getPath("InputOperatorWrap.java")); + } ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java -@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck; - import org.junit.jupiter.api.Test; + @Test +- public void testOperatorWrapFormatted() throws Exception { ++ void operatorWrapFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOperatorWrap.java")); + } --public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { -+final class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testMethodParamPad() throws Exception { ++ void methodParamPad() throws Exception { + verifyWithWholeConfig(getPath("InputMethodParamPad.java")); + } - @Override - protected String getPackageLocation() { -@@ -34,7 +34,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testMethodParamPadFormatted() throws Exception { ++ void methodParamPadFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedMethodParamPad.java")); } @Test - public void testSeparatorWrapDot() throws Exception { + void separatorWrapDot() throws Exception { - final String[] expected = { - "28:30: " + getCheckMessage(SeparatorWrapCheck.class, "line.new", "."), - }; -@@ -47,7 +47,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputSeparatorWrap.java")); + } + + @Test +- public void testSeparatorWrapDotFormatted() throws Exception { ++ void separatorWrapDotFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSeparatorWrap.java")); } @Test - public void testSeparatorWrapComma() throws Exception { + void separatorWrapComma() throws Exception { - final String[] expected = { - "31:17: " + getCheckMessage(SeparatorWrapCheck.class, "line.previous", ","), - }; -@@ -60,7 +60,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputSeparatorWrapComma.java")); + } + + @Test +- public void testSeparatorWrapCommaFormatted() throws Exception { ++ void separatorWrapCommaFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSeparatorWrapComma.java")); } @Test - public void testSeparatorWrapMethodRef() throws Exception { + void separatorWrapMethodRef() throws Exception { - final String[] expected = { - "17:49: " + getCheckMessage(SeparatorWrapCheck.class, MSG_LINE_NEW, "::"), - }; -@@ -73,7 +73,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputSeparatorWrapMethodRef.java")); + } + + @Test +- public void testSeparatorWrapMethodRefFormatted() throws Exception { ++ void separatorWrapMethodRefFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSeparatorWrapMethodRef.java")); } @Test - public void testEllipsis() throws Exception { + void ellipsis() throws Exception { - final String[] expected = { - "11:13: " + getCheckMessage(SeparatorWrapCheck.class, "line.previous", "..."), - }; -@@ -86,7 +86,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputSeparatorWrapEllipsis.java")); + } + + @Test +- public void testEllipsisFormatted() throws Exception { ++ void ellipsisFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSeparatorWrapEllipsis.java")); } @Test - public void testArrayDeclarator() throws Exception { + void arrayDeclarator() throws Exception { - final String[] expected = { - "9:13: " + getCheckMessage(SeparatorWrapCheck.class, "line.previous", "["), - }; ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck; + verifyWithWholeConfig(getPath("InputSeparatorWrapArrayDeclarator.java")); + } + + @Test +- public void testArrayDeclaratorFormatted() throws Exception { ++ void arrayDeclaratorFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSeparatorWrapArrayDeclarator.java")); + } + + @Test +- public void testLambdaBodyWrap() throws Exception { ++ void lambdaBodyWrap() throws Exception { + verifyWithWholeConfig(getPath("InputLambdaBodyWrap.java")); + } + + @Test +- public void testLambdaBodyWrapFormatted() throws Exception { ++ void lambdaBodyWrapFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedLambdaBodyWrap.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule452indentcontinuationlines/IndentContinuationLinesAtLeast4SpacesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule452indentcontinuationlines/IndentContinuationLinesAtLeast4SpacesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule452indentcontinuationl + import com.google.checkstyle.test.base.AbstractIndentationTestSupport; import org.junit.jupiter.api.Test; --public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { -+final class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { +-public class IndentContinuationLinesAtLeast4SpacesTest extends AbstractIndentationTestSupport { ++final class IndentContinuationLinesAtLeast4SpacesTest extends AbstractIndentationTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { +@@ -30,62 +30,62 @@ public class IndentContinuationLinesAtLeast4SpacesTest extends AbstractIndentati } @Test -- public void testEmptyLineSeparator() throws Exception { -+ void emptyLineSeparator() throws Exception { - final Class clazz = EmptyLineSeparatorCheck.class; - final String messageKey = "empty.line.separator"; +- public void testCorrectClass() throws Exception { ++ void correctClass() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectClass.java")); + } ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; - import java.util.Map; - import org.junit.jupiter.api.Test; + @Test +- public void testCorrectField() throws Exception { ++ void correctField() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectFieldAndParameter.java")); + } --public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { -+final class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testCorrectFor() throws Exception { ++ void correctFor() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectForAndParameter.java")); + } - @Override - protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testCorrectIf() throws Exception { ++ void correctIf() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectIfAndParameter.java")); } @Test -- public void testWhitespaceAroundGenerics() throws Exception { -+ void whitespaceAroundGenerics() throws Exception { - final String msgPreceded = "ws.preceded"; - final String msgFollowed = "ws.followed"; - final Configuration checkConfig = getModuleConfig("GenericWhitespace"); -@@ -66,7 +66,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { +- public void testCorrectNewKeyword() throws Exception { ++ void correctNewKeyword() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectNewChildren.java")); } @Test -- public void testGenericWhitespace() throws Exception { -+ void genericWhitespace() throws Exception { - final String msgPreceded = "ws.preceded"; - final String msgFollowed = "ws.followed"; - final String msgNotPreceded = "ws.notPreceded"; -@@ -112,7 +112,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrect.java")); } @Test -- public void genericEndsTheLine() throws Exception { -+ void genericEndsTheLine() throws Exception { - final Configuration checkConfig = getModuleConfig("GenericWhitespace"); - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verify(checkConfig, getPath("InputGenericWhitespaceEndsTheLine.java"), expected); ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/MethodParamPadTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/MethodParamPadTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck; - import org.junit.jupiter.api.Test; +- public void testCorrectReturn() throws Exception { ++ void correctReturn() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectReturnAndParameter.java")); + } --public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { -+final class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testCorrectWhile() throws Exception { ++ void correctWhile() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectWhileDoWhileAndParameter.java")); + } - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testCorrectChained() throws Exception { ++ void correctChained() throws Exception { + verifyWithWholeConfig(getPath("ClassWithChainedMethodsCorrect.java")); } @Test -- public void testOperatorWrap() throws Exception { -+ void operatorWrap() throws Exception { - final Class clazz = MethodParamPadCheck.class; - final String messageKeyPreceded = "ws.preceded"; +- public void testWarnChained() throws Exception { ++ void warnChained() throws Exception { + verifyWithWholeConfig(getPath("ClassWithChainedMethods.java")); + } ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeCaseDefaultColonTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeCaseDefaultColonTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck; + @Test +- public void testCorrectAnnotationArrayInit() throws Exception { ++ void correctAnnotationArrayInit() throws Exception { + verifyWithWholeConfig(getPath("InputIndentationCorrectAnnotationArrayInit.java")); + } + + @Test +- public void testFastMatcher() throws Exception { ++ void fastMatcher() throws Exception { + verifyWithWholeConfig(getPath("InputFastMatcher.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/VerticalWhitespaceTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/VerticalWhitespaceTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule461verticalwhitespace; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModuleTestSupport { -+final class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModuleTestSupport { +-public class VerticalWhitespaceTest extends AbstractGoogleModuleTestSupport { ++final class VerticalWhitespaceTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModule +@@ -30,12 +30,12 @@ public class VerticalWhitespaceTest extends AbstractGoogleModuleTestSupport { } @Test -- public void test() throws Exception { -+ void test() throws Exception { - final Class clazz = NoWhitespaceBeforeCheck.class; - final String messageKeyPreceded = "ws.preceded"; +- public void testEmptyLineSeparator() throws Exception { ++ void emptyLineSeparator() throws Exception { + verifyWithWholeConfig(getPath("InputVerticalWhitespace.java")); + } ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + @Test +- public void testEmptyLineSeparatorFormatted() throws Exception { ++ void emptyLineSeparatorFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedVerticalWhitespace.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/HorizontalWhitespaceTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/HorizontalWhitespaceTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule462horizontalwhitespac + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { -+final class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { +-public class HorizontalWhitespaceTest extends AbstractGoogleModuleTestSupport { ++final class HorizontalWhitespaceTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { +@@ -30,142 +30,142 @@ public class HorizontalWhitespaceTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testEmptyForLoop() throws Exception { -+ void emptyForLoop() throws Exception { - final Class clazz = NoWhitespaceBeforeCheck.class; - final String messageKeyPreceded = "ws.preceded"; +- public void testWhitespaceAroundBasic() throws Exception { ++ void whitespaceAroundBasic() throws Exception { + verifyWithWholeConfig(getPath("InputWhitespaceAroundBasic.java")); + } -@@ -49,7 +49,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testWhitespaceAroundBasicFormatted() throws Exception { ++ void whitespaceAroundBasicFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedWhitespaceAroundBasic.java")); } @Test -- public void testColonOfLabel() throws Exception { -+ void colonOfLabel() throws Exception { - final Class clazz = NoWhitespaceBeforeCheck.class; - final String messageKeyPreceded = "ws.preceded"; +- public void testWhitespaceAroundEmptyTypesCycles() throws Exception { ++ void whitespaceAroundEmptyTypesCycles() throws Exception { + verifyWithWholeConfig(getPath("InputWhitespaceAroundEmptyTypesAndCycles.java")); + } -@@ -64,7 +64,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testWhitespaceAroundEmptyTypesCyclesFormatted() throws Exception { ++ void whitespaceAroundEmptyTypesCyclesFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedWhitespaceAroundEmptyTypesAndCycles.java")); } @Test -- public void testAnnotations() throws Exception { -+ void annotations() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - final Configuration checkConfig = getModuleConfig("NoWhitespaceBefore"); - final String filePath = getPath("InputNoWhitespaceBeforeAnnotations.java"); ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/ParenPadTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/ParenPadTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck; - import org.junit.jupiter.api.Test; +- public void testWhitespaceAfterBad() throws Exception { ++ void whitespaceAfterBad() throws Exception { + verifyWithWholeConfig(getPath("InputWhitespaceAfterBad.java")); + } --public class ParenPadTest extends AbstractGoogleModuleTestSupport { -+final class ParenPadTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testWhitespaceAfterBadFormatted() throws Exception { ++ void whitespaceAfterBadFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedWhitespaceAfterBad.java")); + } - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class ParenPadTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testWhitespaceAfterGood() throws Exception { ++ void whitespaceAfterGood() throws Exception { + verifyWithWholeConfig(getPath("InputWhitespaceAfterGood.java")); } @Test -- public void testMethodParen() throws Exception { -+ void methodParen() throws Exception { - final Class clazz = ParenPadCheck.class; - final String messageKeyPreceded = "ws.preceded"; - final String messageKeyFollowed = "ws.followed"; ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAfterTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAfterTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; - import org.junit.jupiter.api.Test; +- public void testWhitespaceAfterGoodFormatted() throws Exception { ++ void whitespaceAfterGoodFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedWhitespaceAfterGood.java")); + } --public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { -+final class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testParenPad() throws Exception { ++ void parenPad() throws Exception { + verifyWithWholeConfig(getPath("InputParenPad.java")); + } - @Override - protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testParenPadFormatted() throws Exception { ++ void parenPadFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedParenPad.java")); } @Test -- public void testWhitespaceAfterBad() throws Exception { -+ void whitespaceAfterBad() throws Exception { - final Class clazz = WhitespaceAfterCheck.class; - final String message = "ws.notFollowed"; +- public void testNoWhitespaceBeforeEmptyForLoop() throws Exception { ++ void noWhitespaceBeforeEmptyForLoop() throws Exception { + verifyWithWholeConfig(getPath("InputNoWhitespaceBeforeEmptyForLoop.java")); + } -@@ -70,7 +70,7 @@ public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testNoWhitespaceBeforeEmptyForLoopFormatted() throws Exception { ++ void noWhitespaceBeforeEmptyForLoopFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedNoWhitespaceBeforeEmptyForLoop.java")); } @Test -- public void testWhitespaceAfterGood() throws Exception { -+ void whitespaceAfterGood() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - final Configuration checkConfig = getModuleConfig("WhitespaceAfter"); - final String filePath = getPath("InputWhitespaceAfterGood.java"); ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; - import java.util.Map; - import org.junit.jupiter.api.Test; +- public void testNoWhitespaceBeforeColonOfLabel() throws Exception { ++ void noWhitespaceBeforeColonOfLabel() throws Exception { + verifyWithWholeConfig(getPath("InputNoWhitespaceBeforeColonOfLabel.java")); + } --public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { -+final class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testNoWhitespaceBeforeColonOfLabelFormatted() throws Exception { ++ void noWhitespaceBeforeColonOfLabelFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedNoWhitespaceBeforeColonOfLabel.java")); + } - @Override - protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testNoWhitespaceBeforeAnnotations() throws Exception { ++ void noWhitespaceBeforeAnnotations() throws Exception { + verifyWithWholeConfig(getPath("InputNoWhitespaceBeforeAnnotations.java")); } @Test -- public void testWhitespaceAroundBasic() throws Exception { -+ void whitespaceAroundBasic() throws Exception { - final Configuration checkConfig = getModuleConfig("WhitespaceAround"); - final String msgPreceded = "ws.notPreceded"; - final String msgFollowed = "ws.notFollowed"; -@@ -75,7 +75,7 @@ public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { +- public void testNoWhitespaceBeforeAnnotationsFormatted() throws Exception { ++ void noWhitespaceBeforeAnnotationsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedNoWhitespaceBeforeAnnotations.java")); } @Test -- public void testWhitespaceAroundEmptyTypesCycles() throws Exception { -+ void whitespaceAroundEmptyTypesCycles() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +- public void testNoWhitespaceBeforeCaseDefaultColon() throws Exception { ++ void noWhitespaceBeforeCaseDefaultColon() throws Exception { + verifyWithWholeConfig(getPath("InputNoWhitespaceBeforeCaseDefaultColon.java")); + } + + @Test +- public void testNoWhitespaceBeforeCaseDefaultColonFormatted() throws Exception { ++ void noWhitespaceBeforeCaseDefaultColonFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedNoWhitespaceBeforeCaseDefaultColon.java")); + } - final Configuration checkConfig = getModuleConfig("WhitespaceAround"); ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck; + @Test +- public void testMethodParamPad() throws Exception { ++ void methodParamPad() throws Exception { + verifyWithWholeConfig(getPath("InputMethodParamPad.java")); + } + + @Test +- public void testMethodParamPadFormatted() throws Exception { ++ void methodParamPadFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedMethodParamPad.java")); + } + + @Test +- public void testWhitespaceAroundGenerics() throws Exception { ++ void whitespaceAroundGenerics() throws Exception { + verifyWithWholeConfig(getPath("InputWhitespaceAroundGenerics.java")); + } + + @Test +- public void testWhitespaceAroundGenericsFormatted() throws Exception { ++ void whitespaceAroundGenericsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedWhitespaceAroundGenerics.java")); + } + + @Test +- public void testGenericWhitespace() throws Exception { ++ void genericWhitespace() throws Exception { + verifyWithWholeConfig(getPath("InputGenericWhitespace.java")); + } + + @Test +- public void testGenericWhitespaceFormatted() throws Exception { ++ void genericWhitespaceFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedGenericWhitespace.java")); + } + + @Test +- public void genericEndsTheLine() throws Exception { ++ void genericEndsTheLine() throws Exception { + verifyWithWholeConfig(getPath("InputGenericWhitespaceEndsTheLine.java")); + } + + @Test +- public void genericEndsTheLineFormatted() throws Exception { ++ void genericEndsTheLineFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedGenericWhitespaceEndsTheLine.java")); + } + + @Test +- public void testWhitespaceAroundWhen() throws Exception { ++ void whitespaceAroundWhen() throws Exception { + verifyWithWholeConfig(getNonCompilablePath("InputWhitespaceAroundWhen.java")); + } + + @Test +- public void testWhitespaceAroundWhenFormatted() throws Exception { ++ void whitespaceAroundWhenFormatted() throws Exception { + verifyWithWholeConfig(getNonCompilablePath("InputFormattedWhitespaceAroundWhen.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/OneVariablePerDeclarationTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/OneVariablePerDeclarationTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4821onevariableperline + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSupport { -+final class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSupport { +-public class OneVariablePerDeclarationTest extends AbstractGoogleModuleTestSupport { ++final class OneVariablePerDeclarationTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSu +@@ -30,12 +30,12 @@ public class OneVariablePerDeclarationTest extends AbstractGoogleModuleTestSuppo } @Test - public void testMultipleVariableDeclarations() throws Exception { + void multipleVariableDeclarations() throws Exception { - final String msgComma = - getCheckMessage( - MultipleVariableDeclarationsCheck.class, "multiple.variable.declarations.comma"); ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck; + verifyWithWholeConfig(getPath("InputOneVariablePerDeclaration.java")); + } + + @Test +- public void testMultipleVariableDeclarationsFormatted() throws Exception { ++ void multipleVariableDeclarationsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedOneVariablePerDeclaration.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822declaredwhenneeded/DeclaredWhenNeededTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822declaredwhenneeded/DeclaredWhenNeededTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4822declaredwhenneeded + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTestSupport { -+final class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTestSupport { +-public class DeclaredWhenNeededTest extends AbstractGoogleModuleTestSupport { ++final class DeclaredWhenNeededTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTe +@@ -30,7 +30,7 @@ public class DeclaredWhenNeededTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testArrayTypeStyle() throws Exception { -+ void arrayTypeStyle() throws Exception { - final String msgExt = "variable.declaration.usage.distance.extend"; - final Class clazz = - VariableDeclarationUsageDistanceCheck.class; ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java -@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck; +- public void testVariableDeclarationUsageDistance() throws Exception { ++ void variableDeclarationUsageDistance() throws Exception { + verifyWithWholeConfig(getPath("InputDeclaredWhenNeeded.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/NoCstyleArrayDeclarationsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/NoCstyleArrayDeclarationsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4832nocstylearray; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { -+final class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { +-public class NoCstyleArrayDeclarationsTest extends AbstractGoogleModuleTestSupport { ++final class NoCstyleArrayDeclarationsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -34,7 +34,7 @@ public class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class NoCstyleArrayDeclarationsTest extends AbstractGoogleModuleTestSuppo } @Test - public void testArrayTypeStyle() throws Exception { + void arrayTypeStyle() throws Exception { - final String[] expected = { - "9:23: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), - "15:44: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + verifyWithWholeConfig(getPath("InputNoCstyleArrays.java")); + } + } --- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java -@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4841indentation; + import com.google.checkstyle.test.base.AbstractIndentationTestSupport; import org.junit.jupiter.api.Test; -public class IndentationTest extends AbstractIndentationTestSupport { @@ -1059,985 +1284,910 @@ @Override protected String getPackageLocation() { -@@ -36,7 +36,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { +@@ -30,67 +30,67 @@ public class IndentationTest extends AbstractIndentationTestSupport { } @Test - public void testCorrectClass() throws Exception { + void correctClass() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -47,7 +47,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectClass.java")); } @Test - public void testCorrectField() throws Exception { + void correctField() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -58,7 +58,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectFieldAndParameter.java")); } @Test - public void testCorrectFor() throws Exception { + void correctFor() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -69,7 +69,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectForAndParameter.java")); } @Test - public void testCorrectIf() throws Exception { + void correctIf() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -80,7 +80,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectIfAndParameter.java")); } @Test - public void testCorrectNewKeyword() throws Exception { + void correctNewKeyword() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -91,7 +91,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectNewChildren.java")); } @Test - public void testCorrect() throws Exception { + void correct() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -102,7 +102,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrect.java")); } @Test - public void testCorrectReturn() throws Exception { + void correctReturn() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -113,7 +113,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectReturnAndParameter.java")); } @Test - public void testCorrectWhile() throws Exception { + void correctWhile() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -124,7 +124,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputIndentationCorrectWhileDoWhileAndParameter.java")); } @Test - public void testCorrectChained() throws Exception { + void correctChained() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("Indentation"); -@@ -135,7 +135,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputClassWithChainedMethodsCorrect.java")); } @Test - public void testWarnChained() throws Exception { + void warnChained() throws Exception { - final String[] expected = { - "18:5: " + getCheckMessage(IndentationCheck.class, MSG_CHILD_ERROR, "method call", 4, 8), - "23:5: " + getCheckMessage(IndentationCheck.class, MSG_ERROR, ".", 4, 8), -@@ -151,7 +151,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + verifyWithWholeConfig(getPath("InputClassWithChainedMethods.java")); + } + + @Test +- public void testWarnChainedFormatted() throws Exception { ++ void warnChainedFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedClassWithChainedMethods.java")); } @Test - public void testCorrectAnnotationArrayInit() throws Exception { + void correctAnnotationArrayInit() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithWholeConfig(getPath("InputIndentationCorrectAnnotationArrayInit.java")); + } - final Configuration checkConfig = getModuleConfig("Indentation"); ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck; + @Test +- public void testFastMatcher() throws Exception { ++ void fastMatcher() throws Exception { + verifyWithWholeConfig(getPath("InputFastMatcher.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughCommentedTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughCommentedTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4842fallthrough; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class FallThroughTest extends AbstractGoogleModuleTestSupport { -+final class FallThroughTest extends AbstractGoogleModuleTestSupport { +-public class FallThroughCommentedTest extends AbstractGoogleModuleTestSupport { ++final class FallThroughCommentedTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class FallThroughTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class FallThroughCommentedTest extends AbstractGoogleModuleTestSupport { } @Test - public void testFallThrough() throws Exception { + void fallThrough() throws Exception { - final String msg = getCheckMessage(FallThroughCheck.class, "fall.through"); + verifyWithWholeConfig(getPath("InputFallThrough.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultlabelpresence/PresenceOfTheDefaultLabelTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultlabelpresence/PresenceOfTheDefaultLabelTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4843defaultlabelpresen + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + import org.junit.jupiter.api.Test; - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck; +-public class PresenceOfTheDefaultLabelTest extends AbstractGoogleModuleTestSupport { ++final class PresenceOfTheDefaultLabelTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -30,7 +30,7 @@ public class PresenceOfTheDefaultLabelTest extends AbstractGoogleModuleTestSuppo + } + + @Test +- public void testPresenceOfDefaultLabel() throws Exception { ++ void presenceOfDefaultLabel() throws Exception { + verifyWithWholeConfig(getPath("InputPresenceOfDefaultLabel.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4852classannotations/ClassAnnotationsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4852classannotations/ClassAnnotationsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4852classannotations; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { -+final class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { +-public class ClassAnnotationsTest extends AbstractGoogleModuleTestSupport { ++final class ClassAnnotationsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { +@@ -30,13 +30,13 @@ public class ClassAnnotationsTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testMissingSwitchDefault() throws Exception { -+ void missingSwitchDefault() throws Exception { - final String msg = getCheckMessage(MissingSwitchDefaultCheck.class, "missing.switch.default"); +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final String filePath = getPath("InputClassAnnotations.java"); + verifyWithWholeConfig(filePath); + } - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck; + @Test +- public void testAnnotationFormatted() throws Exception { ++ void annotationFormatted() throws Exception { + final String filePath = getPath("InputFormattedClassAnnotations.java"); + verifyWithWholeConfig(filePath); + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4853methodsandconstructorsannotations/MethodsAndConstructorsAnnotationsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4853methodsandconstructorsannotations/MethodsAndConstructorsAnnotationsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4853methodsandconstruc + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { -+final class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { +-public class MethodsAndConstructorsAnnotationsTest extends AbstractGoogleModuleTestSupport { ++final class MethodsAndConstructorsAnnotationsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { +@@ -31,12 +31,12 @@ public class MethodsAndConstructorsAnnotationsTest extends AbstractGoogleModuleT } @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { - final Class clazz = AnnotationLocationCheck.class; - getCheckMessage(clazz, "annotation.location.alone"); - final Configuration checkConfig = -@@ -62,7 +62,7 @@ public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputMethodsAndConstructorsAnnotations.java")); + } + + @Test +- public void testAnnotationFormatted() throws Exception { ++ void annotationFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedMethodsAndConstructorsAnnotations.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4854fieldannotations/FieldAnnotationsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4854fieldannotations/FieldAnnotationsTest.java +@@ -22,19 +22,19 @@ package com.google.checkstyle.test.chapter4formatting.rule4854fieldannotations; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class FieldAnnotationsTest extends AbstractGoogleModuleTestSupport { ++final class FieldAnnotationsTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/google/checkstyle/test/chapter4formatting/rule4854fieldannotations"; + } + + @Test +- public void testAnnotations() throws Exception { ++ void annotations() throws Exception { + verifyWithWholeConfig(getPath("InputFieldAnnotations.java")); } @Test -- public void testAnnotationVariables() throws Exception { -+ void annotationVariables() throws Exception { - final Class clazz = AnnotationLocationCheck.class; - getCheckMessage(clazz, "annotation.location.alone"); - final Configuration checkConfig = ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck; +- public void testAnnotationsFormatted() throws Exception { ++ void annotationsFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedFieldAnnotations.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/BlockCommentStyleTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/BlockCommentStyleTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule4861blockcommentstyle; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { -+final class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { +-public class BlockCommentStyleTest extends AbstractGoogleModuleTestSupport { ++final class BlockCommentStyleTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { +@@ -30,43 +30,43 @@ public class BlockCommentStyleTest extends AbstractGoogleModuleTestSupport { } @Test - public void testCommentIsAtTheEndOfBlock() throws Exception { + void commentIsAtTheEndOfBlock() throws Exception { - final String[] expected = { - "18:26: " - + getCheckMessage( -@@ -125,7 +125,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputCommentsIndentationCommentIsAtTheEndOfBlock.java")); + } + + @Test +- public void testCommentIsAtTheEndOfBlockFormatted() throws Exception { ++ void commentIsAtTheEndOfBlockFormatted() throws Exception { + verifyWithWholeConfig( + getPath("InputFormattedCommentsIndentationCommentIsAtTheEndOfBlock.java")); } @Test - public void testCommentIsInsideSwitchBlock() throws Exception { + void commentIsInsideSwitchBlock() throws Exception { - final String[] expected = { - "19:13: " - + getCheckMessage( -@@ -228,7 +228,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputCommentsIndentationInSwitchBlock.java")); + } + + @Test +- public void testCommentIsInsideSwitchBlockFormatted() throws Exception { ++ void commentIsInsideSwitchBlockFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedCommentsIndentationInSwitchBlock.java")); } @Test - public void testCommentIsInsideEmptyBlock() throws Exception { + void commentIsInsideEmptyBlock() throws Exception { - final String[] expected = { - "9:20: " - + getCheckMessage( -@@ -255,7 +255,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputCommentsIndentationInEmptyBlock.java")); + } + + @Test +- public void testCommentIsInsideEmptyBlockFormatted() throws Exception { ++ void commentIsInsideEmptyBlockFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedCommentsIndentationInEmptyBlock.java")); } @Test - public void testSurroundingCode() throws Exception { + void surroundingCode() throws Exception { - final String[] expected = { - "13:15: " - + getCheckMessage( ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck; + verifyWithWholeConfig(getPath("InputCommentsIndentationSurroundingCode.java")); + } + + @Test +- public void testSurroundingCodeFormatted() throws Exception { ++ void surroundingCodeFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedCommentsIndentationSurroundingCode.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifiersTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifiersTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule487modifiers; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class ModifierOrderTest extends AbstractGoogleModuleTestSupport { -+final class ModifierOrderTest extends AbstractGoogleModuleTestSupport { +-public class ModifiersTest extends AbstractGoogleModuleTestSupport { ++final class ModifiersTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class ModifierOrderTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class ModifiersTest extends AbstractGoogleModuleTestSupport { } @Test - public void testModifierOrder() throws Exception { + void modifierOrder() throws Exception { - final Class clazz = ModifierOrderCheck.class; - final String msgMod = "mod.order"; - final String msgAnnotation = "annotation.order"; ---- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java -@@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; - import com.puppycrawl.tools.checkstyle.api.Configuration; + verifyWithWholeConfig(getPath("InputModifierOrder.java")); + } + + @Test +- public void testModifierOrderFormatted() throws Exception { ++ void modifierOrderFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedModifierOrder.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/NumericLiteralsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/NumericLiteralsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter4formatting.rule488numericliterals; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class UpperEllTest extends AbstractGoogleModuleTestSupport { -+final class UpperEllTest extends AbstractGoogleModuleTestSupport { +-public class NumericLiteralsTest extends AbstractGoogleModuleTestSupport { ++final class NumericLiteralsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -31,7 +31,7 @@ public class UpperEllTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class NumericLiteralsTest extends AbstractGoogleModuleTestSupport { } @Test - public void testUpperEll() throws Exception { + void upperEll() throws Exception { - final String[] expected = { - "6:33: Should use uppercase 'L'.", - "12:25: Should use uppercase 'L'.", ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; + verifyWithWholeConfig(getPath("InputNumericLiterals.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/RulesCommonToAllIdentifiersTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/RulesCommonToAllIdentifiersTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule51identifiernames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { +-public class RulesCommonToAllIdentifiersTest extends AbstractGoogleModuleTestSupport { ++final class RulesCommonToAllIdentifiersTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class RulesCommonToAllIdentifiersTest extends AbstractGoogleModuleTestSup } @Test - public void testCatchParameterName() throws Exception { + void catchParameterName() throws Exception { - final String msgKey = "name.invalidPattern"; - final Configuration checkConfig = getModuleConfig("CatchParameterName"); - final String format = checkConfig.getProperty("format"); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java -@@ -26,7 +26,7 @@ import java.io.File; + verifyWithWholeConfig(getPath("InputCatchParameterName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNamesTest.java +@@ -24,7 +24,7 @@ import java.io.File; import java.io.IOException; import org.junit.jupiter.api.Test; --public class PackageNameTest extends AbstractGoogleModuleTestSupport { -+final class PackageNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; +-public class PackageNamesTest extends AbstractGoogleModuleTestSupport { ++final class PackageNamesTest extends AbstractGoogleModuleTestSupport { -@@ -40,7 +40,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { +@@ -36,22 +36,22 @@ public class PackageNamesTest extends AbstractGoogleModuleTestSupport { } @Test - public void testGoodPackageName() throws Exception { + void goodPackageName() throws Exception { - final Configuration checkConfig = getModuleConfig("PackageName"); - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - -@@ -51,7 +51,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("packagenames", "InputPackageNameGood.java")); } @Test - public void testBadPackageName() throws Exception { + void badPackageName() throws Exception { - final String packagePath = - "com.google.checkstyle.test.chapter5naming.rule521packageNamesCamelCase"; - final Configuration checkConfig = getModuleConfig("PackageName"); -@@ -69,7 +69,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("packageNamesCamelCase", "InputPackageNameBad.java")); } @Test - public void testBadPackageName2() throws Exception { + void badPackageName2() throws Exception { - final String packagePath = "com.google.checkstyle.test.chapter5naming.rule521_packagenames"; - final Configuration checkConfig = getModuleConfig("PackageName"); - final String format = checkConfig.getProperty("format"); -@@ -86,7 +86,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("_packagenames", "InputBadPackageName2.java")); } @Test - public void testBadPackageName3() throws Exception { + void badPackageName3() throws Exception { - final String packagePath = "com.google.checkstyle.test.chapter5naming.rule521$packagenames"; - final Configuration checkConfig = getModuleConfig("PackageName"); - final String format = checkConfig.getProperty("format"); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; + verifyWithWholeConfig(getPath("$packagenames", "InputPackageBadName3.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule522classnames/ClassNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule522classnames/ClassNamesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule522classnames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class TypeNameTest extends AbstractGoogleModuleTestSupport { -+final class TypeNameTest extends AbstractGoogleModuleTestSupport { +-public class ClassNamesTest extends AbstractGoogleModuleTestSupport { ++final class ClassNamesTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class TypeNameTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class ClassNamesTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testTypeName() throws Exception { -+ void typeName() throws Exception { - final Configuration checkConfig = getModuleConfig("TypeName"); - final String msgKey = "name.invalidPattern"; - final String format = "^[A-Z][a-zA-Z0-9]*$"; ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; +- public void testClassNames() throws Exception { ++ void classNames() throws Exception { + verifyWithWholeConfig(getPath("InputClassNames.java")); + } + + @Test +- public void testClassNamesFormatted() throws Exception { ++ void classNamesFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedClassNames.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNamesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule523methodnames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class MethodNameTest extends AbstractGoogleModuleTestSupport { -+final class MethodNameTest extends AbstractGoogleModuleTestSupport { +-public class MethodNamesTest extends AbstractGoogleModuleTestSupport { ++final class MethodNamesTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class MethodNameTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class MethodNamesTest extends AbstractGoogleModuleTestSupport { } @Test - public void testMethodName() throws Exception { + void methodName() throws Exception { - final Configuration checkConfig = getModuleConfig("MethodName"); - final String msgKey = "name.invalidPattern"; - final String format = "^[a-z][a-z0-9]\\w*$"; ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; + verifyWithWholeConfig(getPath("InputMethodName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/NonConstantFieldNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/NonConstantFieldNamesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule525nonconstantfieldnames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class MemberNameTest extends AbstractGoogleModuleTestSupport { -+final class MemberNameTest extends AbstractGoogleModuleTestSupport { +-public class NonConstantFieldNamesTest extends AbstractGoogleModuleTestSupport { ++final class NonConstantFieldNamesTest extends AbstractGoogleModuleTestSupport { - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class MemberNameTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { +@@ -30,12 +30,12 @@ public class NonConstantFieldNamesTest extends AbstractGoogleModuleTestSupport { } @Test - public void testMemberName() throws Exception { + void memberName() throws Exception { - final Configuration checkConfig = getModuleConfig("MemberName"); - final String format = checkConfig.getProperty("format"); - final Map messages = checkConfig.getMessages(); -@@ -61,7 +61,7 @@ public class MemberNameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputNonConstantNamesBasic.java")); } @Test - public void testSimple() throws Exception { + void simple() throws Exception { - final Configuration checkConfig = getModuleConfig("MemberName"); - final String format = checkConfig.getProperty("format"); - final Map messages = checkConfig.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/LambdaParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/LambdaParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; + verifyWithWholeConfig(getPath("InputNonConstantNamesSimple.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNamesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule526parameternames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { +-public class ParameterNamesTest extends AbstractGoogleModuleTestSupport { ++final class ParameterNamesTest extends AbstractGoogleModuleTestSupport { - public static final String MSG_INVALID_PATTERN = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { +@@ -30,22 +30,22 @@ public class ParameterNamesTest extends AbstractGoogleModuleTestSupport { } @Test - public void testLambdaParameterName() throws Exception { + void lambdaParameterName() throws Exception { - final Configuration config = getModuleConfig("LambdaParameterName"); - final String format = config.getProperty("format"); - final Map messages = config.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; - import org.junit.jupiter.api.Test; - --public class ParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class ParameterNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class ParameterNameTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputLambdaParameterName.java")); } @Test - public void testGeneralParameterName() throws Exception { + void generalParameterName() throws Exception { - final Configuration config = getModuleConfig("ParameterName"); - final String format = config.getProperty("format"); - final Map messages = config.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/RecordComponentNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/RecordComponentNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; - import org.junit.jupiter.api.Test; - --public class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { -+final class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; + verifyWithWholeConfig(getPath("InputParameterName.java")); + } -@@ -34,7 +34,7 @@ public class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testRecordParameterName() throws Exception { ++ void recordParameterName() throws Exception { + verifyWithWholeConfig(getNonCompilablePath("InputRecordComponentName.java")); } @Test -- public void testGeneralParameterName() throws Exception { -+ void generalParameterName() throws Exception { - final Configuration config = getModuleConfig("RecordComponentName"); - final String format = config.getProperty("format"); - final Map messages = config.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; +- public void testCatchParameterName() throws Exception { ++ void catchParameterName() throws Exception { + verifyWithWholeConfig(getPath("InputCatchParameterName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNamesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule527localvariablenames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { -+final class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { +-public class LocalVariableNamesTest extends AbstractGoogleModuleTestSupport { ++final class LocalVariableNamesTest extends AbstractGoogleModuleTestSupport { - private static final String MSG_KEY = "name.invalidPattern"; + @Override + protected String getPackageLocation() { +@@ -30,18 +30,18 @@ public class LocalVariableNamesTest extends AbstractGoogleModuleTestSupport { + } -@@ -34,7 +34,7 @@ public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testPatternVariableName() throws Exception { ++ void patternVariableName() throws Exception { + verifyWithWholeConfig( + getNonCompilablePath("InputPatternVariableNameEnhancedInstanceofTestDefault.java")); } @Test -- public void testLocalVariableName() throws Exception { -+ void localVariableName() throws Exception { - final Configuration checkConfig = getModuleConfig("LocalVariableName"); - final String format = checkConfig.getProperty("format"); - final Map messages = checkConfig.getMessages(); -@@ -58,7 +58,7 @@ public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { +- public void testLocalAndPatternVariableName() throws Exception { ++ void localAndPatternVariableName() throws Exception { + verifyWithWholeConfig(getPath("InputLocalVariableNameSimple.java")); } @Test - public void testOneChar() throws Exception { + void oneChar() throws Exception { - final Configuration checkConfig = getModuleConfig("LocalVariableName"); - final String format = checkConfig.getProperty("format"); - final Map messages = checkConfig.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/PatternVariableNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/PatternVariableNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; + verifyWithWholeConfig(getPath("InputLocalVariableNameOneCharVarName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/TypeVariableNamesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/TypeVariableNamesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter5naming.rule528typevariablenames; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { -+final class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { +-public class TypeVariableNamesTest extends AbstractGoogleModuleTestSupport { ++final class TypeVariableNamesTest extends AbstractGoogleModuleTestSupport { - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { +@@ -30,22 +30,22 @@ public class TypeVariableNamesTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testPatternVariableName() throws Exception { -+ void patternVariableName() throws Exception { - final Configuration checkConfig = getModuleConfig("PatternVariableName"); - final String format = checkConfig.getProperty("format"); - final Map messages = checkConfig.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; - import org.junit.jupiter.api.Test; - --public class ClassTypeParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class ClassTypeParameterNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class ClassTypeParameterNameTest extends AbstractGoogleModuleTestSupport +- public void testMethodDefault() throws Exception { ++ void methodDefault() throws Exception { + verifyWithWholeConfig(getPath("InputMethodTypeParameterName.java")); } @Test - public void testClassDefault() throws Exception { + void classDefault() throws Exception { - final Configuration configuration = getModuleConfig("ClassTypeParameterName"); - final String format = configuration.getProperty("format"); - final Map messages = configuration.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; - import org.junit.jupiter.api.Test; - --public class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupp + verifyWithWholeConfig(getPath("InputClassTypeParameterName.java")); } @Test - public void testInterfaceDefault() throws Exception { + void interfaceDefault() throws Exception { - final Configuration configuration = getModuleConfig("InterfaceTypeParameterName"); - final String format = configuration.getProperty("format"); - final Map messages = configuration.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; - import org.junit.jupiter.api.Test; - --public class MethodTypeParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class MethodTypeParameterNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class MethodTypeParameterNameTest extends AbstractGoogleModuleTestSupport - } - - @Test -- public void testMethodDefault() throws Exception { -+ void methodDefault() throws Exception { - final Configuration checkConfig = getModuleConfig("MethodTypeParameterName"); - final String format = checkConfig.getProperty("format"); - final Map messages = checkConfig.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/RecordTypeParameterNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/RecordTypeParameterNameTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import java.util.Map; - import org.junit.jupiter.api.Test; - --public class RecordTypeParameterNameTest extends AbstractGoogleModuleTestSupport { -+final class RecordTypeParameterNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "name.invalidPattern"; - -@@ -34,7 +34,7 @@ public class RecordTypeParameterNameTest extends AbstractGoogleModuleTestSupport + verifyWithWholeConfig(getPath("InputInterfaceTypeParameterName.java")); } @Test - public void testRecordDefault() throws Exception { + void recordDefault() throws Exception { - final Configuration configuration = getModuleConfig("RecordTypeParameterName"); - final String format = configuration.getProperty("format"); - final Map messages = configuration.getMessages(); ---- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameChe - import java.io.IOException; + verifyWithWholeConfig(getNonCompilablePath("InputRecordTypeParameterName.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/CamelCaseDefinedTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/CamelCaseDefinedTest.java +@@ -22,19 +22,19 @@ package com.google.checkstyle.test.chapter5naming.rule53camelcase; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class AbbreviationAsWordInNameTest extends AbstractGoogleModuleTestSupport { -+final class AbbreviationAsWordInNameTest extends AbstractGoogleModuleTestSupport { - - private static final String MSG_KEY = "abbreviation.as.word"; - private final Class clazz = AbbreviationAsWordInNameCheck.class; -@@ -36,7 +36,7 @@ public class AbbreviationAsWordInNameTest extends AbstractGoogleModuleTestSuppor +-public class CamelCaseDefinedTest extends AbstractGoogleModuleTestSupport { ++final class CamelCaseDefinedTest extends AbstractGoogleModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/google/checkstyle/test/chapter5naming/rule53camelcase"; } @Test -- public void testAbbreviationAsWordInName() throws Exception { -+ void abbreviationAsWordInName() throws Exception { - final int maxCapitalCount = 1; +- public void testCamelCaseNames() throws Exception { ++ void camelCaseNames() throws Exception { + verifyWithWholeConfig(getPath("InputCamelCaseDefined.java")); + } - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; + @Test +- public void testCamelCaseNamesFormatted() throws Exception { ++ void camelCaseNamesFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedCamelCaseDefined.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/CaughtExceptionsNotIgnoredTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/CaughtExceptionsNotIgnoredTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter6programpractice.rule62donotignoreexce + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { -+final class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +-public class CaughtExceptionsNotIgnoredTest extends AbstractGoogleModuleTestSupport { ++final class CaughtExceptionsNotIgnoredTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class CaughtExceptionsNotIgnoredTest extends AbstractGoogleModuleTestSupp } @Test -- public void testEmptyBlockCatch() throws Exception { -+ void emptyBlockCatch() throws Exception { - final String[] expected = { - "29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), - "50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), ---- a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck; +- public void testEmptyFinallyBlock() throws Exception { ++ void emptyFinallyBlock() throws Exception { + verifyWithWholeConfig(getPath("InputEmptyFinallyBlock.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/FinalizersNotUsedTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/FinalizersNotUsedTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter6programpractice.rule64finalizers; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { -+final class NoFinalizerTest extends AbstractGoogleModuleTestSupport { +-public class FinalizersNotUsedTest extends AbstractGoogleModuleTestSupport { ++final class FinalizersNotUsedTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class FinalizersNotUsedTest extends AbstractGoogleModuleTestSupport { } @Test - public void testNoFinalizerBasic() throws Exception { + void noFinalizerBasic() throws Exception { - final String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method"); - - final String[] expected = { -@@ -47,7 +47,7 @@ public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputNoFinalizer.java")); } @Test - public void testNoFinalizerExtended() throws Exception { + void noFinalizerExtended() throws Exception { - final String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method"); - - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionCheck; + verifyWithWholeConfig(getPath("InputNoFinalizeExtend.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/GeneralFormTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/GeneralFormTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule711generalform; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { -+final class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { +-public class GeneralFormTest extends AbstractGoogleModuleTestSupport { ++final class GeneralFormTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport +@@ -30,12 +30,12 @@ public class GeneralFormTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testDefault() throws Exception { -+ void testDefault() throws Exception { - final String message = getCheckMessage(InvalidJavadocPositionCheck.class, "invalid.position"); - - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.javadoc.SingleLineJavadocCheck; - import org.junit.jupiter.api.Test; - --public class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport { -+final class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport { - - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport { +- public void testSingleLineJavadocAndInvalidJavadocPosition() throws Exception { ++ void singleLineJavadocAndInvalidJavadocPosition() throws Exception { + verifyWithWholeConfig(getPath("InputSingleLineJavadocAndInvalidJavadocPosition.java")); } @Test -- public void testSingleLineJavadoc() throws Exception { -+ void singleLineJavadoc() throws Exception { - final String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc"); - - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +- public void testSingleLineJavadocAndInvalidJavadocPositionFormatted() throws Exception { ++ void singleLineJavadocAndInvalidJavadocPositionFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedSingleLineJavadocAndInvalidJavadocPosition.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/ParagraphsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/ParagraphsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule712paragraphs; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { -+final class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { +-public class ParagraphsTest extends AbstractGoogleModuleTestSupport { ++final class ParagraphsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { +@@ -30,42 +30,42 @@ public class ParagraphsTest extends AbstractGoogleModuleTestSupport { } @Test - public void testJavadocParagraphCorrect() throws Exception { + void javadocParagraphCorrect() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithWholeConfig(getPath("InputCorrectJavadocParagraph.java")); + } - final Configuration checkConfig = getModuleConfig("JavadocParagraph"); -@@ -44,7 +44,7 @@ public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testJavadocParagraphCorrectFormatted() throws Exception { ++ void javadocParagraphCorrectFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedCorrectJavadocParagraph.java")); } @Test - public void testJavadocParagraphIncorrect() throws Exception { + void javadocParagraphIncorrect() throws Exception { - final String msgBefore = - getCheckMessage(JavadocParagraphCheck.class, "javadoc.paragraph.line.before"); - final String msgRed = ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/RequireEmptyLineBeforeBlockTagGroupTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/RequireEmptyLineBeforeBlockTagGroupTest.java -@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; - import java.io.IOException; - import org.junit.jupiter.api.Test; + verifyWithWholeConfig(getPath("InputIncorrectJavadocParagraph.java")); + } --public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModuleTestSupport { -+final class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModuleTestSupport { + @Test +- public void testJavadocParagraphIncorrectFormatted() throws Exception { ++ void javadocParagraphIncorrectFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedIncorrectJavadocParagraph.java")); + } - @Override - protected String getPackageLocation() { -@@ -34,7 +34,7 @@ public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModul + @Test +- public void testRequireEmptyLineBeforeBlockTagGroupCorrect() throws Exception { ++ void requireEmptyLineBeforeBlockTagGroupCorrect() throws Exception { + verifyWithWholeConfig(getPath("InputCorrectRequireEmptyLineBeforeBlockTagGroup.java")); } @Test -- public void testJavadocParagraphCorrect() throws Exception { -+ void javadocParagraphCorrect() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +- public void testRequireEmptyLineBeforeBlockTagGroupCorrectFormatted() throws Exception { ++ void requireEmptyLineBeforeBlockTagGroupCorrectFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedCorrectRequireEmptyLineBeforeBlockTagGroup.java")); + } - final Configuration checkConfig = getModuleConfig("RequireEmptyLineBeforeBlockTagGroup"); -@@ -45,7 +45,7 @@ public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModul + @Test +- public void testRequireEmptyLineBeforeBlockTagGroupIncorrect() throws Exception { ++ void requireEmptyLineBeforeBlockTagGroupIncorrect() throws Exception { + verifyWithWholeConfig(getPath("InputIncorrectRequireEmptyLineBeforeBlockTagGroup.java")); } @Test -- public void testJavadocParagraphIncorrect() throws Exception { -+ void javadocParagraphIncorrect() throws Exception { - final String[] expected = { - "5: " + getTagCheckMessage("@since"), - "11: " + getTagCheckMessage("@param"), ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +- public void testRequireEmptyLineBeforeBlockTagGroupIncorrectFormatted() throws Exception { ++ void requireEmptyLineBeforeBlockTagGroupIncorrectFormatted() throws Exception { + verifyWithWholeConfig( + getPath("InputFormattedIncorrectRequireEmptyLineBeforeBlockTagGroup.java")); + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/BlockTagsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/BlockTagsTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule713atclauses; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { -+final class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +-public class BlockTagsTest extends AbstractGoogleModuleTestSupport { ++final class BlockTagsTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +@@ -30,52 +30,52 @@ public class BlockTagsTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testCorrect1() throws Exception { -+ void correct1() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("AtclauseOrder"); -@@ -44,7 +44,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +- public void testCorrectAtClauseOrder1() throws Exception { ++ void correctAtClauseOrder1() throws Exception { + verifyWithWholeConfig(getPath("InputCorrectAtClauseOrderCheck1.java")); } @Test -- public void testCorrect2() throws Exception { -+ void correct2() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("AtclauseOrder"); -@@ -55,7 +55,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +- public void testCorrectAtClauseOrder2() throws Exception { ++ void correctAtClauseOrder2() throws Exception { + verifyWithWholeConfig(getPath("InputCorrectAtClauseOrderCheck2.java")); } @Test -- public void testCorrect3() throws Exception { -+ void correct3() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("AtclauseOrder"); -@@ -66,7 +66,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +- public void testCorrectAtClauseOrder3() throws Exception { ++ void correctAtClauseOrder3() throws Exception { + verifyWithWholeConfig(getPath("InputCorrectAtClauseOrderCheck3.java")); } @Test -- public void testIncorrect1() throws Exception { -+ void incorrect1() throws Exception { - final String tagOrder = "[@param, @return, @throws, @deprecated]"; - final String msg = getCheckMessage(AtclauseOrderCheck.class, "at.clause.order", tagOrder); - -@@ -90,7 +90,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +- public void testIncorrectAtClauseOrder1() throws Exception { ++ void incorrectAtClauseOrder1() throws Exception { + verifyWithWholeConfig(getPath("InputIncorrectAtClauseOrderCheck1.java")); } @Test -- public void testIncorrect2() throws Exception { -+ void incorrect2() throws Exception { - final String tagOrder = "[@param, @return, @throws, @deprecated]"; - final String msg = getCheckMessage(AtclauseOrderCheck.class, "at.clause.order", tagOrder); - -@@ -112,7 +112,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +- public void testIncorrectAtClauseOrder2() throws Exception { ++ void incorrectAtClauseOrder2() throws Exception { + verifyWithWholeConfig(getPath("InputIncorrectAtClauseOrderCheck2.java")); } @Test -- public void testIncorrect3() throws Exception { -+ void incorrect3() throws Exception { - final String tagOrder = "[@param, @return, @throws, @deprecated]"; - final String msg = getCheckMessage(AtclauseOrderCheck.class, "at.clause.order", tagOrder); - ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck; - import org.junit.jupiter.api.Test; - --public class JavadocTagContinuationIndentationTest extends AbstractGoogleModuleTestSupport { -+final class JavadocTagContinuationIndentationTest extends AbstractGoogleModuleTestSupport { - - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class JavadocTagContinuationIndentationTest extends AbstractGoogleModuleT +- public void testIncorrectAtClauseOrder3() throws Exception { ++ void incorrectAtClauseOrder3() throws Exception { + verifyWithWholeConfig(getPath("InputIncorrectAtClauseOrderCheck3.java")); } @Test -- public void testWithDefaultConfiguration() throws Exception { -+ void withDefaultConfiguration() throws Exception { - final String msg = - getCheckMessage(JavadocTagContinuationIndentationCheck.class, "tag.continuation.indent", 4); - ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck; - import org.junit.jupiter.api.Test; - --public class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSupport { -+final class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSupport { - - @Override - protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSup +- public void testJavadocTagContinuationIndentation() throws Exception { ++ void javadocTagContinuationIndentation() throws Exception { + verifyWithWholeConfig(getPath("InputJavaDocTagContinuationIndentation.java")); } @Test -- public void testDefaultConfiguration() throws Exception { -+ void defaultConfiguration() throws Exception { - final String msg = - getCheckMessage(NonEmptyAtclauseDescriptionCheck.class, "non.empty.atclause"); - -@@ -58,7 +58,7 @@ public class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSup +- public void testJavadocTagContinuationIndentationFormatted() throws Exception { ++ void javadocTagContinuationIndentationFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedJavaDocTagContinuationIndentation.java")); } @Test -- public void testSpaceSequence() throws Exception { -+ void spaceSequence() throws Exception { - final String msg = - getCheckMessage(NonEmptyAtclauseDescriptionCheck.class, "non.empty.atclause"); +- public void testNonEmptyAtclauseDescription() throws Exception { ++ void nonEmptyAtclauseDescription() throws Exception { + verifyWithWholeConfig(getPath("InputNonEmptyAtclauseDescription.java")); + } ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java -@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + @Test +- public void testNonEmptyAtclauseDescriptionSpaceSequence() throws Exception { ++ void nonEmptyAtclauseDescriptionSpaceSequence() throws Exception { + verifyWithWholeConfig(getPath("InputNonEmptyAtclauseDescriptionSpaceSeq.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/TheSummaryFragmentTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/TheSummaryFragmentTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule72thesummaryfragment; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { -+final class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { +-public class TheSummaryFragmentTest extends AbstractGoogleModuleTestSupport { ++final class TheSummaryFragmentTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,7 +33,7 @@ public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { +@@ -30,12 +30,12 @@ public class TheSummaryFragmentTest extends AbstractGoogleModuleTestSupport { } @Test - public void testCorrect() throws Exception { + void correct() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - final Configuration checkConfig = getModuleConfig("SummaryJavadoc"); -@@ -44,7 +44,7 @@ public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { + verifyWithWholeConfig(getPath("InputCorrectSummaryFragment.java")); } @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { - final String msgFirstSentence = - getCheckMessage(SummaryJavadocCheck.class, "summary.first.sentence"); - final String msgForbiddenFragment = ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + verifyWithWholeConfig(getPath("InputIncorrectSummaryFragment.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/ExceptionSelfExplanatoryMembersTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/ExceptionSelfExplanatoryMembersTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule731selfexplanatory; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class JavadocMethodTest extends AbstractGoogleModuleTestSupport { -+final class JavadocMethodTest extends AbstractGoogleModuleTestSupport { +-public class ExceptionSelfExplanatoryMembersTest extends AbstractGoogleModuleTestSupport { ++final class ExceptionSelfExplanatoryMembersTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class JavadocMethodTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class ExceptionSelfExplanatoryMembersTest extends AbstractGoogleModuleTes } @Test -- public void testJavadocMethod() throws Exception { -+ void javadocMethod() throws Exception { - - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/MissingJavadocMethodTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/MissingJavadocMethodTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck; +- public void testBothModules() throws Exception { ++ void bothModules() throws Exception { + verifyWithWholeConfig(getPath("InputJavadocMethodAndMissingJavadocMethod.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule732exceptionoverrides/ExceptionOverridesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule732exceptionoverrides/ExceptionOverridesTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule732exceptionoverrides; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { -+final class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { +-public class ExceptionOverridesTest extends AbstractGoogleModuleTestSupport { ++final class ExceptionOverridesTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { +@@ -30,7 +30,7 @@ public class ExceptionOverridesTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testJavadocMethod() throws Exception { -+ void javadocMethod() throws Exception { - final String msg = getCheckMessage(MissingJavadocMethodCheck.class, "javadoc.missing"); - - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java -@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; - import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionCheck; +- public void testBothModules() throws Exception { ++ void bothModules() throws Exception { + verifyWithWholeConfig(getPath("InputJavadocMethodAndMissingJavadocMethod.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/NonRequiredJavadocTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/NonRequiredJavadocTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule734nonrequiredjavadoc; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { -+final class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { +-public class NonRequiredJavadocTest extends AbstractGoogleModuleTestSupport { ++final class NonRequiredJavadocTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport +@@ -30,12 +30,12 @@ public class NonRequiredJavadocTest extends AbstractGoogleModuleTestSupport { } @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - final String message = getCheckMessage(InvalidJavadocPositionCheck.class, "invalid.position"); + verifyWithWholeConfig(getPath("InputInvalidJavadocPosition.java")); + } - final String[] expected = { ---- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/MissingJavadocTypeTest.java -+++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/MissingJavadocTypeTest.java -@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck; - import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + @Test +- public void testDefaultFormatted() throws Exception { ++ void defaultFormatted() throws Exception { + verifyWithWholeConfig(getPath("InputFormattedInvalidJavadocPosition.java")); + } + } +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/WhereJavadocIsUsedTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/WhereJavadocIsUsedTest.java +@@ -22,7 +22,7 @@ package com.google.checkstyle.test.chapter7javadoc.rule73wherejavadocrequired; + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import org.junit.jupiter.api.Test; --public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { -+final class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { +-public class WhereJavadocIsUsedTest extends AbstractGoogleModuleTestSupport { ++final class WhereJavadocIsUsedTest extends AbstractGoogleModuleTestSupport { @Override protected String getPackageLocation() { -@@ -35,7 +35,7 @@ public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { +@@ -30,17 +30,17 @@ public class WhereJavadocIsUsedTest extends AbstractGoogleModuleTestSupport { } @Test -- public void testJavadocType() throws Exception { -+ void javadocType() throws Exception { - - final String[] expected = { - "3:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), -@@ -58,7 +58,7 @@ public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { +- public void testMissingJavadocTypeIncorrect() throws Exception { ++ void missingJavadocTypeIncorrect() throws Exception { + verifyWithWholeConfig(getPath("InputMissingJavadocTypeIncorrect.java")); } @Test -- public void testJavadocTypeNoViolations() throws Exception { -+ void javadocTypeNoViolations() throws Exception { - - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +- public void testMissingJavadocTypeCorrect() throws Exception { ++ void missingJavadocTypeCorrect() throws Exception { + verifyWithWholeConfig(getPath("InputMissingJavadocTypeCorrect.java")); + } + @Test +- public void testJavadocMethodAndMissingJavadocMethod() throws Exception { ++ void javadocMethodAndMissingJavadocMethod() throws Exception { + verifyWithWholeConfig(getPath("InputJavadocMethodAndMissingJavadocMethod.java")); + } + } --- a/src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java +++ b/src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionChec @@ -2080,15 +2230,18 @@ MultipleVariableDeclarationsCheck.class, "multiple.variable.declarations.comma"); --- a/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java +++ b/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java -@@ -20,6 +20,7 @@ +@@ -20,7 +20,10 @@ package org.checkstyle.base; import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.stream.Collectors.toUnmodifiableList; ++import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractPathTestSupport; import com.puppycrawl.tools.checkstyle.Checker; -@@ -39,7 +40,7 @@ import java.io.InputStreamReader; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +@@ -41,7 +44,7 @@ import java.io.InputStreamReader; import java.io.LineNumberReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -2097,7 +2250,15 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; -@@ -397,8 +398,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor +@@ -51,7 +54,6 @@ import java.util.Locale; + import java.util.Map; + import java.util.Properties; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + + public abstract class AbstractItModuleTestSupport extends AbstractPathTestSupport { + +@@ -402,8 +404,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor // process each of the lines try (ByteArrayInputStream inputStream = new ByteArrayInputStream(stream.toByteArray()); @@ -2107,7 +2268,40 @@ int previousLineNumber = 0; for (int index = 0; index < expected.length; index++) { final String expectedResult = messageFileName + ":" + expected[index]; -@@ -493,7 +493,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor +@@ -461,7 +462,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor + throws Exception { + stream.flush(); + stream.reset(); +- final List files = Collections.singletonList(new File(file)); ++ final List files = ImmutableList.of(new File(file)); + final Checker checker = createChecker(config); + final Map> actualViolations = getActualViolations(checker.process(files)); + checker.destroy(); +@@ -480,8 +481,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor + private Map> getActualViolations(int errorCount) throws IOException { + // process each of the lines + try (ByteArrayInputStream inputStream = new ByteArrayInputStream(stream.toByteArray()); +- LineNumberReader lnr = +- new LineNumberReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { ++ LineNumberReader lnr = new LineNumberReader(new InputStreamReader(inputStream, UTF_8))) { + final Map> actualViolations = new HashMap<>(); + for (String line = lnr.readLine(); + line != null && lnr.getLineNumber() <= errorCount; +@@ -514,11 +514,11 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor + actualViolations.stream() + .map(violation -> violation.substring(0, violation.indexOf(':'))) + .map(Integer::valueOf) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + final List expectedViolationLines = + testInputViolations.stream() + .map(TestInputViolation::getLineNo) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + assertWithMessage("Violation lines for %s differ.", file) + .that(actualViolationLines) + .isEqualTo(expectedViolationLines); +@@ -593,7 +593,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor */ protected Integer[] getLinesWithWarn(String fileName) throws IOException { final List result = new ArrayList<>(); @@ -2156,23 +2350,54 @@ checkConfig.addProperty("groups", "android,com.twitter,com,junit,net,org,java,javax"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java -@@ -20,6 +20,7 @@ +@@ -19,7 +19,10 @@ + package org.checkstyle.suppressionxpathfilter; ++import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.UUID.randomUUID; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.JavaParser; -@@ -114,7 +115,7 @@ public abstract class AbstractXpathTestSupport extends AbstractCheckstyleModuleT +@@ -35,7 +38,6 @@ import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.util.List; + import java.util.Locale; +-import java.util.UUID; + import java.util.regex.Matcher; + import java.util.regex.Pattern; + import org.checkstyle.base.AbstractCheckstyleModuleTestSupport; +@@ -113,10 +115,9 @@ public abstract class AbstractXpathTestSupport extends AbstractCheckstyleModuleT + */ private String createSuppressionsXpathConfigFile(String checkName, List xpathQueries) throws Exception { - final Path suppressionsXpathConfigPath = Files.createTempFile(temporaryFolder, "", ""); -- try (Writer bw = Files.newBufferedWriter(suppressionsXpathConfigPath, StandardCharsets.UTF_8)) { -+ try (Writer bw = Files.newBufferedWriter(suppressionsXpathConfigPath, UTF_8)) { +- final String uniqueFileName = "suppressions_xpath_config_" + UUID.randomUUID() + ".xml"; ++ final String uniqueFileName = "suppressions_xpath_config_" + randomUUID() + ".xml"; + final File suppressionsXpathConfigPath = new File(temporaryFolder, uniqueFileName); +- try (Writer bw = +- Files.newBufferedWriter(suppressionsXpathConfigPath.toPath(), StandardCharsets.UTF_8)) { ++ try (Writer bw = Files.newBufferedWriter(suppressionsXpathConfigPath.toPath(), UTF_8)) { bw.write("\n"); bw.write(" expectedXpathQueries) + throws Exception { +- if (expectedViolation.length != 1) { +- throw new IllegalArgumentException( +- "Expected violations should contain exactly one element." +- + " Multiple violations are not supported."); +- } ++ checkArgument( ++ expectedViolation.length == 1, ++ "Expected violations should contain exactly one element." ++ + " Multiple violations are not supported."); + + final ViolationPosition position = extractLineAndColumnNumber(expectedViolation); + final List generatedXpathQueries = generateXpathQueries(fileToProcess, position); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbbreviationAsWordInNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbbreviationAsWordInNameTest.java @@ -19,14 +19,14 @@ @@ -2199,7 +2424,7 @@ - public void testAnnotation() throws Exception { + void annotation() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameAnnotation.java")); + new File(getPath("InputXpathAbbreviationAsWordInNameAnnotation.java")); @@ -53,7 +53,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; @@ -2208,7 +2433,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameAnnotation']]" + + "@text='InputXpathAbbreviationAsWordInNameAnnotation']]" + "/OBJBLOCK/ANNOTATION_DEF/IDENT[@text='ANNOTATION']"); @@ -62,7 +62,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @@ -2217,7 +2442,7 @@ - public void testAnnotationField() throws Exception { + void annotationField() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField.java")); + new File(getPath("InputXpathAbbreviationAsWordInNameAnnotationField.java")); @@ -79,7 +79,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; @@ -2226,7 +2451,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/ANNOTATION_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField']]" + + "@text='InputXpathAbbreviationAsWordInNameAnnotationField']]" + "/OBJBLOCK/ANNOTATION_FIELD_DEF/IDENT[@text='ANNOTATION_FIELD']"); @@ -88,7 +88,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @@ -2234,125 +2459,125 @@ @Test - public void testClass() throws Exception { + void testClass() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameClass.java")); + final File fileToProcess = new File(getPath("InputXpathAbbreviationAsWordInNameClass.java")); -@@ -105,7 +105,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + final DefaultConfiguration moduleConfig = +@@ -104,7 +104,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameClass']]" + + "@text='InputXpathAbbreviationAsWordInNameClass']]" + "/OBJBLOCK/CLASS_DEF/IDENT[@text='CLASS']"); -@@ -114,7 +114,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -113,7 +113,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameEnum.java")); + final File fileToProcess = new File(getPath("InputXpathAbbreviationAsWordInNameEnum.java")); -@@ -131,7 +131,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + final DefaultConfiguration moduleConfig = +@@ -129,7 +129,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameEnum']]" + + "@text='InputXpathAbbreviationAsWordInNameEnum']]" + "/OBJBLOCK/ENUM_DEF/IDENT[@text='ENUMERATION']"); -@@ -140,7 +140,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -138,7 +138,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @Test - public void testField() throws Exception { + void field() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameField.java")); + final File fileToProcess = new File(getPath("InputXpathAbbreviationAsWordInNameField.java")); -@@ -157,7 +157,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + final DefaultConfiguration moduleConfig = +@@ -154,7 +154,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameField']]" + + "@text='InputXpathAbbreviationAsWordInNameField']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='FIELD']"); -@@ -166,7 +166,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -163,7 +163,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameInterface.java")); + new File(getPath("InputXpathAbbreviationAsWordInNameInterface.java")); -@@ -183,7 +183,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -180,7 +180,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameInterface']]" + + "@text='InputXpathAbbreviationAsWordInNameInterface']]" + "/OBJBLOCK/INTERFACE_DEF/IDENT[@text='INTERFACE']"); -@@ -192,7 +192,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -189,7 +189,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @Test - public void testMethod() throws Exception { + void method() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameMethod.java")); + final File fileToProcess = new File(getPath("InputXpathAbbreviationAsWordInNameMethod.java")); -@@ -209,7 +209,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + final DefaultConfiguration moduleConfig = +@@ -205,7 +205,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/INTERFACE_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameMethod']]" + + "@text='InputXpathAbbreviationAsWordInNameMethod']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='METHOD']"); -@@ -218,7 +218,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -214,7 +214,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @Test - public void testParameter() throws Exception { + void parameter() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameParameter.java")); + new File(getPath("InputXpathAbbreviationAsWordInNameParameter.java")); -@@ -235,7 +235,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -231,7 +231,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/INTERFACE_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameParameter']]" + + "@text='InputXpathAbbreviationAsWordInNameParameter']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" -@@ -245,7 +245,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe +@@ -241,7 +241,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } @Test - public void testVariable() throws Exception { + void variable() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameVariable.java")); + final File fileToProcess = new File(getPath("InputXpathAbbreviationAsWordInNameVariable.java")); -@@ -262,7 +262,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + final DefaultConfiguration moduleConfig = +@@ -257,7 +257,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameVariable']]" + + "@text='InputXpathAbbreviationAsWordInNameVariable']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbstractClassNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbstractClassNameTest.java @@ -2371,27 +2596,27 @@ @Test - public void testClassNameTop() throws Exception { + void classNameTop() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbstractClassNameTop.java")); + final File fileToProcess = new File(getPath("InputXpathAbstractClassNameTop.java")); -@@ -66,7 +66,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(AbstractClassNameCheck.class); +@@ -64,7 +64,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo } @Test - public void testClassNameInner() throws Exception { + void classNameInner() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbstractClassNameInner.java")); + final File fileToProcess = new File(getPath("InputXpathAbstractClassNameInner.java")); -@@ -97,7 +97,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(AbstractClassNameCheck.class); +@@ -94,7 +94,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo } @Test - public void testClassNameNoModifier() throws Exception { + void classNameNoModifier() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAbstractClassNameNoModifier.java")); + final File fileToProcess = new File(getPath("InputXpathAbstractClassNameNoModifier.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(AbstractClassNameCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -2409,54 +2634,54 @@ @Test - public void testClass() throws Exception { + void testClass() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationLocationClass.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationLocationClass.java")); -@@ -68,7 +68,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationLocationCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationLocationInterface.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationLocationInterface.java")); -@@ -101,7 +101,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationLocationCheck.class); +@@ -98,7 +98,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationLocationEnum.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationLocationEnum.java")); -@@ -133,7 +133,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationLocationCheck.class); +@@ -128,7 +128,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } @Test - public void testMethod() throws Exception { + void method() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationLocationMethod.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationLocationMethod.java")); -@@ -169,7 +169,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationLocationCheck.class); +@@ -163,7 +163,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } @Test - public void testVariable() throws Exception { + void variable() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationLocationVariable.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationLocationVariable.java")); -@@ -205,7 +205,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationLocationCheck.class); +@@ -198,7 +198,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } @Test - public void testConstructor() throws Exception { + void constructor() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationLocationCTOR.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationLocationCTOR.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationLocationCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationOnSameLineTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationOnSameLineTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -2474,27 +2699,27 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineOne.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationOnSameLineMethod.java")); -@@ -78,7 +78,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationOnSameLineCheck.class); +@@ -77,7 +77,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineTwo.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationOnSameLineField.java")); -@@ -113,7 +113,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationOnSameLineCheck.class); +@@ -111,7 +111,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu } @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineThree.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationOnSameLineInterface.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationOnSameLineCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java @@ -19,15 +19,15 @@ @@ -2521,89 +2746,89 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleOne.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleOne.java")); -@@ -64,7 +64,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -63,7 +63,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleTwo.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleTwo.java")); -@@ -99,7 +99,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -96,7 +96,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleThree.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleThree.java")); -@@ -136,7 +136,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -132,7 +132,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleFour.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleFour.java")); -@@ -154,7 +154,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -149,7 +149,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionAnnotationUseStyleFour']]" + + "[./IDENT[@text='InputXpathAnnotationUseStyleFour']]" + "/MODIFIERS/ANNOTATION[./IDENT[@text='SuppressWarnings']]" -@@ -164,7 +164,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp +@@ -159,7 +159,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testFive() throws Exception { + void five() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleFive.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleFive.java")); -@@ -200,7 +200,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -193,7 +193,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testSix() throws Exception { + void six() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleSix.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleSix.java")); -@@ -236,7 +236,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -227,7 +227,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testSeven() throws Exception { + void seven() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleSeven.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleSeven.java")); -@@ -263,7 +263,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -253,7 +253,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } @Test - public void testEight() throws Exception { + void eight() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnnotationUseStyleEight.java")); + final File fileToProcess = new File(getPath("InputXpathAnnotationUseStyleEight.java")); -@@ -281,7 +281,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(AnnotationUseStyleCheck.class); +@@ -270,7 +270,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionAnnotationUseStyleEight']]" + + "[./IDENT[@text='InputXpathAnnotationUseStyleEight']]" + "/MODIFIERS/ANNOTATION[./IDENT[@text='SuppressWarnings']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java @@ -2622,17 +2847,17 @@ @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAnonInnerLengthDefault.java")); + final File fileToProcess = new File(getPath("InputXpathAnonInnerLengthDefault.java")); -@@ -63,7 +63,7 @@ public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(AnonInnerLengthCheck.class); +@@ -62,7 +62,7 @@ public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport } @Test - public void testMaxLength() throws Exception { + void maxLength() throws Exception { final int maxLen = 5; - final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnonInnerLength.java")); + final File fileToProcess = new File(getPath("InputXpathAnonInnerLength.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java @@ -2660,26 +2885,26 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionArrayTrailingCommaOne.java")); + final File fileToProcess = new File(getPath("InputXpathArrayTrailingCommaLinear.java")); -@@ -62,7 +62,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(ArrayTrailingCommaCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionArrayTrailingCommaTwo.java")); + final File fileToProcess = new File(getPath("InputXpathArrayTrailingCommaMatrix.java")); -@@ -73,7 +73,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(ArrayTrailingCommaCheck.class); +@@ -71,7 +71,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionArrayTrailingCommaTwo']]" + + "[./IDENT[@text='InputXpathArrayTrailingCommaMatrix']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='d2']]/ASSIGN/EXPR/LITERAL_NEW" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java @@ -2706,35 +2931,35 @@ @Test - public void testVariable() throws Exception { + void variable() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionArrayTypeStyleVariable.java")); + final File fileToProcess = new File(getPath("InputXpathArrayTypeStyleVariable.java")); -@@ -45,7 +45,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(ArrayTypeStyleCheck.class); +@@ -44,7 +44,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionArrayTypeStyleVariable']]" + + "[./IDENT[@text='InputXpathArrayTypeStyleVariable']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='strings']]/TYPE[" -@@ -55,7 +55,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport +@@ -54,7 +54,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport } @Test - public void testMethodDef() throws Exception { + void methodDef() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionArrayTypeStyleMethodDef.java")); + final File fileToProcess = new File(getPath("InputXpathArrayTypeStyleMethodDef.java")); -@@ -66,7 +66,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(ArrayTypeStyleCheck.class); +@@ -64,7 +64,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionArrayTypeStyleMethodDef']]" + + "[./IDENT[@text='InputXpathArrayTypeStyleMethodDef']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='getData']]/TYPE/ARRAY_DECLARATOR"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidDoubleBraceInitializationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidDoubleBraceInitializationTest.java @@ -2751,19 +2976,19 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testClassFields() throws Exception { ++ void classFields() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidDoubleBraceInitialization.java")); + new File(getPath("InputXpathAvoidDoubleBraceInitializationClassFields.java")); @@ -62,7 +62,7 @@ public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractX } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidDoubleBraceInitializationTwo.java")); + new File(getPath("InputXpathAvoidDoubleBraceInitializationMethodDef.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java @@ -2783,7 +3008,7 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersDefault.java")); + new File(getPath("InputXpathAvoidEscapedUnicodeCharactersDefault.java")); @@ -63,7 +63,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } @@ -2792,35 +3017,35 @@ - public void testControlCharacters() throws Exception { + void controlCharacters() throws Exception { final File fileToProcess = - new File( - getPath( -@@ -94,7 +94,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + new File(getPath("InputXpathAvoidEscapedUnicodeCharactersControlCharacters.java")); + +@@ -92,7 +92,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } @Test - public void testTailComment() throws Exception { + void tailComment() throws Exception { final File fileToProcess = - new File( - getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersTailComment.java")); -@@ -124,7 +124,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + new File(getPath("InputXpathAvoidEscapedUnicodeCharactersTailComment.java")); + +@@ -121,7 +121,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } @Test - public void testAllCharactersEscaped() throws Exception { + void allCharactersEscaped() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersAllEscaped.java")); + new File(getPath("InputXpathAvoidEscapedUnicodeCharactersAllEscaped.java")); -@@ -153,7 +153,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp +@@ -150,7 +150,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } @Test - public void testNonPrintableCharacters() throws Exception { + void nonPrintableCharacters() throws Exception { final File fileToProcess = - new File( - getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersNonPrintable.java")); + new File(getPath("InputXpathAvoidEscapedUnicodeCharactersNonPrintable.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java @@ -19,15 +19,15 @@ @@ -2848,7 +3073,7 @@ - public void testInlineConditionalsVariableDef() throws Exception { + void inlineConditionalsVariableDef() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsVariableDef.java")); + new File(getPath("InputXpathAvoidInlineConditionalsVariableDef.java")); @@ -63,7 +63,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes } @@ -2856,27 +3081,27 @@ @Test - public void testInlineConditionalsAssign() throws Exception { + void inlineConditionalsAssign() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsAssign.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidInlineConditionalsAssign.java")); -@@ -77,7 +77,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes + final DefaultConfiguration moduleConfig = +@@ -76,7 +76,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='" - + "SuppressionXpathRegressionAvoidInlineConditionalsAssign']]" + + "InputXpathAvoidInlineConditionalsAssign']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='setB']]/SLIST" -@@ -87,7 +87,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes +@@ -86,7 +86,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes } @Test - public void testInlineConditionalsAssert() throws Exception { + void inlineConditionalsAssert() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsAssert.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidInlineConditionalsAssert.java")); + final DefaultConfiguration moduleConfig = --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java @@ -19,15 +19,15 @@ @@ -2903,54 +3128,72 @@ @Test - public void testEmpty() throws Exception { + void empty() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksEmpty.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidNestedBlocksEmpty.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(AvoidNestedBlocksCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionAvoidNestedBlocksEmpty']]" + + "[./IDENT[@text='InputXpathAvoidNestedBlocksEmpty']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='empty']]/SLIST/SLIST"); -@@ -57,7 +57,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo +@@ -56,7 +56,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } @Test - public void testVariableAssignment() throws Exception { + void variableAssignment() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksVariable.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidNestedBlocksVariable.java")); -@@ -70,7 +70,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(AvoidNestedBlocksCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionAvoidNestedBlocksVariable']]" + + "[./IDENT[@text='InputXpathAvoidNestedBlocksVariable']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='varAssign']]/SLIST/SLIST"); -@@ -79,7 +79,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo +@@ -77,7 +77,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } @Test - public void testSwitchAllowInSwitchCaseFalse() throws Exception { + void switchAllowInSwitchCaseFalse() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksSwitch1.java")); + new File(getPath("InputXpathAvoidNestedBlocksNotAllowedInSwitchCase.java")); -@@ -112,7 +112,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo +@@ -104,7 +104,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } @Test - public void testSwitchAllowInSwitchCaseTrue() throws Exception { + void switchAllowInSwitchCaseTrue() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksSwitch2.java")); + new File(getPath("InputXpathAvoidNestedBlocksAllowedInSwitchCase.java")); + +@@ -118,7 +118,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='InputXpathAvoidNestedBlocksAllowedInSwitchCase" + + "']]/OBJBLOCK/METHOD_DEF[./IDENT[@text='s']]" +@@ -128,7 +128,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + } + + @Test +- public void testSwitchWithBreakOutside() throws Exception { ++ void switchWithBreakOutside() throws Exception { + final File fileToProcess = new File(getPath("InputXpathAvoidNestedBlocksBreakOutside.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(AvoidNestedBlocksCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java @@ -19,14 +19,14 @@ @@ -2977,7 +3220,7 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall.java")); + new File(getPath("InputXpathAvoidNoArgumentSuperConstructorCallDefault.java")); @@ -49,7 +49,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest }; @@ -2986,7 +3229,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall']]" + + "[@text='InputXpathAvoidNoArgumentSuperConstructorCallDefault']]" + "/OBJBLOCK/CTOR_DEF[./IDENT[" @@ -60,7 +60,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest } @@ -2995,16 +3238,16 @@ - public void testInnerClass() throws Exception { + void innerClass() throws Exception { final File fileToProcess = - new File( - getPath( -@@ -73,7 +73,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest + new File(getPath("InputXpathAvoidNoArgumentSuperConstructorCallInnerClass.java")); + +@@ -71,7 +71,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCallInnerClass']]" + + "'InputXpathAvoidNoArgumentSuperConstructorCallInnerClass']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java @@ -3031,7 +3274,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStarImport1.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidStarImportOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -47,13 +47,13 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport @@ -3047,7 +3290,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStarImport2.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidStarImportTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -62,8 +62,7 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport @@ -3085,10 +3328,10 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidStaticImport1.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidStaticImportOne.java")); -@@ -48,13 +48,13 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -47,13 +47,13 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3101,10 +3344,10 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionAvoidStaticImport2.java")); + final File fileToProcess = new File(getPath("InputXpathAvoidStaticImportTwo.java")); -@@ -66,8 +66,7 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -64,8 +64,7 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3137,10 +3380,10 @@ } @Test -- public void testMethodOne() throws Exception { -+ void methodOne() throws Exception { +- public void testCatchBlock() throws Exception { ++ void catchBlock() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityOne.java")); + new File(getPath("InputXpathBooleanExpressionComplexityCatchBlock.java")); @@ -51,7 +51,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat }; @@ -3149,16 +3392,16 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionBooleanExpressionComplexityOne']]" + + "[@text='InputXpathBooleanExpressionComplexityCatchBlock']]" + "/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 { +- public void testClassFields() throws Exception { ++ void classFields() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityTwo.java")); + new File(getPath("InputXpathBooleanExpressionComplexityClassFields.java")); @@ -79,7 +79,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat }; @@ -3167,16 +3410,16 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionBooleanExpressionComplexityTwo']]" + + "@text='InputXpathBooleanExpressionComplexityClassFields']]" + "/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 { +- public void testConditionals() throws Exception { ++ void conditionals() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionBoolean" + "ExpressionComplexityThree.java")); + new File(getPath("InputXpathBooleanExpressionComplexityConditionals.java")); @@ -106,7 +106,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat }; @@ -3185,7 +3428,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionBooleanExpressionComplexityThree']]" + + "@text='InputXpathBooleanExpressionComplexityConditionals']]" + "/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 @@ -3212,37 +3455,37 @@ @Test - public void testSimple() throws Exception { + void simple() throws Exception { - final String pattern = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; + 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 +@@ -49,7 +49,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameSimple']]" + + "[./IDENT[@text='InputXpathCatchParameterNameSimple']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" -@@ -60,7 +60,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -59,7 +59,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 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 +@@ -71,7 +71,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameNested']]" + + "[./IDENT[@text='InputXpathCatchParameterNameNested']]" + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='NestedClass']]" -@@ -85,7 +85,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -83,7 +83,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } @Test @@ -3251,16 +3494,16 @@ final String pattern = "^[a-z][a-zA-Z0-9]+$"; final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); -@@ -99,7 +99,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -96,7 +96,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameStaticInit']]" + + "[./IDENT[@text='InputXpathCatchParameterNameStaticInit']]" + "/OBJBLOCK/STATIC_INIT/SLIST" -@@ -109,7 +109,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -106,7 +106,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } @Test @@ -3269,16 +3512,16 @@ final String pattern = "^[a-z][a-zA-Z0-9]+$"; final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); -@@ -124,7 +124,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -120,7 +120,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameAnonymous']]" + + "[./IDENT[@text='InputXpathCatchParameterNameAnonymous']]" + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" -@@ -137,7 +137,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -133,7 +133,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } @Test @@ -3287,16 +3530,16 @@ final String pattern = "^[A-Z][a-z]+$"; final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); -@@ -151,7 +151,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -146,7 +146,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameLambda']]" + + "[./IDENT[@text='InputXpathCatchParameterNameLambda']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='lambdaFunction']]" -@@ -163,7 +163,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -158,7 +158,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } @Test @@ -3305,16 +3548,16 @@ final String pattern = "^[A-Z][a-z]+$"; final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); -@@ -178,7 +178,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -172,7 +172,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/ENUM_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameEnum']]" + + "[./IDENT[@text='InputXpathCatchParameterNameEnum']]" + "/OBJBLOCK/ENUM_CONSTANT_DEF[./IDENT[@text='VALUE']]" -@@ -190,7 +190,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -184,7 +184,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } @Test @@ -3323,15 +3566,53 @@ final String pattern = "^[A-Z][a-z]+$"; final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); -@@ -204,7 +204,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp +@@ -197,7 +197,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/INTERFACE_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCatchParameterNameInterface']]" + + "[./IDENT[@text='InputXpathCatchParameterNameInterface']]" + "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='InnerInterface']]" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassDataAbstractionCouplingTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassDataAbstractionCouplingTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionClassDataAbstractionCouplingTest extends AbstractXpathTestSupport { ++final class XpathRegressionClassDataAbstractionCouplingTest extends AbstractXpathTestSupport { + + private final String checkName = ClassDataAbstractionCouplingCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionClassDataAbstractionCouplingTest extends AbstractXpa + } + + @Test +- public void testClassDataAbstractCouplingClass() throws Exception { ++ void classDataAbstractCouplingClass() throws Exception { + final File classPath = new File(getPath("InputXpathClassDataAbstractionCouplingClass.java")); + + final DefaultConfiguration configuration = +@@ -79,7 +79,7 @@ public class XpathRegressionClassDataAbstractionCouplingTest extends AbstractXpa + } + + @Test +- public void testClassDataAbstractCouplingEnum() throws Exception { ++ void classDataAbstractCouplingEnum() throws Exception { + final File classPath = new File(getPath("InputXpathClassDataAbstractionCouplingEnum.java")); + + final DefaultConfiguration configuration = +@@ -122,7 +122,7 @@ public class XpathRegressionClassDataAbstractionCouplingTest extends AbstractXpa + } + + @Test +- public void testClassDataAbstractCouplingInterface() throws Exception { ++ void classDataAbstractCouplingInterface() throws Exception { + final File classPath = + new File(getPath("InputXpathClassDataAbstractionCouplingInterface.java")); + --- 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; @@ -3347,19 +3628,57 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierOne.java")); + new File(getPath("InputXpathClassMemberImpliedModifierInterface.java")); @@ -68,7 +68,7 @@ public class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpath } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierTwo.java")); +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + final File fileToProcess = new File(getPath("InputXpathClassMemberImpliedModifierEnum.java")); + + final DefaultConfiguration moduleConfig = +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassTypeParameterNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassTypeParameterNameTest.java +@@ -27,7 +27,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionClassTypeParameterNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionClassTypeParameterNameTest extends AbstractXpathTestSupport { + + private final String checkName = ClassTypeParameterNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionClassTypeParameterNameTest extends AbstractXpathTest + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathClassTypeParameterNameClass.java")); + final String pattern = "^[A-Z]$"; + final DefaultConfiguration moduleConfig = createModuleConfig(ClassTypeParameterNameCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionClassTypeParameterNameTest extends AbstractXpathTest + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final String pattern = "^[A-Z]{2,}$"; + final File fileToProcess = new File(getPath("InputXpathClassTypeParameterNameInterface.java")); + +@@ -96,7 +96,7 @@ public class XpathRegressionClassTypeParameterNameTest extends AbstractXpathTest + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final String pattern = "(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"; + final File fileToProcess = new File(getPath("InputXpathClassTypeParameterNameMethod.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java @@ -3386,143 +3705,143 @@ @Test - public void testSingleLine() throws Exception { + void singleLine() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "SingleLine.java")); + final File fileToProcess = new File(getPath("InputXpathCommentsIndentationSingleLine.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationSingleLine']]" + + "[@text='InputXpathCommentsIndentationSingleLine']]" + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]"); -@@ -57,7 +57,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -56,7 +56,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testBlock() throws Exception { + void block() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "Block.java")); + final File fileToProcess = new File(getPath("InputXpathCommentsIndentationBlock.java")); -@@ -69,7 +69,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationBlock']]/OBJBLOCK/" + + "[@text='InputXpathCommentsIndentationBlock']]/OBJBLOCK/" + "VARIABLE_DEF[./IDENT[@text='f']]/TYPE/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" -@@ -79,7 +79,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -77,7 +77,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testSeparator() throws Exception { + void separator() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "Separator.java")); + final File fileToProcess = new File(getPath("InputXpathCommentsIndentationSeparator.java")); -@@ -92,7 +92,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); +@@ -89,7 +89,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationSeparator']]" + + "[@text='InputXpathCommentsIndentationSeparator']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/MODIFIERS/SINGLE_LINE_COMMENT" -@@ -102,7 +102,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -99,7 +99,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testDistributedStatement() throws Exception { + void distributedStatement() throws Exception { final File fileToProcess = - new File( - getPath("SuppressionXpathRegressionCommentsIndentation" + "DistributedStatement.java")); -@@ -116,7 +116,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + new File(getPath("InputXpathCommentsIndentationDistributedStatement.java")); + +@@ -112,7 +112,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationDistributedStatement']]" + + "[@text='InputXpathCommentsIndentationDistributedStatement']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" -@@ -126,7 +126,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -122,7 +122,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testSingleLineBlock() throws Exception { + void singleLineBlock() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "SingleLineBlock.java")); + new File(getPath("InputXpathCommentsIndentationSingleLineBlock.java")); -@@ -138,7 +138,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -134,7 +134,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationSingleLineBlock']]" + + "[@text='InputXpathCommentsIndentationSingleLineBlock']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" -@@ -148,7 +148,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -144,7 +144,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testNonEmptyCase() throws Exception { + void nonEmptyCase() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "NonEmptyCase.java")); + final File fileToProcess = new File(getPath("InputXpathCommentsIndentationNonEmptyCase.java")); -@@ -161,7 +161,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); +@@ -156,7 +156,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationNonEmptyCase']]" + + "[@text='InputXpathCommentsIndentationNonEmptyCase']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" -@@ -171,7 +171,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -166,7 +166,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testEmptyCase() throws Exception { + void emptyCase() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "EmptyCase.java")); + final File fileToProcess = new File(getPath("InputXpathCommentsIndentationEmptyCase.java")); -@@ -184,7 +184,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); +@@ -178,7 +178,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationEmptyCase']]" + + "[@text='InputXpathCommentsIndentationEmptyCase']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" -@@ -194,7 +194,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup +@@ -188,7 +188,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } @Test - public void testWithinBlockStatement() throws Exception { + void withinBlockStatement() throws Exception { final File fileToProcess = - new File( - getPath("SuppressionXpathRegressionCommentsIndentation" + "WithinBlockStatement.java")); -@@ -208,7 +208,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + new File(getPath("InputXpathCommentsIndentationWithinBlockStatement.java")); + +@@ -201,7 +201,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationWithinBlockStatement']]" + + "[@text='InputXpathCommentsIndentationWithinBlockStatement']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/VARIABLE_DEF" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java @@ -3549,72 +3868,110 @@ @Test - public void testLowercase() throws Exception { + void lowercase() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionConstantNameLowercase.java")); + final File fileToProcess = new File(getPath("InputXpathConstantNameLowercase.java")); -@@ -51,7 +51,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -50,7 +50,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionConstantNameLowercase']]" + + "[@text='InputXpathConstantNameLowercase']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='number']"); -@@ -60,7 +60,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { +@@ -59,7 +59,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } @Test - public void testCamelCase() throws Exception { + void camelCase() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionConstantNameCamelCase.java")); + final File fileToProcess = new File(getPath("InputXpathConstantNameCamelCase.java")); -@@ -71,7 +71,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -69,7 +69,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionConstantNameCamelCase']]" + + "[./IDENT[@text='InputXpathConstantNameCamelCase']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='badConstant']"); -@@ -80,7 +80,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { +@@ -78,7 +78,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } @Test - public void testWithBeginningUnderscore() throws Exception { + void withBeginningUnderscore() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java")); + new File(getPath("InputXpathConstantNameWithBeginningUnderscore.java")); -@@ -91,7 +91,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { +@@ -89,7 +89,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionConstantNameWithBeginningUnderscore']]" + + "[@text='InputXpathConstantNameWithBeginningUnderscore']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='_CONSTANT']"); -@@ -100,7 +100,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { +@@ -98,7 +98,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } @Test - public void testWithTwoUnderscores() throws Exception { + void withTwoUnderscores() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionConstantNameWithTwoUnderscores.java")); + final File fileToProcess = new File(getPath("InputXpathConstantNameWithTwoUnderscores.java")); -@@ -111,7 +111,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -108,7 +108,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionConstantNameWithTwoUnderscores']]" + + "[@text='InputXpathConstantNameWithTwoUnderscores']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='BAD__NAME']"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstructorsDeclarationGroupingTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstructorsDeclarationGroupingTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionConstructorsDeclarationGroupingTest extends AbstractXpathTestSupport { ++final class XpathRegressionConstructorsDeclarationGroupingTest extends AbstractXpathTestSupport { + + private final Class clazz = + ConstructorsDeclarationGroupingCheck.class; +@@ -37,7 +37,7 @@ public class XpathRegressionConstructorsDeclarationGroupingTest extends Abstract + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final File fileToProcess = + new File(getPath("InputXpathConstructorsDeclarationGroupingClass.java")); + +@@ -67,7 +67,7 @@ public class XpathRegressionConstructorsDeclarationGroupingTest extends Abstract + } + + @Test +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + final File fileToProcess = + new File(getPath("InputXpathConstructorsDeclarationGroupingEnum.java")); + +@@ -97,7 +97,7 @@ public class XpathRegressionConstructorsDeclarationGroupingTest extends Abstract + } + + @Test +- public void testRecords() throws Exception { ++ void records() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathConstructorsDeclarationGroupingRecords.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java @@ -19,14 +19,14 @@ @@ -3640,53 +3997,53 @@ @Test - public void testCovariantEqualsInClass() throws Exception { + void covariantEqualsInClass() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCovariantEqualsInClass.java")); + final File fileToProcess = new File(getPath("InputXpathCovariantEqualsInClass.java")); -@@ -47,7 +47,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(CovariantEqualsCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInClass']]" + + "[./IDENT[@text='InputXpathCovariantEqualsInClass']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); -@@ -56,7 +56,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport +@@ -55,7 +55,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport } @Test - public void testCovariantEqualsInEnum() throws Exception { + void covariantEqualsInEnum() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCovariantEqualsInEnum.java")); + final File fileToProcess = new File(getPath("InputXpathCovariantEqualsInEnum.java")); -@@ -67,7 +67,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(CovariantEqualsCheck.class); +@@ -65,7 +65,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/ENUM_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInEnum']]" + + "[./IDENT[@text='InputXpathCovariantEqualsInEnum']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); -@@ -76,7 +76,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport +@@ -74,7 +74,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport } @Test - public void testCovariantEqualsInRecord() throws Exception { + void covariantEqualsInRecord() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionCovariantEqualsInRecord.java")); + new File(getNonCompilablePath("InputXpathCovariantEqualsInRecord.java")); -@@ -87,7 +87,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport +@@ -85,7 +85,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/RECORD_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInRecord']]" + + "[./IDENT[@text='InputXpathCovariantEqualsInRecord']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java @@ -3713,10 +4070,10 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCustomImportOrderOne.java")); + final File fileToProcess = new File(getPath("InputXpathCustomImportOrderOne.java")); -@@ -54,13 +54,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CustomImportOrderCheck.class); +@@ -53,13 +53,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3729,10 +4086,10 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCustomImportOrderTwo.java")); + final File fileToProcess = new File(getPath("InputXpathCustomImportOrderTwo.java")); -@@ -76,13 +76,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CustomImportOrderCheck.class); +@@ -74,13 +74,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3745,10 +4102,10 @@ @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCustomImportOrderThree.java")); + final File fileToProcess = new File(getPath("InputXpathCustomImportOrderThree.java")); -@@ -98,13 +98,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CustomImportOrderCheck.class); +@@ -95,13 +95,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3761,10 +4118,10 @@ @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCustomImportOrderFour.java")); + final File fileToProcess = new File(getPath("InputXpathCustomImportOrderFour.java")); -@@ -120,13 +120,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CustomImportOrderCheck.class); +@@ -116,13 +116,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3777,10 +4134,10 @@ @Test - public void testFive() throws Exception { + void five() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCustomImportOrderFive.java")); + final File fileToProcess = new File(getPath("InputXpathCustomImportOrderFive.java")); -@@ -143,13 +143,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CustomImportOrderCheck.class); +@@ -138,13 +138,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3793,10 +4150,10 @@ @Test - public void testSix() throws Exception { + void six() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCustomImportOrderSix.java")); + final File fileToProcess = new File(getPath("InputXpathCustomImportOrderSix.java")); -@@ -168,7 +168,7 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(CustomImportOrderCheck.class); +@@ -162,7 +162,7 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = @@ -3820,20 +4177,20 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testConditionals() throws Exception { ++ void conditionals() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCyclomaticComplexityOne.java")); -@@ -66,7 +66,7 @@ public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSu + final File fileToProcess = new File(getPath("InputXpathCyclomaticComplexityConditionals.java")); + +@@ -65,7 +65,7 @@ public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSu } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCyclomaticComplexityTwo.java")); +- public void testSwitchBlock() throws Exception { ++ void switchBlock() throws Exception { + final File fileToProcess = new File(getPath("InputXpathCyclomaticComplexitySwitchBlock.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(CyclomaticComplexityCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDeclarationOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDeclarationOrderTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -3849,20 +4206,20 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionDeclarationOrderOne.java")); +- public void testNonStatic() throws Exception { ++ void nonStatic() throws Exception { + final File fileToProcess = new File(getPath("InputXpathDeclarationOrderNonStatic.java")); -@@ -62,7 +62,7 @@ public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(DeclarationOrderCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSuppor } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionDeclarationOrderTwo.java")); +- public void testStatic() throws Exception { ++ void testStatic() throws Exception { + final File fileToProcess = new File(getPath("InputXpathDeclarationOrderStatic.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(DeclarationOrderCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java @@ -19,15 +19,15 @@ @@ -3887,28 +4244,28 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionDefaultComesLastOne.java")); +- public void testNonEmptyCase() throws Exception { ++ void nonEmptyCase() throws Exception { + final File fileToProcess = new File(getPath("InputXpathDefaultComesLastNonEmptyCase.java")); -@@ -62,7 +62,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(DefaultComesLastCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionDefaultComesLastTwo.java")); +- public void testEmptyCase() throws Exception { ++ void emptyCase() throws Exception { + final File fileToProcess = new File(getPath("InputXpathDefaultComesLastEmptyCase.java")); -@@ -77,7 +77,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(DefaultComesLastCheck.class); +@@ -75,7 +75,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionDefaultComesLastTwo']]/OBJBLOCK" + + "[@text='InputXpathDefaultComesLastEmptyCase']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/CASE_GROUP" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java @@ -3935,7 +4292,7 @@ @Test - public void testEmptyForLoopEmptyBlock() throws Exception { + void emptyForLoopEmptyBlock() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyBlockEmpty.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyBlockEmpty.java")); final DefaultConfiguration moduleConfig = createModuleConfig(EmptyBlockCheck.class); moduleConfig.addProperty("option", "TEXT"); @@ -43,7 +43,7 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { @@ -3945,7 +4302,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyBlockEmpty']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathEmptyBlockEmpty']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]" @@ -52,14 +52,14 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { } @@ -3953,7 +4310,7 @@ @Test - public void testEmptyForLoopEmptyStatement() throws Exception { + void emptyForLoopEmptyStatement() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyBlockEmpty.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyBlockEmpty.java")); final DefaultConfiguration moduleConfig = createModuleConfig(EmptyBlockCheck.class); final String[] expectedViolation = { "5:38: " + getCheckMessage(EmptyBlockCheck.class, EmptyBlockCheck.MSG_KEY_BLOCK_NO_STATEMENT), @@ -3962,7 +4319,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyBlockEmpty']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathEmptyBlockEmpty']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java @@ -3989,7 +4346,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyCatchBlock1.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyCatchBlockOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(clazz); @@ -46,7 +46,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport @@ -3999,7 +4356,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionEmptyCatchBlock1']]" + + "[./IDENT[@text='InputXpathEmptyCatchBlockOne']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]" @@ -56,7 +56,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport } @@ -4007,7 +4364,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyCatchBlock2.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyCatchBlockTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(clazz); @@ -66,7 +66,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport @@ -4017,7 +4374,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionEmptyCatchBlock2']]" + + "[./IDENT[@text='InputXpathEmptyCatchBlockTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForInitializerPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForInitializerPadTest.java @@ -4036,17 +4393,17 @@ @Test - public void testPreceded() throws Exception { + void preceded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyForInitializerPadPreceded.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyForInitializerPadPreceded.java")); -@@ -62,7 +62,7 @@ public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyForInitializerPadCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTest } @Test - public void testNotPreceded() throws Exception { + void notPreceded() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyForInitializerPadNotPreceded.java")); + new File(getPath("InputXpathEmptyForInitializerPadNotPreceded.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java @@ -4065,18 +4422,18 @@ @Test - public void testFollowed() throws Exception { + void followed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyForIteratorPadFollowed.java")); -@@ -62,7 +62,7 @@ public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyForIteratorPadCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSup } @Test - public void testNotFollowed() throws Exception { + void notFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadNotFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyForIteratorPadNotFollowed.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyForIteratorPadCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java @@ -19,15 +19,15 @@ @@ -4103,62 +4460,62 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyLineSeparator1.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyLineSeparatorOne.java")); -@@ -57,7 +57,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyLineSeparatorCheck.class); +@@ -56,7 +56,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyLineSeparator2.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyLineSeparatorTwo.java")); -@@ -77,7 +77,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyLineSeparatorCheck.class); +@@ -75,7 +75,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyLineSeparator3.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyLineSeparatorThree.java")); -@@ -110,7 +110,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyLineSeparatorCheck.class); +@@ -107,7 +107,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyLineSeparator4.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyLineSeparatorFour.java")); -@@ -124,7 +124,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyLineSeparatorCheck.class); +@@ -120,7 +120,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionEmptyLineSeparator4']]" + + "[./IDENT[@text='InputXpathEmptyLineSeparatorFour']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo1']]/SLIST/RCURLY"); -@@ -133,7 +133,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp +@@ -129,7 +129,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } @Test - public void testFive() throws Exception { + void five() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEmptyLineSeparator5.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyLineSeparatorFive.java")); -@@ -148,7 +148,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyLineSeparatorCheck.class); +@@ -143,7 +143,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionEmptyLineSeparator5']]" + + "[./IDENT[@text='InputXpathEmptyLineSeparatorFive']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo1']]/SLIST/LITERAL_TRY/SLIST" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java @@ -4185,7 +4542,7 @@ @Test - public void testForLoopEmptyStatement() throws Exception { + void forLoopEmptyStatement() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyStatement1.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyStatementLoops.java")); final DefaultConfiguration moduleConfig = createModuleConfig(EmptyStatementCheck.class); final String[] expectedViolation = { "5:36: " + getCheckMessage(EmptyStatementCheck.class, EmptyStatementCheck.MSG_KEY), @@ -4194,7 +4551,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyStatement1']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathEmptyStatementLoops']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -52,14 +52,14 @@ public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport } @@ -4202,7 +4559,7 @@ @Test - public void testIfBlockEmptyStatement() throws Exception { + void ifBlockEmptyStatement() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyStatement2.java")); + final File fileToProcess = new File(getPath("InputXpathEmptyStatementConditionals.java")); final DefaultConfiguration moduleConfig = createModuleConfig(EmptyStatementCheck.class); final String[] expectedViolation = { "6:19: " + getCheckMessage(EmptyStatementCheck.class, EmptyStatementCheck.MSG_KEY), @@ -4211,7 +4568,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyStatement2']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathEmptyStatementConditionals']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java @@ -4230,7 +4587,7 @@ @Test - public void testEquals() throws Exception { + void testEquals() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsAvoidNull.java")); + final File fileToProcess = new File(getPath("InputXpathEqualsAvoidNull.java")); final DefaultConfiguration moduleConfig = createModuleConfig(clazz); @@ -58,7 +58,7 @@ public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport @@ -4239,9 +4596,9 @@ @Test - public void testEqualsIgnoreCase() throws Exception { + void equalsIgnoreCase() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEqualsAvoidNullIgnoreCase.java")); + final File fileToProcess = new File(getPath("InputXpathEqualsAvoidNullIgnoreCase.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); --- 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; @@ -4258,7 +4615,7 @@ @Test - public void testEqualsOnly() throws Exception { + void equalsOnly() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCode1.java")); + final File fileToProcess = new File(getPath("InputXpathEqualsHashCodeEqualsOnly.java")); final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); @@ -58,7 +58,7 @@ public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport @@ -4267,7 +4624,7 @@ @Test - public void testHashCodeOnly() throws Exception { + void hashCodeOnly() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCode2.java")); + final File fileToProcess = new File(getPath("InputXpathEqualsHashCodeHashCodeOnly.java")); final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); @@ -83,7 +83,7 @@ public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport @@ -4276,9 +4633,64 @@ @Test - public void testNestedCase() throws Exception { + void nestedCase() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionEqualsHashCodeNestedCase.java")); + final File fileToProcess = new File(getPath("InputXpathEqualsHashCodeNestedCase.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExecutableStatementCountTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExecutableStatementCountTest.java +@@ -21,6 +21,7 @@ package org.checkstyle.suppressionxpathfilter; + import static com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck; + import java.io.File; +@@ -28,7 +29,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionExecutableStatementCountTest extends AbstractXpathTestSupport { ++final class XpathRegressionExecutableStatementCountTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -36,7 +37,7 @@ public class XpathRegressionExecutableStatementCountTest extends AbstractXpathTe + } + + @Test +- public void testDefaultConfig() throws Exception { ++ void defaultConfig() throws Exception { + final String filePath = getPath("InputXpathExecutableStatementCountDefault.java"); + final File fileToProcess = new File(filePath); + +@@ -67,7 +68,7 @@ public class XpathRegressionExecutableStatementCountTest extends AbstractXpathTe + } + + @Test +- public void testCustomMax() throws Exception { ++ void customMax() throws Exception { + final String filePath = getPath("InputXpathExecutableStatementCountCustomMax.java"); + final File fileToProcess = new File(filePath); + +@@ -102,7 +103,7 @@ public class XpathRegressionExecutableStatementCountTest extends AbstractXpathTe + } + + @Test +- public void testLambdas() throws Exception { ++ void lambdas() throws Exception { + final String filePath = getPath("InputXpathExecutableStatementCountLambdas.java"); + final File fileToProcess = new File(filePath); + +@@ -117,7 +118,7 @@ public class XpathRegressionExecutableStatementCountTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- List.of( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='InputXpathExecutableStatementCountLambdas']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='c']]/ASSIGN/LAMBDA"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java @@ -19,14 +19,14 @@ @@ -4302,10 +4714,10 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testPrimitiveType() throws Exception { ++ void primitiveType() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionExplicitInitializationOne.java")); + new File(getPath("InputXpathExplicitInitializationPrimitiveType.java")); @@ -49,7 +49,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest }; @@ -4314,25 +4726,25 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionExplicitInitializationOne']]" + + "[./IDENT[@text='InputXpathExplicitInitializationPrimitiveType']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='a']"); @@ -58,7 +58,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionExplicitInitializationTwo.java")); +- public void testObjectType() throws Exception { ++ void objectType() throws Exception { + final File fileToProcess = new File(getPath("InputXpathExplicitInitializationObjectType.java")); -@@ -74,7 +74,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(ExplicitInitializationCheck.class); +@@ -73,7 +73,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionExplicitInitializationTwo']]" + + "[./IDENT[@text='InputXpathExplicitInitializationObjectType']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='bar']"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFallThroughTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFallThroughTest.java @@ -4349,18 +4761,18 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionFallThroughOne.java")); +- public void testFallThrough() throws Exception { ++ void fallThrough() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFallThrough.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FallThroughCheck.class); @@ -59,7 +59,7 @@ public class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionFallThroughTwo.java")); +- public void testDefaultCase() throws Exception { ++ void defaultCase() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFallThroughDefaultCase.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FallThroughCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java @@ -4378,18 +4790,18 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalClassDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); -@@ -61,7 +61,7 @@ public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { +@@ -58,7 +58,7 @@ public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass2.java")); +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalClassInnerClass.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalLocalVariableTest.java @@ -4414,163 +4826,163 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable1.java")); +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableMethodDef.java")); -@@ -47,7 +48,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -46,7 +47,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalLocalVariable1']]" + + "[@text='InputXpathFinalLocalVariableMethodDef']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]" -@@ -57,7 +58,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -56,7 +57,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable2.java")); +- public void testForLoop() throws Exception { ++ void forLoop() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableForLoop.java")); -@@ -69,7 +70,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -67,7 +68,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalLocalVariable2']]" + + "[@text='InputXpathFinalLocalVariableForLoop']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method2']]/SLIST/" -@@ -79,7 +80,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -77,7 +78,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable3.java")); +- public void testSwitchCase() throws Exception { ++ void switchCase() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableSwitchCase.java")); -@@ -91,7 +92,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -88,7 +89,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalLocalVariable3']]" + + "[@text='InputXpathFinalLocalVariableSwitchCase']]" + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" -@@ -102,7 +103,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -99,7 +100,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testFour() throws Exception { -+ void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable4.java")); +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableInnerClass.java")); -@@ -115,7 +116,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -111,7 +112,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalLocalVariable4']]" + + "[@text='InputXpathFinalLocalVariableInnerClass']]" + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" -@@ -126,7 +127,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -122,7 +123,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testFive() throws Exception { -+ void five() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable5.java")); +- public void testParameterDef() throws Exception { ++ void parameterDef() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableParameterDef.java")); -@@ -139,7 +140,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -134,7 +135,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalLocalVariable5']]" + + "[@text='InputXpathFinalLocalVariableParameterDef']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" -@@ -149,7 +150,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -144,7 +145,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testSix() throws Exception { -+ void six() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable6.java")); +- public void testEnhancedFor() throws Exception { ++ void enhancedFor() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableEnhancedFor.java")); -@@ -162,7 +163,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -156,7 +157,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionFinalLocalVariable6']]" + + "[./IDENT[@text='InputXpathFinalLocalVariableEnhancedFor']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method1']]" -@@ -172,7 +173,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -166,7 +167,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testSeven() throws Exception { -+ void seven() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable7.java")); +- public void testCtor() throws Exception { ++ void ctor() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableCtor.java")); -@@ -185,7 +186,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -178,7 +179,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionFinalLocalVariable7']]" + + "[./IDENT[@text='InputXpathFinalLocalVariableCtor']]" + "/OBJBLOCK/CTOR_DEF[./IDENT" -@@ -196,7 +197,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -189,7 +190,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testEight() throws Exception { -+ void eight() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable8.java")); +- public void testTryBlock() throws Exception { ++ void tryBlock() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableTryBlock.java")); -@@ -209,7 +210,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -201,7 +202,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalLocalVariable8']]" + + "[@text='InputXpathFinalLocalVariableTryBlock']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkCodeBlock']]" -@@ -219,7 +220,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp +@@ -211,7 +212,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } @Test -- public void testNine() throws Exception { -+ void nine() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionFinalLocalVariable9.java")); +- public void testConditionals() throws Exception { ++ void conditionals() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalLocalVariableConditionals.java")); -@@ -231,7 +232,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(FinalLocalVariableCheck.class); +@@ -222,7 +223,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionFinalLocalVariable9']]" + + "[./IDENT[@text='InputXpathFinalLocalVariableConditionals']]" + "/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 @@ -4594,9 +5006,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters1.java")); +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalParametersMethod.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); @@ -46,7 +47,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport @@ -4606,15 +5018,15 @@ - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalParameters1']]" + + "[@text='InputXpathFinalParametersMethod']]" + "/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")); +- public void testCtor() throws Exception { ++ void ctor() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalParametersCtor.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); @@ -85,7 +86,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport @@ -4624,15 +5036,15 @@ - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalParameters2']]" + + "[@text='InputXpathFinalParametersCtor']]" + "/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")); +- public void testAnonymous() throws Exception { ++ void anonymous() throws Exception { + final File fileToProcess = new File(getPath("InputXpathFinalParametersAnonymous.java")); final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); @@ -129,7 +130,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport @@ -4642,7 +5054,7 @@ - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionFinalParameters3']]" + + "[@text='InputXpathFinalParametersAnonymous']]" + "/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 @@ -4670,135 +5082,135 @@ @Test - public void testProcessEnd() throws Exception { + void processEnd() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceEnd.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceEnd.java")); -@@ -50,7 +50,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -49,7 +49,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionGenericWhitespaceEnd']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathGenericWhitespaceEnd']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='bad']]" -@@ -61,7 +61,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo +@@ -60,7 +60,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessNestedGenericsOne() throws Exception { + void processNestedGenericsOne() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceNestedOne.java")); -@@ -74,7 +74,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -72,7 +72,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne']]" + + "@text='InputXpathGenericWhitespaceNestedOne']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" -@@ -85,7 +85,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo +@@ -83,7 +83,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessNestedGenericsTwo() throws Exception { + void processNestedGenericsTwo() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceNestedTwo.java")); -@@ -98,7 +98,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -95,7 +95,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo']]" + + "@text='InputXpathGenericWhitespaceNestedTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" -@@ -109,7 +109,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo +@@ -106,7 +106,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessNestedGenericsThree() throws Exception { + void processNestedGenericsThree() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceNestedThree.java")); -@@ -122,7 +122,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -118,7 +118,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree']]" + + "@text='InputXpathGenericWhitespaceNestedThree']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" -@@ -133,7 +133,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo +@@ -129,7 +129,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessSingleGenericOne() throws Exception { + void processSingleGenericOne() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericOne.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceSingleOne.java")); -@@ -146,7 +146,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -141,7 +141,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionGenericWhitespaceSingleGenericOne']]" + + "@text='InputXpathGenericWhitespaceSingleOne']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/METHOD_CALL" -@@ -157,7 +157,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo +@@ -152,7 +152,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessSingleGenericTwo() throws Exception { + void processSingleGenericTwo() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceSingleTwo.java")); -@@ -170,7 +170,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -164,7 +164,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo']]" + + "@text='InputXpathGenericWhitespaceSingleTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS/GENERIC_END"); -@@ -179,7 +179,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo +@@ -173,7 +173,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessStartOne() throws Exception { + void processStartOne() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartOne.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceStartOne.java")); -@@ -204,7 +204,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -197,7 +197,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessStartTwo() throws Exception { + void processStartTwo() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartTwo.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceStartTwo.java")); -@@ -233,7 +233,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); +@@ -225,7 +225,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } @Test - public void testProcessStartThree() throws Exception { + void processStartThree() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartThree.java")); + final File fileToProcess = new File(getPath("InputXpathGenericWhitespaceStartThree.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(GenericWhitespaceCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java @@ -19,14 +19,14 @@ @@ -4822,9 +5234,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionHiddenFieldOne.java")); +- public void testLambdaExpInMethodCall() throws Exception { ++ void lambdaExpInMethodCall() throws Exception { + final File fileToProcess = new File(getPath("InputXpathHiddenFieldLambdaExpInMethodCall.java")); final DefaultConfiguration moduleConfig = createModuleConfig(HiddenFieldCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { @@ -4834,15 +5246,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionHiddenFieldOne']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathHiddenFieldLambdaExpInMethodCall']]/OBJBLOCK" + "/INSTANCE_INIT/SLIST/EXPR/METHOD_CALL/ELIST/LAMBDA/PARAMETERS" @@ -56,7 +56,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionHiddenFieldTwo.java")); +- public void testMethodParam() throws Exception { ++ void methodParam() throws Exception { + final File fileToProcess = new File(getPath("InputXpathHiddenFieldMethodParam.java")); final DefaultConfiguration moduleConfig = createModuleConfig(HiddenFieldCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { @@ -4852,7 +5264,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionHiddenFieldTwo']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathHiddenFieldMethodParam']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='method']]/PARAMETERS/PARAMETER_DEF" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java @@ -4879,7 +5291,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalCatchOne.java")); + final File fileToProcess = new File(getPath("InputXpathIllegalCatchOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalCatchCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { @@ -4889,7 +5301,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIllegalCatchOne']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathIllegalCatchOne']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='fun']]/SLIST" @@ -57,7 +57,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { } @@ -4897,7 +5309,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalCatchTwo.java")); + final File fileToProcess = new File(getPath("InputXpathIllegalCatchTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalCatchCheck.class); @@ -69,7 +69,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { @@ -4907,7 +5319,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIllegalCatchTwo']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathIllegalCatchTwo']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='methodTwo']]/SLIST" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java @@ -4936,34 +5348,34 @@ - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = - new File( - getNonCompilablePath("SuppressionXpathRegressionIllegalIdentifierNameTestOne.java")); -@@ -56,7 +56,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS + new File(getNonCompilablePath("InputXpathIllegalIdentifierNameOne.java")); + +@@ -55,7 +55,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/RECORD_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIllegalIdentifierNameTestOne'" + + "[./IDENT[@text='InputXpathIllegalIdentifierNameOne'" + "]]/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='yield']"); -@@ -65,7 +65,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS +@@ -64,7 +64,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS } @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = - new File( - getNonCompilablePath("SuppressionXpathRegressionIllegalIdentifierNameTestTwo.java")); -@@ -84,7 +84,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS + new File(getNonCompilablePath("InputXpathIllegalIdentifierNameTwo.java")); + +@@ -82,7 +82,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIllegalIdentifierNameTestTwo']" + + "[./IDENT[@text='InputXpathIllegalIdentifierNameTwo']" + "]/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/PARAMETERS/PARAMETER_DEF" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java @@ -4988,9 +5400,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalImportOne.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalImportDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalImportCheck.class); moduleConfig.addProperty("illegalPkgs", "java.util"); @@ -44,13 +44,13 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { @@ -5004,9 +5416,9 @@ } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalImportTwo.java")); +- public void testStatic() throws Exception { ++ void testStatic() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalImportStatic.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalImportCheck.class); @@ -61,8 +61,7 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { @@ -5035,7 +5447,7 @@ @Test - public void testSimple() throws Exception { + void simple() throws Exception { - final String fileName = "SuppressionXpathRegressionIllegalInstantiationSimple.java"; + final String fileName = "InputXpathIllegalInstantiationSimple.java"; final File fileToProcess = new File(getNonCompilablePath(fileName)); @@ -61,7 +61,7 @@ public class XpathRegressionIllegalInstantiationTest extends AbstractXpathTestSu @@ -5044,7 +5456,7 @@ @Test - public void testAnonymous() throws Exception { + void anonymous() throws Exception { - final String fileName = "SuppressionXpathRegressionIllegalInstantiationAnonymous.java"; + final String fileName = "InputXpathIllegalInstantiationAnonymous.java"; final File fileToProcess = new File(getNonCompilablePath(fileName)); @@ -88,7 +88,7 @@ public class XpathRegressionIllegalInstantiationTest extends AbstractXpathTestSu @@ -5053,7 +5465,7 @@ @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { - final String fileName = "SuppressionXpathRegressionIllegalInstantiationInterface.java"; + final String fileName = "InputXpathIllegalInstantiationInterface.java"; final File fileToProcess = new File(getNonCompilablePath(fileName)); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java @@ -5079,9 +5491,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalThrowsOne.java")); +- public void testRuntimeException() throws Exception { ++ void runtimeException() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalThrowsRuntimeException.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalThrowsCheck.class); @@ -48,7 +48,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { @@ -5091,15 +5503,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIllegalThrowsOne']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathIllegalThrowsRuntimeException']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sayHello']]/LITERAL_THROWS" @@ -58,7 +58,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalThrowsTwo.java")); +- public void testError() throws Exception { ++ void error() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalThrowsError.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalThrowsCheck.class); @@ -70,7 +70,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { @@ -5109,7 +5521,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIllegalThrowsTwo']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathIllegalThrowsError']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='methodTwo']]/LITERAL_THROWS" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java @@ -5134,9 +5546,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalToken1.java")); +- public void testLabel() throws Exception { ++ void label() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalTokenLabel.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); final String[] expectedViolation = { "5:10: " + getCheckMessage(IllegalTokenCheck.class, IllegalTokenCheck.MSG_KEY, "outer:"), @@ -5145,15 +5557,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalToken1']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathIllegalTokenLabel']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]" @@ -53,7 +53,7 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalToken2.java")); +- public void testNative() throws Exception { ++ void testNative() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalTokenNative.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); @@ -63,7 +63,7 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { @@ -5163,7 +5575,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalToken2']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathIllegalTokenNative']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java @@ -5189,37 +5601,37 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIllegalTokenText1.java")); +- public void testField() throws Exception { ++ void field() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalTokenTextField.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); -@@ -62,7 +62,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + moduleConfig.addProperty("format", "12345"); +@@ -61,7 +61,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIllegalTokenText2.java")); +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalTokenTextMethod.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); -@@ -90,7 +90,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + moduleConfig.addProperty("format", "forbiddenText"); +@@ -88,7 +88,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIllegalTokenText3.java")); +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIllegalTokenTextInterface.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); -@@ -102,7 +102,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor + moduleConfig.addProperty("format", "invalidIdentifier"); +@@ -99,7 +99,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']]" + + "/INTERFACE_DEF[./IDENT[@text='InputXpathIllegalTokenTextInterface']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='invalidIdentifier']"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java @@ -5246,7 +5658,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalTypeOne.java")); + final File fileToProcess = new File(getPath("InputXpathIllegalTypeOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTypeCheck.class); moduleConfig.addProperty("tokens", "METHOD_DEF"); @@ -45,7 +45,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { @@ -5256,7 +5668,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTypeOne']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathIllegalTypeOne']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/TYPE_PARAMETER" @@ -56,7 +56,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { } @@ -5264,7 +5676,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalTypeTwo.java")); + final File fileToProcess = new File(getPath("InputXpathIllegalTypeTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTypeCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { @@ -5273,7 +5685,7 @@ final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( - "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTypeTwo']" + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathIllegalTypeTwo']" + "]/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/" + "TYPE_PARAMETER[./IDENT[@text='T']]/TYPE_UPPER_BOUNDS/IDENT[@text='Boolean']"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.java @@ -5302,7 +5714,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlOne.java")); + final File fileToProcess = new File(getPath("InputXpathImportControlOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); @@ -49,13 +49,13 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { @@ -5318,7 +5730,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlTwo.java")); + final File fileToProcess = new File(getPath("InputXpathImportControlTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); @@ -72,7 +72,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { @@ -5327,19 +5739,19 @@ @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionImportControlThree.java")); + final File fileToProcess = new File(getPath("InputXpathImportControlThree.java")); -@@ -89,7 +89,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); +@@ -88,7 +88,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { } @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionImportControlFour.java")); + final File fileToProcess = new File(getPath("InputXpathImportControlFour.java")); -@@ -103,7 +103,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); +@@ -101,7 +101,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -5373,7 +5785,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderOne.java")); + final File fileToProcess = new File(getPath("InputXpathImportOrderOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -46,13 +46,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { @@ -5389,7 +5801,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderTwo.java")); + final File fileToProcess = new File(getPath("InputXpathImportOrderTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -64,13 +64,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { @@ -5405,7 +5817,7 @@ @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderThree.java")); + final File fileToProcess = new File(getPath("InputXpathImportOrderThree.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -83,13 +83,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { @@ -5421,7 +5833,7 @@ @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderFour.java")); + final File fileToProcess = new File(getPath("InputXpathImportOrderFour.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -101,14 +101,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { @@ -5438,7 +5850,7 @@ @Test - public void testFive() throws Exception { + void five() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderFive.java")); + final File fileToProcess = new File(getPath("InputXpathImportOrderFive.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -121,7 +120,7 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { @@ -5474,100 +5886,100 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationTestOne.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIndentationDefault.java")); -@@ -67,7 +67,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } @Test - public void testBasicOffset() throws Exception { + void basicOffset() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationTestTwo.java")); + final File fileToProcess = new File(getPath("InputXpathIndentationBasicOffset.java")); -@@ -106,7 +106,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -104,7 +104,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } @Test - public void testCaseIndent() throws Exception { + void caseIndent() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationTestThree.java")); + final File fileToProcess = new File(getPath("InputXpathIndentationSwitchCase.java")); -@@ -141,7 +141,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -138,7 +138,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } @Test -- public void testLambda() throws Exception { -+ void lambda() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationLambdaTest1.java")); +- public void testLambdaOne() throws Exception { ++ void lambdaOne() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIndentationLambdaOne.java")); -@@ -160,7 +160,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -156,7 +156,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIndentationLambdaTest1" + + "[./IDENT[@text='InputXpathIndentationLambdaOne" + "']]/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF" -@@ -170,7 +170,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { +@@ -166,7 +166,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } @Test -- public void testLambda2() throws Exception { -+ void lambda2() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationLambdaTest2.java")); +- public void testLambdaTwo() throws Exception { ++ void lambdaTwo() throws Exception { + final File fileToProcess = new File(getPath("InputXpathIndentationLambdaTwo.java")); -@@ -195,7 +195,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -190,7 +190,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIndentationLambdaTest2']]" + + "[./IDENT[@text='InputXpathIndentationLambdaTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[" -@@ -205,7 +205,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { +@@ -200,7 +200,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } @Test - public void testIfWithNoCurlies() throws Exception { + void ifWithNoCurlies() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationIfWithoutCurly.java")); + final File fileToProcess = new File(getPath("InputXpathIndentationIfWithoutCurly.java")); -@@ -226,7 +226,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -220,7 +220,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIndentationIfWithoutCurly']]" + + "[./IDENT[@text='InputXpathIndentationIfWithoutCurly']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/EXPR/" -@@ -236,7 +236,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { +@@ -230,7 +230,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } @Test - public void testElseWithNoCurlies() throws Exception { + void elseWithNoCurlies() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionIndentationElseWithoutCurly.java")); + final File fileToProcess = new File(getPath("InputXpathIndentationElseWithoutCurly.java")); -@@ -258,7 +258,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IndentationCheck.class); +@@ -251,7 +251,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionIndentationElseWithoutCurly']]" + + "[./IDENT[@text='InputXpathIndentationElseWithoutCurly']]" + "/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 @@ -5592,9 +6004,9 @@ } @Test -- public void testFile1() throws Exception { -+ void file1() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerAssignment1.java")); +- public void testInnerAssignment() throws Exception { ++ void innerAssignment() throws Exception { + final File fileToProcess = new File(getPath("InputXpathInnerAssignment.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class); @@ -46,7 +47,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport @@ -5604,15 +6016,15 @@ - List.of( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionInnerAssignment1']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathInnerAssignment']]" + "/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")); +- public void testArrays() throws Exception { ++ void arrays() throws Exception { + final File fileToProcess = new File(getPath("InputXpathInnerAssignmentArrays.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerTypeLastTest.java @@ -5632,7 +6044,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastOne.java")); + final File fileToProcess = new File(getPath("InputXpathInnerTypeLastOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InnerTypeLastCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { @@ -5642,7 +6054,7 @@ - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastTwo.java")); + final File fileToProcess = new File(getPath("InputXpathInnerTypeLastTwo.java")); @@ -99,7 +99,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { } @@ -5651,8 +6063,8 @@ - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInnerTypeLastThree.java")); + final File fileToProcess = new File(getPath("InputXpathInnerTypeLastThree.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; @@ -5668,18 +6080,18 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceIsType1.java")); +- public void testAllowMarker() throws Exception { ++ void allowMarker() throws Exception { + final File fileToProcess = new File(getPath("InputXpathInterfaceIsTypeAllowMarker.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InterfaceIsTypeCheck.class); @@ -59,7 +59,7 @@ public class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceIsType2.java")); +- public void testAllowMarkerFalse() throws Exception { ++ void allowMarkerFalse() throws Exception { + final File fileToProcess = new File(getPath("InputXpathInterfaceIsType.java")); final DefaultConfiguration moduleConfig = createModuleConfig(InterfaceIsTypeCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java @@ -5697,28 +6109,66 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testField() throws Exception { ++ void field() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier1.java")); + new File(getPath("InputXpathInterfaceMemberImpliedModifierField.java")); @@ -67,7 +67,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testMethod() throws Exception { ++ void method() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier2.java")); + new File(getPath("InputXpathInterfaceMemberImpliedModifierMethod.java")); @@ -100,7 +100,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { +- public void testInner() throws Exception { ++ void inner() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier3.java")); + new File(getPath("InputXpathInterfaceMemberImpliedModifierInner.java")); + +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceTypeParameterNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceTypeParameterNameTest.java +@@ -28,7 +28,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionInterfaceTypeParameterNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionInterfaceTypeParameterNameTest extends AbstractXpathTestSupport { + private final String checkName = InterfaceTypeParameterNameCheck.class.getSimpleName(); + + @Override +@@ -37,7 +37,7 @@ public class XpathRegressionInterfaceTypeParameterNameTest extends AbstractXpath + } + + @Test +- public void testInsideClass() throws Exception { ++ void insideClass() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathInterfaceTypeParameterNameInsideClass.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionInterfaceTypeParameterNameTest extends AbstractXpath + } + + @Test +- public void testInsideInnerClass() throws Exception { ++ void insideInnerClass() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathInterfaceTypeParameterNameInsideInnerClass.java")); + +@@ -102,7 +102,7 @@ public class XpathRegressionInterfaceTypeParameterNameTest extends AbstractXpath + } + + @Test +- public void testTopLevelPublic() throws Exception { ++ void topLevelPublic() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathInterfaceTypeParameterNameTopLevelPublic.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java @@ -5745,107 +6195,107 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionOne.java")); + final File fileToProcess = new File(getPath("InputXpathInvalidJavadocPositionOne.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionOne']]" + + "[./IDENT[@text='InputXpathInvalidJavadocPositionOne']]" + "/MODIFIERS/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" -@@ -58,7 +58,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest +@@ -57,7 +57,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionTwo.java")); + final File fileToProcess = new File(getPath("InputXpathInvalidJavadocPositionTwo.java")); -@@ -70,7 +70,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionInvalidJavadocPositionTwo']]" + + "[@text='InputXpathInvalidJavadocPositionTwo']]" + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" -@@ -80,7 +80,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest +@@ -78,7 +78,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionThree.java")); + final File fileToProcess = new File(getPath("InputXpathInvalidJavadocPositionThree.java")); -@@ -92,7 +92,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); +@@ -89,7 +89,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionThree']]/" + + "[./IDENT[@text='InputXpathInvalidJavadocPositionThree']]/" + "OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" -@@ -102,7 +102,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest +@@ -99,7 +99,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionFour.java")); + final File fileToProcess = new File(getPath("InputXpathInvalidJavadocPositionFour.java")); -@@ -114,7 +114,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); +@@ -110,7 +110,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionFour']]" + + "[./IDENT[@text='InputXpathInvalidJavadocPositionFour']]" + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" -@@ -124,7 +124,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest +@@ -120,7 +120,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } @Test - public void testFive() throws Exception { + void five() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionFive.java")); + final File fileToProcess = new File(getPath("InputXpathInvalidJavadocPositionFive.java")); -@@ -136,7 +136,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); +@@ -131,7 +131,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionFive']]" + + "[./IDENT[@text='InputXpathInvalidJavadocPositionFive']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" -@@ -147,7 +147,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest +@@ -142,7 +142,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } @Test - public void testSix() throws Exception { + void six() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionSix.java")); + final File fileToProcess = new File(getPath("InputXpathInvalidJavadocPositionSix.java")); -@@ -159,7 +159,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(InvalidJavadocPositionCheck.class); +@@ -153,7 +153,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionSix']]" + + "[./IDENT[@text='InputXpathInvalidJavadocPositionSix']]" + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavaNCSSTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavaNCSSTest.java @@ -5872,7 +6322,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSOne.java")); + final File fileToProcess = new File(getPath("InputXpathJavaNCSSOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); @@ -46,7 +47,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { @@ -5882,7 +6332,7 @@ - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionJavaNCSSOne']]" + + "[./IDENT[@text='InputXpathJavaNCSSOne']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]", @@ -61,7 +62,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { } @@ -5890,7 +6340,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSTwo.java")); + final File fileToProcess = new File(getPath("InputXpathJavaNCSSTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); @@ -73,7 +74,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { @@ -5899,19 +6349,19 @@ final List expectedXpathQueries = - List.of( + ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + "[./IDENT[@text='InputXpathJavaNCSSTwo']]", + "/COMPILATION_UNIT/CLASS_DEF" + "[./IDENT[@text='InputXpathJavaNCSSTwo']]/MODIFIERS", "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionJavaNCSSTwo']]", - "/COMPILATION_UNIT/CLASS_DEF" -@@ -86,7 +87,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { +@@ -84,7 +85,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 File fileToProcess = new File(getPath("InputXpathJavaNCSSThree.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); -@@ -98,7 +99,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { +@@ -96,7 +97,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -5945,35 +6395,35 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocContentLocationOne.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocContentLocationOne.java")); -@@ -50,7 +50,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocContentLocationCheck.class); +@@ -49,7 +49,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/INTERFACE_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionJavadocContentLocationOne']]" + + "[./IDENT[@text='InputXpathJavadocContentLocationOne']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE/BLOCK_COMMENT_BEGIN" -@@ -60,7 +60,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest +@@ -59,7 +59,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocContentLocationTwo.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocContentLocationTwo.java")); -@@ -76,7 +76,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocContentLocationCheck.class); +@@ -74,7 +74,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/INTERFACE_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionJavadocContentLocationTwo']]" + + "[@text='InputXpathJavadocContentLocationTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE/BLOCK_COMMENT_BEGIN" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocMethodTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocMethodTest.java @@ -6001,7 +6451,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodOne.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocMethodOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { @@ -6010,7 +6460,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodTwo.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocMethodTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); @@ -76,7 +76,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { @@ -6020,7 +6470,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionJavadocMethodTwo']]" + + "[./IDENT[@text='InputXpathJavadocMethodTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkParam']]/PARAMETERS" @@ -86,7 +86,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } @@ -6028,44 +6478,44 @@ @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocMethodThree.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocMethodThree.java")); -@@ -111,7 +111,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); +@@ -110,7 +110,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocMethodFour.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocMethodFour.java")); -@@ -125,7 +125,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); +@@ -123,7 +123,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionJavadocMethodFour']]" + + "[./IDENT[@text='InputXpathJavadocMethodFour']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" -@@ -135,7 +135,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { +@@ -133,7 +133,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } @Test - public void testFive() throws Exception { + void five() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocMethodFive.java")); + final File fileToProcess = new File(getPath("InputXpathJavadocMethodFive.java")); -@@ -153,7 +153,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); +@@ -150,7 +150,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionJavadocMethodFive']]" + + "[./IDENT[@text='InputXpathJavadocMethodFive']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bar']]/SLIST" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocTypeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocTypeTest.java @@ -6082,27 +6532,27 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeOne.java")); +- public void testMissingTag() throws Exception { ++ void missingTag() throws Exception { + final File fileToProcess = new File(getPath("InputXpathJavadocTypeMissingTag.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); -@@ -66,7 +66,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { +@@ -65,7 +65,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeTwo.java")); +- public void testWrongFormat() throws Exception { ++ void wrongFormat() throws Exception { + final File fileToProcess = new File(getPath("InputXpathJavadocTypeWrongFormat.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); -@@ -91,7 +91,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { +@@ -89,7 +89,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeThree.java")); +- public void testIncomplete() throws Exception { ++ void incomplete() throws Exception { + final File fileToProcess = new File(getPath("InputXpathJavadocTypeIncomplete.java")); final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java @@ -6120,20 +6570,20 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testPrivateClassFields() throws Exception { ++ void privateClassFields() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocVariableOne.java")); + new File(getPath("InputXpathJavadocVariablePrivateClassFields.java")); @@ -63,7 +63,7 @@ public class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionJavadocVariableTwo.java")); +- public void testInnerClassFields() throws Exception { ++ void innerClassFields() throws Exception { + final File fileToProcess = new File(getPath("InputXpathJavadocVariableInnerClassFields.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocVariableCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java @@ -19,14 +19,14 @@ @@ -6157,37 +6607,37 @@ } @Test -- public void testDefault() throws Exception { -+ void testDefault() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionLambdaBodyLength1.java")); +- public void testDefaultMax() throws Exception { ++ void defaultMax() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLambdaBodyLengthDefaultMax.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); -@@ -45,7 +45,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor + final String[] expectedViolation = { +@@ -44,7 +44,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionLambdaBodyLength1']]" + + "[./IDENT[@text='InputXpathLambdaBodyLengthDefaultMax']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST" -@@ -55,7 +55,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor +@@ -54,7 +54,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor } @Test -- public void testMaxIsNotDefault() throws Exception { -+ void maxIsNotDefault() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionLambdaBodyLength2.java")); +- public void testCustomMax() throws Exception { ++ void customMax() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLambdaBodyLengthCustomMax.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); -@@ -65,7 +65,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor + moduleConfig.addProperty("max", "5"); +@@ -63,7 +63,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionLambdaBodyLength2']]" + + "[./IDENT[@text='InputXpathLambdaBodyLengthCustomMax']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java @@ -6214,28 +6664,28 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionLambdaParameterName1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLambdaParameterNameDefault.java")); -@@ -55,7 +55,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(LambdaParameterNameCheck.class); +@@ -54,7 +54,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionLambdaParameterName1']]" + + "[./IDENT[@text='InputXpathLambdaParameterNameDefault']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[" -@@ -65,7 +65,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup +@@ -64,7 +64,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testNonDefaultPattern() throws Exception { ++ void nonDefaultPattern() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionLambdaParameterName2.java")); + new File(getPath("InputXpathLambdaParameterNameNonDefaultPattern.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java @@ -6264,36 +6714,182 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyOne.java")); + final File fileToProcess = new File(getPath("InputXpathLeftCurlyOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); -@@ -58,7 +58,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { +@@ -57,7 +57,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyTwo.java")); + final File fileToProcess = new File(getPath("InputXpathLeftCurlyTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); -@@ -79,7 +79,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { +@@ -77,7 +77,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { } @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyThree.java")); + final File fileToProcess = new File(getPath("InputXpathLeftCurlyThree.java")); final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); -@@ -90,7 +90,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { +@@ -88,7 +88,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionLeftCurlyThree']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathLeftCurlyThree']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLocalFinalVariableNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLocalFinalVariableNameTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck.MSG_INVALID_PATTERN; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTestSupport { + + private final String checkName = LocalFinalVariableNameCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTest + } + + @Test +- public void testResource() throws Exception { ++ void resource() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLocalFinalVariableNameResource.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LocalFinalVariableNameCheck.class); +@@ -55,7 +55,7 @@ public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathLocalFinalVariableNameResource']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='MyMethod']]/SLIST/LITERAL_TRY" +@@ -65,7 +65,7 @@ public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTest + } + + @Test +- public void testVariable() throws Exception { ++ void variable() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLocalFinalVariableNameVar.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LocalFinalVariableNameCheck.class); +@@ -78,7 +78,7 @@ public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathLocalFinalVariableNameVar']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='MyMethod']]/SLIST/VARIABLE_DEF" +@@ -88,7 +88,7 @@ public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTest + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLocalFinalVariableNameInner.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LocalFinalVariableNameCheck.class); +@@ -101,7 +101,7 @@ public class XpathRegressionLocalFinalVariableNameTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathLocalFinalVariableNameInner']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]/OBJBLOCK" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLocalVariableNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLocalVariableNameTest.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.LocalVariableNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -36,7 +36,7 @@ public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLocalVariableNameMethod.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LocalVariableNameCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathLocalVariableNameMethod']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='MyMethod']]" +@@ -57,7 +57,7 @@ public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testIteration() throws Exception { ++ void iteration() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLocalVariableNameIteration.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LocalVariableNameCheck.class); +@@ -69,7 +69,7 @@ public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathLocalVariableNameIteration']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='MyMethod']]/" +@@ -79,7 +79,7 @@ public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathLocalVariableNameInnerClass.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LocalVariableNameCheck.class); +@@ -90,7 +90,7 @@ public class XpathRegressionLocalVariableNameTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathLocalVariableNameInnerClass']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]/OBJBLOCK/" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMagicNumberTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMagicNumberTest.java @@ -19,6 +19,7 @@ @@ -6319,35 +6915,35 @@ @Test - public void testVariable() throws Exception { + void variable() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMagicNumberVariable.java")); + final File fileToProcess = new File(getPath("InputXpathMagicNumberVariable.java")); -@@ -59,7 +60,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(MagicNumberCheck.class); +@@ -58,7 +59,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { } @Test - public void testMethodDef() throws Exception { + void methodDef() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMagicNumberMethodDef.java")); + final File fileToProcess = new File(getPath("InputXpathMagicNumberMethodDef.java")); -@@ -85,7 +86,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(MagicNumberCheck.class); +@@ -83,7 +84,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { } @Test - public void testAnotherVariable() throws Exception { + void anotherVariable() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMagicNumberAnotherVariable.java")); + final File fileToProcess = new File(getPath("InputXpathMagicNumberAnotherVariable.java")); -@@ -96,7 +97,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(MagicNumberCheck.class); +@@ -93,7 +94,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionMagicNumberAnotherVariable']]" + + "[./IDENT[@text='InputXpathMagicNumberAnotherVariable']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='performOperation']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java @@ -6376,7 +6972,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathOne.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { @@ -6385,7 +6981,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathTwo.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); @@ -75,7 +75,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { @@ -6395,7 +6991,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionMatchXpathTwo']]" + + "[./IDENT[@text='InputXpathMatchXpathTwo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='func1']]" @@ -85,7 +85,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @@ -6403,125 +6999,125 @@ @Test - public void testEncodedQuoteString() throws Exception { + void encodedQuoteString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedQuoteString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedQuoteString.java")); -@@ -113,7 +113,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -112,7 +112,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedLessString() throws Exception { + void encodedLessString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedLessString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedLessString.java")); -@@ -140,7 +140,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -138,7 +138,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedNewLineString() throws Exception { + void encodedNewLineString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedNewLineString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedNewLineString.java")); -@@ -167,7 +167,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -164,7 +164,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testGreaterString() throws Exception { + void greaterString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedGreaterString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedGreaterString.java")); -@@ -194,7 +194,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -190,7 +190,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedAmpString() throws Exception { + void encodedAmpString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAmpString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedAmpString.java")); -@@ -221,7 +221,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -216,7 +216,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedAposString() throws Exception { + void encodedAposString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAposString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedAposString.java")); -@@ -249,7 +249,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -243,7 +243,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedCarriageString() throws Exception { + void encodedCarriageString() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedCarriageString.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedCarriageString.java")); -@@ -277,7 +277,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -270,7 +270,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedAmpersandChars() throws Exception { + void encodedAmpersandChars() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAmpChar.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedAmpChar.java")); -@@ -307,7 +307,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -299,7 +299,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedQuoteChar() throws Exception { + void encodedQuoteChar() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedQuotChar.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedQuoteChar.java")); -@@ -334,7 +334,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -325,7 +325,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedLessChar() throws Exception { + void encodedLessChar() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedLessChar.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedLessChar.java")); -@@ -361,7 +361,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -351,7 +351,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedAposChar() throws Exception { + void encodedAposChar() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAposChar.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedAposChar.java")); -@@ -388,7 +388,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -377,7 +377,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testEncodedGreaterChar() throws Exception { + void encodedGreaterChar() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMatchXpathEncodedGreaterChar.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathEncodedGreaterChar.java")); -@@ -417,7 +417,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); +@@ -405,7 +405,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } @Test - public void testFollowing() throws Exception { + void following() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathThree.java")); + final File fileToProcess = new File(getPath("InputXpathMatchXpathThree.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); -@@ -428,7 +428,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { +@@ -416,7 +416,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionMatchXpathThree']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathMatchXpathThree']]" + "/OBJBLOCK/RCURLY"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java @@ -6547,9 +7143,9 @@ } @Test -- public void test1() throws Exception { -+ void test1() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMemberName1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMemberNameDefault.java")); final String pattern = "^[a-z][a-zA-Z0-9]*$"; @@ -50,7 +50,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { @@ -6560,14 +7156,14 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionMemberName1']]" + + "='InputXpathMemberNameDefault']]" @@ -59,7 +59,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { } @Test -- public void test2() throws Exception { -+ void test2() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMemberName2.java")); +- public void testIgnoreProtected() throws Exception { ++ void ignoreProtected() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMemberNameIgnoreProtected.java")); final String pattern = "^m[A-Z][a-zA-Z0-9]*$"; @@ -75,7 +75,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { @@ -6578,7 +7174,7 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionMemberName2']]" + + "='InputXpathMemberNameIgnoreProtected']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -6594,45 +7190,45 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodCountDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); -@@ -59,7 +59,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { +@@ -58,7 +58,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount2.java")); +- public void testPrivate() throws Exception { ++ void testPrivate() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodCountPrivate.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); -@@ -84,7 +84,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { +@@ -82,7 +82,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount1.java")); +- public void testPackage() throws Exception { ++ void testPackage() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodCountDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); -@@ -109,7 +109,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { +@@ -106,7 +106,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } @Test -- public void testFour() throws Exception { -+ void four() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount3.java")); +- public void testProtected() throws Exception { ++ void testProtected() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodCountProtected.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); -@@ -135,7 +135,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { +@@ -131,7 +131,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } @Test -- public void testFive() throws Exception { -+ void five() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount4.java")); +- public void testPublic() throws Exception { ++ void testPublic() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodCountPublic.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodLengthTest.java @@ -6652,27 +7248,27 @@ @Test - public void testSimple() throws Exception { + void simple() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMethodLengthSimple.java")); + final File fileToProcess = new File(getPath("InputXpathMethodLengthSimple.java")); -@@ -75,7 +75,7 @@ public class XpathRegressionMethodLengthTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(MethodLengthCheck.class); +@@ -70,7 +70,7 @@ public class XpathRegressionMethodLengthTest extends AbstractXpathTestSupport { } @Test - public void testNoEmptyLines() throws Exception { + void noEmptyLines() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMethodLengthNoEmptyLines.java")); + final File fileToProcess = new File(getPath("InputXpathMethodLengthNoEmptyLines.java")); -@@ -105,7 +105,7 @@ public class XpathRegressionMethodLengthTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(MethodLengthCheck.class); +@@ -99,7 +99,7 @@ public class XpathRegressionMethodLengthTest extends AbstractXpathTestSupport { } @Test - public void testSingleToken() throws Exception { + void singleToken() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMethodLengthSingleToken.java")); + final File fileToProcess = new File(getPath("InputXpathMethodLengthSingleToken.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(MethodLengthCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java @@ -19,15 +19,15 @@ @@ -6697,9 +7293,9 @@ } @Test -- public void test1() throws Exception { -+ void test1() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodNameDefault.java")); final String pattern = "^[a-z][a-zA-Z0-9]*$"; @@ -53,7 +53,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { @@ -6710,14 +7306,14 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionMethodName1']]" + + "='InputXpathMethodNameDefault']]" @@ -62,7 +62,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { } @Test -- public void test2() throws Exception { -+ void test2() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName2.java")); +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodNameInner.java")); final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; @@ -76,7 +76,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { @@ -6728,14 +7324,14 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionMethodName2']]" + + "='InputXpathMethodNameInner']]" @@ -86,7 +86,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { } @Test -- public void test3() throws Exception { -+ void test3() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName3.java")); +- public void testCustomProperties() throws Exception { ++ void customProperties() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodNameCustomProperties.java")); final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; @@ -102,7 +102,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { @@ -6772,54 +7368,92 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMethodParamPadOne.java")); + final File fileToProcess = new File(getPath("InputXpathMethodParamPadOne.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MethodParamPadCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionMethodParamPadOne']]/OBJBLOCK" + + "[@text='InputXpathMethodParamPadOne']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='InputMethodParamPad']]/LPAREN"); -@@ -57,7 +57,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport +@@ -56,7 +56,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMethodParamPadTwo.java")); + final File fileToProcess = new File(getPath("InputXpathMethodParamPadTwo.java")); -@@ -69,7 +69,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MethodParamPadCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionMethodParamPadTwo']]/OBJBLOCK" + + "[@text='InputXpathMethodParamPadTwo']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sayHello']]/LPAREN"); -@@ -78,7 +78,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport +@@ -76,7 +76,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport } @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMethodParamPadThree.java")); + final File fileToProcess = new File(getPath("InputXpathMethodParamPadThree.java")); -@@ -92,7 +92,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MethodParamPadCheck.class); +@@ -89,7 +89,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionMethodParamPadThree']]/OBJBLOCK" + + "[@text='InputXpathMethodParamPadThree']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sayHello']]/LPAREN"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodTypeParameterNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodTypeParameterNameTest.java +@@ -28,7 +28,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMethodTypeParameterNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionMethodTypeParameterNameTest extends AbstractXpathTestSupport { + + private final String checkName = MethodTypeParameterNameCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionMethodTypeParameterNameTest extends AbstractXpathTes + } + + @Test +- public void test1() throws Exception { ++ void test1() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodTypeParameterNameDefault.java")); + + final DefaultConfiguration moduleConfig = +@@ -66,7 +66,7 @@ public class XpathRegressionMethodTypeParameterNameTest extends AbstractXpathTes + } + + @Test +- public void test2() throws Exception { ++ void test2() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodTypeParameterNameInner.java")); + + final DefaultConfiguration moduleConfig = +@@ -97,7 +97,7 @@ public class XpathRegressionMethodTypeParameterNameTest extends AbstractXpathTes + } + + @Test +- public void test3() throws Exception { ++ void test3() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMethodTypeParameterNameLowercase.java")); + + final DefaultConfiguration moduleConfig = --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingCtorTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingCtorTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -6835,18 +7469,18 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingCtor1.java")); +- public void testMissingCtor() throws Exception { ++ void missingCtor() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingCtor.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MissingCtorCheck.class); -@@ -58,7 +58,7 @@ public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { +@@ -56,7 +56,7 @@ public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingCtor2.java")); +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingCtorInner.java")); final DefaultConfiguration moduleConfig = createModuleConfig(MissingCtorCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java @@ -6864,20 +7498,20 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocMethod1.java")); +- public void testMissingJavadocMethodCtor() throws Exception { ++ void missingJavadocMethodCtor() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingJavadocMethodCtor.java")); -@@ -68,7 +68,7 @@ public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocMethodCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSu } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocMethod2.java")); +- public void testMissingJavadocMethod() throws Exception { ++ void missingJavadocMethod() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingJavadocMethod.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocMethodCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocPackageTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocPackageTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -6924,44 +7558,91 @@ @Test - public void testClass() throws Exception { + void testClass() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocTypeClass.java")); + final File fileToProcess = new File(getPath("InputXpathMissingJavadocTypeClass.java")); -@@ -65,7 +65,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocTypeCheck.class); +@@ -63,7 +63,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } @Test - public void testScope() throws Exception { + void scope() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocTypeScope.java")); + final File fileToProcess = new File(getPath("InputXpathMissingJavadocTypeScope.java")); -@@ -96,7 +96,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocTypeCheck.class); +@@ -93,7 +93,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } @Test - public void testExcluded() throws Exception { + void excluded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocTypeExcluded.java")); + final File fileToProcess = new File(getPath("InputXpathMissingJavadocTypeExcluded.java")); -@@ -128,7 +128,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocTypeCheck.class); +@@ -124,7 +124,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocTypeAnnotation.java")); + final File fileToProcess = new File(getPath("InputXpathMissingJavadocTypeAnnotation.java")); -@@ -164,7 +164,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocTypeCheck.class); +@@ -159,7 +159,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } @Test - public void testToken() throws Exception { + void token() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingJavadocTypeToken.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocTypeCheck.class); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingNullCaseInSwitchTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingNullCaseInSwitchTest.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.MissingNullCaseInSwitchCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingNullCaseInSwitchTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingNullCaseInSwitchTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -35,7 +35,7 @@ public class XpathRegressionMissingNullCaseInSwitchTest extends AbstractXpathTes + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingJavadocTypeToken.java")); + new File(getNonCompilablePath("InputXpathMissingNullCaseInSwitchSimple.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionMissingNullCaseInSwitchTest extends AbstractXpathTes + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='InputXpathMissingNullCaseInSwitchSimple']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH"); +@@ -56,7 +56,7 @@ public class XpathRegressionMissingNullCaseInSwitchTest extends AbstractXpathTes + } + + @Test +- public void testNestedExpression() throws Exception { ++ void nestedExpression() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathMissingNullCaseInSwitchNested.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java @@ -6980,63 +7661,63 @@ @Test - public void testClass() throws Exception { + void testClass() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideClass.java")); + final File fileToProcess = new File(getPath("InputXpathMissingOverrideClass.java")); -@@ -64,7 +64,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MissingOverrideCheck.class); +@@ -63,7 +63,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideInterface.java")); + final File fileToProcess = new File(getPath("InputXpathMissingOverrideInterface.java")); -@@ -95,7 +95,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MissingOverrideCheck.class); +@@ -93,7 +93,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } @Test - public void testAnonymous() throws Exception { + void anonymous() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideAnonymous.java")); + final File fileToProcess = new File(getPath("InputXpathMissingOverrideAnonymous.java")); -@@ -129,7 +129,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MissingOverrideCheck.class); +@@ -126,7 +126,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } @Test -- public void testInheritDocInvalid1() throws Exception { -+ void inheritDocInvalid1() throws Exception { +- public void testInheritDocInvalidPrivateMethod() throws Exception { ++ void inheritDocInvalidPrivateMethod() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideInheritDocInvalid1.java")); + new File(getPath("InputXpathMissingOverrideInheritDocInvalidPrivateMethod.java")); -@@ -159,7 +159,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport +@@ -156,7 +156,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } @Test -- public void testInheritDocInvalid2() throws Exception { -+ void inheritDocInvalid2() throws Exception { +- public void testInheritDocInvalidPublicMethod() throws Exception { ++ void inheritDocInvalidPublicMethod() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideInheritDocInvalid2.java")); + new File(getPath("InputXpathMissingOverrideInheritDocInvalidPublicMethod.java")); -@@ -189,7 +189,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport +@@ -186,7 +186,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } @Test -- public void testJavaFiveCompatibility1() throws Exception { -+ void javaFiveCompatibility1() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideClass.java")); +- public void testJavaFiveCompatibilityOne() throws Exception { ++ void javaFiveCompatibilityOne() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingOverrideClass.java")); -@@ -218,7 +218,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(MissingOverrideCheck.class); +@@ -214,7 +214,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } @Test -- public void testJavaFiveCompatibility2() throws Exception { -+ void javaFiveCompatibility2() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingOverrideInterface.java")); +- public void testJavaFiveCompatibilityTwo() throws Exception { ++ void javaFiveCompatibilityTwo() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingOverrideInterface.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(MissingOverrideCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java @@ -19,15 +19,15 @@ @@ -7061,29 +7742,94 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingSwitchDefaultOne.java")); +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingSwitchDefaultSimple.java")); -@@ -47,7 +47,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(clss); +@@ -46,7 +46,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionMissingSwitchDefaultOne']]" + + "[./IDENT[@text='InputXpathMissingSwitchDefaultSimple']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test1']]" -@@ -57,7 +57,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu +@@ -56,7 +56,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testNested() throws Exception { ++ void nested() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMissingSwitchDefaultNested.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(clss); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifiedControlVariableTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifiedControlVariableTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTestSupport { ++final class XpathRegressionModifiedControlVariableTest extends AbstractXpathTestSupport { + private final Class checkClass = ModifiedControlVariableCheck.class; + + @Override +@@ -35,7 +35,7 @@ public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTes + } + + @Test +- public void testDefaultForLoop() throws Exception { ++ void defaultForLoop() throws Exception { + final File fileToProcess = new File(getPath("InputXpathModifiedControlVariableWithFor.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(checkClass); + final String[] expectedViolation = { +@@ -56,7 +56,7 @@ public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTes + } + + @Test +- public void testDefaultForeach() throws Exception { ++ void defaultForeach() throws Exception { + final File fileToProcess = + new File(getPath("InputXpathModifiedControlVariableWithForeach.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(checkClass); +@@ -76,7 +76,7 @@ public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTes + } + + @Test +- public void testSkipEnhancedForLoop() throws Exception { ++ void skipEnhancedForLoop() throws Exception { + final File fileToProcess = + new File(getPath("InputXpathModifiedControlVariableSkipEnhancedForLoop.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(checkClass); +@@ -98,7 +98,7 @@ public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTes + } + + @Test +- public void testDefaultNestedForLoop() throws Exception { ++ void defaultNestedForLoop() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMissingSwitchDefaultTwo.java")); + new File(getPath("InputXpathModifiedControlVariableNestedWithFor.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(checkClass); +@@ -122,7 +122,7 @@ public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTes + } + @Test +- public void testForeachNested() throws Exception { ++ void foreachNested() throws Exception { + final File fileToProcess = + new File(getPath("InputXpathModifiedControlVariableNestedWithForeach.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(checkClass); +@@ -146,7 +146,7 @@ public class XpathRegressionModifiedControlVariableTest extends AbstractXpathTes + } + + @Test +- public void testSkipEnhancedForLoopNested() throws Exception { ++ void skipEnhancedForLoopNested() throws Exception { + final File fileToProcess = + new File(getPath("InputXpathModifiedControlVariableNestedSkipEnhancedForLoop.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(checkClass); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java @@ -19,15 +19,15 @@ @@ -7110,36 +7856,36 @@ @Test - public void testMethod() throws Exception { + void method() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionModifierOrderMethod.java")); + final File fileToProcess = new File(getPath("InputXpathModifierOrderMethod.java")); -@@ -63,7 +63,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); +@@ -62,7 +62,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { } @Test - public void testVariable() throws Exception { + void variable() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionModifierOrderVariable.java")); + final File fileToProcess = new File(getPath("InputXpathModifierOrderVariable.java")); -@@ -74,7 +74,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); +@@ -72,7 +72,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionModifierOrderVariable']]" + + "[@text='InputXpathModifierOrderVariable']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='var']]/MODIFIERS/LITERAL_PRIVATE"); -@@ -83,7 +83,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { +@@ -81,7 +81,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { } @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionModifierOrderAnnotation.java")); + final File fileToProcess = new File(getPath("InputXpathModifierOrderAnnotation.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleStringLiteralsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleStringLiteralsTest.java @@ -21,15 +21,15 @@ package org.checkstyle.suppressionxpathfilter; @@ -7166,54 +7912,54 @@ @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMultipleStringLiteralsDefault.java")); + final File fileToProcess = new File(getPath("InputXpathMultipleStringLiteralsDefault.java")); -@@ -64,7 +64,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(MultipleStringLiteralsCheck.class); +@@ -63,7 +63,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest } @Test - public void testAllowDuplicates() throws Exception { + void allowDuplicates() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMultipleStringLiteralsAllowDuplicates.java")); + new File(getPath("InputXpathMultipleStringLiteralsAllowDuplicates.java")); -@@ -76,7 +76,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest +@@ -75,7 +75,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionMultipleStringLiteralsAllowDuplicates']]" + + "[@text='InputXpathMultipleStringLiteralsAllowDuplicates']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]/SLIST/VARIABLE_DEF" -@@ -87,7 +87,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest +@@ -86,7 +86,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest } @Test - public void testIgnoreRegexp() throws Exception { + void ignoreRegexp() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMultipleStringLiteralsIgnoreRegexp.java")); + new File(getPath("InputXpathMultipleStringLiteralsIgnoreRegexp.java")); -@@ -99,7 +99,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest +@@ -98,7 +98,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionMultipleStringLiteralsIgnoreRegexp']]" + + "[@text='InputXpathMultipleStringLiteralsIgnoreRegexp']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]/SLIST/VARIABLE_DEF" -@@ -109,7 +109,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest +@@ -108,7 +108,7 @@ public class XpathRegressionMultipleStringLiteralsTest extends AbstractXpathTest } @Test - public void testIgnoreOccurrenceContext() throws Exception { + void ignoreOccurrenceContext() throws Exception { - final String filePath = - "SuppressionXpathRegressionMultipleStringLiteralsIgnoreOccurrenceContext.java"; + final String filePath = "InputXpathMultipleStringLiteralsIgnoreOccurrenceContext.java"; final File fileToProcess = new File(getPath(filePath)); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleVariableDeclarationsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleVariableDeclarationsTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -7229,20 +7975,58 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testCommaSeparator() throws Exception { ++ void commaSeparator() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMultipleVariableDeclarationsOne.java")); + new File(getPath("InputXpathMultipleVariableDeclarationsCommaSeparator.java")); @@ -81,7 +81,7 @@ public class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpa } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionMultipleVariableDeclarationsTwo.java")); +- public void testMultipleVariableDeclarations() throws Exception { ++ void multipleVariableDeclarations() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMultipleVariableDeclarations.java")); + + final DefaultConfiguration moduleConfig = +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMutableExceptionTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMutableExceptionTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMutableExceptionTest extends AbstractXpathTestSupport { ++final class XpathRegressionMutableExceptionTest extends AbstractXpathTestSupport { + + private final String checkName = MutableExceptionCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMutableExceptionTest extends AbstractXpathTestSuppor + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathMutableExceptionDefault.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MutableExceptionCheck.class); +@@ -64,7 +64,7 @@ public class XpathRegressionMutableExceptionTest extends AbstractXpathTestSuppor + } + @Test +- public void testClassName() throws Exception { ++ void className() throws Exception { + final String classFormat = "^.*ExceptionClassName$"; + final File fileToProcess = new File(getPath("InputXpathMutableExceptionClassName.java")); + +@@ -94,7 +94,7 @@ public class XpathRegressionMutableExceptionTest extends AbstractXpathTestSuppor + } + + @Test +- public void testExtendedClassName() throws Exception { ++ void extendedClassName() throws Exception { + final String extendedClassNameFormat = "^.*Throwable$"; + final File fileToProcess = + new File(getPath("InputXpathMutableExceptionExtendedClassName.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java @@ -19,16 +19,16 @@ @@ -7268,28 +8052,28 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNPathComplexityOne.java")); +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNPathComplexityMethod.java")); -@@ -65,7 +65,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(NPathComplexityCheck.class); +@@ -64,7 +64,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNPathComplexityTwo.java")); +- public void testStaticBlock() throws Exception { ++ void staticBlock() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNPathComplexityStaticBlock.java")); -@@ -77,7 +77,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(NPathComplexityCheck.class); +@@ -75,7 +75,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNPathComplexityTwo']]" + + "[./IDENT[@text='InputXpathNPathComplexityStaticBlock']]" + "/OBJBLOCK/STATIC_INIT"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java @@ -7316,7 +8100,7 @@ @Test - public void testDo() throws Exception { + void testDo() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNeedBracesDo.java")); + final File fileToProcess = new File(getPath("InputXpathNeedBracesDo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NeedBracesCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { @@ -7326,7 +8110,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesDo']]" + + "[./IDENT[@text='InputXpathNeedBracesDo']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_DO"); @@ -56,7 +56,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } @@ -7334,53 +8118,53 @@ @Test - public void testSingleLine() throws Exception { + void singleLine() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNeedBracesSingleLine.java")); + final File fileToProcess = new File(getPath("InputXpathNeedBracesSingleLine.java")); -@@ -68,7 +68,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(NeedBracesCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesSingleLine']]" + + "[./IDENT[@text='InputXpathNeedBracesSingleLine']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF"); -@@ -77,7 +77,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { +@@ -76,7 +76,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } @Test - public void testSingleLineLambda() throws Exception { + void singleLineLambda() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNeedBracesSingleLineLambda.java")); + final File fileToProcess = new File(getPath("InputXpathNeedBracesSingleLineLambda.java")); -@@ -90,7 +90,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(NeedBracesCheck.class); +@@ -88,7 +88,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesSingleLineLambda']]" + + "[./IDENT[@text='InputXpathNeedBracesSingleLineLambda']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='r3']]/ASSIGN/LAMBDA"); -@@ -99,7 +99,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { +@@ -97,7 +97,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } @Test - public void testEmptyLoopBody() throws Exception { + void emptyLoopBody() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNeedBracesEmptyLoopBody.java")); + final File fileToProcess = new File(getPath("InputXpathNeedBracesEmptyLoopBody.java")); -@@ -110,7 +110,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(NeedBracesCheck.class); +@@ -107,7 +107,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesEmptyLoopBody']]" + + "[./IDENT[@text='InputXpathNeedBracesEmptyLoopBody']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_WHILE"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java @@ -7407,7 +8191,7 @@ @Test - public void testCorrect() throws Exception { + void correct() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedForDepth.java")); + final File fileToProcess = new File(getPath("InputXpathNestedForDepth.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NestedForDepthCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport @@ -7417,7 +8201,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNestedForDepth']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathNestedForDepth']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_FOR" @@ -56,7 +56,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport } @@ -7425,17 +8209,17 @@ @Test - public void testMax() throws Exception { + void max() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNestedForDepthMax.java")); + final File fileToProcess = new File(getPath("InputXpathNestedForDepthMax.java")); -@@ -68,7 +68,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(NestedForDepthCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNestedForDepthMax']]" + + "[./IDENT[@text='InputXpathNestedForDepthMax']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java @@ -7462,7 +8246,7 @@ @Test - public void testCorrect() throws Exception { + void correct() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedIfDepth.java")); + final File fileToProcess = new File(getPath("InputXpathNestedIfDepth.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NestedIfDepthCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { @@ -7472,7 +8256,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNestedIfDepth']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathNestedIfDepth']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF" @@ -56,7 +56,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { } @@ -7480,7 +8264,7 @@ @Test - public void testMax() throws Exception { + void max() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedIfDepthMax.java")); + final File fileToProcess = new File(getPath("InputXpathNestedIfDepthMax.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NestedIfDepthCheck.class); @@ -67,7 +67,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { @@ -7490,7 +8274,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNestedIfDepthMax']]" + + "[./IDENT[@text='InputXpathNestedIfDepthMax']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java @@ -7517,7 +8301,7 @@ @Test - public void testCorrect() throws Exception { + void correct() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedTryDepth.java")); + final File fileToProcess = new File(getPath("InputXpathNestedTryDepth.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NestedTryDepthCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport @@ -7527,7 +8311,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNestedTryDepth']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathNestedTryDepth']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_TRY/SLIST" @@ -56,7 +56,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport } @@ -7535,17 +8319,17 @@ @Test - public void testMax() throws Exception { + void max() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNestedTryDepthMax.java")); + final File fileToProcess = new File(getPath("InputXpathNestedTryDepthMax.java")); -@@ -68,7 +68,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(NestedTryDepthCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNestedTryDepthMax']]" + + "[./IDENT[@text='InputXpathNestedTryDepthMax']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java @@ -7572,35 +8356,35 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoArrayTrailingCommaOne.java")); + final File fileToProcess = new File(getPath("InputXpathNoArrayTrailingCommaOne.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(NoArrayTrailingCommaCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionNoArrayTrailingCommaOne']]" + + "[@text='InputXpathNoArrayTrailingCommaOne']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='t1']]/ASSIGN/EXPR" -@@ -58,7 +58,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu +@@ -57,7 +57,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoArrayTrailingCommaTwo.java")); + final File fileToProcess = new File(getPath("InputXpathNoArrayTrailingCommaTwo.java")); -@@ -70,7 +70,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(NoArrayTrailingCommaCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoArrayTrailingCommaTwo']]" + + "[./IDENT[@text='InputXpathNoArrayTrailingCommaTwo']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='t4']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoCloneTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoCloneTest.java @@ -7617,9 +8401,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoCloneOne.java")); +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNoCloneMethod.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoCloneCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { @@ -7628,7 +8412,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoCloneTwo.java")); + final File fileToProcess = new File(getPath("InputXpathNoCloneInnerClass.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoCloneCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java @@ -7656,35 +8440,35 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoEnumTrailingCommaOne.java")); + final File fileToProcess = new File(getPath("InputXpathNoEnumTrailingCommaOne.java")); -@@ -47,7 +47,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(NoEnumTrailingCommaCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoEnumTrailingCommaOne']]" + + "[./IDENT[@text='InputXpathNoEnumTrailingCommaOne']]" + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Foo3']]/OBJBLOCK/COMMA[2]"); -@@ -56,7 +56,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup +@@ -55,7 +55,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoEnumTrailingCommaTwo.java")); + final File fileToProcess = new File(getPath("InputXpathNoEnumTrailingCommaTwo.java")); -@@ -67,7 +67,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(NoEnumTrailingCommaCheck.class); +@@ -65,7 +65,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoEnumTrailingCommaTwo']]" + + "[./IDENT[@text='InputXpathNoEnumTrailingCommaTwo']]" + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Foo6']]/OBJBLOCK/COMMA[2]"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoFinalizerTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoFinalizerTest.java @@ -7701,18 +8485,18 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoFinalizer1.java")); +- public void testMain() throws Exception { ++ void main() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNoFinalizerMain.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoFinalizerCheck.class); @@ -59,7 +59,7 @@ public class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoFinalizer2.java")); +- public void testInner() throws Exception { ++ void inner() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNoFinalizerInner.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoFinalizerCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java @@ -7730,27 +8514,27 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNoLineWrapDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); @@ -50,7 +50,7 @@ public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap2.java")); +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNoLineWrapTokensMethodDef.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); @@ -78,7 +78,7 @@ public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap3.java")); +- public void testTokensCtorDef() throws Exception { ++ void tokensCtorDef() throws Exception { + final File fileToProcess = new File(getPath("InputXpathNoLineWrapTokensCtorDef.java")); final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.java @@ -7779,36 +8563,36 @@ @Test - public void testNoWhitespaceAfter() throws Exception { + void noWhitespaceAfter() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceAfter.java")); + final File fileToProcess = new File(getPath("InputXpathNoWhitespaceAfter.java")); -@@ -61,7 +61,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(NoWhitespaceAfterCheck.class); +@@ -60,7 +60,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo } @Test - public void testTokens() throws Exception { + void tokens() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceAfterTokens.java")); + final File fileToProcess = new File(getPath("InputXpathNoWhitespaceAfterTokens.java")); -@@ -73,7 +73,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(NoWhitespaceAfterCheck.class); +@@ -71,7 +71,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceAfterTokens']]" + + "[./IDENT[@text='InputXpathNoWhitespaceAfterTokens']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" -@@ -84,7 +84,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo +@@ -82,7 +82,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo } @Test - public void testAllowLineBreaks() throws Exception { + void allowLineBreaks() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceAfterLineBreaks.java")); + final File fileToProcess = new File(getPath("InputXpathNoWhitespaceAfterLineBreaks.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(NoWhitespaceAfterCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java @@ -19,15 +19,14 @@ @@ -7836,7 +8620,7 @@ - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonOne.java")); + new File(getPath("InputXpathNoWhitespaceBeforeCaseDefaultColonOne.java")); @@ -53,7 +52,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; @@ -7845,7 +8629,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonOne']]" + + "'InputXpathNoWhitespaceBeforeCaseDefaultColonOne']]" + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP/LITERAL_CASE/COLON"); @@ -62,7 +61,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } @@ -7854,7 +8638,7 @@ - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonTwo.java")); + new File(getPath("InputXpathNoWhitespaceBeforeCaseDefaultColonTwo.java")); @@ -78,7 +77,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; @@ -7863,7 +8647,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonTwo']]" + + "'InputXpathNoWhitespaceBeforeCaseDefaultColonTwo']]" + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" @@ -88,7 +87,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } @@ -7872,7 +8656,7 @@ - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonThree.java")); + new File(getPath("InputXpathNoWhitespaceBeforeCaseDefaultColonThree.java")); @@ -104,7 +103,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; @@ -7881,7 +8665,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonThree']]" + + "'InputXpathNoWhitespaceBeforeCaseDefaultColonThree']]" + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" @@ -114,7 +113,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } @@ -7890,7 +8674,7 @@ - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonFour.java")); + new File(getPath("InputXpathNoWhitespaceBeforeCaseDefaultColonFour.java")); @@ -130,7 +129,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; @@ -7899,7 +8683,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonFour']]" + + "'InputXpathNoWhitespaceBeforeCaseDefaultColonFour']]" + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java @@ -7926,53 +8710,53 @@ @Test - public void testNoWhitespaceBefore() throws Exception { + void noWhitespaceBefore() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBefore.java")); + final File fileToProcess = new File(getPath("InputXpathNoWhitespaceBefore.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(NoWhitespaceBeforeCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceBefore']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathNoWhitespaceBefore']]/OBJBLOCK" + "/VARIABLE_DEF[./IDENT[@text='bad']]/SEMI"); -@@ -57,7 +57,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp +@@ -56,7 +56,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp } @Test - public void testTokens() throws Exception { + void tokens() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeTokens.java")); + final File fileToProcess = new File(getPath("InputXpathNoWhitespaceBeforeTokens.java")); -@@ -70,7 +70,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(NoWhitespaceBeforeCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceBeforeTokens']]" + + "[./IDENT[@text='InputXpathNoWhitespaceBeforeTokens']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" -@@ -81,7 +81,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp +@@ -79,7 +79,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp } @Test - public void testAllowLineBreaks() throws Exception { + void allowLineBreaks() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeLineBreaks.java")); + final File fileToProcess = new File(getPath("InputXpathNoWhitespaceBeforeLineBreaks.java")); -@@ -94,7 +94,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + final DefaultConfiguration moduleConfig = createModuleConfig(NoWhitespaceBeforeCheck.class); +@@ -91,7 +91,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceBeforeLineBreaks']]" + + "[./IDENT[@text='InputXpathNoWhitespaceBeforeLineBreaks']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java @@ -7997,37 +8781,37 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOneStatementPerLineOne.java")); +- public void testClassFields() throws Exception { ++ void classFields() throws Exception { + final File fileToProcess = new File(getPath("InputXpathOneStatementPerLineClassFields.java")); -@@ -47,7 +47,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(OneStatementPerLineCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionOneStatementPerLineOne']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathOneStatementPerLineClassFields']]/OBJBLOCK" + "/VARIABLE_DEF[./IDENT[@text='j']]/SEMI"); -@@ -56,7 +56,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup +@@ -55,7 +55,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOneStatementPerLineTwo.java")); +- public void testForLoopBlock() throws Exception { ++ void forLoopBlock() throws Exception { + final File fileToProcess = new File(getPath("InputXpathOneStatementPerLineForLoopBlock.java")); -@@ -67,7 +67,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(OneStatementPerLineCheck.class); +@@ -65,7 +65,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionOneStatementPerLineTwo']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathOneStatementPerLineForLoopBlock']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='foo5']]/SLIST/LITERAL_FOR/SLIST/SEMI[2]"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneTopLevelClassTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneTopLevelClassTest.java @@ -8046,18 +8830,18 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOneTopLevelClassFirst.java")); + final File fileToProcess = new File(getPath("InputXpathOneTopLevelClassFirst.java")); -@@ -58,7 +58,7 @@ public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(OneTopLevelClassCheck.class); +@@ -57,7 +57,7 @@ public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSuppor } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOneTopLevelClassSecond.java")); + final File fileToProcess = new File(getPath("InputXpathOneTopLevelClassSecond.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(OneTopLevelClassCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java @@ -19,14 +19,14 @@ @@ -8083,10 +8867,10 @@ @Test - public void testOperatorWrapNewLine() throws Exception { + void operatorWrapNewLine() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOperatorWrapNewLine.java")); + final File fileToProcess = new File(getPath("InputXpathOperatorWrapNewLine.java")); -@@ -47,7 +47,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(OperatorWrapCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8094,24 +8878,24 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionOperatorWrapNewLine']]" -@@ -60,7 +60,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + + "='InputXpathOperatorWrapNewLine']]" +@@ -59,7 +59,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { } @Test - public void testOperatorWrapPreviousLine() throws Exception { + void operatorWrapPreviousLine() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOperatorWrapPreviousLine.java")); + final File fileToProcess = new File(getPath("InputXpathOperatorWrapPreviousLine.java")); -@@ -73,7 +73,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(OperatorWrapCheck.class); +@@ -71,7 +71,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionOperatorWrapPreviousLine']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathOperatorWrapPreviousLine']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='b']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeFilenameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeFilenameTest.java @@ -8130,18 +8914,18 @@ @Test - public void testNoPublic() throws Exception { + void noPublic() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOuterTypeFilename1.java")); + final File fileToProcess = new File(getPath("InputXpathOuterTypeFilenameOne.java")); -@@ -56,7 +56,7 @@ public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSuppo + final DefaultConfiguration moduleConfig = createModuleConfig(OuterTypeFilenameCheck.class); +@@ -55,7 +55,7 @@ public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSuppo } @Test - public void testNested() throws Exception { + void nested() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOuterTypeFilename2.java")); + final File fileToProcess = new File(getPath("InputXpathOuterTypeFilenameTwo.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(OuterTypeFilenameCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -8159,16 +8943,16 @@ @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOuterTypeNumberDefault.java")); + final File fileToProcess = new File(getPath("InputXpathOuterTypeNumberDefault.java")); -@@ -53,7 +53,7 @@ public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(OuterTypeNumberCheck.class); +@@ -52,7 +52,7 @@ public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport } @Test - public void testMax() throws Exception { + void max() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionOuterTypeNumber.java")); + final File fileToProcess = new File(getPath("InputXpathOuterTypeNumber.java")); final DefaultConfiguration moduleConfig = createModuleConfig(OuterTypeNumberCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java @@ -8186,19 +8970,19 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder1.java")); + new File(getPath("InputXpathOverloadMethodsDeclarationOrderDefault.java")); @@ -64,7 +64,7 @@ public class XpathRegressionOverloadMethodsDeclarationOrderTest extends Abstract } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testAnonymous() throws Exception { ++ void anonymous() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder2.java")); + new File(getPath("InputXpathOverloadMethodsDeclarationOrderAnonymous.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java @@ -8218,7 +9002,7 @@ - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPackageAnnotationOne.java")); + new File(getNonCompilablePath("InputXpathPackageAnnotationOne.java")); @@ -53,7 +53,7 @@ public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSuppo } @@ -8227,7 +9011,7 @@ - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPackageAnnotationTwo.java")); + new File(getNonCompilablePath("InputXpathPackageAnnotationTwo.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java @@ -8244,18 +9028,18 @@ } @Test -- public void test1() throws Exception { -+ void test1() throws Exception { - final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression1.java")); +- public void testWrongPackage() throws Exception { ++ void wrongPackage() throws Exception { + final File fileToProcess = new File(getNonCompilablePath("InputXpathWrongPackage.java")); final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); @@ -54,7 +54,7 @@ public class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupp } @Test -- public void test2() throws Exception { -+ void test2() throws Exception { - final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression2.java")); +- public void testMissingPackage() throws Exception { ++ void missingPackage() throws Exception { + final File fileToProcess = new File(getNonCompilablePath("InputXpathMissingPackage.java")); final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageNameTest.java @@ -8284,7 +9068,7 @@ - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionPackageNameOne.java")); + final File fileToProcess = new File(getPath("InputXpathPackageNameOne.java")); @@ -57,7 +57,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { }; @@ -8299,12 +9083,12 @@ } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testThree() throws Exception { ++ void three() throws Exception { - final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPackageName.java")); -@@ -86,7 +86,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { + final File fileToProcess = new File(getNonCompilablePath("InputXpathPackageNameThree.java")); + +@@ -85,7 +85,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8313,16 +9097,16 @@ "/COMPILATION_UNIT/PACKAGE_DEF/DOT[./IDENT" + "[@text='PACKAGENAME']]/DOT[./IDENT" + "[@text='suppressionxpathfilter']]" -@@ -96,7 +96,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { +@@ -95,7 +95,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { +- public void testTwo() throws Exception { ++ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionPackageNameTwo.java")); + final File fileToProcess = new File(getPath("InputXpathPackageNameTwo.java")); -@@ -115,7 +115,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { +@@ -114,7 +114,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8331,6 +9115,44 @@ "/COMPILATION_UNIT/PACKAGE_DEF/DOT" + "[./IDENT[@text='packagename']]/DOT" + "[./IDENT[@text='suppressionxpathfilter']]" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterAssignmentTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterAssignmentTest.java +@@ -28,7 +28,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionParameterAssignmentTest extends AbstractXpathTestSupport { ++final class XpathRegressionParameterAssignmentTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -36,7 +36,7 @@ public class XpathRegressionParameterAssignmentTest extends AbstractXpathTestSup + } + + @Test +- public void testMethods() throws Exception { ++ void methods() throws Exception { + final String filePath = getPath("InputXpathParameterAssignmentMethods.java"); + final File fileToProcess = new File(filePath); + +@@ -61,7 +61,7 @@ public class XpathRegressionParameterAssignmentTest extends AbstractXpathTestSup + } + + @Test +- public void testLambdas() throws Exception { ++ void lambdas() throws Exception { + final String filePath = getPath("InputXpathParameterAssignmentLambdas.java"); + final File fileToProcess = new File(filePath); + +@@ -86,7 +86,7 @@ public class XpathRegressionParameterAssignmentTest extends AbstractXpathTestSup + } + + @Test +- public void testCtor() throws Exception { ++ void ctor() throws Exception { + final String filePath = getPath("InputXpathParameterAssignmentCtor.java"); + final File fileToProcess = new File(filePath); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNameTest.java @@ -19,15 +19,15 @@ @@ -8357,10 +9179,10 @@ @Test - public void testDefaultPattern() throws Exception { + void defaultPattern() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParameterNameDefaultPattern.java")); + final File fileToProcess = new File(getPath("InputXpathParameterNameDefaultPattern.java")); -@@ -51,7 +51,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; +@@ -50,7 +50,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8368,17 +9190,17 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionParameterNameDefaultPattern']]" -@@ -61,7 +61,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + + "='InputXpathParameterNameDefaultPattern']]" +@@ -60,7 +60,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } @Test - public void testDifferentPattern() throws Exception { + void differentPattern() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParameterNameDifferentPattern.java")); + final File fileToProcess = new File(getPath("InputXpathParameterNameDifferentPattern.java")); -@@ -76,7 +76,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + final String pattern = "^[a-z][_a-zA-Z0-9]+$"; +@@ -74,7 +74,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8386,17 +9208,17 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionParameterNameDifferentPattern']]" -@@ -86,7 +86,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + + "='InputXpathParameterNameDifferentPattern']]" +@@ -84,7 +84,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } @Test - public void testIgnoreOverridden() throws Exception { + void ignoreOverridden() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParameterNameIgnoreOverridden.java")); + final File fileToProcess = new File(getPath("InputXpathParameterNameIgnoreOverridden.java")); -@@ -101,7 +101,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; +@@ -98,7 +98,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8404,17 +9226,17 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionParameterNameIgnoreOverridden']]" -@@ -111,7 +111,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + + "='InputXpathParameterNameIgnoreOverridden']]" +@@ -108,7 +108,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } @Test - public void testAccessModifiers() throws Exception { + void accessModifiers() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParameterNameAccessModifier.java")); + final File fileToProcess = new File(getPath("InputXpathParameterNameAccessModifier.java")); -@@ -127,7 +127,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { + final String pattern = "^[a-z][a-z0-9][a-zA-Z0-9]*$"; +@@ -123,7 +123,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = @@ -8422,7 +9244,7 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionParameterNameAccessModifier']]" + + "='InputXpathParameterNameAccessModifier']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNumberTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNumberTest.java @@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; @@ -8448,54 +9270,72 @@ @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParameterNumberDefault.java")); + final File fileToProcess = new File(getPath("InputXpathParameterNumberDefault.java")); -@@ -47,7 +47,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(ParameterNumberCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionParameterNumberDefault']]" + + "[./IDENT[@text='InputXpathParameterNumberDefault']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='myMethod']"); -@@ -56,7 +56,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport +@@ -55,7 +55,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport } @Test - public void testMethods() throws Exception { + void methods() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParameterNumberMethods.java")); + final File fileToProcess = new File(getPath("InputXpathParameterNumberMethods.java")); -@@ -69,7 +69,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(ParameterNumberCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionParameterNumberMethods']]" + + "[./IDENT[@text='InputXpathParameterNumberMethods']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='myMethod']"); -@@ -78,7 +78,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport +@@ -76,7 +76,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport } @Test - public void testIgnoreOverriddenMethods() throws Exception { + void ignoreOverriddenMethods() throws Exception { - final String filePath = - getPath("SuppressionXpathRegressionParameterNumberIgnoreOverriddenMethods.java"); + final String filePath = getPath("InputXpathParameterNumberIgnoreOverriddenMethods.java"); final File fileToProcess = new File(filePath); -@@ -91,7 +91,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport + +@@ -88,7 +88,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionParameterNumberIgnoreOverriddenMethods']]" + + "[@text='InputXpathParameterNumberIgnoreOverriddenMethods']]" + "/OBJBLOCK/CTOR_DEF/IDENT" +@@ -98,7 +98,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport + } + + @Test +- public void testIgnoreAnnotatedBy() throws Exception { ++ void ignoreAnnotatedBy() throws Exception { + final String filePath = getPath("InputXpathParameterNumberIgnoreAnnotatedBy.java"); + final File fileToProcess = new File(filePath); + +@@ -111,7 +111,7 @@ public class XpathRegressionParameterNumberTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputXpathParameterNumberIgnoreAnnotatedBy']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java @@ -19,16 +19,16 @@ @@ -8523,71 +9363,71 @@ @Test - public void testLeftFollowed() throws Exception { + void leftFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParenPadLeftFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathParenPadLeftFollowed.java")); -@@ -49,7 +49,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(ParenPadCheck.class); +@@ -48,7 +48,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionParenPadLeftFollowed']]" + + "[./IDENT[@text='InputXpathParenPadLeftFollowed']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/LPAREN"); -@@ -58,7 +58,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { +@@ -57,7 +57,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } @Test - public void testLeftNotFollowed() throws Exception { + void leftNotFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParenPadLeftNotFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathParenPadLeftNotFollowed.java")); -@@ -71,7 +71,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(ParenPadCheck.class); +@@ -69,7 +69,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionParenPadLeftNotFollowed']]" + + "[./IDENT[@text='InputXpathParenPadLeftNotFollowed']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/LPAREN"); -@@ -80,7 +80,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { +@@ -78,7 +78,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } @Test - public void testRightPreceded() throws Exception { + void rightPreceded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParenPadRightPreceded.java")); + final File fileToProcess = new File(getPath("InputXpathParenPadRightPreceded.java")); -@@ -91,7 +91,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(ParenPadCheck.class); +@@ -88,7 +88,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionParenPadRightPreceded']]" + + "[./IDENT[@text='InputXpathParenPadRightPreceded']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/RPAREN"); -@@ -100,7 +100,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { +@@ -97,7 +97,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } @Test - public void testRightNotPreceded() throws Exception { + void rightNotPreceded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionParenPadRightNotPreceded.java")); + final File fileToProcess = new File(getPath("InputXpathParenPadRightNotPreceded.java")); -@@ -113,7 +113,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(ParenPadCheck.class); +@@ -109,7 +109,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionParenPadRightNotPreceded']]" + + "[./IDENT[@text='InputXpathParenPadRightNotPreceded']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/RPAREN"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java @@ -8616,7 +9456,7 @@ - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName1.java")); + new File(getNonCompilablePath("InputXpathPatternVariableNameOne.java")); @@ -54,7 +54,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; @@ -8625,7 +9465,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName1']]" + + "[./IDENT[@text='InputXpathPatternVariableNameOne']]" + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" @@ -65,7 +65,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } @@ -8634,7 +9474,7 @@ - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName2.java")); + new File(getNonCompilablePath("InputXpathPatternVariableNameTwo.java")); @@ -84,7 +84,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; @@ -8643,7 +9483,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName2']]" + + "[./IDENT[@text='InputXpathPatternVariableNameTwo']]" + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" @@ -95,7 +95,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } @@ -8652,7 +9492,7 @@ - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName3.java")); + new File(getNonCompilablePath("InputXpathPatternVariableNameThree.java")); @@ -114,7 +114,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; @@ -8661,7 +9501,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName3']]" + + "[./IDENT[@text='InputXpathPatternVariableNameThree']]" + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/" @@ -125,7 +125,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } @@ -8670,7 +9510,7 @@ - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName4.java")); + new File(getNonCompilablePath("InputXpathPatternVariableNameFour.java")); @@ -144,7 +144,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; @@ -8679,7 +9519,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName1']]" + + "[./IDENT[@text='InputXpathPatternVariableNameFour']]" + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java @@ -8705,10 +9545,10 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRecordComponentName1.java")); + new File(getNonCompilablePath("InputXpathRecordComponentNameDefault.java")); @@ -53,7 +53,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup }; @@ -8716,17 +9556,17 @@ final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( - "/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentName1']]" + "/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='InputXpathRecordComponentNameDefault']]" + "/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='_value']"); @@ -61,7 +61,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testFormat() throws Exception { ++ void format() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRecordComponentName2.java")); + new File(getNonCompilablePath("InputXpathRecordComponentNameFormat.java")); @@ -78,7 +78,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup }; @@ -8735,7 +9575,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRecordComponentName2']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRecordComponentNameFormat']]/OBJBLOCK" + "/RECORD_DEF[./IDENT[@text='MyRecord']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java @@ -8752,19 +9592,19 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRecordComponentNumber1.java")); + new File(getNonCompilablePath("InputXpathRecordComponentNumberDefault.java")); @@ -60,7 +60,7 @@ public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestS } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testCustomMax() throws Exception { ++ void customMax() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRecordComponentNumber2.java")); + new File(getNonCompilablePath("InputXpathRecordComponentNumberCustomMax.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java @@ -8781,19 +9621,19 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testTypeDeclared() throws Exception { ++ void typeDeclared() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionRecordTypeParameterName1.java")); + new File(getNonCompilablePath("InputXpathRecordTypeParameterNameTypeDeclared.java")); -@@ -66,7 +66,7 @@ public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTes +@@ -68,7 +68,7 @@ public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTes } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testTypeDefault() throws Exception { ++ void typeDefault() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionRecordTypeParameterName2.java")); + new File(getNonCompilablePath("InputXpathRecordTypeParameterNameTypeDefault.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java @@ -8818,14 +9658,14 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRedundantImport1.java")); +- public void testInternal() throws Exception { ++ void internal() throws Exception { + final File fileToProcess = new File(getPath("InputXpathRedundantImportInternal.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RedundantImportCheck.class); final String[] expectedViolation = { @@ -47,13 +47,13 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport "org.checkstyle.suppressionxpathfilter" - + ".redundantimport.SuppressionXpathRegressionRedundantImport1"), + + ".redundantimport.InputXpathRedundantImportInternal"), }; - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); @@ -8834,9 +9674,9 @@ } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRedundantImport2.java")); +- public void testLibrary() throws Exception { ++ void library() throws Exception { + final File fileToProcess = new File(getPath("InputXpathRedundantImportLibrary.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RedundantImportCheck.class); final String[] expectedViolation = { @@ -61,13 +61,13 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport @@ -8850,9 +9690,9 @@ } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRedundantImport3.java")); +- public void testDuplicate() throws Exception { ++ void duplicate() throws Exception { + final File fileToProcess = new File(getPath("InputXpathRedundantImportDuplicate.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RedundantImportCheck.class); final String[] expectedViolation = { @@ -79,7 +79,7 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport @@ -8889,7 +9729,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRequireThisOne.java")); + final File fileToProcess = new File(getPath("InputXpathRequireThisOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RequireThisCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { @@ -8899,7 +9739,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionRequireThisOne']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRequireThisOne']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='changeAge']]/SLIST/EXPR/ASSIGN" @@ -57,7 +57,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { } @@ -8907,7 +9747,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRequireThisTwo.java")); + final File fileToProcess = new File(getPath("InputXpathRequireThisTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RequireThisCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { @@ -8917,7 +9757,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionRequireThisTwo']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRequireThisTwo']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='method2']]/SLIST/EXPR" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionReturnCountTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionReturnCountTest.java @@ -8942,54 +9782,54 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount1.java")); +- public void testVoid() throws Exception { ++ void testVoid() throws Exception { + final File fileToProcess = new File(getPath("InputXpathReturnCountVoid.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -62,7 +63,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount1.java")); +- public void testCustomMaxForVoid() throws Exception { ++ void customMaxForVoid() throws Exception { + final File fileToProcess = new File(getPath("InputXpathReturnCountVoid.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -92,7 +93,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount2.java")); +- public void testNonVoid() throws Exception { ++ void nonVoid() throws Exception { + final File fileToProcess = new File(getPath("InputXpathReturnCountNonVoid.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -120,7 +121,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { } @Test -- public void testFour() throws Exception { -+ void four() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount2.java")); +- public void testCustomMax() throws Exception { ++ void customMax() throws Exception { + final File fileToProcess = new File(getPath("InputXpathReturnCountNonVoid.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -150,7 +151,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { } @Test -- public void testFive() throws Exception { -+ void five() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount3.java")); +- public void testCtor() throws Exception { ++ void ctor() throws Exception { + final File fileToProcess = new File(getPath("InputXpathReturnCountCtor.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -176,7 +177,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { } @Test -- public void testSix() throws Exception { -+ void six() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount4.java")); +- public void testLambda() throws Exception { ++ void lambda() throws Exception { + final File fileToProcess = new File(getPath("InputXpathReturnCountLambda.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -186,7 +187,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { @@ -8999,7 +9839,7 @@ - List.of( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionReturnCount4']]" + + "[./IDENT[@text='InputXpathReturnCountLambda']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testLambda']]/SLIST" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java @@ -9027,7 +9867,7 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyOne.java")); + final File fileToProcess = new File(getPath("InputXpathRightCurlyOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { @@ -9037,7 +9877,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyOne']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRightCurlyOne']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/SLIST/RCURLY"); @@ -56,7 +56,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } @@ -9045,7 +9885,7 @@ @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyTwo.java")); + final File fileToProcess = new File(getPath("InputXpathRightCurlyTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { @@ -9055,7 +9895,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyTwo']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRightCurlyTwo']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='fooMethod']]/SLIST/LITERAL_TRY/SLIST/RCURLY"); @@ -77,7 +77,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } @@ -9063,7 +9903,7 @@ @Test - public void testThree() throws Exception { + void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyThree.java")); + final File fileToProcess = new File(getPath("InputXpathRightCurlyThree.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -89,7 +89,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { @@ -9073,7 +9913,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyThree']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRightCurlyThree']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST/RCURLY"); @@ -98,7 +98,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } @@ -9081,7 +9921,7 @@ @Test - public void testFour() throws Exception { + void four() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyFour.java")); + final File fileToProcess = new File(getPath("InputXpathRightCurlyFour.java")); final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -111,7 +111,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { @@ -9091,8 +9931,37 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyFour']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathRightCurlyFour']]/OBJBLOCK" + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST/RCURLY"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSealedShouldHavePermitsListTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSealedShouldHavePermitsListTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionSealedShouldHavePermitsListTest extends AbstractXpathTestSupport { ++final class XpathRegressionSealedShouldHavePermitsListTest extends AbstractXpathTestSupport { + + private final String checkName = SealedShouldHavePermitsListCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionSealedShouldHavePermitsListTest extends AbstractXpat + } + + @Test +- public void testInner() throws Exception { ++ void inner() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathSealedShouldHavePermitsListInner.java")); + +@@ -65,7 +65,7 @@ public class XpathRegressionSealedShouldHavePermitsListTest extends AbstractXpat + } + + @Test +- public void testTopLevel() throws Exception { ++ void topLevel() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathSealedShouldHavePermitsListTopLevel.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanExpressionTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanExpressionTest.java @@ -21,15 +21,15 @@ package org.checkstyle.suppressionxpathfilter; @@ -9119,7 +9988,7 @@ @Test - public void testSimple() throws Exception { + void simple() throws Exception { - final String fileName = "SuppressionXpathRegressionSimplifyBooleanExpressionSimple.java"; + final String fileName = "InputXpathSimplifyBooleanExpressionSimple.java"; final File fileToProcess = new File(getPath(fileName)); @@ -61,7 +61,7 @@ public class XpathRegressionSimplifyBooleanExpressionTest extends AbstractXpathT @@ -9128,7 +9997,7 @@ @Test - public void testAnonymous() throws Exception { + void anonymous() throws Exception { - final String fileName = "SuppressionXpathRegressionSimplifyBooleanExpressionAnonymous.java"; + final String fileName = "InputXpathSimplifyBooleanExpressionAnonymous.java"; final File fileToProcess = new File(getPath(fileName)); @@ -87,7 +87,7 @@ public class XpathRegressionSimplifyBooleanExpressionTest extends AbstractXpathT @@ -9137,7 +10006,7 @@ @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { - final String fileName = "SuppressionXpathRegressionSimplifyBooleanExpressionInterface.java"; + final String fileName = "InputXpathSimplifyBooleanExpressionInterface.java"; final File fileToProcess = new File(getPath(fileName)); @@ -99,7 +99,7 @@ public class XpathRegressionSimplifyBooleanExpressionTest extends AbstractXpathT @@ -9147,7 +10016,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionSimplifyBooleanExpressionInterface']]" + + "[@text='InputXpathSimplifyBooleanExpressionInterface']]" + "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Inner']]/OBJBLOCK/METHOD_DEF[./IDENT" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java @@ -9175,34 +10044,34 @@ - public void testIfBooleanEqualsBoolean() throws Exception { + void ifBooleanEqualsBoolean() throws Exception { final File fileToProcess = - new File( - getPath("SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanEqualsBoolean.java")); -@@ -51,7 +51,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS + new File(getPath("InputXpathSimplifyBooleanReturnIfBooleanEqualsBoolean.java")); + +@@ -50,7 +50,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanEqualsBoolean']]" + + "'InputXpathSimplifyBooleanReturnIfBooleanEqualsBoolean']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='toTest']]/SLIST/LITERAL_IF"); -@@ -60,7 +60,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS +@@ -59,7 +59,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS } @Test - public void testIfBooleanReturnBoolean() throws Exception { + void ifBooleanReturnBoolean() throws Exception { final File fileToProcess = - new File( - getPath("SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanReturnBoolean.java")); -@@ -72,7 +72,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS + new File(getPath("InputXpathSimplifyBooleanReturnIfBooleanReturnBoolean.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanReturnBoolean']]" + + "'InputXpathSimplifyBooleanReturnIfBooleanReturnBoolean']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='toTest']]/SLIST/EXPR/METHOD_CALL/ELIST" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java @@ -9229,35 +10098,35 @@ @Test - public void testSingleSpaceSeparator() throws Exception { + void singleSpaceSeparator() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionSingleSpaceSeparator.java")); + final File fileToProcess = new File(getPath("InputXpathSingleSpaceSeparator.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu + final DefaultConfiguration moduleConfig = createModuleConfig(SingleSpaceSeparatorCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionSingleSpaceSeparator']]/OBJBLOCK" + + "[./IDENT[@text='InputXpathSingleSpaceSeparator']]/OBJBLOCK" + "/VARIABLE_DEF/IDENT[@text='bad']"); -@@ -57,7 +57,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu +@@ -56,7 +56,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu } @Test - public void testValidateComments() throws Exception { + void validateComments() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionSingleSpaceSeparatorValidateComments.java")); + new File(getPath("InputXpathSingleSpaceSeparatorValidateComments.java")); -@@ -70,7 +70,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu +@@ -69,7 +69,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[." - + "/IDENT[@text='SuppressionXpathRegressionSingleSpaceSeparatorValidateComments']]" + + "/IDENT[@text='InputXpathSingleSpaceSeparatorValidateComments']]" + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStaticVariableNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStaticVariableNameTest.java @@ -9283,12 +10152,12 @@ } @Test -- public void test1() throws Exception { -+ void test1() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionStaticVariableName1.java")); +- public void testStaticVariableName() throws Exception { ++ void staticVariableName() throws Exception { + final File fileToProcess = new File(getPath("InputXpathStaticVariableName.java")); -@@ -54,7 +54,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + final String pattern = "^[a-z][a-zA-Z0-9]*$"; +@@ -53,7 +53,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = @@ -9296,17 +10165,17 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionStaticVariableName1']]" -@@ -63,7 +63,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + + "='InputXpathStaticVariableName']]" +@@ -62,7 +62,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp } @Test -- public void test2() throws Exception { -+ void test2() throws Exception { +- public void testInnerClassField() throws Exception { ++ void innerClassField() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionStaticVariableName2.java")); + new File(getNonCompilablePath("InputXpathStaticVariableNameInnerClassField.java")); -@@ -80,7 +80,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp +@@ -79,7 +79,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = @@ -9314,17 +10183,17 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionStaticVariableName2']]" -@@ -91,7 +91,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp + + "='InputXpathStaticVariableNameInnerClassField']]" +@@ -90,7 +90,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp } @Test -- public void test3() throws Exception { -+ void test3() throws Exception { +- public void testNoAccessModifier() throws Exception { ++ void noAccessModifier() throws Exception { final File fileToProcess = - new File(getNonCompilablePath("SuppressionXpathRegressionStaticVariableName3.java")); + new File(getNonCompilablePath("InputXpathStaticVariableNameNoAccessModifier.java")); -@@ -108,7 +108,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp +@@ -107,7 +107,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp }; final List expectedXpathQueries = @@ -9332,7 +10201,7 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionStaticVariableName2']]" + + "='InputXpathStaticVariableNameNoAccessModifier']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java @@ -19,15 +19,15 @@ @@ -9357,37 +10226,37 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionStringLiteralEquality.java")); +- public void testEqualityTrue() throws Exception { ++ void equalityTrue() throws Exception { + final File fileToProcess = new File(getPath("InputXpathStringLiteralEqualityTrue.java")); final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); -@@ -61,7 +61,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + final String[] expectedViolation = { +@@ -60,7 +60,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionStringLiteralEquality1.java")); +- public void testEqualityFalse() throws Exception { ++ void equalityFalse() throws Exception { + final File fileToProcess = new File(getPath("InputXpathStringLiteralEqualityFalse.java")); final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); -@@ -85,7 +85,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + final String[] expectedViolation = { +@@ -83,7 +83,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionStringLiteralEquality2.java")); +- public void testEqualityExp() throws Exception { ++ void equalityExp() throws Exception { + final File fileToProcess = new File(getPath("InputXpathStringLiteralEqualityExp.java")); final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); -@@ -95,7 +95,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + final String[] expectedViolation = { +@@ -92,7 +92,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS StringLiteralEqualityCheck.class, StringLiteralEqualityCheck.MSG_KEY, "=="), }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionStringLiteralEquality2']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathStringLiteralEqualityExp']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuperCloneTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuperCloneTest.java @@ -9415,54 +10284,146 @@ @Test - public void testInnerClone() throws Exception { + void innerClone() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionSuperCloneInnerClone.java")); + final File fileToProcess = new File(getPath("InputXpathSuperCloneInnerClone.java")); -@@ -46,7 +46,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(SuperCloneCheck.class); +@@ -45,7 +45,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 { + + "[./IDENT[@text='InputXpathSuperCloneInnerClone']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClone']]" +@@ -55,7 +55,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { } @Test - public void testNoSuperClone() throws Exception { + void noSuperClone() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionSuperCloneNoSuperClone.java")); + final File fileToProcess = new File(getPath("InputXpathSuperCloneNoSuperClone.java")); -@@ -68,7 +68,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(SuperCloneCheck.class); +@@ -65,7 +65,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 { + + "[./IDENT[@text='InputXpathSuperCloneNoSuperClone']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='NoSuperClone']]" +@@ -75,7 +75,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { } @Test - public void testPlainAndSubclasses() throws Exception { + void plainAndSubclasses() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionSuperClonePlainAndSubclasses.java")); + final File fileToProcess = new File(getPath("InputXpathSuperClonePlainAndSubclasses.java")); -@@ -90,7 +90,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { + final DefaultConfiguration moduleConfig = createModuleConfig(SuperCloneCheck.class); +@@ -85,7 +85,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpath" - + "RegressionSuperClonePlainAndSubclasses']]" + + "[./IDENT[@text='InputXpathSuperClonePlainAndSubclasses']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='clone']"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuppressWarningsTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuppressWarningsTest.java +@@ -28,7 +28,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSupport { ++final class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSupport { + private final String checkName = SuppressWarningsCheck.class.getSimpleName(); + + @Override +@@ -37,7 +37,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testClassDefinition() throws Exception { ++ void classDefinition() throws Exception { + final File fileToCheck = new File(getPath("InputXpathSuppressWarningsClassDefinition.java")); + + final DefaultConfiguration configuration = createModuleConfig(SuppressWarningsCheck.class); +@@ -65,7 +65,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testParameterDefinition() throws Exception { ++ void parameterDefinition() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathSuppressWarningsParameterDefinition.java")); + +@@ -102,7 +102,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testVariableDefinition() throws Exception { ++ void variableDefinition() throws Exception { + final File fileToCheck = new File(getPath("InputXpathSuppressWarningsVariableDefinition.java")); + + final DefaultConfiguration configuration = createModuleConfig(SuppressWarningsCheck.class); +@@ -134,7 +134,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testEnumDefinition() throws Exception { ++ void enumDefinition() throws Exception { + final File fileToCheck = new File(getPath("InputXpathSuppressWarningsEnumDefinition.java")); + + final DefaultConfiguration configuration = createModuleConfig(SuppressWarningsCheck.class); +@@ -162,7 +162,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testInterfaceDefinition() throws Exception { ++ void interfaceDefinition() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathSuppressWarningsInterfaceDefinition.java")); + +@@ -191,7 +191,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testEnumConstantDefinition() throws Exception { ++ void enumConstantDefinition() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathSuppressWarningsEnumConstantDefinition.java")); + +@@ -224,7 +224,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testMethodDefinition() throws Exception { ++ void methodDefinition() throws Exception { + final File fileToCheck = new File(getPath("InputXpathSuppressWarningsMethodDefinition.java")); + + final DefaultConfiguration configuration = createModuleConfig(SuppressWarningsCheck.class); +@@ -256,7 +256,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testAnnotationDefinition() throws Exception { ++ void annotationDefinition() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathSuppressWarningsAnnotationDefinition.java")); + +@@ -285,7 +285,7 @@ public class XpathRegressionSuppressWarningsTest extends AbstractXpathTestSuppor + } + + @Test +- public void testAnnotationFieldDefinition() throws Exception { ++ void annotationFieldDefinition() throws Exception { + final File fileToCheck = + new File(getPath("InputXpathSuppressWarningsAnnotationFieldDefinition.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java @@ -19,14 +19,14 @@ @@ -9486,9 +10447,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionThrowsCount1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathThrowsCountDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); final String[] expectedViolation = { "4:30: " + getCheckMessage(ThrowsCountCheck.class, ThrowsCountCheck.MSG_KEY, 5, 4), @@ -9497,15 +10458,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionThrowsCount1']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathThrowsCountDefault']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" @@ -53,7 +53,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionThrowsCount2.java")); +- public void testCustomMax() throws Exception { ++ void customMax() throws Exception { + final File fileToProcess = new File(getPath("InputXpathThrowsCountCustomMax.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); @@ -63,7 +63,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { @@ -9515,15 +10476,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/INTERFACE_DEF[./IDENT[@text='SuppressionXpathRegressionThrowsCount2']]" + + "/INTERFACE_DEF[./IDENT[@text='InputXpathThrowsCountCustomMax']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" @@ -73,7 +73,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionThrowsCount3.java")); +- public void testPrivateMethods() throws Exception { ++ void privateMethods() throws Exception { + final File fileToProcess = new File(getPath("InputXpathThrowsCountPrivateMethods.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); @@ -83,7 +83,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { @@ -9533,7 +10494,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT" - + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionThrowsCount3']]" + + "/CLASS_DEF[./IDENT[@text='InputXpathThrowsCountPrivateMethods']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunc']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java @@ -9558,9 +10519,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionTodoCommentOne.java")); +- public void testSingleLine() throws Exception { ++ void singleLine() throws Exception { + final File fileToProcess = new File(getPath("InputXpathTodoCommentSingleLine.java")); final DefaultConfiguration moduleConfig = createModuleConfig(TodoCommentCheck.class); @@ -48,7 +48,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { @@ -9570,15 +10531,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionTodoCommentOne']]/OBJBLOCK/" + + "'InputXpathTodoCommentSingleLine']]/OBJBLOCK/" + "SINGLE_LINE_COMMENT/COMMENT_CONTENT[@text=' warn FIXME:\\n']"); @@ -57,7 +57,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionTodoCommentTwo.java")); +- public void testBlock() throws Exception { ++ void block() throws Exception { + final File fileToProcess = new File(getPath("InputXpathTodoCommentBlock.java")); final DefaultConfiguration moduleConfig = createModuleConfig(TodoCommentCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { @@ -9588,7 +10549,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionTodoCommentTwo']]/" + + "'InputXpathTodoCommentBlock']]/" + "OBJBLOCK/BLOCK_COMMENT_BEGIN/COMMENT_CONTENT" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java @@ -9613,9 +10574,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionTrailingComment1.java")); +- public void testSingleLine() throws Exception { ++ void singleLine() throws Exception { + final File fileToProcess = new File(getPath("InputXpathTrailingCommentSingleLine.java")); final DefaultConfiguration moduleConfig = createModuleConfig(TrailingCommentCheck.class); @@ -45,7 +45,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport @@ -9625,15 +10586,15 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionTrailingComment1']]/" + + "[./IDENT[@text='InputXpathTrailingCommentSingleLine']]/" + "OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' don'" @@ -55,7 +55,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionTrailingComment2.java")); +- public void testBlock() throws Exception { ++ void block() throws Exception { + final File fileToProcess = new File(getPath("InputXpathTrailingCommentBlock.java")); final DefaultConfiguration moduleConfig = createModuleConfig(TrailingCommentCheck.class); @@ -65,7 +65,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport @@ -9643,7 +10604,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionTrailingComment2']]" + + "[./IDENT[@text='InputXpathTrailingCommentBlock']]" + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' warn\\n']]"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java @@ -9669,9 +10630,9 @@ } @Test -- public void test1() throws Exception { -+ void test1() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypeName1.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathTypeNameDefault.java")); final String pattern = "^[A-Z][a-zA-Z0-9]*$"; @@ -50,7 +50,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { @@ -9682,14 +10643,14 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionTypeName1']]" + + "='InputXpathTypeNameDefault']]" @@ -59,7 +59,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { } @Test -- public void test2() throws Exception { -+ void test2() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypeName2.java")); +- public void testInterfaceDef() throws Exception { ++ void interfaceDef() throws Exception { + final File fileToProcess = new File(getPath("InputXpathTypeNameInterfaceDef.java")); final String pattern = "^I_[a-zA-Z0-9]*$"; @@ -74,7 +74,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { @@ -9700,7 +10661,7 @@ + ImmutableList.of( "/COMPILATION_UNIT" + "/CLASS_DEF[./IDENT[@text" - + "='SuppressionXpathRegressionTypeName2']]" + + "='InputXpathTypeNameInterfaceDef']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java @@ -19,17 +19,17 @@ @@ -9729,53 +10690,53 @@ @Test - public void testLeftFollowed() throws Exception { + void leftFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionTypecastParenPadLeftFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathTypecastParenPadLeftFollowed.java")); -@@ -64,7 +64,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(TypecastParenPadCheck.class); +@@ -63,7 +63,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } @Test - public void testLeftNotFollowed() throws Exception { + void leftNotFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionTypecastParenPadLeftNotFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathTypecastParenPadLeftNotFollowed.java")); -@@ -90,7 +90,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(TypecastParenPadCheck.class); +@@ -88,7 +88,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } @Test - public void testRightPreceded() throws Exception { + void rightPreceded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionTypecastParenPadRightPreceded.java")); + final File fileToProcess = new File(getPath("InputXpathTypecastParenPadRightPreceded.java")); -@@ -103,7 +103,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(TypecastParenPadCheck.class); +@@ -100,7 +100,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionTypecastParenPadRightPreceded']]" + + "[./IDENT[@text='InputXpathTypecastParenPadRightPreceded']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); -@@ -112,7 +112,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor +@@ -109,7 +109,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } @Test - public void testRightNotPreceded() throws Exception { + void rightNotPreceded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionTypecastParenPadRightNotPreceded.java")); + final File fileToProcess = new File(getPath("InputXpathTypecastParenPadRightNotPreceded.java")); -@@ -126,7 +126,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(TypecastParenPadCheck.class); +@@ -122,7 +122,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionTypecastParenPadRightNotPreceded']]" + + "@text='InputXpathTypecastParenPadRightNotPreceded']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUncommentedMainTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUncommentedMainTest.java @@ -9792,20 +10753,20 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionUncommentedMain.java")); +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUncommentedMainDefault.java")); final DefaultConfiguration moduleConfig = createModuleConfig(UncommentedMainCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUncommentedMainTwo.java")); +- public void testInStaticClass() throws Exception { ++ void inStaticClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUncommentedMainInStaticClass.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(UncommentedMainCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java @@ -19,15 +19,15 @@ @@ -9830,109 +10791,109 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testClassFields() throws Exception { ++ void classFields() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses1.java")); + new File(getPath("InputXpathUnnecessaryParenthesesClassFields.java")); @@ -62,7 +62,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testConditionals() throws Exception { ++ void conditionals() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses2.java")); + new File(getPath("InputXpathUnnecessaryParenthesesConditionals.java")); @@ -89,7 +89,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testThree() throws Exception { -+ void three() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses3.java")); +- public void testLambdas() throws Exception { ++ void lambdas() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUnnecessaryParenthesesLambdas.java")); -@@ -102,7 +102,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(UnnecessaryParenthesesCheck.class); +@@ -101,7 +101,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses3']]" + + "[./IDENT[@text='InputXpathUnnecessaryParenthesesLambdas']]" + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='predicate']]" -@@ -112,7 +112,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest +@@ -111,7 +111,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testFour() throws Exception { -+ void four() throws Exception { +- public void testLocalVariables() throws Exception { ++ void localVariables() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses4.java")); + new File(getPath("InputXpathUnnecessaryParenthesesLocalVariables.java")); -@@ -125,7 +125,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest +@@ -124,7 +124,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses4']]" + + "[./IDENT[@text='InputXpathUnnecessaryParenthesesLocalVariables']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" -@@ -136,7 +136,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest +@@ -135,7 +135,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testFive() throws Exception { -+ void five() throws Exception { +- public void testStringLiteral() throws Exception { ++ void stringLiteral() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses5.java")); + new File(getPath("InputXpathUnnecessaryParenthesesStringLiteral.java")); -@@ -151,7 +151,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest +@@ -150,7 +150,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses5']]" + + "[./IDENT[@text='InputXpathUnnecessaryParenthesesStringLiteral']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" -@@ -162,7 +162,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest +@@ -161,7 +161,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testSix() throws Exception { -+ void six() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses6.java")); +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUnnecessaryParenthesesMethodDef.java")); -@@ -175,7 +175,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(UnnecessaryParenthesesCheck.class); +@@ -173,7 +173,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses6']]" + + "[./IDENT[@text='InputXpathUnnecessaryParenthesesMethodDef']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" -@@ -186,7 +186,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest +@@ -184,7 +184,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testSeven() throws Exception { -+ void seven() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses7.java")); +- public void testReturnExpr() throws Exception { ++ void returnExpr() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUnnecessaryParenthesesReturnExpr.java")); -@@ -213,7 +213,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + final DefaultConfiguration moduleConfig = createModuleConfig(UnnecessaryParenthesesCheck.class); +@@ -210,7 +210,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } @Test -- public void testEight() throws Exception { -+ void eight() throws Exception { +- public void testExprWithMethodParam() throws Exception { ++ void exprWithMethodParam() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses8.java")); + new File(getPath("InputXpathUnnecessaryParenthesesExprWithMethodParam.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java @@ -9957,12 +10918,12 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testSimple() throws Exception { ++ void simple() throws Exception { final File fileToProcess = - new File( - getPath( -@@ -48,13 +48,13 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + new File(getPath("InputXpathUnnecessarySemicolonAfterOuterTypeDeclarationSimple.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -46,13 +46,13 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest "5:2: " + getCheckMessage(CLASS, UnnecessarySemicolonAfterOuterTypeDeclarationCheck.MSG_SEMI), }; @@ -9973,12 +10934,12 @@ } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testInnerTypes() throws Exception { ++ void innerTypes() throws Exception { final File fileToProcess = new File( - getPath( -@@ -66,7 +66,7 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + getPath("InputXpathUnnecessarySemicolonAfterOuterTypeDeclarationInnerTypes" + ".java")); +@@ -62,7 +62,7 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + getCheckMessage(CLASS, UnnecessarySemicolonAfterOuterTypeDeclarationCheck.MSG_SEMI), }; @@ -10013,9 +10974,9 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = - new File( - getPath( -@@ -50,7 +50,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + new File(getPath("InputXpathUnnecessarySemicolonAfterTypeMemberDeclarationDefault.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -48,7 +48,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest }; final List expectedXpathQueries = @@ -10023,8 +10984,8 @@ + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + "[@text=" - + "'SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMemberDeclaration']]" -@@ -60,7 +60,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + + "'InputXpathUnnecessarySemicolonAfterTypeMemberDeclarationDefault']]" +@@ -58,7 +58,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest } @Test @@ -10032,15 +10993,15 @@ + void tokens() throws Exception { final File fileToProcess = new File( - getPath( -@@ -75,7 +75,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + getPath("InputXpathUnnecessarySemicolonAfterTypeMemberDeclarationTokens" + ".java")); +@@ -71,7 +71,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[." - + "/IDENT[@text='SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMember" + + "/IDENT[@text='InputXpathUnnecessarySemicolonAfterTypeMember" + "DeclarationTokens']]" --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java @@ -10065,10 +11026,10 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { +- public void testSimple() throws Exception { ++ void simple() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInEnumeration.java")); + new File(getPath("InputXpathUnnecessarySemicolonInEnumerationSimple.java")); @@ -51,13 +51,13 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra }; @@ -10081,10 +11042,10 @@ } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { +- public void testAll() throws Exception { ++ void all() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInEnumerationAll.java")); + new File(getPath("InputXpathUnnecessarySemicolonInEnumerationAll.java")); @@ -72,7 +72,7 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra }; @@ -10093,7 +11054,7 @@ - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/ENUM_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionUnnecessarySemicolonInEnumerationAll']]" + + "'InputXpathUnnecessarySemicolonInEnumerationAll']]" + "/OBJBLOCK/SEMI"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java @@ -10121,35 +11082,64 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInTryWithResources.java")); + new File(getPath("InputXpathUnnecessarySemicolonInTryWithResourcesDefault.java")); final DefaultConfiguration moduleConfig = -@@ -54,7 +54,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest +@@ -50,7 +50,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest UnnecessarySemicolonInTryWithResourcesCheck.MSG_SEMI), }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionUnnecessarySemicolonInTryWithResources']]" + + "'InputXpathUnnecessarySemicolonInTryWithResourcesDefault']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='m']]/SLIST/LITERAL_TRY" -@@ -63,7 +63,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest +@@ -59,7 +59,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest } @Test -- public void testAllowWhenNoBraceAfterSemicolon() throws Exception { -+ void allowWhenNoBraceAfterSemicolon() throws Exception { +- public void testNoBrace() throws Exception { ++ void noBrace() throws Exception { final File fileToProcess = - new File( - getPath( -@@ -81,7 +81,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest + new File(getPath("InputXpathUnnecessarySemicolonInTryWithResourcesNoBrace.java")); + +@@ -75,7 +75,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" - + "'SuppressionXpathRegressionUnnecessarySemicolonInTryWithResourcesNoBrace']]" + + "'InputXpathUnnecessarySemicolonInTryWithResourcesNoBrace']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedCatchParameterShouldBeUnnamedTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedCatchParameterShouldBeUnnamedTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnusedCatchParameterShouldBeUnnamedTest ++final class XpathRegressionUnusedCatchParameterShouldBeUnnamedTest + extends AbstractXpathTestSupport { + + private final String checkName = UnusedCatchParameterShouldBeUnnamedCheck.class.getSimpleName(); +@@ -37,7 +37,7 @@ public class XpathRegressionUnusedCatchParameterShouldBeUnnamedTest + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathUnusedCatchParameterShouldBeUnnamedSimple.java")); + +@@ -77,7 +77,7 @@ public class XpathRegressionUnusedCatchParameterShouldBeUnnamedTest + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathUnusedCatchParameterShouldBeUnnamedNested.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java @@ -19,14 +19,14 @@ @@ -10173,9 +11163,9 @@ } @Test -- public void testOne() throws Exception { -+ void one() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedImportsOne.java")); +- public void testUnusedImports() throws Exception { ++ void unusedImports() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUnusedImports.java")); final DefaultConfiguration moduleConfig = createModuleConfig(UnusedImportsCheck.class); @@ -47,14 +47,14 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { @@ -10190,9 +11180,9 @@ } @Test -- public void testTwo() throws Exception { -+ void two() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedImportsTwo.java")); +- public void testStatic() throws Exception { ++ void testStatic() throws Exception { + final File fileToProcess = new File(getPath("InputXpathUnusedImportsStatic.java")); final DefaultConfiguration moduleConfig = createModuleConfig(UnusedImportsCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { @@ -10204,6 +11194,35 @@ "/COMPILATION_UNIT/STATIC_IMPORT/DOT" + "[./IDENT[@text='Entry']]/DOT[./IDENT[@text='Map']]" + "/DOT/IDENT[@text='java']"); +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLambdaParameterShouldBeUnnamedTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLambdaParameterShouldBeUnnamedTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnusedLambdaParameterShouldBeUnnamedTest ++final class XpathRegressionUnusedLambdaParameterShouldBeUnnamedTest + extends AbstractXpathTestSupport { + + private final String checkName = UnusedLambdaParameterShouldBeUnnamedCheck.class.getSimpleName(); +@@ -37,7 +37,7 @@ public class XpathRegressionUnusedLambdaParameterShouldBeUnnamedTest + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathUnusedLambdaParameterShouldBeUnnamedSimple.java")); + +@@ -81,7 +81,7 @@ public class XpathRegressionUnusedLambdaParameterShouldBeUnnamedTest + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathUnusedLambdaParameterShouldBeUnnamedNested.java")); + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLocalVariableTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLocalVariableTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -10221,18 +11240,18 @@ @Test - public void testOne() throws Exception { + void one() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnusedLocalVariableOne.java")); + final File fileToProcess = new File(getPath("InputXpathUnusedLocalVariableOne.java")); -@@ -71,7 +71,7 @@ public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSup + final DefaultConfiguration moduleConfig = createModuleConfig(UnusedLocalVariableCheck.class); +@@ -70,7 +70,7 @@ public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSup } @Test - public void testTwo() throws Exception { + void two() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionUnusedLocalVariableTwo.java")); + final File fileToProcess = new File(getPath("InputXpathUnusedLocalVariableTwo.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(UnusedLocalVariableCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUpperEllTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUpperEllTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; @@ -10250,7 +11269,7 @@ @Test - public void testUpperEllOne() throws Exception { + void upperEllOne() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionUpperEllFirst.java")); + final File fileToProcess = new File(getPath("InputXpathUpperEllOne.java")); final DefaultConfiguration moduleConfig = createModuleConfig(UpperEllCheck.class); @@ -59,7 +59,7 @@ public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { @@ -10259,7 +11278,7 @@ @Test - public void testUpperEllTwo() throws Exception { + void upperEllTwo() throws Exception { - final File fileToProcess = new File(getPath("SuppressionXpathRegressionUpperEllSecond.java")); + final File fileToProcess = new File(getPath("InputXpathUpperEllTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(UpperEllCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java @@ -10280,7 +11299,7 @@ - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionVariableDeclarationUsageDistance1.java")); + new File(getPath("InputXpathVariableDeclarationUsageDistanceOne.java")); @@ -79,7 +79,7 @@ public class XpathRegressionVariableDeclarationUsageDistanceTest extends Abstrac } @@ -10289,7 +11308,127 @@ - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionVariableDeclarationUsageDistance2.java")); + new File(getPath("InputXpathVariableDeclarationUsageDistanceTwo.java")); + +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVisibilityModifierTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVisibilityModifierTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupport { ++final class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupport { + + private final String checkName = VisibilityModifierCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + } + + @Test +- public void testDefaultModifier() throws Exception { ++ void defaultModifier() throws Exception { + final File fileToProcess = new File(getPath("InputXpathVisibilityModifierDefault.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(VisibilityModifierCheck.class); +@@ -48,7 +48,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathVisibilityModifierDefault']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='field']"); +@@ -57,7 +57,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final File fileToProcess = new File(getPath("InputXpathVisibilityModifierAnnotation.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(VisibilityModifierCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathVisibilityModifierAnnotation']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='annotatedString']"); +@@ -77,7 +77,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + } + + @Test +- public void testAnonymousClass() throws Exception { ++ void anonymousClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathVisibilityModifierAnonymous.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(VisibilityModifierCheck.class); +@@ -87,7 +87,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathVisibilityModifierAnonymous']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='runnable']]" +@@ -98,7 +98,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = new File(getPath("InputXpathVisibilityModifierInner.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(VisibilityModifierCheck.class); +@@ -108,7 +108,7 @@ public class XpathRegressionVisibilityModifierTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='InputXpathVisibilityModifierInner']]" + + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]/OBJBLOCK/" +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhenShouldBeUsedTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhenShouldBeUsedTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionWhenShouldBeUsedTest extends AbstractXpathTestSupport { ++final class XpathRegressionWhenShouldBeUsedTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionWhenShouldBeUsedTest extends AbstractXpathTestSuppor + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathWhenShouldBeUsedSimple.java")); + +@@ -55,7 +55,7 @@ public class XpathRegressionWhenShouldBeUsedTest extends AbstractXpathTestSuppor + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("InputXpathWhenShouldBeUsedNested.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java @@ -10316,35 +11455,35 @@ @Test - public void testWhitespaceAfterTypecast() throws Exception { + void whitespaceAfterTypecast() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionWhitespaceAfterTypecast.java")); + final File fileToProcess = new File(getPath("InputXpathWhitespaceAfterTypecast.java")); -@@ -48,7 +48,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(WhitespaceAfterCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionWhitespaceAfterTypecast']]/OBJBLOCK" + + "@text='InputXpathWhitespaceAfterTypecast']]/OBJBLOCK" + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); -@@ -57,7 +57,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport +@@ -56,7 +56,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport } @Test - public void testWhitespaceAfterNotFollowed() throws Exception { + void whitespaceAfterNotFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionWhitespaceAfterNotFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathWhitespaceAfterNotFollowed.java")); -@@ -70,7 +70,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport + final DefaultConfiguration moduleConfig = createModuleConfig(WhitespaceAfterCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionWhitespaceAfterNotFollowed']]/OBJBLOCK" + + "@text='InputXpathWhitespaceAfterNotFollowed']]/OBJBLOCK" + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/ARRAY_INIT/COMMA"); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java @@ -10371,39 +11510,39 @@ @Test - public void testWhitespaceAroundNotPreceded() throws Exception { + void whitespaceAroundNotPreceded() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionWhitespaceAroundNotPreceded.java")); + final File fileToProcess = new File(getPath("InputXpathWhitespaceAroundNotPreceded.java")); -@@ -49,7 +49,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(WhitespaceAroundCheck.class); +@@ -48,7 +48,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionWhitespaceAroundNotPreceded']]/OBJBLOCK" + + "@text='InputXpathWhitespaceAroundNotPreceded']]/OBJBLOCK" + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN"); -@@ -58,7 +58,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor +@@ -57,7 +57,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor } @Test - public void testWhitespaceAroundNotFollowed() throws Exception { + void whitespaceAroundNotFollowed() throws Exception { - final File fileToProcess = - new File(getPath("SuppressionXpathRegressionWhitespaceAroundNotFollowed.java")); + final File fileToProcess = new File(getPath("InputXpathWhitespaceAroundNotFollowed.java")); -@@ -71,7 +71,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor + final DefaultConfiguration moduleConfig = createModuleConfig(WhitespaceAroundCheck.class); +@@ -69,7 +69,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor }; final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionWhitespaceAroundNotFollowed']]/OBJBLOCK" + + "@text='InputXpathWhitespaceAroundNotFollowed']]/OBJBLOCK" + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN"); --- a/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java -@@ -276,8 +276,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali +@@ -277,8 +277,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts a string to a pattern. */ private static final class PatternConverter implements Converter { @@ -10413,7 +11552,17 @@ public Object convert(Class type, Object value) { return CommonUtil.createPattern(value.toString()); } -@@ -286,8 +286,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali +@@ -287,8 +287,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + /** A converter that converts a comma-separated string into an array of patterns. */ + private static final class PatternArrayConverter implements Converter { + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + final StringTokenizer tokenizer = new StringTokenizer(value.toString(), COMMA_SEPARATOR); + final List result = new ArrayList<>(); +@@ -305,8 +305,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts strings to severity level. */ private static final class SeverityLevelConverter implements Converter { @@ -10423,7 +11572,7 @@ public Object convert(Class type, Object value) { return SeverityLevel.getInstance(value.toString()); } -@@ -296,8 +296,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali +@@ -315,8 +315,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts strings to scope. */ private static final class ScopeConverter implements Converter { @@ -10433,7 +11582,7 @@ public Object convert(Class type, Object value) { return Scope.getInstance(value.toString()); } -@@ -306,9 +306,9 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali +@@ -325,9 +325,9 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts strings to uri. */ private static final class UriConverter implements Converter { @@ -10445,7 +11594,7 @@ public Object convert(Class type, Object value) { final String url = value.toString(); URI result = null; -@@ -331,8 +331,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali +@@ -350,8 +350,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali */ private static final class RelaxedStringArrayConverter implements Converter { @@ -10455,7 +11604,7 @@ public Object convert(Class type, Object value) { final StringTokenizer tokenizer = new StringTokenizer(value.toString().trim(), COMMA_SEPARATOR); -@@ -357,8 +357,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali +@@ -376,8 +376,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** Constant for optimization. */ private static final AccessModifierOption[] EMPTY_MODIFIER_ARRAY = new AccessModifierOption[0]; @@ -10514,7 +11663,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.api.SeverityLevel; -@@ -523,9 +525,7 @@ public final class ConfigurationLoader { +@@ -522,9 +524,7 @@ public final class ConfigurationLoader { final DefaultConfiguration top = configStack.peek(); top.addMessage(key, value); } else { @@ -10592,7 +11741,7 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java -@@ -19,20 +19,22 @@ +@@ -19,19 +19,21 @@ package com.puppycrawl.tools.checkstyle; @@ -10610,15 +11759,14 @@ -import java.util.Collections; import java.util.Iterator; import java.util.List; --import java.util.Objects; - import java.util.Optional; +-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; -@@ -416,7 +418,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) @@ -10627,7 +11775,7 @@ // We add C style array declarator brackets to TYPE ast final DetailAstImpl typeAst = (DetailAstImpl) methodDef.findFirstToken(TokenTypes.TYPE); -@@ -479,7 +481,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor children = ctx.children.stream() .filter(child -> !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) @@ -10636,7 +11784,7 @@ processChildren(methodDef, children); // We add C style array declarator brackets to TYPE ast -@@ -790,7 +792,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) @@ -10654,7 +11802,7 @@ // We add C style array declarator brackets to TYPE ast final DetailAstImpl typeAst = -@@ -862,7 +864,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !child.equals(ctx.LITERAL_SUPER())) @@ -10663,7 +11811,7 @@ return primaryCtorCall; } -@@ -1100,7 +1102,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.VariableModifierContext)) @@ -10672,7 +11820,7 @@ return catchParameterDef; } -@@ -1431,8 +1433,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor children = ctx.children.stream() .filter(child -> !child.equals(ctx.DOUBLE_COLON())) @@ -10701,7 +11849,7 @@ processChildren(doubleColon, children); return doubleColon; } -@@ -1538,7 +1538,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !child.equals(ctx.QUESTION())) @@ -10710,7 +11858,7 @@ return root; } -@@ -1565,7 +1565,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor descendantList = binOpList.parallelStream() .map(this::getInnerBopAst) @@ -10719,7 +11867,7 @@ bop.addChild(descendantList.poll()); DetailAstImpl pointer = bop.getFirstChild(); -@@ -1602,8 +1602,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor buildSimpleStringTemplateArgument(ctx)); - } - -@@ -1773,7 +1772,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor Pattern.compile("^" + pattern + "$")) @@ -11137,8 +12267,8 @@ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.AuditListener; - import com.puppycrawl.tools.checkstyle.api.SeverityLevel; -@@ -29,7 +32,6 @@ import java.io.OutputStream; + import com.puppycrawl.tools.checkstyle.api.AutomaticBean; +@@ -30,7 +33,6 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.StringWriter; @@ -11146,7 +12276,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -@@ -107,10 +109,8 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener +@@ -125,10 +127,8 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener */ public SarifLogger(OutputStream outputStream, OutputStreamOptions outputStreamOptions) throws IOException { @@ -11159,7 +12289,7 @@ closeStream = outputStreamOptions == OutputStreamOptions.CLOSE; report = readResource("/com/puppycrawl/tools/checkstyle/sarif/SarifReport.template"); resultLineColumn = -@@ -307,7 +307,7 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener +@@ -325,7 +325,7 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener result.write(buffer, 0, length); length = inputStream.read(buffer); } @@ -11240,7 +12370,7 @@ import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -41,7 +45,6 @@ import java.util.Map; +@@ -42,7 +46,6 @@ import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -11248,7 +12378,7 @@ import java.util.stream.Stream; /** Responsible for walking an abstract syntax tree and notifying interested checks at each node. */ -@@ -371,7 +374,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe +@@ -435,7 +438,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe resource -> { return ((ExternalResourceHolder) resource).getExternalResourceLocations().stream(); }) @@ -11257,7 +12387,7 @@ } /** -@@ -403,7 +406,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe +@@ -467,7 +470,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe private static SortedSet createNewCheckSortedSet() { return new TreeSet<>( Comparator.comparing(check -> check.getClass().getName()) @@ -11565,7 +12695,7 @@ && Objects.equals(bundle, violation.bundle) --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java -@@ -265,8 +265,8 @@ public class AvoidEscapedUnicodeCharactersCheck extends AbstractCheck { +@@ -266,8 +266,8 @@ public class AvoidEscapedUnicodeCharactersCheck extends AbstractCheck { } // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 @@ -11784,7 +12914,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -@@ -162,7 +163,7 @@ public class SuppressWarningsCheck extends AbstractCheck { +@@ -166,7 +167,7 @@ public class SuppressWarningsCheck extends AbstractCheck { final DetailAST token = warningHolder.findFirstToken(TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR); // case like '@SuppressWarnings(value = UNUSED)' @@ -11793,7 +12923,7 @@ DetailAST warning = parent.findFirstToken(TokenTypes.EXPR); // rare case with empty array ex: @SuppressWarnings({}) -@@ -242,10 +243,10 @@ public class SuppressWarningsCheck extends AbstractCheck { +@@ -246,10 +247,10 @@ public class SuppressWarningsCheck extends AbstractCheck { final DetailAST annValuePair = annotation.findFirstToken(TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR); @@ -11806,6 +12936,34 @@ } /** +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ConstructorsDeclarationGroupingCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ConstructorsDeclarationGroupingCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.stream.Collectors.toUnmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -26,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import java.util.ArrayList; + import java.util.List; + import java.util.Optional; +-import java.util.stream.Collectors; + + /** + *
Checks that all constructors are grouped together. If there is any non-constructor code +@@ -106,7 +107,7 @@ public class ConstructorsDeclarationGroupingCheck extends AbstractCheck { + final List constructorsToLog = + childrenAfterFirstNonConstructor.stream() + .filter(ConstructorsDeclarationGroupingCheck::isConstructor) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + + // find the last grouped constructor + final DetailAST lastGroupedConstructor = --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java @@ -19,12 +19,13 @@ @@ -11841,18 +12999,6 @@ } /** ---- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java -+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java -@@ -370,7 +370,7 @@ public class FallThroughCheck extends AbstractCheck { - return Optional.ofNullable(getNextNonCommentAst(ast)) - .map(DetailAST::getPreviousSibling) - .map(previous -> previous.getFirstChild().getText()) -- .map(text -> reliefPattern.matcher(text).find()) -- .orElse(Boolean.FALSE); -+ .filter(text -> reliefPattern.matcher(text).find()) -+ .isPresent(); - } - } --- 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 @@ @@ -11871,7 +13017,7 @@ -import java.util.stream.Collectors; /** - * Checks that certain exception types do not appear in a {@code catch} statement. + *
Checks that certain exception types do not appear in a {@code catch} statement.
@@ -74,7 +75,7 @@ public final class IllegalCatchCheck extends AbstractCheck { "java.lang.RuntimeException", "java.lang.Throwable", @@ -11899,7 +13045,7 @@ -import java.util.stream.Collectors; /** - * Checks for illegal instantiations where a factory method is preferred. + *
Checks for illegal instantiations where a factory method is preferred.
@@ -314,6 +315,6 @@ public class IllegalInstantiationCheck extends AbstractCheck { * @since 3.0 */ @@ -11926,7 +13072,7 @@ -import java.util.stream.Collectors; /** - * Checks that specified types are not declared to be thrown. Declaring that a method throws {@code + *
Checks that specified types are not declared to be thrown. Declaring that a method throws @@ -69,7 +70,7 @@ public final class IllegalThrowsCheck extends AbstractCheck { new String[] { "finalize", @@ -11963,7 +13109,7 @@ import java.util.regex.Pattern; /** -@@ -125,7 +127,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { +@@ -124,7 +126,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { * @since 3.2 */ public void setMessage(String message) { @@ -11972,7 +13118,7 @@ } /** -@@ -157,7 +159,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { +@@ -156,7 +158,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { private void updateRegexp() { final int compileFlags; if (ignoreCase) { @@ -12009,6 +13155,33 @@ } catch (XPathException ex) { throw new IllegalStateException("Evaluation of Xpath query failed: " + query, ex); } +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheck.java +@@ -19,13 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.Collections.unmodifiableList; ++ + 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.TokenUtil; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Optional; + +@@ -111,7 +112,7 @@ public class MissingNullCaseInSwitchCheck extends AbstractCheck { + TokenUtil.forEachChild(ast, TokenTypes.LITERAL_CASE, caseLabels::add); + ast = ast.getNextSibling(); + } +- return Collections.unmodifiableList(caseLabels); ++ return unmodifiableList(caseLabels); + } + + /** --- 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,8 @@ @@ -12027,8 +13200,8 @@ -import java.util.stream.Collectors; /** - * Checks that for loop control variables are not modified inside the for block. An example is: -@@ -295,7 +296,7 @@ public final class ModifiedControlVariableCheck extends AbstractCheck { + *
Checks that for loop control variables are not modified inside the for block. An example +@@ -296,7 +297,7 @@ public final class ModifiedControlVariableCheck extends AbstractCheck { final Set iteratingVariables = getForIteratorVariables(ast); return initializedVariables.stream() .filter(iteratingVariables::contains) @@ -12064,6 +13237,34 @@ } @Override +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -26,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.regex.Pattern; + +@@ -636,7 +637,7 @@ public class UnnecessaryParenthesesCheck extends AbstractCheck { + } + directChild = directChild.getNextSibling(); + } +- return Collections.unmodifiableList(surroundedChildren); ++ return unmodifiableList(surroundedChildren); + } + + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheck.java @@ -19,6 +19,8 @@ @@ -12082,8 +13283,8 @@ -import java.util.stream.Collectors; /** - * Checks that a local variable is declared and/or assigned, but not used. Doesn't support Checks that a local variable is declared and/or assigned, but not used. Doesn't support { return hasSameNameAsSuperClass(superClassName, typeDeclDesc); }) @@ -12091,6 +13292,33 @@ + .collect(toUnmodifiableList()); } + /** +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/WhenShouldBeUsedCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/WhenShouldBeUsedCheck.java +@@ -19,13 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.Collections.unmodifiableList; ++ + 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.TokenUtil; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + + /** +@@ -120,7 +121,7 @@ public class WhenShouldBeUsedCheck extends AbstractCheck { + blockStatements.add(ast); + ast = ast.getNextSibling(); + } +- return Collections.unmodifiableList(blockStatements); ++ return unmodifiableList(blockStatements); + } + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java @@ -12117,7 +13345,7 @@ -import java.util.stream.Collectors; /** - * Checks that classes are designed for extension (subclass creation). + *
Checks that classes are designed for extension (subclass creation).
@@ -180,7 +181,7 @@ public class DesignForExtensionCheck extends AbstractCheck { new String[] { "Test", "Before", "After", "BeforeClass", "AfterClass", @@ -12166,6 +13394,31 @@ return innerClasses.entrySet().stream() .filter(entry -> entry.getKey().endsWith(dotAndClassName)) .map(Map.Entry::getValue) +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheck.java +@@ -19,12 +19,12 @@ + + package com.puppycrawl.tools.checkstyle.checks.design; + ++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; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil; +-import java.util.Collections; + import java.util.Set; + + /** +@@ -86,7 +86,7 @@ public class HideUtilityClassConstructorCheck extends AbstractCheck { + * target class has annotations specified with their simple names, this property should contain + * the annotations with the same simple names. + */ +- private Set ignoreAnnotatedBy = Collections.emptySet(); ++ private Set ignoreAnnotatedBy = ImmutableSet.of(); + + /** + * Setter to ignore classes annotated with the specified annotation(s). Annotation names provided --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java @@ -19,11 +19,12 @@ @@ -12181,8 +13434,8 @@ -import java.util.Objects; /** - * Restricts throws statements to a specified count. Methods with "Override" or "java.lang.Override" -@@ -167,7 +168,7 @@ public final class ThrowsCountCheck extends AbstractCheck { + *
Restricts throws statements to a specified count. Methods with "Override" or +@@ -168,7 +169,7 @@ public final class ThrowsCountCheck extends AbstractCheck { */ private static String getAnnotationName(DetailAST annotation) { final DetailAST dotAst = annotation.findFirstToken(TokenTypes.DOT); @@ -12210,7 +13463,7 @@ -import java.util.stream.Collectors; /** - * Checks visibility of class members. Only static final, immutable or annotated by specified + *
Checks visibility of class members. Only static final, immutable or annotated by specified @@ -152,7 +154,7 @@ public class VisibilityModifierCheck extends AbstractCheck { /** Default ignore annotations canonical names. */ @@ -12241,15 +13494,7 @@ import com.puppycrawl.tools.checkstyle.PropertyType; import com.puppycrawl.tools.checkstyle.XdocsPropertyType; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; -@@ -35,7 +38,6 @@ import java.net.URI; - import java.nio.charset.Charset; - import java.nio.charset.UnsupportedCharsetException; - import java.util.ArrayList; --import java.util.Collections; - import java.util.List; - import java.util.Set; - import java.util.regex.Pattern; -@@ -116,10 +118,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck +@@ -115,10 +118,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck * @throws IllegalArgumentException if header has already been set */ private void checkHeaderNotInitialized() { @@ -12263,15 +13508,15 @@ } /** -@@ -190,9 +191,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck +@@ -189,9 +191,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck final Set result; if (headerFile == null) { -- result = Collections.emptySet(); +- result = Set.of(); + result = ImmutableSet.of(); } else { -- result = Collections.singleton(headerFile.toString()); -+ result = ImmutableSet.of(headerFile.toString()); +- result = Set.of(headerFile.toASCIIString()); ++ result = ImmutableSet.of(headerFile.toASCIIString()); } return result; @@ -12333,15 +13578,7 @@ import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -27,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.api.ExternalResourceHolder; - import com.puppycrawl.tools.checkstyle.api.FullIdent; - import com.puppycrawl.tools.checkstyle.api.TokenTypes; - import java.net.URI; --import java.util.Collections; - import java.util.Set; - import java.util.regex.Pattern; - -@@ -167,8 +167,8 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc +@@ -166,8 +167,8 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc } // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 @@ -12351,12 +13588,12 @@ public void beginTree(DetailAST rootAST) { currentImportControl = null; processCurrentFile = path.matcher(getFilePath()).find(); -@@ -207,7 +207,7 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc +@@ -206,7 +207,7 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc @Override public Set getExternalResourceLocations() { -- return Collections.singleton(file.toString()); -+ return ImmutableSet.of(file.toString()); +- return Set.of(file.toASCIIString()); ++ return ImmutableSet.of(file.toASCIIString()); } /** @@ -12371,7 +13608,7 @@ import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; -@@ -658,9 +660,7 @@ public class ImportOrderCheck extends AbstractCheck { +@@ -674,9 +676,7 @@ public class ImportOrderCheck extends AbstractCheck { // matches any package grp = Pattern.compile(""); } else if (pkg.startsWith(FORWARD_SLASH)) { @@ -12384,16 +13621,18 @@ } else { --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java -@@ -19,6 +19,8 @@ +@@ -19,6 +19,10 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; ++import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toUnmodifiableList; ++import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser; import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseErrorMessage; import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseStatus; -@@ -36,7 +38,6 @@ import java.util.HashSet; +@@ -36,7 +40,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -12401,7 +13640,7 @@ /** * Base class for Checks that process Javadoc comments. -@@ -182,9 +183,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { +@@ -183,9 +186,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { validateDefaultJavadocTokens(); if (javadocTokens.isEmpty()) { javadocTokens.addAll( @@ -12412,6 +13651,33 @@ } else { final int[] acceptableJavadocTokens = getAcceptableJavadocTokens(); Arrays.sort(acceptableJavadocTokens); +@@ -211,13 +212,13 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { + */ + private void validateDefaultJavadocTokens() { + final Set defaultTokens = +- Arrays.stream(getDefaultJavadocTokens()).boxed().collect(Collectors.toUnmodifiableSet()); ++ Arrays.stream(getDefaultJavadocTokens()).boxed().collect(toUnmodifiableSet()); + + final List missingRequiredTokenNames = + Arrays.stream(getRequiredJavadocTokens()) + .boxed() + .filter(token -> !defaultTokens.contains(token)) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + + if (!missingRequiredTokenNames.isEmpty()) { + final String message = +@@ -226,9 +227,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { + "Javadoc Token \"%s\" from required javadoc " + + "tokens was not found in default " + + "javadoc tokens list in check %s", +- missingRequiredTokenNames.stream() +- .map(String::valueOf) +- .collect(Collectors.joining(", ")), ++ missingRequiredTokenNames.stream().map(String::valueOf).collect(joining(", ")), + getClass().getName()); + throw new IllegalStateException(message); + } --- 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,6 +19,8 @@ @@ -12430,7 +13696,7 @@ -import java.util.stream.Collectors; /** - * Checks that a Checks that a Validates abbreviations (consecutive capital letters) length in identifier name, it also @@ -199,8 +200,7 @@ public class AbbreviationAsWordInNameCheck extends AbstractCheck { */ public void setAllowedAbbreviations(String... allowedAbbreviations) { @@ -12811,7 +14088,7 @@ -import java.util.Objects; /** - * Checks lambda parameter names. + *
Checks lambda parameter names.
@@ -70,7 +69,7 @@ public class LambdaParameterNameCheck extends AbstractNameCheck { public void visitToken(DetailAST ast) { final boolean isInSwitchRule = ast.getParent().getType() == TokenTypes.SWITCH_RULE; @@ -12884,16 +14161,16 @@ import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; -@@ -151,7 +154,7 @@ public class RegexpCheck extends AbstractCheck { - private int errorCount; +@@ -145,7 +148,7 @@ public class RegexpCheck extends AbstractCheck { + private boolean checkForDuplicates; /** Specify the pattern to match against. */ - private Pattern format = Pattern.compile("^$", Pattern.MULTILINE); + private Pattern format = Pattern.compile("^$", MULTILINE); - /** The matcher. */ - private Matcher matcher; -@@ -218,7 +221,7 @@ public class RegexpCheck extends AbstractCheck { + /** + * Setter to specify message which is used to notify about violations, if empty then the default +@@ -209,7 +212,7 @@ public class RegexpCheck extends AbstractCheck { * @since 4.0 */ public final void setFormat(Pattern pattern) { @@ -12902,18 +14179,8 @@ } @Override -@@ -237,8 +240,8 @@ public class RegexpCheck extends AbstractCheck { - } - - // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 -- @SuppressWarnings("deprecation") - @Override -+ @SuppressWarnings("deprecation") - public void beginTree(DetailAST rootAST) { - matcher = format.matcher(getFileContents().getText().getFullText()); - matchCount = 0; -@@ -336,7 +339,7 @@ public class RegexpCheck extends AbstractCheck { - private String getMessage() { +@@ -314,7 +317,7 @@ public class RegexpCheck extends AbstractCheck { + private String getMessage(int errorCount) { String msg; - if (message == null || message.isEmpty()) { @@ -12939,7 +14206,7 @@ -import java.util.regex.Pattern; /** - * Checks that a specified pattern matches across multiple lines in any file type. + *
Checks that a specified pattern matches across multiple lines in any file type.
@@ -121,9 +123,9 @@ public class RegexpMultilineCheck extends AbstractFileSetCheck { final int result; @@ -12964,6 +14231,32 @@ public void beginTree(DetailAST rootAST) { MatchSuppressor suppressor = null; if (ignoreComments) { +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheck.java +@@ -19,13 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.checks.sizes; + ++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; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.util.Collections; + import java.util.Set; + + /** +@@ -72,7 +72,7 @@ public class ParameterNumberCheck extends AbstractCheck { + private boolean ignoreOverriddenMethods; + + /** Ignore methods and constructors annotated with the specified annotation(s). */ +- private Set ignoreAnnotatedBy = Collections.emptySet(); ++ private Set ignoreAnnotatedBy = ImmutableSet.of(); + + /** + * Setter to specify the maximum number of parameters allowed. --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElement.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElement.java @@ -19,7 +19,8 @@ @@ -12998,7 +14291,7 @@ && 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 +@@ -484,7 +484,7 @@ public class SuppressionCommentFilter extends AbstractAutomaticBean implements T final Tag tag = (Tag) other; return Objects.equals(line, tag.line) && Objects.equals(column, tag.column) @@ -13454,7 +14747,7 @@ "SuppressWithNearbyCommentFilter.fileContents", "SuppressionCommentFilter.fileContents"); /** Properties that can not be gathered from class instance. */ -@@ -291,27 +297,25 @@ public final class SiteUtil { +@@ -294,27 +300,25 @@ public final class SiteUtil { /** Path to main source code folder. */ private static final String MAIN_FOLDER_PATH = @@ -13490,7 +14783,7 @@ .toString())); /** Private utility constructor. */ -@@ -472,7 +476,7 @@ public final class SiteUtil { +@@ -475,7 +479,7 @@ public final class SiteUtil { * @throws MacroExecutionException if an I/O error occurs. */ public static Set getXdocsTemplatesFilePaths() throws MacroExecutionException { @@ -13499,7 +14792,7 @@ try (Stream stream = Files.find( directory, -@@ -480,7 +484,7 @@ public final class SiteUtil { +@@ -483,7 +487,7 @@ public final class SiteUtil { (path, attr) -> { return attr.isRegularFile() && path.toString().endsWith(".xml.template"); })) { @@ -13508,7 +14801,7 @@ } catch (IOException ioException) { throw new MacroExecutionException("Failed to find xdocs templates", ioException); } -@@ -507,7 +511,7 @@ public final class SiteUtil { +@@ -510,7 +514,7 @@ public final class SiteUtil { } // If parent class is not found, check interfaces @@ -13517,7 +14810,7 @@ final Class[] interfaces = moduleClass.getInterfaces(); for (Class interfaceClass : interfaces) { parentModuleName = CLASS_TO_PARENT_MODULE.get(interfaceClass); -@@ -517,7 +521,7 @@ public final class SiteUtil { +@@ -520,7 +524,7 @@ public final class SiteUtil { } } @@ -13526,7 +14819,7 @@ final String message = String.format( Locale.ROOT, "Failed to find parent module for %s", moduleClass.getSimpleName()); -@@ -541,7 +545,7 @@ public final class SiteUtil { +@@ -544,7 +548,7 @@ public final class SiteUtil { prop -> { return !isGlobalProperty(clss, prop) && !isUndocumentedProperty(clss, prop); }) @@ -13535,7 +14828,7 @@ properties.addAll(getNonExplicitProperties(instance, clss)); return new TreeSet<>(properties); } -@@ -660,7 +664,7 @@ public final class SiteUtil { +@@ -663,7 +667,7 @@ public final class SiteUtil { treeWalkerConfig.addChild(scraperCheckConfig); try { checker.configure(defaultConfiguration); @@ -13544,7 +14837,7 @@ checker.process(filesToProcess); checker.destroy(); } catch (CheckstyleException checkstyleException) { -@@ -983,9 +987,7 @@ public final class SiteUtil { +@@ -986,9 +990,7 @@ public final class SiteUtil { if (value != null && Array.getLength(value) > 0) { result = removeSquareBrackets( @@ -13555,7 +14848,7 @@ } if (result.isEmpty()) { -@@ -1017,8 +1019,7 @@ public final class SiteUtil { +@@ -1020,8 +1022,7 @@ public final class SiteUtil { result = ""; } else { try (Stream valuesStream = getValuesStream(value)) { @@ -13565,7 +14858,7 @@ } } -@@ -1059,10 +1060,7 @@ public final class SiteUtil { +@@ -1062,10 +1063,7 @@ public final class SiteUtil { private static String getIntArrayPropertyValue(Object value) { try (IntStream stream = getIntStream(value)) { String result = @@ -13577,7 +14870,7 @@ if (result.isEmpty()) { result = CURLY_BRACKETS; } -@@ -1168,11 +1166,11 @@ public final class SiteUtil { +@@ -1170,11 +1168,11 @@ public final class SiteUtil { */ public static List getDifference(int[] tokens, int... subtractions) { final Set subtractionsSet = @@ -13591,7 +14884,7 @@ } /** -@@ -1219,7 +1217,7 @@ public final class SiteUtil { +@@ -1221,7 +1219,7 @@ public final class SiteUtil { throw new MacroExecutionException("Failed to get parent path for " + templatePath); } return templatePathParent @@ -13759,7 +15052,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -@@ -235,8 +233,8 @@ public final class CommonUtil { +@@ -236,8 +234,8 @@ public final class CommonUtil { if (baseDirectory == null) { resultPath = path; } else { @@ -13770,7 +15063,7 @@ resultPath = pathBase.relativize(pathAbsolute).toString(); } return resultPath; -@@ -447,7 +445,7 @@ public final class CommonUtil { +@@ -461,7 +459,7 @@ public final class CommonUtil { * extension. */ public static String getFileExtension(String fileNameWithExtension) { @@ -13779,7 +15072,7 @@ final int dotIndex = fileName.lastIndexOf('.'); final String extension; if (dotIndex == -1) { -@@ -506,7 +504,7 @@ public final class CommonUtil { +@@ -520,7 +518,7 @@ public final class CommonUtil { * @return true if the arg is blank. */ public static boolean isBlank(String value) { @@ -13883,15 +15176,15 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.lang.reflect.Field; -@@ -31,7 +35,6 @@ import java.util.Optional; - import java.util.ResourceBundle; +@@ -32,7 +36,6 @@ import java.util.ResourceBundle; + import java.util.Set; import java.util.function.Consumer; import java.util.function.Predicate; -import java.util.stream.Collectors; import java.util.stream.IntStream; /** Contains utility methods for tokens. */ -@@ -91,7 +94,7 @@ public final class TokenUtil { +@@ -92,7 +95,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) @@ -13900,7 +15193,7 @@ } /** -@@ -102,7 +105,7 @@ public final class TokenUtil { +@@ -103,7 +106,7 @@ public final class TokenUtil { */ public static Map invertMap(Map map) { return map.entrySet().stream() @@ -13909,7 +15202,7 @@ } /** -@@ -134,9 +137,7 @@ public final class TokenUtil { +@@ -135,9 +138,7 @@ public final class TokenUtil { */ public static String getTokenName(int id) { final String name = TOKEN_VALUE_TO_NAME.get(id); @@ -13920,7 +15213,7 @@ return name; } -@@ -149,10 +150,7 @@ public final class TokenUtil { +@@ -150,10 +151,7 @@ public final class TokenUtil { */ public static int getTokenId(String name) { final Integer id = TOKEN_NAME_TO_VALUE.get(name); @@ -13932,7 +15225,7 @@ return id; } -@@ -164,10 +162,9 @@ public final class TokenUtil { +@@ -165,10 +163,9 @@ public final class TokenUtil { * @throws IllegalArgumentException when name is unknown */ public static String getShortDescription(String name) { @@ -13946,7 +15239,7 @@ final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes"; final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes, Locale.ROOT); -@@ -332,7 +329,7 @@ public final class TokenUtil { +@@ -344,7 +341,7 @@ public final class TokenUtil { public static BitSet asBitSet(String... tokens) { return Arrays.stream(tokens) .map(String::trim) @@ -13973,7 +15266,7 @@ -import java.util.stream.Collectors; /** - * Note: it simply wraps the existing JDK methods to provide a workaround for Pitest survival on + *
Note: it simply wraps the existing JDK methods to provide a workaround for Pitest survival @@ -57,7 +59,7 @@ public final class UnmodifiableCollectionUtil { * @return An unmodifiable List containing elements of the specified type. */ @@ -14081,10 +15374,10 @@ import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; + import javax.annotation.Nullable; /** - * Generates xpath queries. Xpath queries are generated based on received {@code DetailAst} element, -@@ -145,7 +146,7 @@ public class XpathQueryGenerator { +@@ -146,7 +147,7 @@ public class XpathQueryGenerator { public List generate() { return getMatchingAstElements().stream() .map(XpathQueryGenerator::generateXpathQuery) @@ -14095,7 +15388,23 @@ /** --- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBeanTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBeanTest.java -@@ -34,9 +34,9 @@ import org.apache.commons.beanutils.ConvertUtilsBean; +@@ -20,7 +20,9 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableList; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.Scope; + import com.puppycrawl.tools.checkstyle.api.SeverityLevel; +@@ -30,15 +32,14 @@ import java.net.URI; + import java.util.Arrays; + import java.util.List; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import org.apache.commons.beanutils.ConversionException; + import org.apache.commons.beanutils.ConvertUtilsBean; import org.apache.commons.beanutils.Converter; import org.junit.jupiter.api.Test; @@ -14107,7 +15416,7 @@ final TestBean testBean = new TestBean(); final DefaultConfiguration conf = new DefaultConfiguration("testConf"); conf.addProperty("NonExistent", "doesn't matter"); -@@ -53,7 +53,7 @@ public class AbstractAutomaticBeanTest { +@@ -55,7 +56,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14116,7 +15425,7 @@ final TestBean testBean = new TestBean(); final DefaultConfiguration conf = new DefaultConfiguration("testConf"); conf.addProperty("privateField", "doesn't matter"); -@@ -70,7 +70,7 @@ public class AbstractAutomaticBeanTest { +@@ -72,7 +73,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14125,7 +15434,7 @@ final TestBean testBean = new TestBean(); testBean.configure(new DefaultConfiguration("bean config")); testBean.setupChild(null); -@@ -90,7 +90,7 @@ public class AbstractAutomaticBeanTest { +@@ -92,7 +93,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14134,7 +15443,7 @@ final TestBean testBean = new TestBean(); final DefaultConfiguration parentConf = new DefaultConfiguration("parentConf"); final DefaultConfiguration childConf = new DefaultConfiguration("childConf"); -@@ -111,7 +111,7 @@ public class AbstractAutomaticBeanTest { +@@ -113,7 +114,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14143,7 +15452,7 @@ final TestBean testBean = new TestBean(); final DefaultContext context = new DefaultContext(); context.add("exceptionalMethod", 123.0f); -@@ -132,7 +132,7 @@ public class AbstractAutomaticBeanTest { +@@ -134,7 +135,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14152,7 +15461,7 @@ final TestBean testBean = new TestBean(); final DefaultContext context = new DefaultContext(); context.add("val", "some string"); -@@ -153,7 +153,7 @@ public class AbstractAutomaticBeanTest { +@@ -155,7 +156,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14161,7 +15470,7 @@ final TestBean testBean = new TestBean(); testBean.setVal(0); testBean.setWrong("wrongVal"); -@@ -170,7 +170,7 @@ public class AbstractAutomaticBeanTest { +@@ -172,7 +173,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14170,7 +15479,7 @@ final ConvertUtilsBeanStub convertUtilsBean = new ConvertUtilsBeanStub(); TestUtil.invokeStaticMethod( AbstractAutomaticBean.class, "registerIntegralTypes", convertUtilsBean); -@@ -180,7 +180,7 @@ public class AbstractAutomaticBeanTest { +@@ -182,7 +183,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14179,7 +15488,7 @@ final ConverterBean bean = new ConverterBean(); // methods are not seen as used by reflection -@@ -214,7 +214,7 @@ public class AbstractAutomaticBeanTest { +@@ -216,7 +217,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14188,7 +15497,7 @@ final ConverterBean bean = new ConverterBean(); final DefaultConfiguration config = new DefaultConfiguration("bean"); config.addProperty("uri", ""); -@@ -224,7 +224,7 @@ public class AbstractAutomaticBeanTest { +@@ -226,7 +227,7 @@ public class AbstractAutomaticBeanTest { } @Test @@ -14197,6 +15506,53 @@ final ConverterBean bean = new ConverterBean(); final DefaultConfiguration config = new DefaultConfiguration("bean"); config.addProperty("uri", "BAD"); +@@ -243,7 +244,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testBeanConverterPatternArray() throws Exception { ++ void beanConverterPatternArray() throws Exception { + final ConverterBean bean = new ConverterBean(); + final DefaultConfiguration config = new DefaultConfiguration("bean"); + final String patternString = "^a*$ , ^b*$ , ^c*$ "; +@@ -252,7 +253,7 @@ public class AbstractAutomaticBeanTest { + bean.configure(config); + + final List actualPatternStrings = +- Arrays.stream(bean.patterns).map(Pattern::pattern).collect(Collectors.toUnmodifiableList()); ++ Arrays.stream(bean.patterns).map(Pattern::pattern).collect(toUnmodifiableList()); + + assertWithMessage("invalid size of result").that(bean.patterns).hasLength(3); + assertWithMessage("invalid result") +@@ -261,16 +262,16 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testBeanConverterPatternArraySingleElement() throws Exception { ++ void beanConverterPatternArraySingleElement() throws Exception { + final ConverterBean bean = new ConverterBean(); + final DefaultConfiguration config = new DefaultConfiguration("bean"); + final String patternString = "^a*$"; +- final List expectedPatternStrings = List.of("^a*$"); ++ final List expectedPatternStrings = ImmutableList.of("^a*$"); + config.addProperty("patterns", patternString); + bean.configure(config); + + final List actualPatternStrings = +- Arrays.stream(bean.patterns).map(Pattern::pattern).collect(Collectors.toUnmodifiableList()); ++ Arrays.stream(bean.patterns).map(Pattern::pattern).collect(toUnmodifiableList()); + + assertWithMessage("invalid size of result").that(bean.patterns).hasLength(1); + assertWithMessage("invalid result") +@@ -279,7 +280,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testBeanConverterPatternArrayEmptyString() throws Exception { ++ void beanConverterPatternArrayEmptyString() throws Exception { + final ConverterBean bean = new ConverterBean(); + final DefaultConfiguration config = new DefaultConfiguration("bean"); + config.addProperty("patterns", ""); --- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java @@ -20,7 +20,11 @@ @@ -14219,7 +15575,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport { -@@ -422,8 +425,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -459,8 +462,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport */ protected final void execute(Configuration config, String... filenames) throws Exception { final Checker checker = createChecker(config); @@ -14229,7 +15585,7 @@ checker.process(files); checker.destroy(); } -@@ -436,8 +438,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -473,8 +475,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport * @throws Exception if there is a problem during checker configuration */ protected static void execute(Checker checker, String... filenames) throws Exception { @@ -14239,7 +15595,7 @@ checker.process(files); checker.destroy(); } -@@ -458,11 +459,11 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -495,11 +496,11 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport actualViolations.stream() .map(violation -> violation.substring(0, violation.indexOf(':'))) .map(Integer::valueOf) @@ -14253,7 +15609,21 @@ assertWithMessage("Violation lines for %s differ.", file) .that(actualViolationLines) .isEqualTo(expectedViolationLines); -@@ -485,7 +486,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -523,11 +524,11 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport + actualViolations.stream() + .map(violation -> violation.substring(0, violation.indexOf(':'))) + .map(Integer::valueOf) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + final List expectedViolationLines = + testInputViolations.stream() + .map(TestInputViolation::getLineNo) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + assertWithMessage("Violation lines for %s differ.", file) + .that(actualViolationLines) + .isEqualTo(expectedViolationLines); +@@ -550,7 +551,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport throws Exception { stream.flush(); stream.reset(); @@ -14262,7 +15632,7 @@ final Checker checker = createChecker(config); final Map> actualViolations = getActualViolations(checker.process(files)); checker.destroy(); -@@ -504,8 +505,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -569,8 +570,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()); @@ -14272,7 +15642,7 @@ final Map> actualViolations = new HashMap<>(); for (String line = lnr.readLine(); line != null && lnr.getLineNumber() <= errorCount; -@@ -608,7 +608,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport +@@ -682,7 +682,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport protected static String[] removeSuppressed( String[] actualViolations, String... suppressedViolations) { final List actualViolationsList = @@ -14529,19 +15899,21 @@ 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 -@@ -25,7 +25,11 @@ import static com.puppycrawl.tools.checkstyle.DefaultLogger.AUDIT_FINISHED_MESSA +@@ -25,7 +25,13 @@ 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.Objects.requireNonNull; ++import static java.util.UUID.randomUUID; +import static java.util.stream.Collectors.toUnmodifiableList; +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; -@@ -72,7 +76,6 @@ import java.nio.charset.StandardCharsets; +@@ -74,17 +80,13 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; @@ -14549,15 +15921,27 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; -@@ -80,7 +83,6 @@ import java.util.Properties; +-import java.util.Objects; + import java.util.Properties; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; +-import java.util.UUID; -import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -@@ -117,7 +119,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -106,8 +108,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + private File createTempFile(String prefix, String suffix) throws IOException { +- final String name = +- Objects.requireNonNull(prefix) + UUID.randomUUID() + Objects.requireNonNull(suffix); ++ final String name = requireNonNull(prefix) + randomUUID() + requireNonNull(suffix); + return Files.createFile(temporaryFolder.toPath().resolve(name)).toFile(); + } + +@@ -131,7 +132,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14566,18 +15950,16 @@ final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); checker.addListener(auditAdapter); -@@ -131,8 +133,8 @@ public class CheckerTest extends AbstractModuleTestSupport { - // should remove all listeners, file sets, and filters +@@ -146,7 +147,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.destroy(); -- final File tempFile = File.createTempFile("junit", null, temporaryFolder); + final File tempFile = createTempFile("junit"); - checker.process(Collections.singletonList(tempFile)); -+ final File tempFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); + checker.process(ImmutableList.of(tempFile)); final SortedSet violations = new TreeSet<>(); violations.add( new Violation( -@@ -154,7 +156,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -168,7 +169,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14586,7 +15968,7 @@ final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); checker.addListener(auditAdapter); -@@ -210,7 +212,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -224,7 +225,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14595,7 +15977,7 @@ final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); final DebugAuditAdapter aa2 = new DebugAuditAdapter(); -@@ -267,21 +269,21 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -281,21 +282,21 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14620,7 +16002,7 @@ final Checker checker = new Checker(); final TestBeforeExecutionFileFilter filter = new TestBeforeExecutionFileFilter(); final TestBeforeExecutionFileFilter f2 = new TestBeforeExecutionFileFilter(); -@@ -290,7 +292,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -304,7 +305,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.removeBeforeExecutionFileFilter(filter); f2.resetFilter(); @@ -14629,7 +16011,7 @@ assertWithMessage("Checker.acceptFileStarted() doesn't call filter") .that(f2.wasCalled()) .isTrue(); -@@ -300,7 +302,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -314,7 +315,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14638,7 +16020,7 @@ final Checker checker = new Checker(); final DebugFilter filter = new DebugFilter(); -@@ -316,7 +318,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -330,7 +331,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14647,7 +16029,7 @@ final Checker checker = new Checker(); final DebugFilter filter = new DebugFilter(); final DebugFilter f2 = new DebugFilter(); -@@ -337,11 +339,12 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -351,7 +352,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14655,24 +16037,8 @@ + void fileExtensions() throws Exception { final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); - checkerConfig.addProperty( -- "cacheFile", File.createTempFile("junit", null, temporaryFolder).getPath()); -+ "cacheFile", -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath()); - - final Checker checker = new Checker(); - checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); -@@ -357,7 +360,8 @@ public class CheckerTest extends AbstractModuleTestSupport { - files.add(otherFile); - final String[] fileExtensions = {"java", "xml", "properties"}; - checker.setFileExtensions(fileExtensions); -- checker.setCacheFile(File.createTempFile("junit", null, temporaryFolder).getPath()); -+ checker.setCacheFile( -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath()); - final int counter = checker.process(files); - - // comparing to 1 as there is only one legal file in input -@@ -378,10 +382,10 @@ public class CheckerTest extends AbstractModuleTestSupport { + checkerConfig.addProperty("cacheFile", createTempFile("junit").getPath()); +@@ -391,7 +392,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14680,22 +16046,8 @@ + void ignoredFileExtensions() throws Exception { final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); -- final File tempFile = File.createTempFile("junit", null, temporaryFolder); -+ final File tempFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checkerConfig.addProperty("cacheFile", tempFile.getPath()); - - final Checker checker = new Checker(); -@@ -396,7 +400,8 @@ public class CheckerTest extends AbstractModuleTestSupport { - allIgnoredFiles.add(ignoredFile); - final String[] fileExtensions = {"java", "xml", "properties"}; - checker.setFileExtensions(fileExtensions); -- checker.setCacheFile(File.createTempFile("junit", null, temporaryFolder).getPath()); -+ checker.setCacheFile( -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath()); - final int counter = checker.process(allIgnoredFiles); - - // comparing to 0 as there is no legal file in input -@@ -413,7 +418,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + final File tempFile = createTempFile("junit"); +@@ -426,7 +427,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14704,7 +16056,15 @@ // all that is set by reflection, so just make code coverage be happy final Checker checker = new Checker(); checker.setBasedir("some"); -@@ -437,7 +442,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -450,14 +451,14 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetSeverity() throws Exception { ++ void setSeverity() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineXmlConfig(getPath("InputCheckerTestSeverity.java"), expected); } @Test @@ -14713,7 +16073,7 @@ final Checker checker = new Checker(); try { -@@ -451,7 +456,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -471,7 +472,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14722,7 +16082,7 @@ final Checker checker = new Checker(); final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); -@@ -465,7 +470,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -485,7 +486,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14731,7 +16091,7 @@ final Checker checker = new Checker(); final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); checker.setModuleClassLoader(contextClassLoader); -@@ -496,7 +501,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -516,7 +517,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14740,7 +16100,7 @@ final Checker checker = new Checker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -514,7 +519,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -534,7 +535,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14749,7 +16109,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); checkConfig.addProperty("$$No such property", null); try { -@@ -533,7 +538,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -553,7 +554,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14758,7 +16118,7 @@ final Checker checker = new Checker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -550,7 +555,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -570,7 +571,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14767,7 +16127,7 @@ final Checker checker = new Checker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -572,8 +577,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -592,8 +593,7 @@ public class CheckerTest extends AbstractModuleTestSupport { /** It is OK to have long test method name here as it describes the test purpose. */ @Test @@ -14777,20 +16137,7 @@ assertWithMessage("ExternalResourceHolder has changed his parent") .that(ExternalResourceHolder.class.isAssignableFrom(HiddenFieldCheck.class)) .isFalse(); -@@ -585,10 +589,10 @@ public class CheckerTest extends AbstractModuleTestSupport { - final DefaultConfiguration checkerConfig = createRootConfig(treeWalkerConfig); - checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); - -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checkerConfig.addProperty("cacheFile", cacheFile.getPath()); - -- final File tmpFile = File.createTempFile("file", ".java", temporaryFolder); -+ final File tmpFile = Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile(); - - execute(checkerConfig, tmpFile.getPath()); - final Properties cacheAfterFirstRun = new Properties(); -@@ -609,18 +613,18 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -629,7 +629,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14799,20 +16146,7 @@ final Checker checker = new Checker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); - checker.setModuleFactory(factory); - checker.configure(createModuleConfig(TranslationCheck.class)); - -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checker.setCacheFile(cacheFile.getPath()); - - checker.setupChild(createModuleConfig(TranslationCheck.class)); -- final File tmpFile = File.createTempFile("file", ".java", temporaryFolder); -+ final File tmpFile = Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile(); - final List files = new ArrayList<>(1); - files.add(tmpFile); - checker.process(files); -@@ -650,10 +654,10 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -670,7 +670,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14820,22 +16154,8 @@ + void clearExistingCache() throws Exception { final DefaultConfiguration checkerConfig = createRootConfig(null); checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checkerConfig.addProperty("cacheFile", cacheFile.getPath()); - - final Checker checker = new Checker(); -@@ -675,7 +679,8 @@ public class CheckerTest extends AbstractModuleTestSupport { - .that(cacheAfterClear.getProperty(PropertyCacheFile.CONFIG_HASH_KEY)) - .isNotNull(); - -- final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String pathToEmptyFile = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); - - // file that should be audited is not in cache - execute(checkerConfig, pathToEmptyFile); -@@ -698,12 +703,12 @@ public class CheckerTest extends AbstractModuleTestSupport { + final File cacheFile = createTempFile("junit"); +@@ -718,7 +718,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14844,13 +16164,7 @@ final DefaultConfiguration violationCheck = createModuleConfig(DummyFileSetViolationCheck.class); final DefaultConfiguration checkerConfig = new DefaultConfiguration("myConfig"); - checkerConfig.addProperty("charset", "UTF-8"); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checkerConfig.addProperty("cacheFile", cacheFile.getPath()); - checkerConfig.addChild(violationCheck); - final Checker checker = new Checker(); -@@ -711,7 +716,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -731,7 +731,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.configure(checkerConfig); checker.addListener(getBriefUtLogger()); @@ -14859,7 +16173,7 @@ checker.clearCache(); // invoke destroy to persist cache final PropertyCacheFile cache = TestUtil.getInternalState(checker, "cacheFile"); -@@ -726,7 +731,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -746,7 +746,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14868,7 +16182,7 @@ final Checker checker = new Checker(); checker.setFileExtensions(".test1", "test2"); final String[] actual = TestUtil.getInternalState(checker, "fileExtensions"); -@@ -736,7 +741,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -756,7 +756,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14877,7 +16191,7 @@ // The idea of the test is to check that when cache file is not set, // the invocation of clearCache method does not throw an exception. final Checker checker = new Checker(); -@@ -755,7 +760,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -775,7 +775,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @Test @@ -14886,7 +16200,7 @@ // Assume that I/O error is happened when we try to invoke 'lastModified()' method. final String errorMessage = "Java Virtual Machine is broken" -@@ -811,7 +816,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -831,7 +831,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @Test @@ -14895,7 +16209,7 @@ // Assume that I/O error is happened when we try to invoke 'lastModified()' method. final String errorMessage = "Java Virtual Machine is broken" -@@ -869,18 +874,18 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -889,8 +889,7 @@ public class CheckerTest extends AbstractModuleTestSupport { /** It is OK to have long test method name here as it describes the test purpose. */ @Test @@ -14905,20 +16219,7 @@ assertWithMessage("ExternalResourceHolder has changed its parent") .that(ExternalResourceHolder.class.isAssignableFrom(DummyFilter.class)) .isFalse(); - final DefaultConfiguration filterConfig = createModuleConfig(DummyFilter.class); - - final DefaultConfiguration checkerConfig = createRootConfig(filterConfig); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checkerConfig.addProperty("cacheFile", cacheFile.getPath()); - -- final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String pathToEmptyFile = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); - - execute(checkerConfig, pathToEmptyFile); - final Properties cacheAfterFirstRun = new Properties(); -@@ -915,8 +920,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -935,8 +934,7 @@ public class CheckerTest extends AbstractModuleTestSupport { /** It is OK to have long test method name here as it describes the test purpose. */ // -@cs[ExecutableStatementCount] This test needs to verify many things. @Test @@ -14928,55 +16229,25 @@ // Use case (https://github.com/checkstyle/checkstyle/pull/3092#issuecomment-218162436): // Imagine that cache exists in a file. New version of Checkstyle appear. // New release contains update to a some check to have additional external resource. -@@ -930,7 +934,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - check.setFirstExternalResourceLocation(firstExternalResourceLocation); - - final DefaultConfiguration checkerConfig = createRootConfig(null); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); - checkerConfig.addProperty("cacheFile", cacheFile.getPath()); - - final Checker checker = new Checker(); -@@ -940,7 +944,8 @@ public class CheckerTest extends AbstractModuleTestSupport { - checker.configure(checkerConfig); - checker.addListener(getBriefUtLogger()); - -- final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String pathToEmptyFile = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); - - execute(checker, pathToEmptyFile); - final Properties cacheAfterFirstRun = new Properties(); -@@ -996,7 +1001,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1016,7 +1014,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test - public void testClearLazyLoadCacheInDetailAST() throws Exception { + void clearLazyLoadCacheInDetailAST() throws Exception { - final DefaultConfiguration checkConfig1 = - createModuleConfig(CheckWhichDoesNotRequireCommentNodes.class); - final DefaultConfiguration checkConfig2 = -@@ -1015,8 +1020,8 @@ public class CheckerTest extends AbstractModuleTestSupport { + + final String filePath = getPath("InputCheckerClearDetailAstLazyLoadCache.java"); + +@@ -1025,7 +1023,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test - public void testCacheOnViolationSuppression() throws Exception { -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + void cacheOnViolationSuppression() throws Exception { -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); + final File cacheFile = createTempFile("junit"); final DefaultConfiguration violationCheck = createModuleConfig(DummyFileSetViolationCheck.class); - -@@ -1028,7 +1033,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - checkerConfig.addChild(filterConfig); - - final String fileViolationPath = -- File.createTempFile("ViolationFile", ".java", temporaryFolder).getPath(); -+ Files.createTempFile(temporaryFolder.toPath(), "ViolationFile", ".java").toFile().getPath(); - - execute(checkerConfig, fileViolationPath); - -@@ -1043,7 +1048,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1052,7 +1050,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -14985,18 +16256,16 @@ final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); final String filePath = getPath("InputChecker.java"); try { -@@ -1057,8 +1062,8 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1066,7 +1064,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test - public void testExceptionWithCache() throws Exception { -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + void exceptionWithCache() throws Exception { -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); + final File cacheFile = createTempFile("junit"); final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); - -@@ -1074,7 +1079,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1083,7 +1081,7 @@ public class CheckerTest extends AbstractModuleTestSupport { final String filePath = getPath("InputChecker.java"); try { @@ -15005,29 +16274,25 @@ assertWithMessage("Exception is expected").fail(); } catch (CheckstyleException ex) { assertWithMessage("Error message is not expected") -@@ -1102,8 +1107,8 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1111,7 +1109,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @Test - public void testCatchErrorWithCache() throws Exception { -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + void catchErrorWithCache() throws Exception { -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); + final File cacheFile = createTempFile("junit"); final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); - checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); -@@ -1178,8 +1183,8 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1187,7 +1185,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @Test - public void testCatchErrorWithCacheWithNoFileName() throws Exception { -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + void catchErrorWithCacheWithNoFileName() throws Exception { -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); + final File cacheFile = createTempFile("junit"); final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); - checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); -@@ -1249,7 +1254,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1258,7 +1256,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @Test @@ -15036,45 +16301,43 @@ final String errorMessage = "Security Exception"; final RuntimeException expectedError = new SecurityException(errorMessage); -@@ -1297,8 +1302,8 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1306,7 +1304,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @Test - public void testExceptionWithCacheAndNoFileName() throws Exception { -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + void exceptionWithCacheAndNoFileName() throws Exception { -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); + final File cacheFile = createTempFile("junit"); final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); - checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); -@@ -1356,7 +1361,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1365,7 +1363,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test - public void testHaltOnExceptionOff() throws Exception { + void haltOnExceptionOff() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); - - final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); -@@ -1376,7 +1381,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + final String filePath = getPath("InputChecker.java"); + final String[] expected = { + "1: " + getCheckMessage(EXCEPTION_MSG, "java.lang.IndexOutOfBoundsException: test"), +@@ -1375,7 +1373,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test - public void testTabViolationDefault() throws Exception { + void tabViolationDefault() throws Exception { final String[] expected = { - "10:17: violation", "13:33: violation", + "17:17: violation", "21:49: violation", }; -@@ -1384,7 +1389,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1383,7 +1381,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test -- public void testTabViolation() throws Exception { -+ void tabViolation() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(VerifyPositionAfterTabFileSet.class); - final DefaultConfiguration checkerConfig = createRootConfig(checkConfig); -@@ -1396,11 +1401,11 @@ public class CheckerTest extends AbstractModuleTestSupport { +- public void testTabViolationCustomWidth() throws Exception { ++ void tabViolationCustomWidth() throws Exception { + final String[] expected = { + "18:17: violation", "22:37: violation", + }; +@@ -1392,11 +1390,11 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -15088,7 +16351,7 @@ final List expected = Arrays.asList("beginProcessing", "finishProcessing", "destroy"); assertWithMessage("Method calls were not expected") .that(fileSet.getMethodCalls()) -@@ -1408,7 +1413,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1404,7 +1402,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -15097,7 +16360,7 @@ final DummyFileSet fileSet = new DummyFileSet(); final Checker checker = new Checker(); checker.addFileSetCheck(fileSet); -@@ -1418,7 +1423,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1414,7 +1412,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -15106,7 +16369,7 @@ final Checker checker = new Checker(); final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); final PackageObjectFactory factory = -@@ -1435,14 +1440,14 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1431,14 +1429,14 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.setModuleFactory(factory); checker.setupChild(createModuleConfig(DebugAuditAdapter.class)); // Let's try fire some events @@ -15123,7 +16386,7 @@ final Checker checker = new Checker(); final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); final PackageObjectFactory factory = -@@ -1458,14 +1463,14 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1454,14 +1452,14 @@ public class CheckerTest extends AbstractModuleTestSupport { }; checker.setModuleFactory(factory); checker.setupChild(createModuleConfig(TestBeforeExecutionFileFilter.class)); @@ -15140,7 +16403,7 @@ final Checker checker = new Checker(); final DummyFileSet fileSet = new DummyFileSet(); final PackageObjectFactory factory = -@@ -1487,7 +1492,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1483,7 +1481,7 @@ public class CheckerTest extends AbstractModuleTestSupport { // -@cs[CheckstyleTestMakeup] must use raw class to directly initialize DefaultLogger @Test @@ -15149,16 +16412,7 @@ final Checker checker = new Checker(); try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = new CloseAndFlushTestByteArrayOutputStream(); -@@ -1501,7 +1506,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - testErrorOutputStream, - OutputStreamOptions.CLOSE)); - -- final File tmpFile = File.createTempFile("file", ".java", temporaryFolder); -+ final File tmpFile = Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile(); - - execute(checker, tmpFile.getPath()); - -@@ -1522,14 +1527,14 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1518,7 +1516,7 @@ public class CheckerTest extends AbstractModuleTestSupport { // -@cs[CheckstyleTestMakeup] must use raw class to directly initialize DefaultLogger @Test @@ -15167,15 +16421,7 @@ final Checker checker = new Checker(); try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = new CloseAndFlushTestByteArrayOutputStream()) { - checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader()); - checker.addListener(new XMLLogger(testInfoOutputStream, OutputStreamOptions.CLOSE)); - -- final File tmpFile = File.createTempFile("file", ".java", temporaryFolder); -+ final File tmpFile = Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile(); - - execute(checker, tmpFile.getPath(), tmpFile.getPath()); - -@@ -1543,7 +1548,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1539,7 +1537,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -15184,17 +16430,7 @@ // we need to test a module with two instances, one with id and the other not final DefaultConfiguration moduleConfig1 = createModuleConfig(NewlineAtEndOfFileCheck.class); final DefaultConfiguration moduleConfig2 = createModuleConfig(NewlineAtEndOfFileCheck.class); -@@ -1566,7 +1571,8 @@ public class CheckerTest extends AbstractModuleTestSupport { - new AuditEventDefaultFormatter()); - checker.addListener(logger); - -- final String path = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String path = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); - final String violationMessage = - getCheckMessage(NewlineAtEndOfFileCheck.class, MSG_KEY_NO_NEWLINE_EOF); - final String[] expected = { -@@ -1575,10 +1581,9 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1571,10 +1569,9 @@ public class CheckerTest extends AbstractModuleTestSupport { // super.verify does not work here, for we change the logger out.flush(); @@ -15207,7 +16443,7 @@ // we need to ignore the unrelated lines final List actual = lnr.lines() -@@ -1586,7 +1591,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1582,7 +1579,7 @@ public class CheckerTest extends AbstractModuleTestSupport { .filter(line -> !getCheckMessage(AUDIT_FINISHED_MESSAGE).equals(line)) .limit(expected.length) .sorted() @@ -15216,7 +16452,7 @@ Arrays.sort(expected); for (int i = 0; i < expected.length; i++) { -@@ -1603,7 +1608,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1599,7 +1596,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } @Test @@ -15225,42 +16461,43 @@ final Checker checker = createChecker(createModuleConfig(TranslationCheck.class)); final OutputStream infoStream = new ByteArrayOutputStream(); final OutputStream errorStream = new ByteArrayOutputStream(); -@@ -1612,11 +1617,13 @@ public class CheckerTest extends AbstractModuleTestSupport { - infoStream, OutputStreamOptions.CLOSE, - errorStream, OutputStreamOptions.CLOSE); - checker.addListener(loggerWithCounter); -- final File cacheFile = File.createTempFile("cacheFile", ".txt", temporaryFolder); -+ final File cacheFile = -+ Files.createTempFile(temporaryFolder.toPath(), "cacheFile", ".txt").toFile(); +@@ -1612,7 +1609,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.setCacheFile(cacheFile.getAbsolutePath()); -- final File testFile = File.createTempFile("testFile", ".java", temporaryFolder); + final File testFile = createTempFile("testFile", ".java"); - final List files = List.of(testFile, testFile); -+ final File testFile = -+ Files.createTempFile(temporaryFolder.toPath(), "testFile", ".java").toFile(); + final List files = ImmutableList.of(testFile, testFile); checker.process(files); assertWithMessage("Cached file should not be processed twice") -@@ -1628,7 +1635,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1623,7 +1620,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } - @SuppressForbidden @Test - public void testUnmappableCharacters() throws Exception { + void unmappableCharacters() throws Exception { final String[] expected = { - "4: " + getCheckMessage(LineLengthCheck.class, MSG_KEY, 75, 238), + "14: " + getCheckMessage(LineLengthCheck.class, MSG_KEY, 80, 225), }; -@@ -1643,7 +1650,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - } - +@@ -1639,7 +1636,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + */ + @SuppressForbidden @Test - public void testViolationMessageOnIoException() throws Exception { + void violationMessageOnIoException() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); -@@ -1930,7 +1937,7 @@ public class CheckerTest extends AbstractModuleTestSupport { +@@ -1668,7 +1665,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * complicate code. + */ + @Test +- public void testRelativizedFileExclusion() throws Exception { ++ void relativizedFileExclusion() throws Exception { + final DefaultConfiguration newLineAtEndOfFileConfig = + createModuleConfig(NewlineAtEndOfFileCheck.class); + +@@ -1944,7 +1941,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } public List getMethodCalls() { @@ -15570,13 +16807,22 @@ @@ -628,7 +627,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } + @Test +- public void testLoadConfigurationFromClassPathWithNonAsciiSymbolsInPath() throws Exception { ++ void loadConfigurationFromClassPathWithNonAsciiSymbolsInPath() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + ConfigurationLoader.loadConfiguration( +@@ -644,7 +643,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + @Test - public void testParsePropertyString() throws Exception { + void parsePropertyString() throws Exception { final List propertyRefs = new ArrayList<>(); final List fragments = new ArrayList<>(); -@@ -638,7 +637,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -654,7 +653,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -15585,7 +16831,7 @@ final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); final String fName = getPath("InputConfigurationLoaderChecks.xml"); -@@ -653,7 +652,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -669,7 +668,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { ConfigurationLoader.loadConfiguration( new InputSource( Files.newInputStream( @@ -15594,7 +16840,7 @@ new PropertiesExpander(new Properties()), ConfigurationLoader.IgnoredModulesOptions.EXECUTE); -@@ -663,7 +662,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -679,7 +678,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -15603,7 +16849,7 @@ try (MockedConstruction mocked = mockConstruction( DefaultConfiguration.class, -@@ -691,7 +690,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -707,7 +706,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -15612,7 +16858,7 @@ final String[] configFiles = { "InputConfigurationLoaderOldConfig0.xml", "InputConfigurationLoaderOldConfig1.xml", -@@ -707,7 +706,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -723,7 +722,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { final DefaultConfiguration config = (DefaultConfiguration) ConfigurationLoader.loadConfiguration( @@ -15621,7 +16867,7 @@ new PropertiesExpander(new Properties()), IgnoredModulesOptions.OMIT); -@@ -739,7 +738,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { +@@ -755,7 +754,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } @Test @@ -16324,7 +17570,7 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.FileContents; -@@ -37,13 +38,12 @@ import java.util.ArrayList; +@@ -38,14 +39,13 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; @@ -16334,12 +17580,13 @@ import org.antlr.v4.runtime.CommonTokenStream; import org.junit.jupiter.api.Test; + // -@cs[ClassDataAbstractionCoupling] No way to split up class usage. -public class JavaAstVisitorTest extends AbstractModuleTestSupport { +final class JavaAstVisitorTest extends AbstractModuleTestSupport { /** * If a visit method is not overridden, we should explain why we do not 'visit' the parse tree at -@@ -97,7 +97,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -94,7 +94,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } @Test @@ -16348,7 +17595,7 @@ final Method[] baseVisitMethods = JavaLanguageParserBaseVisitor.class.getDeclaredMethods(); final Method[] visitMethods = JavaAstVisitor.class.getDeclaredMethods(); -@@ -107,7 +107,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -104,7 +104,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { .filter(method -> method.getName().contains("visit")) .filter(method -> method.getModifiers() == Modifier.PUBLIC) .map(Method::getName) @@ -16357,7 +17604,7 @@ final Set filteredVisitMethodNames = Arrays.stream(visitMethods) -@@ -117,7 +117,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -114,7 +114,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { .filter(method -> !"visit".equals(method.getName())) .filter(method -> method.getModifiers() == Modifier.PUBLIC) .map(Method::getName) @@ -16366,7 +17613,7 @@ final String message = "Visit methods in 'JavaLanguageParserBaseVisitor' generated from " -@@ -131,7 +131,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -128,7 +128,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } @Test @@ -16375,7 +17622,16 @@ // Order of BaseVisitor's generated 'visit' methods match the order of // production rules in 'JavaLanguageParser.g4'. final String baseVisitorFilename = -@@ -200,7 +200,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -167,7 +167,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + * @throws IOException if file does not exist + */ + @Test +- public void countExprUsagesInParserGrammar() throws IOException { ++ void countExprUsagesInParserGrammar() throws IOException { + final String parserGrammarFilename = + "src/main/resources/com/puppycrawl" + + "/tools/checkstyle/grammar/java/JavaLanguageParser.g4"; +@@ -233,7 +233,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } @Test @@ -16384,7 +17640,7 @@ final Method addLastSibling = JavaAstVisitor.class.getDeclaredMethod( "addLastSibling", DetailAstImpl.class, DetailAstImpl.class); -@@ -227,7 +227,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { +@@ -260,7 +260,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { * @throws Exception if input file does not exist */ @Test @@ -16429,15 +17685,6 @@ final DetailAST root = JavaParser.parseFile( new File(getPath("InputJavaParserHiddenComments.java")), -@@ -68,7 +68,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { - - assertWithMessage("Block comment should be present").that(blockComment.isPresent()).isTrue(); - -- final DetailAST comment = blockComment.get(); -+ final DetailAST comment = blockComment.orElseThrow(); - - assertWithMessage("Unexpected line number").that(comment.getLineNo()).isEqualTo(3); - assertWithMessage("Unexpected column number").that(comment.getColumnNo()).isEqualTo(0); @@ -84,7 +84,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } @@ -16447,15 +17694,6 @@ final DetailAST root = JavaParser.parseFile( new File(getPath("InputJavaParserHiddenComments.java")), -@@ -97,7 +97,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { - .that(singleLineComment.isPresent()) - .isTrue(); - -- final DetailAST comment = singleLineComment.get(); -+ final DetailAST comment = singleLineComment.orElseThrow(); - - assertWithMessage("Unexpected line number").that(comment.getLineNo()).isEqualTo(13); - assertWithMessage("Unexpected column number").that(comment.getColumnNo()).isEqualTo(0); @@ -116,7 +116,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } @@ -16465,15 +17703,6 @@ final DetailAST root = JavaParser.parseFile( new File(getPath("InputJavaParserHiddenComments2.java")), -@@ -129,7 +129,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { - .that(singleLineComment.isPresent()) - .isTrue(); - -- final DetailAST comment = singleLineComment.get(); -+ final DetailAST comment = singleLineComment.orElseThrow(); - - assertWithMessage("Unexpected line number").that(comment.getLineNo()).isEqualTo(1); - assertWithMessage("Unexpected column number").that(comment.getColumnNo()).isEqualTo(4); @@ -148,7 +148,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } @@ -16510,15 +17739,6 @@ final DetailAST root = JavaParser.parseFile( new File(getNonCompilablePath("InputJavaParserTextBlocks.java")), -@@ -218,7 +218,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { - .that(textBlockContent.isPresent()) - .isTrue(); - -- final DetailAST content = textBlockContent.get(); -+ final DetailAST content = textBlockContent.orElseThrow(); - final String expectedContents = "\n string"; - - assertWithMessage("Unexpected line number").that(content.getLineNo()).isEqualTo(5); @@ -229,7 +229,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } @@ -16918,7 +18138,7 @@ private static final String SHORT_USAGE = String.format( -@@ -222,7 +221,7 @@ public class MainTest { +@@ -220,7 +219,7 @@ public class MainTest { * @param systemOut wrapper for {@code System.out} */ @BeforeEach @@ -16927,7 +18147,7 @@ systemErr.captureMuted(); systemOut.captureMuted(); -@@ -247,14 +246,14 @@ public class MainTest { +@@ -245,14 +244,14 @@ public class MainTest { } @Test @@ -16944,7 +18164,7 @@ assertMainReturnCode(0, "-V"); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -265,7 +264,7 @@ public class MainTest { +@@ -263,7 +262,7 @@ public class MainTest { } @Test @@ -16953,7 +18173,7 @@ assertMainReturnCode(0, "-h"); assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(USAGE); assertWithMessage("Unexpected system error log") -@@ -274,7 +273,7 @@ public class MainTest { +@@ -272,7 +271,7 @@ public class MainTest { } @Test @@ -16962,7 +18182,7 @@ // need to specify a file: // is defined as a required positional param; // picocli verifies required parameters before checking unknown options -@@ -287,8 +286,7 @@ public class MainTest { +@@ -285,8 +284,7 @@ public class MainTest { } @Test @@ -16972,7 +18192,7 @@ assertMainReturnCode(-1, "-q"); // files is defined as a required positional param; // picocli verifies required parameters before checking unknown options -@@ -300,7 +298,7 @@ public class MainTest { +@@ -298,7 +296,7 @@ public class MainTest { } @Test @@ -16981,7 +18201,7 @@ assertMainReturnCode(-1, getPath("InputMain.java")); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -311,8 +309,7 @@ public class MainTest { +@@ -309,8 +307,7 @@ public class MainTest { } @Test @@ -16991,7 +18211,7 @@ assertMainReturnCode(-1, "-c", "/google_checks.xml", "NonExistentFile.java"); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -323,10 +320,12 @@ public class MainTest { +@@ -321,10 +318,12 @@ public class MainTest { } @Test @@ -17006,7 +18226,25 @@ // skip execution if file is still readable, it is possible on some Windows machines // see https://github.com/checkstyle/checkstyle/issues/7032 for details assumeTrue(file.setReadable(false), "file is still readable"); -@@ -342,8 +341,7 @@ public class MainTest { +@@ -340,7 +339,7 @@ public class MainTest { + } + + @Test +- public void testCustomSeverityVariableForGoogleConfig(@SysOut Capturable systemOut) { ++ void customSeverityVariableForGoogleConfig(@SysOut Capturable systemOut) { + assertMainReturnCode( + 1, + "-c", +@@ -364,7 +363,7 @@ public class MainTest { + } + + @Test +- public void testDefaultSeverityVariableForGoogleConfig(@SysOut Capturable systemOut) { ++ void defaultSeverityVariableForGoogleConfig(@SysOut Capturable systemOut) { + assertMainReturnCode( + 0, "-c", "/google_checks.xml", getPath("InputMainCustomSeverityForGoogleConfig.java")); + +@@ -383,8 +382,7 @@ public class MainTest { } @Test @@ -17016,7 +18254,7 @@ assertMainReturnCode( -1, "-c", "src/main/resources/non_existent_config.xml", getPath("InputMain.java")); assertWithMessage("Unexpected output log") -@@ -358,8 +356,7 @@ public class MainTest { +@@ -399,8 +397,7 @@ public class MainTest { } @Test @@ -17026,7 +18264,7 @@ assertMainReturnCode(-1, "-c", "/google_checks.xml", "-f", "xmlp", getPath("InputMain.java")); assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); assertWithMessage("Unexpected system error log") -@@ -372,7 +369,7 @@ public class MainTest { +@@ -413,7 +410,7 @@ public class MainTest { } @Test @@ -17035,7 +18273,7 @@ assertMainReturnCode( -2, "-c", getPath("InputMainConfig-non-existent-classname.xml"), getPath("InputMain.java")); final String cause = -@@ -384,7 +381,7 @@ public class MainTest { +@@ -425,7 +422,7 @@ public class MainTest { } @Test @@ -17044,7 +18282,7 @@ assertMainReturnCode( 0, "-c", getPath("InputMainConfig-classname.xml"), getPath("InputMain.java")); assertWithMessage("Unexpected output log") -@@ -396,8 +393,8 @@ public class MainTest { +@@ -437,8 +434,8 @@ public class MainTest { } @Test @@ -17055,7 +18293,7 @@ assertMainReturnCode( 0, "-c", getPath("InputMainConfig-classname.xml"), "-f", "xml", getPath("InputMain.java")); final String expectedPath = getFilePath("InputMain.java"); -@@ -425,8 +422,7 @@ public class MainTest { +@@ -466,8 +463,7 @@ public class MainTest { * @param systemOut the system output stream */ @Test @@ -17065,7 +18303,7 @@ try (ShouldNotBeClosedStream stream = new ShouldNotBeClosedStream()) { System.setOut(stream); System.setErr(stream); -@@ -456,7 +452,7 @@ public class MainTest { +@@ -497,7 +493,7 @@ public class MainTest { * @throws Exception if there is an error. */ @Test @@ -17074,7 +18312,7 @@ final Path path = new File(getPath("InputMain.java")).toPath(); final OutputStreamOptions option = TestUtil.invokeStaticMethod(Main.class, "getOutputStreamOptions", path); -@@ -466,8 +462,7 @@ public class MainTest { +@@ -507,8 +503,7 @@ public class MainTest { } @Test @@ -17084,7 +18322,7 @@ assertMainReturnCode( 0, "-c", -@@ -484,8 +479,8 @@ public class MainTest { +@@ -525,8 +520,8 @@ public class MainTest { } @Test @@ -17095,7 +18333,7 @@ assertMainReturnCode( 0, "-c", getPath("InputMainConfig-classname2.xml"), getPath("InputMain.java")); final Violation invalidPatternMessageMain = -@@ -529,7 +524,7 @@ public class MainTest { +@@ -570,7 +565,7 @@ public class MainTest { } @Test @@ -17104,7 +18342,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { System.setProperty( "org.checkstyle.google.suppressionxpathfilter.config", -@@ -545,7 +540,7 @@ public class MainTest { +@@ -586,7 +581,7 @@ public class MainTest { } @Test @@ -17113,7 +18351,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { System.setProperty( "org.checkstyle.google.suppressionfilter.config", -@@ -561,8 +556,8 @@ public class MainTest { +@@ -602,8 +597,8 @@ public class MainTest { } @Test @@ -17124,7 +18362,7 @@ assertMainReturnCode( 2, "-c", getPath("InputMainConfig-classname2-error.xml"), getPath("InputMain.java")); final Violation errorCounterTwoMessage = -@@ -622,8 +617,8 @@ public class MainTest { +@@ -663,8 +658,8 @@ public class MainTest { * @throws Exception should not throw anything */ @Test @@ -17135,7 +18373,7 @@ assertMainReturnCode( 1, "-c", getPath("InputMainConfig-classname2-error.xml"), getPath("InputMain1.java")); final Violation errorCounterTwoMessage = -@@ -662,7 +657,7 @@ public class MainTest { +@@ -703,7 +698,7 @@ public class MainTest { } @Test @@ -17144,7 +18382,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { assertMainReturnCode(1, "-c", "/sun_checks.xml", getPath("InputMain1.java")); final Violation errorCounterTwoMessage = -@@ -697,7 +692,7 @@ public class MainTest { +@@ -738,7 +733,7 @@ public class MainTest { } @Test @@ -17153,7 +18391,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode( 0, -@@ -715,10 +710,12 @@ public class MainTest { +@@ -756,10 +751,12 @@ public class MainTest { } @Test @@ -17168,7 +18406,7 @@ assertWithMessage("File must exist").that(new File(outputFile).exists()).isTrue(); assertMainReturnCode( 0, -@@ -736,7 +733,7 @@ public class MainTest { +@@ -777,7 +774,7 @@ public class MainTest { } @Test @@ -17177,7 +18415,7 @@ final String outputFile = new File(temporaryFolder, "nonexistent.out").getCanonicalPath(); assertWithMessage("File must not exist").that(new File(outputFile).exists()).isFalse(); assertMainReturnCode( -@@ -752,7 +749,7 @@ public class MainTest { +@@ -793,7 +790,7 @@ public class MainTest { } @Test @@ -17186,7 +18424,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode( 0, -@@ -770,7 +767,7 @@ public class MainTest { +@@ -811,7 +808,7 @@ public class MainTest { } @Test @@ -17195,7 +18433,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode( 0, -@@ -789,7 +786,7 @@ public class MainTest { +@@ -830,7 +827,7 @@ public class MainTest { } @Test @@ -17204,7 +18442,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode( -2, -@@ -806,7 +803,7 @@ public class MainTest { +@@ -847,7 +844,7 @@ public class MainTest { } @Test @@ -17213,7 +18451,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode( -1, -@@ -824,7 +821,7 @@ public class MainTest { +@@ -865,7 +862,7 @@ public class MainTest { } @Test @@ -17222,7 +18460,7 @@ assertMainReturnCode( -2, "-c", getPath("InputMainConfig-Incorrect.xml"), getPath("InputMain.java")); final String errorOutput = -@@ -836,7 +833,7 @@ public class MainTest { +@@ -877,7 +874,7 @@ public class MainTest { } @Test @@ -17231,7 +18469,7 @@ assertMainReturnCode( -2, "-c", getPath("InputMainConfig-incorrectChildren.xml"), getPath("InputMain.java")); final String errorOutput = -@@ -849,7 +846,7 @@ public class MainTest { +@@ -890,7 +887,7 @@ public class MainTest { } @Test @@ -17240,7 +18478,7 @@ assertMainReturnCode( -2, "-c", getPath("InputMainConfig-incorrectChildren2.xml"), getPath("InputMain.java")); final String errorOutput = -@@ -863,7 +860,7 @@ public class MainTest { +@@ -904,7 +901,7 @@ public class MainTest { } @Test @@ -17249,7 +18487,7 @@ final Class[] param = new Class[1]; param[0] = File.class; final Class cliOptionsClass = Class.forName(Main.class.getName()); -@@ -905,8 +902,8 @@ public class MainTest { +@@ -946,8 +943,8 @@ public class MainTest { } @Test @@ -17260,7 +18498,7 @@ // we just reference there all violations final String[][] outputValues = { {"InputMainComplexityOverflow", "1", "172"}, -@@ -953,7 +950,7 @@ public class MainTest { +@@ -994,7 +991,7 @@ public class MainTest { * does not require serialization */ @Test @@ -17269,7 +18507,7 @@ final File fileMock = new File("") { private static final long serialVersionUID = 1L; -@@ -987,7 +984,7 @@ public class MainTest { +@@ -1028,7 +1025,7 @@ public class MainTest { * does not require serialization */ @Test @@ -17278,7 +18516,7 @@ final File[] nullResult = null; final File fileMock = new File("") { -@@ -1015,7 +1012,7 @@ public class MainTest { +@@ -1056,7 +1053,7 @@ public class MainTest { } @Test @@ -17287,7 +18525,7 @@ // We put xml as source to cause parse exception assertMainReturnCode( -2, -@@ -1033,7 +1030,7 @@ public class MainTest { +@@ -1074,7 +1071,7 @@ public class MainTest { } @Test @@ -17296,7 +18534,7 @@ assertMainReturnCode(-2, "-t", getNonCompilablePath("InputMainIncorrectClass.java")); assertWithMessage("First line of exception message should not contain lexer error.") -@@ -1042,7 +1039,7 @@ public class MainTest { +@@ -1083,7 +1080,7 @@ public class MainTest { } @Test @@ -17305,7 +18543,7 @@ assertMainReturnCode(-2, "-t", getNonCompilablePath("InputMainIncorrectClass.java")); final String capturedData = systemErr.getCapturedData(); -@@ -1057,8 +1054,7 @@ public class MainTest { +@@ -1098,8 +1095,7 @@ public class MainTest { } @Test @@ -17315,7 +18553,7 @@ assertMainReturnCode(-1, "-t", getPath("")); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -1069,7 +1065,7 @@ public class MainTest { +@@ -1110,7 +1106,7 @@ public class MainTest { } @Test @@ -17324,7 +18562,7 @@ final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -1111,7 +1107,7 @@ public class MainTest { +@@ -1152,7 +1148,7 @@ public class MainTest { } @Test @@ -17333,7 +18571,7 @@ final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -1136,8 +1132,7 @@ public class MainTest { +@@ -1177,8 +1173,7 @@ public class MainTest { } @Test @@ -17343,7 +18581,7 @@ final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -1159,8 +1154,7 @@ public class MainTest { +@@ -1200,8 +1195,7 @@ public class MainTest { } @Test @@ -17353,7 +18591,7 @@ final String expected = addEndOfLine("COMPILATION_UNIT -> COMPILATION_UNIT [1:0]"); assertMainReturnCode(0, "-b", "/COMPILATION_UNIT", getPath("InputMainXPath.java")); assertWithMessage("Unexpected output log") -@@ -1172,7 +1166,7 @@ public class MainTest { +@@ -1213,7 +1207,7 @@ public class MainTest { } @Test @@ -17362,7 +18600,7 @@ final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -1194,7 +1188,7 @@ public class MainTest { +@@ -1235,7 +1229,7 @@ public class MainTest { } @Test @@ -17371,7 +18609,7 @@ final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -1220,7 +1214,7 @@ public class MainTest { +@@ -1261,7 +1255,7 @@ public class MainTest { } @Test @@ -17380,7 +18618,7 @@ final String invalidXpath = "\\/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='Two']]" + "//METHOD_DEF"; final String filePath = getFilePath("InputMainXPath.java"); -@@ -1238,8 +1232,7 @@ public class MainTest { +@@ -1279,8 +1273,7 @@ public class MainTest { } @Test @@ -17390,7 +18628,7 @@ final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -1293,10 +1286,10 @@ public class MainTest { +@@ -1334,10 +1327,10 @@ public class MainTest { * @noinspectionreason RedundantThrows - false positive */ @Test @@ -17403,7 +18641,7 @@ .replaceAll("\\\\r\\\\n", "\\\\n") .replaceAll("\r\n", "\n"); -@@ -1311,8 +1304,7 @@ public class MainTest { +@@ -1352,8 +1345,7 @@ public class MainTest { } @Test @@ -17413,7 +18651,7 @@ final String expected = addEndOfLine( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputMainSuppressionsStringPrinter']]", -@@ -1331,7 +1323,7 @@ public class MainTest { +@@ -1372,7 +1364,7 @@ public class MainTest { } @Test @@ -17422,7 +18660,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = addEndOfLine( -@@ -1363,7 +1355,7 @@ public class MainTest { +@@ -1404,7 +1396,7 @@ public class MainTest { } @Test @@ -17431,7 +18669,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode(-1, "-c", "/google_checks.xml", getPath(""), "-s", "2:4"); assertWithMessage("Unexpected output log") -@@ -1375,7 +1367,7 @@ public class MainTest { +@@ -1416,7 +1408,7 @@ public class MainTest { } @Test @@ -17440,7 +18678,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode( -1, "-p", getPath("InputMainMycheckstyle.properties"), "-s", "2:4", getPath("")); -@@ -1388,7 +1380,7 @@ public class MainTest { +@@ -1429,7 +1421,7 @@ public class MainTest { } @Test @@ -17449,7 +18687,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode(-1, "-f", "plain", "-s", "2:4", getPath("")); assertWithMessage("Unexpected output log") -@@ -1400,7 +1392,7 @@ public class MainTest { +@@ -1441,7 +1433,7 @@ public class MainTest { } @Test @@ -17458,7 +18696,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); -@@ -1414,7 +1406,7 @@ public class MainTest { +@@ -1455,7 +1447,7 @@ public class MainTest { } @Test @@ -17467,7 +18705,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { assertMainReturnCode(-1, "-s", "2:4", getPath(""), getPath("")); assertWithMessage("Unexpected output log") -@@ -1427,7 +1419,7 @@ public class MainTest { +@@ -1468,7 +1460,7 @@ public class MainTest { } @Test @@ -17476,7 +18714,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = addEndOfLine( -@@ -1546,7 +1538,7 @@ public class MainTest { +@@ -1507,7 +1499,7 @@ public class MainTest { } @Test @@ -17485,7 +18723,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = addEndOfLine( -@@ -1593,7 +1585,7 @@ public class MainTest { +@@ -1554,7 +1546,7 @@ public class MainTest { } @Test @@ -17494,7 +18732,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = ""; -@@ -1612,8 +1604,7 @@ public class MainTest { +@@ -1573,8 +1565,7 @@ public class MainTest { } @Test @@ -17504,7 +18742,7 @@ final String expected = addEndOfLine( "", -@@ -1639,7 +1630,7 @@ public class MainTest { +@@ -1600,7 +1591,7 @@ public class MainTest { "--generate-xpath-suppression", getPath("InputMainGenerateXpathSuppressionsTabWidth.java")); try (BufferedReader br = Files.newBufferedReader(file.toPath())) { @@ -17513,7 +18751,7 @@ assertWithMessage("Unexpected output log").that(fileContent).isEqualTo(expected); assertWithMessage("Unexpected system error log") .that(systemErr.getCapturedData()) -@@ -1648,7 +1639,7 @@ public class MainTest { +@@ -1609,7 +1600,7 @@ public class MainTest { } @Test @@ -17522,7 +18760,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = addEndOfLine( -@@ -1681,7 +1672,7 @@ public class MainTest { +@@ -1642,7 +1633,7 @@ public class MainTest { } @Test @@ -17531,7 +18769,7 @@ @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = ""; -@@ -1711,11 +1702,10 @@ public class MainTest { +@@ -1672,11 +1663,10 @@ public class MainTest { * @noinspectionreason RedundantThrows - false positive */ @Test @@ -17545,7 +18783,7 @@ .replaceAll("\\\\r\\\\n", "\\\\n") .replaceAll("\r\n", "\n"); -@@ -1730,8 +1720,7 @@ public class MainTest { +@@ -1691,8 +1681,7 @@ public class MainTest { } @Test @@ -17555,7 +18793,7 @@ assertMainReturnCode(-1, "-c", "/google_checks.xml", "-t", getPath("")); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -1742,8 +1731,7 @@ public class MainTest { +@@ -1703,8 +1692,7 @@ public class MainTest { } @Test @@ -17565,7 +18803,7 @@ assertMainReturnCode(-1, "-p", getPath("InputMainMycheckstyle.properties"), "-t", getPath("")); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -1754,8 +1742,7 @@ public class MainTest { +@@ -1715,8 +1703,7 @@ public class MainTest { } @Test @@ -17575,7 +18813,7 @@ assertMainReturnCode(-1, "-f", "plain", "-t", getPath("")); assertWithMessage("Unexpected output log") .that(systemOut.getCapturedData()) -@@ -1766,7 +1753,7 @@ public class MainTest { +@@ -1727,7 +1714,7 @@ public class MainTest { } @Test @@ -17584,7 +18822,7 @@ throws IOException { final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); -@@ -1780,7 +1767,7 @@ public class MainTest { +@@ -1741,7 +1728,7 @@ public class MainTest { } @Test @@ -17593,7 +18831,7 @@ throws IOException { final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); -@@ -1794,7 +1781,7 @@ public class MainTest { +@@ -1755,7 +1742,7 @@ public class MainTest { } @Test @@ -17602,7 +18840,7 @@ assertMainReturnCode(0, "-c", "/google_checks.xml", getPath("InputMain.java"), "-d"); assertWithMessage("Unexpected system error log") .that(systemErr.getCapturedData()) -@@ -1802,7 +1789,7 @@ public class MainTest { +@@ -1763,7 +1750,7 @@ public class MainTest { } @Test @@ -17611,7 +18849,7 @@ throws IOException { final String filePath = getFilePath(""); assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-e", filePath); -@@ -1815,7 +1802,7 @@ public class MainTest { +@@ -1776,7 +1763,7 @@ public class MainTest { } @Test @@ -17620,7 +18858,7 @@ throws IOException { final String filePath = getFilePath("InputMain.java"); assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-e", filePath); -@@ -1828,7 +1815,7 @@ public class MainTest { +@@ -1789,7 +1776,7 @@ public class MainTest { } @Test @@ -17629,7 +18867,7 @@ throws IOException { final String filePath = getFilePath(""); assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-x", "."); -@@ -1839,8 +1826,8 @@ public class MainTest { +@@ -1800,8 +1787,8 @@ public class MainTest { } @Test @@ -17640,7 +18878,7 @@ final String filePath = getFilePath("InputMain.java"); assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-x", "."); assertWithMessage("Unexpected output log") -@@ -1849,9 +1836,9 @@ public class MainTest { +@@ -1810,9 +1797,9 @@ public class MainTest { assertWithMessage("Unexpected output log").that(systemErr.getCapturedData()).isEqualTo(""); } @@ -17652,7 +18890,7 @@ final Class optionsClass = Class.forName(Main.class.getName()); final Method method = optionsClass.getDeclaredMethod("listFiles", File.class, List.class); method.setAccessible(true); -@@ -1863,7 +1850,7 @@ public class MainTest { +@@ -1824,7 +1811,7 @@ public class MainTest { } @Test @@ -17661,7 +18899,7 @@ TestRootModuleChecker.reset(); assertMainReturnCode( -@@ -1879,7 +1866,7 @@ public class MainTest { +@@ -1840,7 +1827,7 @@ public class MainTest { } @Test @@ -17670,7 +18908,7 @@ TestRootModuleChecker.reset(); assertMainReturnCode( -2, -@@ -1908,8 +1895,7 @@ public class MainTest { +@@ -1869,8 +1856,7 @@ public class MainTest { } @Test @@ -17680,7 +18918,7 @@ assertMainReturnCode( -2, "-c", -@@ -1925,8 +1911,7 @@ public class MainTest { +@@ -1886,8 +1872,7 @@ public class MainTest { } @Test @@ -17690,7 +18928,7 @@ assertMainReturnCode( -2, "-c", -@@ -1946,15 +1931,14 @@ public class MainTest { +@@ -1907,15 +1892,14 @@ public class MainTest { } @Test @@ -17708,7 +18946,7 @@ assertMainReturnCode(-1); final String usage = "Missing required parameter: ''" + EOL + SHORT_USAGE; assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); -@@ -1964,13 +1948,13 @@ public class MainTest { +@@ -1925,13 +1909,13 @@ public class MainTest { } @Test @@ -17724,7 +18962,7 @@ final ByteArrayOutputStream out = new ByteArrayOutputStream(); final AuditListener listener = Main.OutputFormat.XML.createListener(out, OutputStreamOptions.CLOSE); -@@ -1978,7 +1962,7 @@ public class MainTest { +@@ -1939,7 +1923,7 @@ public class MainTest { } @Test @@ -17733,7 +18971,7 @@ final ByteArrayOutputStream out = new ByteArrayOutputStream(); final AuditListener listener = Main.OutputFormat.SARIF.createListener(out, OutputStreamOptions.CLOSE); -@@ -1986,7 +1970,7 @@ public class MainTest { +@@ -1947,7 +1931,7 @@ public class MainTest { } @Test @@ -17742,7 +18980,7 @@ final ByteArrayOutputStream out = new ByteArrayOutputStream(); final AuditListener listener = Main.OutputFormat.PLAIN.createListener(out, OutputStreamOptions.CLOSE); -@@ -2025,7 +2009,7 @@ public class MainTest { +@@ -1986,7 +1970,7 @@ public class MainTest { private boolean isClosed; private ShouldNotBeClosedStream() { @@ -17804,13 +19042,11 @@ final MetadataGeneratorLogger logger = --- a/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java -@@ -20,8 +20,10 @@ - package com.puppycrawl.tools.checkstyle; +@@ -21,7 +21,9 @@ package com.puppycrawl.tools.checkstyle; import static com.google.common.truth.Truth.assertWithMessage; --import static org.junit.jupiter.api.Assertions.assertThrows; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; +import static java.util.Collections.emptyEnumeration; -+import static org.assertj.core.api.Assertions.assertThatThrownBy; +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -17923,7 +19159,7 @@ try { PackageNamesLoader.getPackageNames(new TestIoExceptionClassLoader()); assertWithMessage("CheckstyleException is expected").fail(); -@@ -229,21 +230,20 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { +@@ -229,9 +230,9 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } @Test @@ -17933,12 +19169,9 @@ - PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(Collections.emptyEnumeration())); + PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(emptyEnumeration())); -- assertThrows( -- UnsupportedOperationException.class, -- () -> actualPackageNames.add("com.puppycrawl.tools.checkstyle.checks.modifier")); -+ assertThatThrownBy( -+ () -> actualPackageNames.add("com.puppycrawl.tools.checkstyle.checks.modifier")) -+ .isInstanceOf(UnsupportedOperationException.class); + final Exception ex = + getExpectedThrowable( +@@ -244,11 +245,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } @Test @@ -17952,7 +19185,7 @@ final Set actualPackageNames = PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); -@@ -252,11 +252,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { +@@ -257,11 +257,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } @Test @@ -18306,7 +19539,12 @@ 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 -@@ -25,7 +25,6 @@ import static org.mockito.ArgumentMatchers.any; +@@ -21,11 +21,11 @@ package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; ++import static java.util.UUID.randomUUID; + import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mockStatic; import com.google.common.io.BaseEncoding; @@ -18314,7 +19552,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; -@@ -39,7 +38,6 @@ import java.io.ObjectOutputStream; +@@ -39,14 +39,12 @@ import java.io.ObjectOutputStream; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; @@ -18322,7 +19560,14 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.HashSet; -@@ -54,7 +52,7 @@ import org.junit.jupiter.params.ParameterizedTest; + import java.util.Locale; + import java.util.Properties; + import java.util.Set; +-import java.util.UUID; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.condition.DisabledOnOs; + import org.junit.jupiter.api.condition.OS; +@@ -55,7 +53,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.mockito.MockedStatic; @@ -18331,7 +19576,7 @@ @TempDir public File temporaryFolder; -@@ -64,7 +62,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -65,7 +63,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -18340,20 +19585,19 @@ try { final Object test = new PropertyCacheFile(null, ""); assertWithMessage("exception expected but got " + test).fail(); -@@ -85,9 +83,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -86,9 +84,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test -- public void testInCache() throws IOException { -+ void inCache() throws IOException { +- public void testInCache() { ++ void inCache() { final Configuration config = new DefaultConfiguration("myName"); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); cache.put("myFile", 1); - assertWithMessage("Should return true when file is in cache") -@@ -102,7 +101,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -104,7 +102,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -18362,7 +19606,7 @@ final Configuration config = new DefaultConfiguration("myName"); final PropertyCacheFile cache = new PropertyCacheFile(config, "fileDoesNotExist.txt"); -@@ -114,7 +113,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -116,7 +114,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -18371,62 +19615,59 @@ final Configuration config = new DefaultConfiguration("myName"); final PropertyCacheFile cache = new PropertyCacheFile(config, getPath("InputPropertyCacheFile")); -@@ -136,9 +135,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -138,9 +136,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test - public void testConfigHashOnReset() throws IOException { + void configHashOnReset() throws IOException { final Configuration config = new DefaultConfiguration("myName"); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); - cache.load(); -@@ -154,9 +154,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -157,9 +155,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test - public void testConfigHashRemainsOnResetExternalResources() throws IOException { + void configHashRemainsOnResetExternalResources() throws IOException { final Configuration config = new DefaultConfiguration("myName"); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +- final String uniqueFileName = "file_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "file_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); - // create cache with one file -@@ -180,11 +181,12 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -184,12 +182,12 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test - public void testCacheRemainsWhenExternalResourceTheSame() throws IOException { + void cacheRemainsWhenExternalResourceTheSame() throws IOException { final Configuration config = new DefaultConfiguration("myName"); - final String externalResourcePath = -- File.createTempFile("junit", null, temporaryFolder).getPath(); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); - - // pre-populate with cache with resources -@@ -209,9 +211,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +- final String externalFile = "junit_" + UUID.randomUUID() + ".java"; ++ final String externalFile = "junit_" + randomUUID() + ".java"; + final File externalResourcePath = new File(temporaryFolder, externalFile); + externalResourcePath.createNewFile(); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + filePath.createNewFile(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); +@@ -216,9 +214,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test - public void testExternalResourceIsSavedInCache() throws Exception { + void externalResourceIsSavedInCache() throws Exception { final Configuration config = new DefaultConfiguration("myName"); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); - cache.load(); -@@ -223,7 +226,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -231,7 +229,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { final MessageDigest digest = MessageDigest.getInstance("SHA-1"); final URI uri = CommonUtil.getUriByFilename(pathToResource); @@ -18435,7 +19676,7 @@ final ByteArrayOutputStream out = new ByteArrayOutputStream(); try (ObjectOutputStream oos = new ObjectOutputStream(out)) { oos.writeObject(input); -@@ -237,7 +240,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -245,7 +243,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -18444,7 +19685,7 @@ final Configuration config = new DefaultConfiguration("myName"); final String filePath = String.format(Locale.ENGLISH, "%s%2$stemp%2$scache.temp", temporaryFolder, File.separator); -@@ -250,10 +253,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -258,10 +256,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -18457,7 +19698,7 @@ final PropertyCacheFile cache = new PropertyCacheFile(config, fileName); // no exception expected -@@ -263,9 +266,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -271,9 +269,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { Files.delete(filePath); } @@ -18469,7 +19710,7 @@ final Path tempDirectory = temporaryFolder.toPath(); final Path symbolicLinkDirectory = temporaryFolder.toPath().resolve("symbolicLink"); Files.createSymbolicLink(symbolicLinkDirectory, tempDirectory); -@@ -282,9 +285,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -290,9 +288,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { .isTrue(); } @@ -18481,19 +19722,21 @@ final Path tempDirectory = temporaryFolder.toPath(); final Path symbolicLinkDirectory = temporaryFolder.toPath().resolve("symbolicLink"); Files.createSymbolicLink(symbolicLinkDirectory, tempDirectory); -@@ -301,9 +304,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -309,10 +307,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { .isTrue(); } - @Test @DisabledOnOs(OS.WINDOWS) - public void testSymbolicLinkToNonDirectory() throws IOException { +- final String uniqueFileName = "tempFile_" + UUID.randomUUID() + ".java"; + @Test + void symbolicLinkToNonDirectory() throws IOException { - final Path tempFile = Files.createTempFile("tempFile", null); ++ final String uniqueFileName = "tempFile_" + randomUUID() + ".java"; + final File tempFile = new File(temporaryFolder, uniqueFileName); + tempFile.createNewFile(); final Path symbolicLinkDirectory = temporaryFolder.toPath(); - final Path symbolicLink = symbolicLinkDirectory.resolve("symbolicLink"); -@@ -323,9 +326,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -333,9 +331,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { .contains(expectedMessage); } @@ -18505,7 +19748,7 @@ final Path actualDirectory = temporaryFolder.toPath(); final Path firstSymbolicLink = temporaryFolder.toPath().resolve("firstLink"); Files.createSymbolicLink(firstSymbolicLink, actualDirectory); -@@ -346,11 +349,11 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -356,10 +354,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test @@ -18513,51 +19756,48 @@ + void changeInConfig() throws Exception { final DefaultConfiguration config = new DefaultConfiguration("myConfig"); config.addProperty("attr", "value"); - -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName); final PropertyCacheFile cache = new PropertyCacheFile(config, cacheFile.getPath()); cache.load(); - -@@ -392,9 +395,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -402,9 +400,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test - public void testNonExistentResource() throws IOException { + void nonExistentResource() throws IOException { final Configuration config = new DefaultConfiguration("myName"); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); - // create cache with one file -@@ -421,9 +425,10 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -432,9 +430,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } @Test -- public void testExceptionNoSuchAlgorithmException() throws Exception { -+ void exceptionNoSuchAlgorithmException() throws Exception { +- public void testExceptionNoSuchAlgorithmException() { ++ void exceptionNoSuchAlgorithmException() { final Configuration config = new DefaultConfiguration("myName"); -- final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath(); - final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath.toString()); cache.put("myFile", 1); - -@@ -460,9 +465,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { +@@ -472,9 +470,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { * @param rawMessages exception messages separated by ';' */ @ParameterizedTest - @ValueSource(strings = {"Same;Same", "First;Second"}) - public void testPutNonExistentExternalResource(String rawMessages) throws Exception { -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; + @ValueSource(strings = {"First;Second", "Same;Same"}) + void putNonExistentExternalResource(String rawMessages) throws Exception { -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName); final String[] messages = rawMessages.split(";"); // We mock getUriByFilename method of CommonUtil to guarantee that it will - // throw CheckstyleException with the specific content. --- a/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java @@ -20,6 +20,7 @@ @@ -18568,9 +19808,9 @@ import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; import com.puppycrawl.tools.checkstyle.api.AuditEvent; -@@ -29,10 +30,9 @@ import com.puppycrawl.tools.checkstyle.internal.utils.CloseAndFlushTestByteArray - import java.io.ByteArrayOutputStream; +@@ -32,10 +33,9 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; + import java.io.OutputStream; import java.io.PrintWriter; -import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; @@ -18580,7 +19820,7 @@ /** * Output stream to hold the test results. The IntelliJ IDEA issues the AutoCloseableResource -@@ -48,7 +48,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -51,7 +51,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18589,7 +19829,7 @@ final String[][] encodings = { {"\"", "\\\""}, {"\\", "\\\\"}, -@@ -71,7 +71,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -74,7 +74,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18598,7 +19838,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation violation = -@@ -94,7 +94,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -97,7 +97,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18607,7 +19847,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation violation = -@@ -117,7 +117,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -120,7 +120,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18616,7 +19856,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation violation = -@@ -155,7 +155,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -158,7 +158,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18625,7 +19865,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation message = -@@ -170,7 +170,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -173,7 +173,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18634,7 +19874,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation violation = -@@ -192,7 +192,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -195,7 +195,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18643,7 +19883,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation violation = -@@ -207,7 +207,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -210,7 +210,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18652,16 +19892,34 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); final Violation violation = -@@ -221,7 +221,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -225,7 +225,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParametersCloseStreamOptions() throws IOException { ++ void ctorWithTwoParametersCloseStreamOptions() throws IOException { + final OutputStream infoStream = new ByteArrayOutputStream(); + final SarifLogger logger = new SarifLogger(infoStream, AutomaticBean.OutputStreamOptions.CLOSE); + final boolean closeStream = TestUtil.getInternalState(logger, "closeStream"); +@@ -235,7 +235,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParametersNoneStreamOptions() throws IOException { ++ void ctorWithTwoParametersNoneStreamOptions() throws IOException { + final OutputStream infoStream = new ByteArrayOutputStream(); + final SarifLogger logger = new SarifLogger(infoStream, AutomaticBean.OutputStreamOptions.NONE); + final boolean closeStream = TestUtil.getInternalState(logger, "closeStream"); +@@ -244,7 +244,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test - public void testNullOutputStreamOptions() { + void nullOutputStreamOptions() { try { - final SarifLogger logger = new SarifLogger(outStream, null); + final SarifLogger logger = new SarifLogger(outStream, (OutputStreamOptions) null); // assert required to calm down eclipse's 'The allocated object is never used' violation -@@ -235,7 +235,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -258,7 +258,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18670,7 +19928,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); logger.auditFinished(null); -@@ -246,7 +246,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -269,7 +269,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18679,7 +19937,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.NONE); logger.auditStarted(null); logger.auditFinished(null); -@@ -259,7 +259,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -282,7 +282,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18688,7 +19946,7 @@ final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); logger.finishLocalSetup(); logger.auditStarted(null); -@@ -268,7 +268,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -291,7 +291,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } @Test @@ -18697,7 +19955,7 @@ try { SarifLogger.readResource("random"); assertWithMessage("Exception expected").fail(); -@@ -282,8 +282,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { +@@ -305,8 +305,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { private static void verifyContent( String expectedOutputFile, ByteArrayOutputStream actualOutputStream) throws IOException { final String expectedContent = readFile(expectedOutputFile); @@ -18833,11 +20091,12 @@ final ThreadModeSettings singleThreadModeSettings = --- a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java -@@ -21,11 +21,15 @@ package com.puppycrawl.tools.checkstyle; +@@ -21,11 +21,16 @@ 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; +import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.UUID.randomUUID; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.CALLS_REAL_METHODS; import static org.mockito.Mockito.doThrow; @@ -18849,15 +20108,21 @@ import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Configuration; -@@ -58,7 +62,6 @@ import java.nio.file.StandardCopyOption; +@@ -59,13 +64,11 @@ import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; + import java.util.HashMap; import java.util.HashSet; import java.util.List; + import java.util.Map; import java.util.Set; -@@ -90,7 +93,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +-import java.util.UUID; + import java.util.regex.Matcher; + import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; +@@ -94,7 +97,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -18866,7 +20131,7 @@ final String path = getPath("InputTreeWalkerProperFileExtension.java"); final String[] expected = { "10:27: " -@@ -126,14 +129,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -130,14 +133,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * @throws Exception if an error occurs */ @Test @@ -18883,16 +20148,16 @@ TreeWalkerAuditEvent.class, (mock, context) -> { throw new CheckstyleException("No audit events expected"); -@@ -147,7 +150,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -151,7 +154,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * that the {@code if (!ordinaryChecks.isEmpty())} condition cannot be removed. */ @Test - public void testConditionRequiredWithoutOrdinaryChecks() throws Exception { + void conditionRequiredWithoutOrdinaryChecks() throws Exception { final String[] expected = { - "7: " + "7:5: " + getCheckMessage( -@@ -159,7 +162,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -163,7 +166,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(); @@ -18901,7 +20166,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); -@@ -173,14 +176,13 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -177,14 +180,13 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * that the {@code if (!commentChecks.isEmpty())} condition cannot be removed. */ @Test @@ -18918,7 +20183,7 @@ // Ensure that there is no calls to walk(..., AstState.WITH_COMMENTS) parser .when(() -> JavaParser.appendHiddenCommentNodes(any(DetailAST.class))) -@@ -191,7 +193,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -195,7 +197,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -18927,7 +20192,7 @@ final String regularFilePath = getPath("InputTreeWalkerImproperFileExtension.java"); final File originalFile = new File(regularFilePath); final File tempFile = new File(temporaryFolder, "file.pdf"); -@@ -201,7 +203,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -205,7 +207,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -18936,18 +20201,19 @@ final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); checkConfig.addProperty("tokens", "VARIABLE_DEF, ENUM_DEF, CLASS_DEF, METHOD_DEF," + "IMPORT"); try { -@@ -225,22 +227,22 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -229,9 +231,9 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test - public void testOnEmptyFile() throws Exception { + void onEmptyFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); -- final File emptyFile = File.createTempFile("file", ".java", temporaryFolder); -+ final File emptyFile = Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile(); +- final String uniqueFileName = "file_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "file_" + randomUUID() + ".java"; + final File emptyFile = new File(temporaryFolder, uniqueFileName); + emptyFile.createNewFile(); execute(checkConfig, emptyFile.getPath()); - final long fileSize = Files.size(emptyFile.toPath()); - assertWithMessage("File should be empty").that(fileSize).isEqualTo(0); +@@ -240,11 +242,11 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -18956,14 +20222,12 @@ final DefaultConfiguration checkConfig = createModuleConfig(JavadocPackageCheck.class); try { - execute( - createTreeWalkerConfig(checkConfig), -- File.createTempFile("junit", null, temporaryFolder).getPath()); -+ Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile().getPath()); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName); + execute(createTreeWalkerConfig(checkConfig), filePath.toString()); assertWithMessage("CheckstyleException is expected").fail(); - } catch (CheckstyleException exception) { - assertWithMessage("Error message is unexpected") -@@ -250,7 +252,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -256,7 +258,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -18972,7 +20236,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -271,7 +273,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -277,7 +279,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -18981,20 +20245,19 @@ final TreeWalker treeWalker = new TreeWalker(); final DefaultConfiguration config = new DefaultConfiguration("default config"); treeWalker.setTabWidth(1); -@@ -284,9 +286,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -290,9 +292,9 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test - public void testForInvalidCheckImplementation() throws Exception { + void forInvalidCheckImplementation() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(BadJavaDocCheck.class); -- final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String pathToEmptyFile = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); +- final String uniqueFileName = "file_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "file_" + randomUUID() + ".java"; + final File pathToEmptyFile = new File(temporaryFolder, uniqueFileName); try { - execute(checkConfig, pathToEmptyFile); -@@ -307,7 +310,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -314,7 +316,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19003,7 +20266,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -335,7 +338,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -342,7 +344,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19012,7 +20275,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.setTabWidth(1); treeWalker.configure(new DefaultConfiguration("default config")); -@@ -347,14 +350,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -354,14 +356,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19020,7 +20283,7 @@ + void withCacheWithNoViolation() throws Exception { final String path = getPath("InputTreeWalkerWithCacheWithNoViolation.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(path, expected); + verifyWithInlineConfigParserTwice(path, expected); } @Test @@ -19029,7 +20292,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.configure(createModuleConfig(TypeNameCheck.class)); final PackageObjectFactory factory = -@@ -377,7 +380,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -384,7 +386,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19038,7 +20301,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.configure(createModuleConfig(TypeNameCheck.class)); final PackageObjectFactory factory = -@@ -400,9 +403,9 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -407,9 +409,9 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19050,7 +20313,7 @@ final String configComment = "/*\n" + "com.puppycrawl.tools.checkstyle.TreeWalkerTest" -@@ -415,7 +418,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -422,7 +424,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19059,7 +20322,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -430,7 +433,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -437,7 +439,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19068,7 +20331,7 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.configure(createModuleConfig(TypeNameCheck.class)); treeWalker.configure(createModuleConfig(CommentsIndentationCheck.class)); -@@ -457,7 +460,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -464,7 +466,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19077,7 +20340,7 @@ final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); -@@ -477,7 +480,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -484,7 +486,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19086,7 +20349,7 @@ final String[] expected = { "17:17: " -@@ -492,7 +495,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -500,7 +502,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19095,7 +20358,7 @@ final String[] expected = { "13:9: " + getCheckMessage(WhitespaceAfterCheck.class, "ws.notFollowed", "if"), -@@ -503,7 +506,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -511,7 +513,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19104,7 +20367,7 @@ final String[] expected = { "15:28: " -@@ -521,7 +524,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -529,7 +531,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19113,15 +20376,16 @@ final TreeWalker treeWalker = new TreeWalker(); treeWalker.setSeverity("error"); treeWalker.setTabWidth(100); -@@ -537,18 +540,18 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -545,19 +547,19 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test - public void testCheckInitIsCalledInTreeWalker() throws Exception { + void checkInitIsCalledInTreeWalker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(VerifyInitCheck.class); -- final File file = File.createTempFile("file", ".pdf", temporaryFolder); -+ final File file = Files.createTempFile(temporaryFolder.toPath(), "file", ".pdf").toFile(); +- final String uniqueFileName = "file_" + UUID.randomUUID() + ".pdf"; ++ final String uniqueFileName = "file_" + randomUUID() + ".pdf"; + final File file = new File(temporaryFolder, uniqueFileName); execute(checkConfig, file.getPath()); assertWithMessage("Init was not called").that(VerifyInitCheck.isInitWasCalled()).isTrue(); } @@ -19131,12 +20395,12 @@ + void checkDestroyIsCalledInTreeWalker() throws Exception { VerifyDestroyCheck.resetDestroyWasCalled(); final DefaultConfiguration checkConfig = createModuleConfig(VerifyDestroyCheck.class); -- final File file = File.createTempFile("file", ".pdf", temporaryFolder); -+ final File file = Files.createTempFile(temporaryFolder.toPath(), "file", ".pdf").toFile(); +- final String uniqueFileName = "file_" + UUID.randomUUID() + ".pdf"; ++ final String uniqueFileName = "file_" + randomUUID() + ".pdf"; + final File file = new File(temporaryFolder, uniqueFileName); execute(checkConfig, file.getPath()); assertWithMessage("Destroy was not called") - .that(VerifyDestroyCheck.isDestroyWasCalled()) -@@ -556,10 +559,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -566,10 +568,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19144,12 +20408,12 @@ + void commentCheckDestroyIsCalledInTreeWalker() throws Exception { VerifyDestroyCheck.resetDestroyWasCalled(); final DefaultConfiguration checkConfig = createModuleConfig(VerifyDestroyCommentCheck.class); -- final File file = File.createTempFile("file", ".pdf", temporaryFolder); -+ final File file = Files.createTempFile(temporaryFolder.toPath(), "file", ".pdf").toFile(); +- final String uniqueFileName = "file_" + UUID.randomUUID() + ".pdf"; ++ final String uniqueFileName = "file_" + randomUUID() + ".pdf"; + final File file = new File(temporaryFolder, uniqueFileName); execute(checkConfig, file.getPath()); assertWithMessage("Destroy was not called") - .that(VerifyDestroyCheck.isDestroyWasCalled()) -@@ -567,17 +570,18 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -578,18 +580,18 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19161,17 +20425,17 @@ treeWalkerConfig.addChild(filterConfig); final DefaultConfiguration checkerConfig = createRootConfig(treeWalkerConfig); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); +- final String uniqueFileName1 = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName1 = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName1); checkerConfig.addProperty("cacheFile", cacheFile.getPath()); -- final String filePath = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); +- final String uniqueFileName2 = "file_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName2 = "file_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName2); - execute(checkerConfig, filePath); - // One more time to use cache. -@@ -589,7 +593,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + execute(checkerConfig, filePath.toString()); +@@ -602,7 +604,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19180,7 +20444,7 @@ // test is only valid when relative paths are given final String filePath = "src/test/resources/" -@@ -601,7 +605,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -614,7 +616,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } @Test @@ -19189,20 +20453,20 @@ final DefaultConfiguration checkConfig = createModuleConfig(EmptyStatementCheck.class); final DefaultConfiguration filterConfig = createModuleConfig(SuppressWithNearbyCommentFilter.class); -@@ -610,9 +614,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -623,10 +625,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { treeWalkerConfig.addChild(filterConfig); final DefaultConfiguration checkerConfig = createRootConfig(treeWalkerConfig); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); +- final String uniqueFileName1 = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName1 = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName1); checkerConfig.addProperty("cacheFile", cacheFile.getPath()); -- final String filePath = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); +- final String uniqueFileName2 = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName2 = "junit_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName2); - execute(checkerConfig, filePath); - -@@ -626,7 +631,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + execute(checkerConfig, filePath.toString()); +@@ -641,7 +643,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { * @throws Exception if file is not found */ @Test @@ -19211,7 +20475,7 @@ final DefaultConfiguration configuration1 = createModuleConfig(AaCheck.class); configuration1.addProperty("id", "2"); -@@ -637,7 +642,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { +@@ -652,7 +654,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { treeWalkerConfig.addChild(configuration2); treeWalkerConfig.addChild(configuration1); @@ -19220,6 +20484,78 @@ final Checker checker = createChecker(treeWalkerConfig); try { +@@ -666,7 +668,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipFileOnJavaParseExceptionTrue() throws Exception { ++ void skipFileOnJavaParseExceptionTrue() throws Exception { + final DefaultConfiguration config = createModuleConfig(TreeWalker.class); + config.addProperty("skipFileOnJavaParseException", "true"); + config.addProperty("javaParseExceptionSeverity", "ignore"); +@@ -682,7 +684,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + final Map> expectedViolation = new HashMap<>(); + expectedViolation.put( + getPath("InputTreeWalkerProperFileExtension.java"), +- Collections.singletonList( ++ ImmutableList.of( + "10:27: " + + getCheckMessage( + ConstantNameCheck.class, +@@ -700,7 +702,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + * exception} is indeed thrown. + */ + @Test +- public void testSkipFileOnJavaParseExceptionFalse() throws Exception { ++ void skipFileOnJavaParseExceptionFalse() throws Exception { + final DefaultConfiguration config = createModuleConfig(TreeWalker.class); + config.addProperty("skipFileOnJavaParseException", "false"); + config.addChild(createModuleConfig(ConstantNameCheck.class)); +@@ -719,7 +721,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipFileOnJavaParseExceptionConfigSeverityIgnore() throws Exception { ++ void skipFileOnJavaParseExceptionConfigSeverityIgnore() throws Exception { + final String path = + getNonCompilablePath("InputTreeWalkerSkipParsingExceptionConfigSeverityIgnore.java"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -727,7 +729,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipFileOnJavaParseExceptionConfigSeverityDefault() throws Exception { ++ void skipFileOnJavaParseExceptionConfigSeverityDefault() throws Exception { + final String path = + getNonCompilablePath("InputTreeWalkerSkipParsingExceptionConfigSeverityDefault.java"); + final String[] expected = { +@@ -741,7 +743,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipFileOnJavaParseExceptionSkipChecks() throws Exception { ++ void skipFileOnJavaParseExceptionSkipChecks() throws Exception { + final DefaultConfiguration config = createModuleConfig(TreeWalker.class); + config.addProperty("skipFileOnJavaParseException", "true"); + config.addProperty("javaParseExceptionSeverity", "ignore"); +@@ -761,7 +763,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavaParseExceptionSeverityDefaultError() throws Exception { ++ void javaParseExceptionSeverityDefaultError() throws Exception { + final DefaultConfiguration config = createModuleConfig(TreeWalker.class); + config.addProperty("skipFileOnJavaParseException", "true"); + config.addChild(createModuleConfig(NoCodeInFileCheck.class)); +@@ -778,7 +780,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + expectedViolation.put(getPath("InputTreeWalkerProperFileExtension.java"), new ArrayList<>()); + expectedViolation.put( + getNonCompilablePath("InputTreeWalkerSkipParsingException.java"), +- List.of( ++ ImmutableList.of( + "1: Java specific (TreeWalker-based) modules are skipped due to an " + + "exception during parsing - " + + "IllegalStateException occurred while parsing file " --- 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; @@ -19654,14 +20990,14 @@ listener.finishLocalSetup(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java -@@ -20,6 +20,7 @@ - package com.puppycrawl.tools.checkstyle.ant; +@@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.ant; import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; +import static java.nio.charset.StandardCharsets.UTF_8; - import static org.junit.jupiter.api.Assertions.assertThrows; import com.google.common.truth.StandardSubjectBuilder; + import com.puppycrawl.tools.checkstyle.AbstractPathTestSupport; @@ -35,7 +36,6 @@ import com.puppycrawl.tools.checkstyle.internal.testmodules.TestRootModuleChecke import java.io.File; import java.io.IOException; @@ -19768,7 +21104,7 @@ + final void noFile() throws IOException { final CheckstyleAntTask antTask = getCheckstyleAntTask(); final BuildException ex = - assertThrows(BuildException.class, antTask::execute, "BuildException is expected"); + getExpectedThrowable(BuildException.class, antTask::execute, "BuildException is expected"); @@ -280,7 +280,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } @@ -19912,7 +21248,7 @@ + void setInvalidType() { final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); final BuildException ex = - assertThrows( + getExpectedThrowable( @@ -602,7 +602,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } @@ -20056,15 +21392,6 @@ final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); antTask.setConfig(getPath(CONFIG_FILE)); antTask.setProject(new Project()); -@@ -835,7 +835,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { - .that(optionalMessageLevelPair.isPresent()) - .isTrue(); - -- final long actualTime = getNumberFromLine(optionalMessageLevelPair.get().getMsg()); -+ final long actualTime = getNumberFromLine(optionalMessageLevelPair.orElseThrow().getMsg()); - - assertWithMessage( - "Logged time in '" + expectedMsg + "' " + "must be less than the testing time") @@ -844,7 +844,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } @@ -20076,12 +21403,9 @@ private static long getNumberFromLine(String line) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractCheckTest.java -@@ -20,8 +20,9 @@ - package com.puppycrawl.tools.checkstyle.api; - +@@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.api; import static com.google.common.truth.Truth.assertWithMessage; --import static org.junit.jupiter.api.Assertions.assertThrows; -+import static org.assertj.core.api.Assertions.assertThatThrownBy; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -20240,7 +21564,7 @@ final String[] expected = { "6:1: Violation.", }; -@@ -375,10 +375,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { +@@ -375,7 +375,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { * file as none of the checks try to modify the tokens. */ @Test @@ -20248,12 +21572,7 @@ + void tokensAreUnmodifiable() { final DummyAbstractCheck check = new DummyAbstractCheck(); final Set tokenNameSet = check.getTokenNames(); -- assertThrows(UnsupportedOperationException.class, () -> tokenNameSet.add("")); -+ assertThatThrownBy(() -> tokenNameSet.add("")) -+ .isInstanceOf(UnsupportedOperationException.class); - } - - public static final class DummyAbstractCheck extends AbstractCheck { + final Exception ex = --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheckTest.java @@ -21,19 +21,19 @@ package com.puppycrawl.tools.checkstyle.api; @@ -20491,7 +21810,7 @@ emptyCheck.configure(config); --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AuditEventTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AuditEventTest.java -@@ -24,10 +24,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; +@@ -24,10 +24,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpecte import org.junit.jupiter.api.Test; @@ -20511,7 +21830,7 @@ - public void testNoSource() { + void noSource() { final IllegalArgumentException ex = - assertThrows( + getExpectedThrowable( IllegalArgumentException.class, @@ -49,7 +49,7 @@ public class AuditEventTest { } @@ -20524,15 +21843,7 @@ 1, --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSetTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSetTest.java -@@ -20,17 +20,17 @@ - package com.puppycrawl.tools.checkstyle.api; - - import static com.google.common.truth.Truth.assertWithMessage; --import static org.junit.jupiter.api.Assertions.assertThrows; -+import static org.assertj.core.api.Assertions.assertThatThrownBy; - - import com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter; - import java.util.Set; +@@ -27,10 +27,10 @@ import java.util.Set; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; @@ -20589,7 +21900,7 @@ final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter()); -@@ -102,12 +102,13 @@ public class BeforeExecutionFileFilterSetTest { +@@ -102,7 +102,7 @@ public class BeforeExecutionFileFilterSetTest { done for the time being */ @Test @@ -20598,14 +21909,7 @@ final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); final BeforeExecutionFileFilter filter = new BeforeExecutionExclusionFileFilter(); filterSet.addBeforeExecutionFileFilter(filter); - final Set excFilterSet = filterSet.getBeforeExecutionFileFilters(); -- assertThrows(UnsupportedOperationException.class, () -> excFilterSet.add(filter)); -+ assertThatThrownBy(() -> excFilterSet.add(filter)) -+ .isInstanceOf(UnsupportedOperationException.class); - } - - /* -@@ -115,7 +116,7 @@ public class BeforeExecutionFileFilterSetTest { +@@ -119,7 +119,7 @@ public class BeforeExecutionFileFilterSetTest { useful for third party integrations. */ @Test @@ -20658,12 +21962,9 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileContentsTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileContentsTest.java -@@ -20,21 +20,21 @@ - package com.puppycrawl.tools.checkstyle.api; - +@@ -22,19 +22,19 @@ package com.puppycrawl.tools.checkstyle.api; import static com.google.common.truth.Truth.assertWithMessage; --import static org.junit.jupiter.api.Assertions.assertThrows; -+import static org.assertj.core.api.Assertions.assertThatThrownBy; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; @@ -20934,7 +22235,7 @@ assertWithMessage("Invalid results") .that( -@@ -335,22 +329,22 @@ public class FileContentsTest { +@@ -335,7 +329,7 @@ public class FileContentsTest { } @Test @@ -20943,10 +22244,7 @@ final FileContents cppComments = new FileContents( new FileText(new File("filename"), Arrays.asList("// comment ", " A + B ", " "))); - cppComments.reportSingleLineComment(1, 0); - final Map comments = cppComments.getSingleLineComments(); -- assertThrows(UnsupportedOperationException.class, () -> comments.remove(0)); -+ assertThatThrownBy(() -> comments.remove(0)).isInstanceOf(UnsupportedOperationException.class); +@@ -349,7 +343,7 @@ public class FileContentsTest { } @Test @@ -20955,12 +22253,6 @@ final FileContents clangComments = new FileContents( new FileText(new File("filename"), Arrays.asList("/* comment ", " ", " comment */"))); - clangComments.reportBlockComment(1, 0, 3, 9); - final Map> comments = clangComments.getBlockComments(); -- assertThrows(UnsupportedOperationException.class, () -> comments.remove(0)); -+ assertThatThrownBy(() -> comments.remove(0)).isInstanceOf(UnsupportedOperationException.class); - } - } --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileSetCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileSetCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -21114,15 +22406,7 @@ final FileText copy = new FileText(fileText); --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java -@@ -20,24 +20,24 @@ - package com.puppycrawl.tools.checkstyle.api; - - import static com.google.common.truth.Truth.assertWithMessage; --import static org.junit.jupiter.api.Assertions.assertThrows; -+import static org.assertj.core.api.Assertions.assertThatThrownBy; - - import com.puppycrawl.tools.checkstyle.filters.SeverityMatchFilter; - import java.util.Objects; +@@ -27,17 +27,17 @@ import java.util.Objects; import java.util.Set; import org.junit.jupiter.api.Test; @@ -21185,7 +22469,7 @@ final FilterSet filterSet = new FilterSet(); filterSet.addFilter(new DummyFilter(true)); filterSet.addFilter(new DummyFilter(false)); -@@ -92,12 +92,13 @@ public class FilterSetTest { +@@ -92,7 +92,7 @@ public class FilterSetTest { done for the time being */ @Test @@ -21194,14 +22478,7 @@ final FilterSet filterSet = new FilterSet(); final Filter filter = new FilterSet(); filterSet.addFilter(filter); - final Set subFilterSet = filterSet.getFilters(); -- assertThrows(UnsupportedOperationException.class, () -> subFilterSet.add(filter)); -+ assertThatThrownBy(() -> subFilterSet.add(filter)) -+ .isInstanceOf(UnsupportedOperationException.class); - } - - /* -@@ -105,7 +106,7 @@ public class FilterSetTest { +@@ -109,7 +109,7 @@ public class FilterSetTest { be useful for third party integrations */ @Test @@ -21785,15 +23062,15 @@ import com.puppycrawl.tools.checkstyle.ConfigurationLoader; import com.puppycrawl.tools.checkstyle.PropertiesExpander; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -29,7 +31,6 @@ import java.io.StringReader; - import java.lang.reflect.Modifier; +@@ -28,7 +30,6 @@ import java.io.IOException; + import java.io.StringReader; 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; -@@ -41,7 +42,6 @@ import java.util.Properties; + import java.util.HashMap; +@@ -39,7 +40,6 @@ import java.util.Properties; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -21801,7 +23078,7 @@ import org.xml.sax.InputSource; public final class InlineConfigParser { -@@ -184,7 +184,7 @@ public final class InlineConfigParser { +@@ -333,7 +333,7 @@ public final class InlineConfigParser { throws Exception { final TestInputConfiguration.Builder testInputConfigBuilder = new TestInputConfiguration.Builder(); @@ -21810,7 +23087,25 @@ final List lines = readFile(filePath); try { setModules(testInputConfigBuilder, inputFilePath, lines); -@@ -241,7 +241,7 @@ public final class InlineConfigParser { +@@ -353,7 +353,7 @@ public final class InlineConfigParser { + throws Exception { + final TestInputConfiguration.Builder testInputConfigBuilder = + new TestInputConfiguration.Builder(); +- final Path filePath = Paths.get(inputFilePath); ++ final Path filePath = Path.of(inputFilePath); + final List lines = readFile(filePath); + + try { +@@ -380,7 +380,7 @@ public final class InlineConfigParser { + */ + public static TestInputConfiguration parseWithXmlHeader(String inputFilePath) throws Exception { + +- final Path filePath = Paths.get(inputFilePath); ++ final Path filePath = Path.of(inputFilePath); + final List lines = readFile(filePath); + if (!checkIsXmlConfig(lines)) { + throw new CheckstyleException("Config cannot be parsed as xml."); +@@ -455,7 +455,7 @@ public final class InlineConfigParser { return lines.stream() .skip(1) .takeWhile(line -> !line.startsWith("*/")) @@ -21858,7 +23153,7 @@ public DefaultConfiguration createConfiguration() { --- a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/TestInputConfiguration.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/TestInputConfiguration.java -@@ -19,13 +19,14 @@ +@@ -19,6 +19,8 @@ package com.puppycrawl.tools.checkstyle.bdd; @@ -21867,6 +23162,7 @@ import com.puppycrawl.tools.checkstyle.Checker; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.TreeWalker; +@@ -26,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; @@ -21874,7 +23170,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -@@ -76,15 +77,15 @@ public final class TestInputConfiguration { +@@ -92,15 +93,15 @@ public final class TestInputConfiguration { } public List getChildrenModules() { @@ -21893,7 +23189,7 @@ } public DefaultConfiguration createConfiguration() { -@@ -163,7 +164,7 @@ public final class TestInputConfiguration { +@@ -194,7 +195,7 @@ public final class TestInputConfiguration { } public List getChildrenModules() { @@ -22363,7 +23659,7 @@ final String[] expected = { "13:14: " + getCheckMessage(MSG_KEY, "i"), "14:15: " + getCheckMessage(MSG_KEY, "i"), -@@ -129,7 +129,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { +@@ -129,13 +129,13 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } @Test @@ -22372,6 +23668,22 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFinalParametersReceiver.java"), expected); } + + @Test +- public void testUnnamedParametersPropertyTrue() throws Exception { ++ void unnamedParametersPropertyTrue() throws Exception { + final String[] expected = { + "25:18: " + getCheckMessage(MSG_KEY, "__"), + "30:18: " + getCheckMessage(MSG_KEY, "_e"), +@@ -149,7 +149,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnamedParametersPropertyFalse() throws Exception { ++ void unnamedParametersPropertyFalse() throws Exception { + final String[] expected = { + "20:18: " + getCheckMessage(MSG_KEY, "_"), + "25:18: " + getCheckMessage(MSG_KEY, "__"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java @@ -40,7 +40,7 @@ import java.util.List; @@ -22842,7 +24154,7 @@ + void outerTypeFilenameRecordsMethodRecordDef() throws Exception { final String[] expected = { - "10:1: " + getCheckMessage(MSG_KEY), + "11:1: " + getCheckMessage(MSG_KEY), @@ -158,7 +159,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } @@ -23117,15 +24429,6 @@ final SuppressWarningsHolder check = new SuppressWarningsHolder(); final Optional annotationDef = -@@ -414,7 +414,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- annotationDef.get(), -+ annotationDef.orElseThrow(), - "ENTRIES", - entries -> ((ThreadLocal>) entries).get().isEmpty())) - .isTrue(); @@ -445,7 +445,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } @@ -24033,6 +25336,15 @@ final String[] expected = { "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), "24:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), +@@ -312,7 +312,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationLocationOnLocalAndPatternVariables() throws Exception { ++ void annotationLocationOnLocalAndPatternVariables() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputAnnotationLocationLocalAndPatternVariables.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -24069,8 +25381,8 @@ - public void testAnnotationOnSameLineCheckPublicMethodAndVariable() throws Exception { + void annotationOnSameLineCheckPublicMethodAndVariable() throws Exception { final String[] expected = { - "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), - "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), + "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), + "21:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), @@ -82,7 +82,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } @@ -24078,8 +25390,8 @@ - public void testAnnotationOnSameLineCheckTokensOnMethodAndVar() throws Exception { + void annotationOnSameLineCheckTokensOnMethodAndVar() throws Exception { final String[] expected = { - "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation3"), - "19:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), + "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation3"), + "21:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), @@ -94,7 +94,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } @@ -24088,7 +25400,7 @@ + void annotationOnSameLineCheckPrivateAndDeprecatedVar() throws Exception { final String[] expected = { "19:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Ann"), - "24:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), + "25:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), @@ -106,7 +106,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } @@ -24106,7 +25418,16 @@ + void annotationOnSameLineRecordsAndCompactCtors() throws Exception { final String[] expected = { "13:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "NonNull1"), - "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), + "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), +@@ -146,7 +146,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationOnSameLinePatternVariables() throws Exception { ++ void annotationOnSameLinePatternVariables() throws Exception { + final String[] expected = { + "37:8: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Deprecated"), + }; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java @@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -24969,6 +26290,15 @@ final String[] expected = { "24:28: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -987,7 +987,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressWarningsPatternVariables() throws Exception { ++ void suppressWarningsPatternVariables() throws Exception { + + final String[] expected = { + "18:57: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, ""), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -25149,8 +26479,8 @@ + void emptyBlockSwitchExpressions() throws Exception { final String[] expected = { "17:30: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), - }; -@@ -215,7 +215,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + "116:32: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "case"), +@@ -217,7 +217,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } @Test @@ -25159,6 +26489,15 @@ final String[] expected = { "16:30: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), "22:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), +@@ -227,7 +227,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyBlockCaseAndDefaultWithTextOption() throws Exception { ++ void emptyBlockCaseAndDefaultWithTextOption() throws Exception { + final String[] expected = { + "20:28: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "case"), + "24:22: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -25661,7 +27000,7 @@ final String[] expected = { "16:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), "18:47: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), -@@ -243,7 +243,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { +@@ -246,7 +246,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } @Test @@ -25670,6 +27009,42 @@ final String[] expected = { "16:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), "18:47: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), +@@ -269,7 +269,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPatternMatchingForSwitch() throws Exception { ++ void patternMatchingForSwitch() throws Exception { + final String[] expected = { + "17:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "21:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), +@@ -293,7 +293,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPatternMatchingForSwitchAllowSingleLine() throws Exception { ++ void patternMatchingForSwitchAllowSingleLine() throws Exception { + final String[] expected = { + "17:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "21:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), +@@ -313,7 +313,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNeedBracesSwitchExpressionAndLambda() throws Exception { ++ void needBracesSwitchExpressionAndLambda() throws Exception { + final String[] expected = { + "21:24: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), + "24:24: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), +@@ -332,7 +332,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNeedBracesSwitchExpressionAndLambdaAllowSingleLine() throws Exception { ++ void needBracesSwitchExpressionAndLambdaAllowSingleLine() throws Exception { + final String[] expected = { + "27:24: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), + "46:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckTest.java @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -25789,7 +27164,15 @@ final String[] expected = { "70:26: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 26), "84:42: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 42), -@@ -293,7 +293,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -293,14 +293,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAloneOrSingleLineTryCatchBlock() throws Exception { ++ void aloneOrSingleLineTryCatchBlock() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRightCurlyTestAloneOrSinglelineTryCatchBlock.java"), expected); } @Test @@ -25798,7 +27181,7 @@ final String[] expected = { "19:9: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 9), }; -@@ -301,7 +301,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -308,7 +308,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25807,7 +27190,7 @@ final String[] expected = { "29:56: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 56), }; -@@ -309,7 +309,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -316,7 +316,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25816,7 +27199,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -328,7 +328,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -335,7 +335,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25825,7 +27208,7 @@ final String[] expected = { "70:9: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 9), "75:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), -@@ -338,7 +338,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -345,7 +345,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25834,7 +27217,7 @@ final String[] expected = { "19:9: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 9), "33:67: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 67), -@@ -349,7 +349,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -356,7 +356,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25843,7 +27226,7 @@ final String[] expected = { "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), "33:67: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 67), -@@ -364,7 +364,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -371,7 +371,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25851,8 +27234,8 @@ + void tryWithResourceAloneSingle() throws Exception { final String[] expected = { "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), - "36:64: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 64), -@@ -376,7 +376,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + "43:15: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 15), +@@ -382,7 +382,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25861,7 +27244,7 @@ final String[] expected = { "13:32: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 32), "15:45: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 45), -@@ -386,26 +386,26 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -392,26 +392,26 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25892,7 +27275,7 @@ final String[] expected = { "16:15: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 15), "17:21: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 21), -@@ -433,7 +433,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -439,7 +439,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25901,7 +27284,7 @@ final String[] expected = { "21:26: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 26), "30:37: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 37), -@@ -450,7 +450,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -456,7 +456,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25910,7 +27293,7 @@ final String[] expected = { "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), "21:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), -@@ -471,7 +471,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -477,7 +477,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25919,7 +27302,7 @@ final String[] expected = { "13:31: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 31), "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), -@@ -499,7 +499,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -505,7 +505,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25928,7 +27311,7 @@ final String[] expected = { "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), "21:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), -@@ -520,7 +520,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -526,7 +526,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25937,7 +27320,7 @@ final String[] expected = { "13:19: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 19), "16:20: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 20), -@@ -530,7 +530,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -536,7 +536,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25946,7 +27329,7 @@ final String[] expected = { "16:20: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 20), }; -@@ -539,7 +539,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -545,7 +545,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25955,7 +27338,7 @@ final String[] expected = { "16:20: " + getCheckMessage(MSG_KEY_LINE_BREAK_BEFORE, "}", 20), }; -@@ -547,7 +547,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -553,7 +553,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25964,7 +27347,7 @@ final String[] expected = { "14:1: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 1), "14:2: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 2), -@@ -556,13 +556,13 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -562,13 +562,13 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25980,7 +27363,7 @@ final String[] expected = { "16:2: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 2), "16:3: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 3), -@@ -571,7 +571,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -577,7 +577,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25989,7 +27372,7 @@ final String[] expected = { "23:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), "23:11: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 11), -@@ -585,7 +585,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -591,7 +591,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -25998,7 +27381,7 @@ final String[] expected = { "24:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), "28:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), -@@ -598,7 +598,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -604,7 +604,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26007,7 +27390,7 @@ final String[] expected = { "24:38: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 38), "30:43: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 43), -@@ -611,7 +611,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -617,7 +617,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26016,7 +27399,7 @@ final String[] expected = { "16:46: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 46), "21:35: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 35), -@@ -621,7 +621,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -627,7 +627,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26025,7 +27408,7 @@ final String[] expected = { "19:12: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 12), "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), -@@ -630,7 +630,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -636,7 +636,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26034,7 +27417,7 @@ final String[] expected = { "20:24: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 24), "27:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), -@@ -644,7 +644,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -650,7 +650,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26043,7 +27426,7 @@ final String[] expected = { "20:24: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 24), "27:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), -@@ -654,7 +654,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -660,7 +660,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26052,7 +27435,7 @@ final String[] expected = { "15:22: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 22), "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), -@@ -677,7 +677,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -683,7 +683,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26061,7 +27444,7 @@ final String[] expected = { "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), "19:36: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 36), -@@ -693,7 +693,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -699,7 +699,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26070,7 +27453,7 @@ final String[] expected = { "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), "19:36: " + getCheckMessage(MSG_KEY_LINE_BREAK_BEFORE, "}", 36), -@@ -710,7 +710,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -716,7 +716,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26079,7 +27462,7 @@ final String[] expected = { "48:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), "56:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), -@@ -721,7 +721,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -727,7 +727,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26088,7 +27471,7 @@ final String[] expected = { "46:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), "54:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), -@@ -733,14 +733,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -739,14 +739,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26105,7 +27488,7 @@ final String[] expected = { "117:28: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 28), }; -@@ -749,14 +749,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -755,14 +755,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26122,7 +27505,7 @@ final String[] expected = { "16:66: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 66), "23:61: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 61), -@@ -770,14 +770,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { +@@ -776,21 +776,21 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } @Test @@ -26139,6 +27522,95 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( getNonCompilablePath("InputRightCurlyTestSwitchExpression7.java"), expected); + } + + @Test +- public void testCaseBlocksInSwitchStatementAlone() throws Exception { ++ void caseBlocksInSwitchStatementAlone() throws Exception { + final String[] expected = { + "33:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), + "44:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -805,7 +805,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksInSwitchStatementAlone2() throws Exception { ++ void caseBlocksInSwitchStatementAlone2() throws Exception { + final String[] expected = { + "17:15: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 15), + "26:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -826,7 +826,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksInSwitchStatementAloneOrSingleLine() throws Exception { ++ void caseBlocksInSwitchStatementAloneOrSingleLine() throws Exception { + final String[] expected = { + "33:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), + "44:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -838,7 +838,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksInSwitchStatementAloneOrSingle2() throws Exception { ++ void caseBlocksInSwitchStatementAloneOrSingle2() throws Exception { + final String[] expected = { + "18:15: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 15), + "27:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -854,7 +854,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksInSwitchStatementSame() throws Exception { ++ void caseBlocksInSwitchStatementSame() throws Exception { + final String[] expected = { + "33:16: " + getCheckMessage(MSG_KEY_LINE_BREAK_BEFORE, "}", 16), + "44:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -867,7 +867,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksInSwitchStatementSame2() throws Exception { ++ void caseBlocksInSwitchStatementSame2() throws Exception { + final String[] expected = { + "18:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), + "27:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -885,7 +885,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksWithSwitchRuleAlone() throws Exception { ++ void caseBlocksWithSwitchRuleAlone() throws Exception { + final String[] expected = { + "32:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), + "44:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), +@@ -903,7 +903,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksWithSwitchRuleAloneOrSingleLine() throws Exception { ++ void caseBlocksWithSwitchRuleAloneOrSingleLine() throws Exception { + + final String[] expected = { + "27:19: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 19), +@@ -921,7 +921,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksWithSwitchExpressionAlone() throws Exception { ++ void caseBlocksWithSwitchExpressionAlone() throws Exception { + final String[] expected = { + "63:31: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 31), + "86:42: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 42), +@@ -931,7 +931,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseBlocksWithSwitchExpressionAloneOrSingleLine() throws Exception { ++ void caseBlocksWithSwitchExpressionAloneOrSingleLine() throws Exception { + final String[] expected = { + "63:31: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 31), + }; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckTest.java @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCh @@ -26195,8 +27667,8 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { final String[] expected = { - "14:53: " + getCheckMessage(MSG_KEY), - "19:40: " + getCheckMessage(MSG_KEY), + "15:53: " + getCheckMessage(MSG_KEY), + "20:40: " + getCheckMessage(MSG_KEY), @@ -54,7 +54,7 @@ public class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestS } @@ -26264,6 +27736,43 @@ final AvoidNoArgumentSuperConstructorCallCheck check = new AvoidNoArgumentSuperConstructorCallCheck(); final int[] expected = { +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ConstructorsDeclarationGroupingCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ConstructorsDeclarationGroupingCheckTest.java +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ConstructorsDeclarat + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class ConstructorsDeclarationGroupingCheckTest extends AbstractModuleTestSupport { ++final class ConstructorsDeclarationGroupingCheckTest extends AbstractModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/puppycrawl/tools/checkstyle/checks/coding/constructorsdeclarationgrouping"; + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "23:5: " + getCheckMessage(MSG_KEY, 19), + "28:5: " + getCheckMessage(MSG_KEY, 19), +@@ -50,7 +50,7 @@ public class ConstructorsDeclarationGroupingCheckTest extends AbstractModuleTest + } + + @Test +- public void testConstructorsDeclarationGroupingRecords() throws Exception { ++ void constructorsDeclarationGroupingRecords() throws Exception { + + final String[] expected = { + "20:9: " + getCheckMessage(MSG_KEY, 12), +@@ -64,7 +64,7 @@ public class ConstructorsDeclarationGroupingCheckTest extends AbstractModuleTest + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final ConstructorsDeclarationGroupingCheck check = new ConstructorsDeclarationGroupingCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckTest.java @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck @@ -26633,6 +28142,15 @@ final String[] expected = { "12:17: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), "13:17: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -261,7 +261,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualAvoidNullRecordPattern() throws Exception { ++ void equalAvoidNullRecordPattern() throws Exception { + final String[] expected = { + "22:40: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), + "29:34: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckTest.java @@ -23,17 +23,17 @@ import static com.google.common.truth.Truth.assertWithMessage; @@ -26879,7 +28397,7 @@ final String[] expected = { "48:11: " + getCheckMessage(MSG_FALL_THROUGH_LAST), "83:11: " + getCheckMessage(MSG_FALL_THROUGH_LAST), -@@ -242,7 +242,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { +@@ -241,7 +241,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test @@ -26888,7 +28406,7 @@ final String[] expected = { "94:13: " + getCheckMessage(MSG_FALL_THROUGH), }; -@@ -250,7 +250,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { +@@ -249,7 +249,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test @@ -26897,7 +28415,7 @@ final String[] expected = { "23:13: " + getCheckMessage(MSG_FALL_THROUGH), "27:13: " + getCheckMessage(MSG_FALL_THROUGH), -@@ -264,13 +264,13 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { +@@ -263,13 +263,13 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test @@ -26913,7 +28431,7 @@ final String[] expected = { "20:13: " + getCheckMessage(MSG_FALL_THROUGH), "43:13: " + getCheckMessage(MSG_FALL_THROUGH), }; -@@ -279,14 +279,14 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { +@@ -278,14 +278,14 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test @@ -26930,7 +28448,7 @@ final String[] expected = { "21:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), "36:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), -@@ -299,7 +299,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { +@@ -298,7 +298,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test @@ -26938,8 +28456,8 @@ + void lastLine() throws Exception { final String[] expected = { "21:13: " + getCheckMessage(MSG_FALL_THROUGH), - // until https://github.com/checkstyle/checkstyle/issues/13553 -@@ -312,7 +312,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + "99:39: " + getCheckMessage(MSG_FALL_THROUGH_LAST), +@@ -307,7 +307,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test @@ -26948,15 +28466,75 @@ final String[] expected = { "19:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), "22:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), -@@ -321,7 +321,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { +@@ -316,13 +316,13 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } @Test - public void testReliefCommentBetweenMultipleComment() throws Exception { + void reliefCommentBetweenMultipleComment() throws Exception { + final String[] expected = {}; + verifyWithInlineConfigParser(getPath("InputFallThrough8.java"), expected); + } + + @Test +- public void testLabeledBreak() throws Exception { ++ void labeledBreak() throws Exception { final String[] expected = { - // until https://github.com/checkstyle/checkstyle/issues/13553 - "25:17: " + getCheckMessage(MSG_FALL_THROUGH), + "51:17: " + getCheckMessage(MSG_FALL_THROUGH), + "55:17: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -334,7 +334,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchLabeledRules() throws Exception { ++ void switchLabeledRules() throws Exception { + final String[] expected = {}; + + verifyWithInlineConfigParser( +@@ -342,7 +342,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineSingleCase() throws Exception { ++ void inlineSingleCase() throws Exception { + final String[] expected = { + "12:17: " + getCheckMessage(MSG_FALL_THROUGH_LAST), + }; +@@ -351,14 +351,14 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineMultipleComment() throws Exception { ++ void inlineMultipleComment() throws Exception { + final String[] expected = {}; + + verifyWithInlineConfigParser(getPath("InputFallThroughMultipleReliefPatterns.java"), expected); + } + + @Test +- public void testFallThroughWithoutReliefPattern() throws Exception { ++ void fallThroughWithoutReliefPattern() throws Exception { + final String[] expected = { + "21:9: " + getCheckMessage(MSG_FALL_THROUGH), + "45:9: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -371,7 +371,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFallThroughWithPatternMatching() throws Exception { ++ void fallThroughWithPatternMatching() throws Exception { + final String[] expected = { + "19:13: " + getCheckMessage(MSG_FALL_THROUGH), + "22:13: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -385,7 +385,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFallThroughWithPatternMatchingCheckLastCase() throws Exception { ++ void fallThroughWithPatternMatchingCheckLastCase() throws Exception { + final String[] expected = { + "19:13: " + getCheckMessage(MSG_FALL_THROUGH), + "21:13: " + getCheckMessage(MSG_FALL_THROUGH), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -27247,6 +28825,24 @@ final String[] expected = { "20:17: " + getCheckMessage(MSG_KEY, "start"), "22:17: " + getCheckMessage(MSG_KEY, "end"), +@@ -364,7 +364,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateUnnamedVariablesTrue() throws Exception { ++ void validateUnnamedVariablesTrue() throws Exception { + final String[] expected = { + "21:22: " + getCheckMessage(MSG_KEY, "i"), + "22:17: " + getCheckMessage(MSG_KEY, "_"), +@@ -380,7 +380,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateUnnamedVariablesFalse() throws Exception { ++ void validateUnnamedVariablesFalse() throws Exception { + final String[] expected = { + "21:22: " + getCheckMessage(MSG_KEY, "i"), + "23:17: " + getCheckMessage(MSG_KEY, "__"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java @@ -34,7 +34,7 @@ import java.util.Optional; @@ -27418,7 +29014,16 @@ final String[] expected = { "49:27: " + getCheckMessage(MSG_KEY, "x"), -@@ -475,7 +475,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { +@@ -469,7 +469,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHiddenFieldRecordPattern() throws Exception { ++ void hiddenFieldRecordPattern() throws Exception { + + final String[] expected = { + "18:46: " + getCheckMessage(MSG_KEY, "s"), +@@ -493,7 +493,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @Test @@ -27427,15 +29032,6 @@ final HiddenFieldCheck check = new HiddenFieldCheck(); final DetailAST root = JavaParser.parseFile( -@@ -487,7 +487,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( -- check, classDef.get(), "frame", new CheckIfStatefulFieldCleared())) -+ check, classDef.orElseThrow(), "frame", new CheckIfStatefulFieldCleared())) - .isTrue(); - } - --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.MS @@ -27605,15 +29201,6 @@ final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); final DetailAST root = JavaParser.parseFile( -@@ -169,7 +169,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- classDef.get(), -+ classDef.orElseThrow(), - "classNames", - classNames -> ((Collection) classNames).isEmpty())) - .isTrue(); @@ -182,7 +182,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @@ -27623,19 +29210,7 @@ final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); final DetailAST root = JavaParser.parseFile( -@@ -195,7 +195,10 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( -- check, importDef.get(), "imports", imports -> ((Collection) imports).isEmpty())) -+ check, -+ importDef.orElseThrow(), -+ "imports", -+ imports -> ((Collection) imports).isEmpty())) - .isTrue(); - } - -@@ -205,9 +208,9 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { +@@ -208,9 +208,9 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { * * @throws Exception when code tested throws exception */ @@ -27647,15 +29222,7 @@ final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); final DetailAST root = JavaParser.parseFile( -@@ -221,14 +224,14 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- literalNew.get(), -+ literalNew.orElseThrow(), - "instantiations", - instantiations -> ((Collection) instantiations).isEmpty())) - .isTrue(); +@@ -231,7 +231,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { } @Test @@ -27847,39 +29414,39 @@ } @Test -- public void testCaseSensitive() throws Exception { -+ void caseSensitive() throws Exception { +- public void testIllegalTokenTextCheckDefaultCaseSensitive() throws Exception { ++ void illegalTokenTextCheckDefaultCaseSensitive() throws Exception { final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), }; -@@ -47,7 +48,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -48,7 +49,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test -- public void testCaseInSensitive() throws Exception { -+ void caseInSensitive() throws Exception { +- public void testIllegalTokenTextCheckCaseInSensitive() throws Exception { ++ void illegalTokenTextCheckCaseInSensitive() throws Exception { final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), "35:32: " + getCheckMessage(MSG_KEY, "a href"), -@@ -56,7 +57,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -58,7 +59,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test -- public void testCustomMessage() throws Exception { -+ void customMessage() throws Exception { +- public void testIllegalTokenTextCheckCustomMessageInStringLiteral() throws Exception { ++ void illegalTokenTextCheckCustomMessageInStringLiteral() throws Exception { final String[] expected = { "34:28: " + "My custom message", -@@ -65,7 +66,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -68,7 +69,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test -- public void testNullCustomMessage() throws Exception { -+ void nullCustomMessage() throws Exception { +- public void testIllegalTokenTextCheckNullMessageInStringLiteral() throws Exception { ++ void illegalTokenTextCheckNullMessageInStringLiteral() throws Exception { final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), -@@ -74,7 +75,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -78,7 +79,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -27888,7 +29455,7 @@ final String[] expected = { "16:28: " + getCheckMessage(MSG_KEY, "a href"), -@@ -88,7 +89,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -92,7 +93,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -27897,7 +29464,7 @@ final String[] expected = { "16:28: " + getCheckMessage(MSG_KEY, "\""), -@@ -104,7 +105,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -108,7 +109,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -27906,25 +29473,16 @@ final IllegalTokenTextCheck check = new IllegalTokenTextCheck(); assertWithMessage("Acceptable tokens should not be null") .that(check.getAcceptableTokens()) -@@ -121,7 +122,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -125,7 +126,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test -- public void testCommentToken() throws Exception { -+ void commentToken() throws Exception { +- public void testIllegalTokenTextCheckCommentToken() throws Exception { ++ void illegalTokenTextCheckCommentToken() throws Exception { final String[] expected = { "1:3: " + getCheckMessage(MSG_KEY, "a href"), "45:28: " + getCheckMessage(MSG_KEY, "a href"), -@@ -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 { +@@ -134,19 +135,19 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -27944,10 +29502,10 @@ @Test - public void testAcceptableTokensMakeSense() { + void acceptableTokensMakeSense() { - final int expectedTokenTypesTotalNumber = 195; + final int expectedTokenTypesTotalNumber = 189; assertWithMessage( "Total number of TokenTypes has changed, acceptable tokens in" -@@ -192,7 +193,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +@@ -179,7 +180,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } @Test @@ -28136,8 +29694,8 @@ - public void testIllegalTypeEnhancedInstanceof() throws Exception { + void illegalTypeEnhancedInstanceof() throws Exception { final String[] expected = { - "28:9: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), - "31:28: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), + "29:9: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), + "32:28: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), @@ -304,7 +304,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } @@ -28235,6 +29793,24 @@ final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY, "Gitter"), }; +@@ -438,7 +438,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTypeWithRecordPattern() throws Exception { ++ void illegalTypeWithRecordPattern() throws Exception { + final String[] expected = { + "28:25: " + getCheckMessage(MSG_KEY, "Point"), + "29:22: " + getCheckMessage(MSG_KEY, "ColoredPoint"), +@@ -467,7 +467,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTypeInPermitsList() throws Exception { ++ void illegalTypeInPermitsList() throws Exception { + final String[] expected = { + "22:52: " + getCheckMessage(MSG_KEY, "D"), + "27:28: " + getCheckMessage(MSG_KEY, "D"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -28298,6 +29874,15 @@ final InnerAssignmentCheck check = new InnerAssignmentCheck(); assertWithMessage("Acceptable tokens should not be null") .that(check.getAcceptableTokens()) +@@ -102,7 +102,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerAssignmentSwitchAndSwitchExpression() throws Exception { ++ void innerAssignmentSwitchAndSwitchExpression() throws Exception { + final String[] expected = { + "28:23: " + getCheckMessage(MSG_KEY), + "38:25: " + getCheckMessage(MSG_KEY), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckTest.java @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -28562,13 +30147,22 @@ @@ -588,7 +588,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } + @Test +- public void testMagicNumberIgnoreFieldDeclarationWithAnnotation() throws Exception { ++ void magicNumberIgnoreFieldDeclarationWithAnnotation() throws Exception { + final String[] expected = { + "16:38: " + getCheckMessage(MSG_KEY, "3"), + "20:40: " + getCheckMessage(MSG_KEY, "60"), +@@ -599,7 +599,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testIgnoreInAnnotationElementDefault() throws Exception { + void ignoreInAnnotationElementDefault() throws Exception { final String[] expected = { "18:29: " + getCheckMessage(MSG_KEY, "10"), "19:33: " + getCheckMessage(MSG_KEY, "11"), }; -@@ -596,7 +596,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { +@@ -607,7 +607,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } @Test @@ -28577,7 +30171,7 @@ final String[] expected = { "38:29: " + getCheckMessage(MSG_KEY, "3.0"), "39:32: " + getCheckMessage(MSG_KEY, "1.5_0"), -@@ -635,7 +635,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { +@@ -646,7 +646,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } @Test @@ -28586,7 +30180,7 @@ final String[] expected = { "25:17: " + getCheckMessage(MSG_KEY, "9"), "27:20: " + getCheckMessage(MSG_KEY, "5.5"), -@@ -659,7 +659,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { +@@ -670,13 +670,13 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } @Test @@ -28595,6 +30189,22 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMagicNumberMagicNumber3.java"), expected); } + + @Test +- public void testMagicNumberInGuards() throws Exception { ++ void magicNumberInGuards() throws Exception { + final String[] expected = { + "21:63: " + getCheckMessage(MSG_KEY, "3"), + "21:72: " + getCheckMessage(MSG_KEY, "8"), +@@ -693,7 +693,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMagicNumberWithUnnamedVariables() throws Exception { ++ void magicNumberWithUnnamedVariables() throws Exception { + final String[] expected = { + "20:17: " + getCheckMessage(MSG_KEY, "9"), + "22:21: " + getCheckMessage(MSG_KEY, "17"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckTest.java @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -28770,7 +30380,7 @@ - public void testMatchXpathWithFailedEvaluation() { + void matchXpathWithFailedEvaluation() { final CheckstyleException ex = - assertThrows( + getExpectedThrowable( CheckstyleException.class, --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckTest.java @@ -28787,8 +30397,8 @@ } @Test -- public void testMissingSwitchDefault() throws Exception { -+ void missingSwitchDefault() throws Exception { +- public void testMissingCtorEmptyClass() throws Exception { ++ void missingCtorEmptyClass() throws Exception { final String[] expected = { "9:1: " + getCheckMessage(MSG_KEY), @@ -28805,11 +30415,76 @@ } @Test -- public void testMissingCtorClassOnOneLine() throws Exception { -+ void missingCtorClassOnOneLine() throws Exception { +- public void testMissingCtorNestedClasses() throws Exception { ++ void missingCtorNestedClasses() throws Exception { final String[] expected = { "9:1: " + getCheckMessage(MSG_KEY), +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport { ++final class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final MissingNullCaseInSwitchCheck check = new MissingNullCaseInSwitchCheck(); + final int[] expected = {TokenTypes.LITERAL_SWITCH}; + +@@ -51,7 +51,7 @@ public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMissingNullCaseInSwitchWithPattern() throws Exception { ++ void missingNullCaseInSwitchWithPattern() throws Exception { + final String[] expected = { + "12:9: " + getCheckMessage(MSG_KEY), + "31:9: " + getCheckMessage(MSG_KEY), +@@ -64,7 +64,7 @@ public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMissingNullCaseInSwitchWithPattern2() throws Exception { ++ void missingNullCaseInSwitchWithPattern2() throws Exception { + final String[] expected = { + "11:9: " + getCheckMessage(MSG_KEY), "40:9: " + getCheckMessage(MSG_KEY), + }; +@@ -73,7 +73,7 @@ public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMissingNullCaseInSwitchWithRecordPattern() throws Exception { ++ void missingNullCaseInSwitchWithRecordPattern() throws Exception { + final String[] expected = { + "12:9: " + getCheckMessage(MSG_KEY), + "32:9: " + getCheckMessage(MSG_KEY), +@@ -86,7 +86,7 @@ public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMissingNullCaseInSwitchWithStringLiterals() throws Exception { ++ void missingNullCaseInSwitchWithStringLiterals() throws Exception { + final String[] expected = { + "12:9: " + getCheckMessage(MSG_KEY), + "23:9: " + getCheckMessage(MSG_KEY), +@@ -103,7 +103,7 @@ public class MissingNullCaseInSwitchCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMissingNullCaseInSwitchWithPrimitives() throws Exception { ++ void missingNullCaseInSwitchWithPrimitives() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputMissingNullCaseInSwitchWithPrimitives.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -28874,7 +30549,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( getNonCompilablePath("InputMissingSwitchDefaultCheckSwitchExpressionsThree.java"), -@@ -93,7 +93,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { +@@ -93,21 +93,21 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } @Test @@ -28883,6 +30558,22 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( getNonCompilablePath("InputMissingSwitchDefaultCaseLabelElements.java"), expected); + } + + @Test +- public void testMissingSwitchDefaultRecordPattern() throws Exception { ++ void missingSwitchDefaultRecordPattern() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputMissingSwitchDefaultRecordPattern.java"), expected); + } + + @Test +- public void testMissingSwitchDefaultWithSwitchExpressionUnderMethodCall() throws Exception { ++ void missingSwitchDefaultWithSwitchExpressionUnderMethodCall() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_KEY), + }; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckTest.java @@ -35,7 +35,7 @@ import java.util.Optional; @@ -28978,15 +30669,6 @@ final ModifiedControlVariableCheck check = new ModifiedControlVariableCheck(); final Optional methodDef = TestUtil.findTokenInAstByPredicate( -@@ -184,7 +184,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- methodDef.get(), -+ methodDef.orElseThrow(), - "variableStack", - variableStack -> ((Collection>) variableStack).isEmpty())) - .isTrue(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckTest.java @@ -31,7 +31,7 @@ import java.util.Arrays; @@ -29117,6 +30799,15 @@ final String[] expected = { "11:5: " + getCheckMessage(MSG_MULTIPLE), "14:5: " + getCheckMessage(MSG_MULTIPLE), +@@ -76,7 +76,7 @@ public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testUnnamedVariables() throws Exception { ++ void unnamedVariables() throws Exception { + + final String[] expected = { + "12:9: " + getCheckMessage(MSG_MULTIPLE_COMMA), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -29132,21 +30823,21 @@ * @throws Exception necessary to fulfill JUnit's interface-requirements for test-methods. */ @Test -- public void testNestedTooDeep() throws Exception { -+ void nestedTooDeep() throws Exception { +- public void testNestedForDepthCheckCustomMaxLevelTwo() throws Exception { ++ void nestedForDepthCheckCustomMaxLevelTwo() throws Exception { final String[] expected = { "32:11: " + getCheckMessage(MSG_KEY, 3, 2), -@@ -60,7 +60,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { +@@ -61,7 +61,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { * @throws Exception necessary to fulfill JUnit's interface-requirements for test-methods. */ @Test -- public void testNestedOk() throws Exception { -+ void nestedOk() throws Exception { +- public void testNestedForDepthCheckCustomMaxLevelFour() throws Exception { ++ void nestedForDepthCheckCustomMaxLevelFour() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -68,7 +68,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { +@@ -70,7 +70,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { } @Test @@ -29155,12 +30846,12 @@ final NestedForDepthCheck check = new NestedForDepthCheck(); assertWithMessage("Acceptable tokens should not be null") .that(check.getAcceptableTokens()) -@@ -82,7 +82,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { +@@ -84,7 +84,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { } @Test -- public void testNestedDefault() throws Exception { -+ void nestedDefault() throws Exception { +- public void testNestedForDepthCheckDefaultMaxLevel() throws Exception { ++ void nestedForDepthCheckDefaultMaxLevel() throws Exception { final String[] expected = { "27:9: " + getCheckMessage(MSG_KEY, 2, 1), }; @@ -29196,6 +30887,15 @@ @@ -56,7 +56,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { } + @Test +- public void testInsideCaseBody() throws Exception { ++ void insideCaseBody() throws Exception { + + final String[] expected = { + "17:25: " + getCheckMessage(MSG_KEY, 2, 1), +@@ -67,7 +67,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29543,7 +31243,7 @@ final String[] expected = { "32:5: " + getCheckMessage(MSG_KEY, 21), -@@ -46,7 +46,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest +@@ -50,7 +50,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } @Test @@ -29552,7 +31252,7 @@ final String[] expected = { "21:9: " + getCheckMessage(MSG_KEY, 15), -@@ -58,7 +58,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest +@@ -63,7 +63,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } @Test @@ -29561,7 +31261,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -67,7 +67,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest +@@ -72,7 +72,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } @Test @@ -29755,15 +31455,6 @@ final ParameterAssignmentCheck check = new ParameterAssignmentCheck(); final Optional methodDef = TestUtil.findTokenInAstByPredicate( -@@ -111,7 +111,7 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- methodDef.get(), -+ methodDef.orElseThrow(), - "parameterNamesStack", - parameterNamesStack -> ((Collection>) parameterNamesStack).isEmpty())) - .isTrue(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java @@ -39,7 +39,7 @@ import java.util.SortedSet; @@ -30098,18 +31789,6 @@ final RequireThisCheck check = new RequireThisCheck(); final DetailAST root = JavaParser.parseFile( -@@ -536,7 +536,10 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( -- check, classDef.get(), "current", current -> ((Collection) current).isEmpty())) -+ check, -+ classDef.orElseThrow(), -+ "current", -+ current -> ((Collection) current).isEmpty())) - .isTrue(); - } - } --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckTest.java @@ -37,7 +37,7 @@ import java.util.Optional; @@ -30203,15 +31882,6 @@ final ReturnCountCheck check = new ReturnCountCheck(); final Optional methodDef = TestUtil.findTokenInAstByPredicate( -@@ -160,7 +160,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- methodDef.get(), -+ methodDef.orElseThrow(), - "contextStack", - contextStack -> ((Collection>) contextStack).isEmpty())) - .isTrue(); @@ -172,7 +172,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { * beneficial. */ @@ -30253,6 +31923,15 @@ @@ -53,7 +53,7 @@ public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSuppor } + @Test +- public void testWhenExpression() throws Exception { ++ void whenExpression() throws Exception { + final String[] expected = { + "13:41: " + getCheckMessage(MSG_KEY), + "16:41: " + getCheckMessage(MSG_KEY), +@@ -66,7 +66,7 @@ public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSuppor + } + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -30282,6 +31961,15 @@ @@ -41,7 +41,7 @@ public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { } + @Test +- public void testYield() throws Exception { ++ void yield() throws Exception { + final String[] expected = { + "14:17: " + getCheckMessage(MSG_KEY), + "28:17: " + getCheckMessage(MSG_KEY), +@@ -53,7 +53,7 @@ public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -30410,15 +32098,6 @@ final AbstractSuperCheck check = new SuperCloneCheck(); final Optional methodDef = TestUtil.findTokenInAstByPredicate( -@@ -102,7 +102,7 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- methodDef.get(), -+ methodDef.orElseThrow(), - "methodStack", - methodStack -> ((Collection>) methodStack).isEmpty())) - .isTrue(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck.M @@ -30513,15 +32192,16 @@ final String[] expected = { "19:23: " + getCheckMessage(MSG_STRING, "\"this\""), "19:34: " + getCheckMessage(MSG_STRING, "\"that\""), -@@ -170,14 +170,14 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -170,7 +170,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test - public void testUnnecessaryParenthesesPatterns() throws Exception { + void unnecessaryParenthesesPatterns() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser( - getNonCompilablePath("InputUnnecessaryParenthesesCheckPatterns.java"), expected); + final String[] expected = { + "24:22: " + getCheckMessage(MSG_ASSIGN), + "27:21: " + getCheckMessage(MSG_ASSIGN), +@@ -181,7 +181,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30530,7 +32210,7 @@ final UnnecessaryParenthesesCheck check = new UnnecessaryParenthesesCheck(); assertWithMessage("Acceptable tokens should not be null") .that(check.getAcceptableTokens()) -@@ -191,7 +191,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -195,7 +195,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30539,7 +32219,7 @@ final String[] expected = { "20:20: " + getCheckMessage(MSG_EXPR), -@@ -225,7 +225,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -229,7 +229,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30548,7 +32228,7 @@ final String[] expected = { "28:17: " + getCheckMessage(MSG_EXPR), "39:17: " + getCheckMessage(MSG_EXPR), -@@ -241,7 +241,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -245,7 +245,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30557,7 +32237,7 @@ final String[] expected = { "22:17: " + getCheckMessage(MSG_IDENT, "test"), "31:18: " + getCheckMessage(MSG_ASSIGN), -@@ -259,7 +259,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -263,7 +263,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30566,7 +32246,7 @@ final String[] expected = { "20:17: " + getCheckMessage(MSG_EXPR), "22:17: " + getCheckMessage(MSG_EXPR), -@@ -293,7 +293,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -297,7 +297,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30575,7 +32255,7 @@ final String[] expected = { "66:18: " + getCheckMessage(MSG_EXPR), "67:17: " + getCheckMessage(MSG_EXPR), -@@ -311,7 +311,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +@@ -315,13 +315,13 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } @Test @@ -30584,6 +32264,22 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputUnnecessaryParenthesesOperator3.java"), expected); } + + @Test +- public void testWhenExpressions() throws Exception { ++ void whenExpressions() throws Exception { + final String[] expected = { + "22:33: " + getCheckMessage(MSG_EXPR), + "24:32: " + getCheckMessage(MSG_EXPR), +@@ -336,7 +336,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnecessaryParenthesesConditionalExpression() throws Exception { ++ void unnecessaryParenthesesConditionalExpression() throws Exception { + final String[] expected = { + "19:17: " + getCheckMessage(MSG_EXPR), + "19:29: " + getCheckMessage(MSG_LITERAL, "3"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -30736,9 +32432,130 @@ final UnnecessarySemicolonInTryWithResourcesCheck check = new UnnecessarySemicolonInTryWithResourcesCheck(); final int[] expected = { +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedCatchParameterShouldBeUnnamedCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedCatchParameterShouldBeUnnamedCheckTest.java +@@ -32,7 +32,7 @@ import java.util.Collection; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModuleTestSupport { ++final class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModule + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final UnusedCatchParameterShouldBeUnnamedCheck checkObj = + new UnusedCatchParameterShouldBeUnnamedCheck(); + final int[] expected = { +@@ -58,7 +58,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModule + } + + @Test +- public void testUnusedCatchParameterShouldBeUnnamed() throws Exception { ++ void unusedCatchParameterShouldBeUnnamed() throws Exception { + final String[] expected = { + "17:16: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), + "24:16: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), +@@ -74,7 +74,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModule + } + + @Test +- public void testUnusedCatchParameterShouldBeUnnamedWithResourceAndFinally() throws Exception { ++ void unusedCatchParameterShouldBeUnnamedWithResourceAndFinally() throws Exception { + final String[] expected = { + "19:18: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), + "38:18: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), +@@ -87,7 +87,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModule + } + + @Test +- public void testUnusedCatchParameterShouldBeUnnamedNested() throws Exception { ++ void unusedCatchParameterShouldBeUnnamedNested() throws Exception { + final String[] expected = { + "15:18: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), + "18:22: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "ex"), +@@ -100,7 +100,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModule + } + + @Test +- public void testUnusedCatchParameterShouldBeUnnamedInsideAnonClass() throws Exception { ++ void unusedCatchParameterShouldBeUnnamedInsideAnonClass() throws Exception { + final String[] expected = { + "14:18: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), + "39:28: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "e"), +@@ -115,7 +115,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckTest extends AbstractModule + } + + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final UnusedCatchParameterShouldBeUnnamedCheck check = + new UnusedCatchParameterShouldBeUnnamedCheck(); + +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLambdaParameterShouldBeUnnamedCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLambdaParameterShouldBeUnnamedCheckTest.java +@@ -32,7 +32,7 @@ import java.util.Collection; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModuleTestSupport { ++final class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModul + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final UnusedLambdaParameterShouldBeUnnamedCheck checkObj = + new UnusedLambdaParameterShouldBeUnnamedCheck(); + final int[] expected = { +@@ -58,7 +58,7 @@ public class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModul + } + + @Test +- public void testSingleLambdaParameter() throws Exception { ++ void singleLambdaParameter() throws Exception { + final String[] expected = { + "18:45: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "character"), + "23:32: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "character"), +@@ -76,7 +76,7 @@ public class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModul + } + + @Test +- public void testMultipleLambdaParameters() throws Exception { ++ void multipleLambdaParameters() throws Exception { + final String[] expected = { + "18:56: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "x"), + "18:59: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "y"), +@@ -97,7 +97,7 @@ public class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModul + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + final String[] expected = { + "17:56: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "x"), + "17:59: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "y"), +@@ -118,7 +118,7 @@ public class UnusedLambdaParameterShouldBeUnnamedCheckTest extends AbstractModul + } + + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final UnusedLambdaParameterShouldBeUnnamedCheck check = + new UnusedLambdaParameterShouldBeUnnamedCheck(); + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckTest.java -@@ -36,7 +36,7 @@ import java.util.Optional; +@@ -37,7 +37,7 @@ import java.util.Optional; import java.util.function.Predicate; import org.junit.jupiter.api.Test; @@ -30747,7 +32564,7 @@ @Override protected String getPackageLocation() { -@@ -44,7 +44,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -45,7 +45,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30756,7 +32573,7 @@ final UnusedLocalVariableCheck checkObj = new UnusedLocalVariableCheck(); final int[] actual = checkObj.getRequiredTokens(); final int[] expected = { -@@ -73,7 +73,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -74,7 +74,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30765,7 +32582,7 @@ final UnusedLocalVariableCheck typeParameterNameCheckObj = new UnusedLocalVariableCheck(); final int[] actual = typeParameterNameCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -102,7 +102,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -103,7 +103,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30774,7 +32591,7 @@ final String[] expected = { "27:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "sameName"), "28:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "b"), -@@ -122,7 +122,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -123,7 +123,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30783,7 +32600,16 @@ final String[] expected = { "17:14: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "i"), "19:14: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "j"), -@@ -138,7 +138,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -139,7 +139,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVar3() throws Exception { ++ void unusedLocalVar3() throws Exception { + final String[] expected = { + "21:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + }; +@@ -147,7 +147,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30792,7 +32618,7 @@ final String[] expected = { "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), "15:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "b"), -@@ -155,7 +155,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -164,7 +164,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30801,7 +32627,7 @@ final String[] expected = { "13:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "l"), "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "obj"), -@@ -171,7 +171,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -180,7 +180,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30810,7 +32636,7 @@ final String[] expected = { "28:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "r"), "49:21: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), -@@ -182,7 +182,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -191,7 +191,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30819,7 +32645,7 @@ final String[] expected = { "21:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "V"), "23:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "S"), -@@ -196,7 +196,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -205,7 +205,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30828,7 +32654,7 @@ final String[] expected = { "29:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "q"), "30:51: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "obj"), -@@ -208,7 +208,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -217,7 +217,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30837,7 +32663,43 @@ final String[] expected = { "36:17: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "p2"), "54:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "o"), -@@ -220,7 +220,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -229,7 +229,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses4() throws Exception { ++ void unusedLocalVarNestedClasses4() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "13:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "ab"), +@@ -239,7 +239,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses5() throws Exception { ++ void unusedLocalVarNestedClasses5() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "13:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "ab"), +@@ -250,7 +250,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses6() throws Exception { ++ void unusedLocalVarNestedClasses6() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "13:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "ab"), +@@ -260,7 +260,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses7() throws Exception { ++ void unusedLocalVarNestedClasses7() throws Exception { + final String[] expected = { + "10:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "11:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "ab"), +@@ -274,7 +274,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30846,7 +32708,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -228,7 +228,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -282,7 +282,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30855,7 +32717,25 @@ final String[] expected = { "22:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), "50:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), -@@ -240,7 +240,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -294,7 +294,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarLambdas() throws Exception { ++ void unusedLocalVarLambdas() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "hoo"), + "19:17: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "j"), +@@ -312,7 +312,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVariableLocalClasses() throws Exception { ++ void unusedLocalVariableLocalClasses() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "15:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "ab"), +@@ -321,7 +321,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30864,7 +32744,7 @@ final String[] expected = { "16:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var1"), "25:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var1"), -@@ -252,7 +252,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -333,7 +333,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30873,7 +32753,7 @@ final String[] expected = { "12:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), "24:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var2"), -@@ -263,14 +263,14 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -344,20 +344,20 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30884,22 +32764,56 @@ getPath("InputUnusedLocalVariableTernaryAndExpressions.java"), expected); } + @Test +- public void testUnusedLocalVariableSwitchStatement() throws Exception { ++ void unusedLocalVariableSwitchStatement() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUnusedLocalVariableSwitchStatement.java"), expected); + } + + @Test +- public void testUnusedLocalVariableSwitchStatement2() throws Exception { ++ void unusedLocalVariableSwitchStatement2() throws Exception { + final String[] expected = { + "59:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "j"), + }; +@@ -366,7 +366,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVariableSwitchExpression() throws Exception { ++ void unusedLocalVariableSwitchExpression() throws Exception { + final String[] expected = { + "16:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "line2"), + }; +@@ -375,7 +375,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVariableWithAllowUnnamed() throws Exception { ++ void unusedLocalVariableWithAllowUnnamed() throws Exception { + final String[] expected = { + "20:13: " + getCheckMessage(MSG_UNUSED_NAMED_LOCAL_VARIABLE, "_x"), + "21:13: " + getCheckMessage(MSG_UNUSED_NAMED_LOCAL_VARIABLE, "__"), +@@ -387,7 +387,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVariableWithAllowUnnamedFalse() throws Exception { ++ void unusedLocalVariableWithAllowUnnamedFalse() throws Exception { + final String[] expected = { + "20:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "_x"), + "21:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "__"), +@@ -402,7 +402,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testClearStateVariables() throws Exception { + void clearStateVariables() throws Exception { final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); final Optional methodDef = TestUtil.findTokenInAstByPredicate( -@@ -280,7 +280,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { - ast -> ast.getType() == TokenTypes.METHOD_DEF); - assertWithMessage("Ast should contain METHOD_DEF").that(methodDef.isPresent()).isTrue(); - final DetailAST variableDef = -- methodDef.get().getLastChild().findFirstToken(TokenTypes.VARIABLE_DEF); -+ methodDef.orElseThrow().getLastChild().findFirstToken(TokenTypes.VARIABLE_DEF); - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( -@@ -294,7 +294,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -426,7 +426,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30908,16 +32822,7 @@ final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); final Optional classDef = TestUtil.findTokenInAstByPredicate( -@@ -303,7 +303,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { - JavaParser.Options.WITHOUT_COMMENTS), - ast -> ast.getType() == TokenTypes.CLASS_DEF); - assertWithMessage("Ast should contain CLASS_DEF").that(classDef.isPresent()).isTrue(); -- final DetailAST classDefToken = classDef.get(); -+ final DetailAST classDefToken = classDef.orElseThrow(); - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( -@@ -337,7 +337,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -469,7 +469,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30926,16 +32831,7 @@ final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); final DetailAST root = JavaParser.parseFile( -@@ -351,7 +351,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { - assertWithMessage("Ast should contain LITERAL_NEW").that(literalNew.isPresent()).isTrue(); - check.beginTree(root); - check.visitToken(classDefAst); -- check.visitToken(literalNew.get()); -+ check.visitToken(literalNew.orElseThrow()); - check.beginTree(null); - final Predicate isClear = - anonInnerAstToTypeDesc -> { -@@ -370,7 +370,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +@@ -502,7 +502,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } @Test @@ -30944,15 +32840,6 @@ final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); final Optional packageDef = TestUtil.findTokenInAstByPredicate( -@@ -379,7 +379,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { - JavaParser.Options.WITHOUT_COMMENTS), - ast -> ast.getType() == TokenTypes.PACKAGE_DEF); - assertWithMessage("Ast should contain PACKAGE_DEF").that(packageDef.isPresent()).isTrue(); -- final DetailAST packageDefToken = packageDef.get(); -+ final DetailAST packageDefToken = packageDef.orElseThrow(); - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -31018,7 +32905,7 @@ final String[] expected = { "42:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), "50:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), -@@ -186,7 +186,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -198,7 +198,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31027,7 +32914,7 @@ final String[] expected = { "42:9: " + getCheckMessage(MSG_KEY_EXT, "a", 2, 1), "50:9: " + getCheckMessage(MSG_KEY_EXT, "temp", 2, 1), -@@ -228,7 +228,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -240,7 +240,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31036,7 +32923,7 @@ final VariableDeclarationUsageDistanceCheck check = new VariableDeclarationUsageDistanceCheck(); assertWithMessage("Acceptable tokens should not be null") .that(check.getAcceptableTokens()) -@@ -242,7 +242,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -254,7 +254,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31045,7 +32932,7 @@ final String[] expected = { "83:9: " + getCheckMessage(MSG_KEY_EXT, "count", 4, 3), "231:9: " + getCheckMessage(MSG_KEY_EXT, "t", 5, 3), -@@ -258,7 +258,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -278,7 +278,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31054,7 +32941,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -266,7 +266,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -286,7 +286,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31063,16 +32950,16 @@ final String[] expected = { "19:9: " + getCheckMessage(MSG_KEY_EXT, "prefs", 4, 3), }; -@@ -276,7 +276,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -296,7 +296,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test - public void testLabels() throws Exception { + void labels() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - - verifyWithInlineConfigParser( -@@ -284,7 +284,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + final String[] expected = { + "15:9: " + getCheckMessage(MSG_KEY_EXT, "eol", 5, 3), + }; +@@ -305,7 +305,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31081,7 +32968,7 @@ final int maxDistance = 1; final String[] expected = { -@@ -303,7 +303,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -324,7 +324,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31090,7 +32977,7 @@ final int maxDistance = 1; final String[] expected = { "16:9: " + getCheckMessage(MSG_KEY, "i", 2, maxDistance), -@@ -314,7 +314,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -335,7 +335,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31099,7 +32986,7 @@ final String[] expected = { "46:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), }; -@@ -324,7 +324,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -345,7 +345,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31108,7 +32995,7 @@ final String[] expected = { "26:9: " + getCheckMessage(MSG_KEY, "z", 3, 1), }; -@@ -334,7 +334,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -355,7 +355,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31117,7 +33004,7 @@ final String[] expected = { "19:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), "20:9: " + getCheckMessage(MSG_KEY, "b", 2, 1), -@@ -345,14 +345,14 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -366,14 +366,14 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31134,7 +33021,7 @@ final String[] expected = { "16:9: " + getCheckMessage(MSG_KEY, "i", 5, 1), }; -@@ -362,7 +362,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes +@@ -383,7 +383,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } @Test @@ -31143,6 +33030,78 @@ final String[] expected = { "15:9: " + getCheckMessage(MSG_KEY, "i", 2, 1), }; +@@ -392,7 +392,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testVariableDeclarationUsageDistanceCloseToBlock() throws Exception { ++ void variableDeclarationUsageDistanceCloseToBlock() throws Exception { + final String[] expected = { + "15:9: " + getCheckMessage(MSG_KEY, "a", 13, 1), + "16:9: " + getCheckMessage(MSG_KEY, "b", 13, 1), +@@ -402,7 +402,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testVariableDeclarationUsageDistancePatternVariables() throws Exception { ++ void variableDeclarationUsageDistancePatternVariables() throws Exception { + final String[] expected = { + "35:9: " + getCheckMessage(MSG_KEY, "b", 5, 1), + }; +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/WhenShouldBeUsedCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/WhenShouldBeUsedCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class WhenShouldBeUsedCheckTest extends AbstractModuleTestSupport { ++final class WhenShouldBeUsedCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class WhenShouldBeUsedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final WhenShouldBeUsedCheck check = new WhenShouldBeUsedCheck(); + final int[] expected = {TokenTypes.LITERAL_CASE}; + +@@ -51,14 +51,14 @@ public class WhenShouldBeUsedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchStatements() throws Exception { ++ void switchStatements() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhenShouldBeUsedSwitchStatements.java"), expected); + } + + @Test +- public void testSwitchRule() throws Exception { ++ void switchRule() throws Exception { + final String[] expected = { + "13:13: " + getCheckMessage(MSG_KEY), + "18:13: " + getCheckMessage(MSG_KEY), +@@ -71,14 +71,14 @@ public class WhenShouldBeUsedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpression() throws Exception { ++ void switchExpression() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhenShouldBeUsedSwitchExpression.java"), expected); + } + + @Test +- public void testNonPatternsSwitch() throws Exception { ++ void nonPatternsSwitch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhenShouldBeUsedNonPatternsSwitch.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -31416,15 +33375,7 @@ final FinalClassCheck check = new FinalClassCheck(); final DetailAST root = JavaParser.parseFile( -@@ -260,14 +260,14 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- packageDef.get(), -+ packageDef.orElseThrow(), - "packageName", - packageName -> ((String) packageName).isEmpty())) - .isTrue(); +@@ -267,7 +267,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } @Test @@ -31569,6 +33520,24 @@ final HideUtilityClassConstructorCheck obj = new HideUtilityClassConstructorCheck(); final int[] expected = {TokenTypes.CLASS_DEF}; assertWithMessage("Default acceptable tokens are invalid") +@@ -132,7 +132,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testIgnoreAnnotatedBy() throws Exception { ++ void ignoreAnnotatedBy() throws Exception { + final String[] expected = { + "30:1: " + getCheckMessage(MSG_KEY), + }; +@@ -141,7 +141,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testIgnoreAnnotatedByFullQualifier() throws Exception { ++ void ignoreAnnotatedByFullQualifier() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckTest.java @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -31950,6 +33919,71 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getNonCompilablePath("InputOneTopLevelClassEmpty.java"), expected); } +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/SealedShouldHavePermitsListCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/SealedShouldHavePermitsListCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupport { ++final class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final SealedShouldHavePermitsListCheck checkObj = new SealedShouldHavePermitsListCheck(); + final int[] expected = {TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -49,7 +49,7 @@ public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testInnerSealedClass() throws Exception { ++ void innerSealedClass() throws Exception { + final String[] expected = { + "10:5: " + getCheckMessage(MSG_KEY), "15:5: " + getCheckMessage(MSG_KEY), + }; +@@ -58,7 +58,7 @@ public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testInnerSealedInterface() throws Exception { ++ void innerSealedInterface() throws Exception { + final String[] expected = { + "10:5: " + getCheckMessage(MSG_KEY), + }; +@@ -67,7 +67,7 @@ public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testTopLevelSealedClass() throws Exception { ++ void topLevelSealedClass() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; +@@ -76,7 +76,7 @@ public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testTopLevelSealedInterface() throws Exception { ++ void topLevelSealedInterface() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; +@@ -86,7 +86,7 @@ public class SealedShouldHavePermitsListCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testJepExample() throws Exception { ++ void jepExample() throws Exception { + final String[] expected = { + "10:1: " + getCheckMessage(MSG_KEY), "24:1: " + getCheckMessage(MSG_KEY), + }; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -31965,8 +33999,8 @@ } @Test -- public void testDefault() throws Exception { -+ void testDefault() throws Exception { +- public void testThrowsCountDefault() throws Exception { ++ void throwsCountDefault() throws Exception { final String[] expected = { "25:20: " + getCheckMessage(MSG_KEY, 5, 4), @@ -31974,8 +34008,8 @@ } @Test -- public void testMax() throws Exception { -+ void max() throws Exception { +- public void testThrowsCountCustomMaxCount() throws Exception { ++ void throwsCountCustomMaxCount() throws Exception { final String[] expected = { "35:20: " + getCheckMessage(MSG_KEY, 6, 5), @@ -32010,8 +34044,8 @@ } @Test -- public void testNotIgnorePrivateMethod() throws Exception { -+ void notIgnorePrivateMethod() throws Exception { +- public void testThrowsCountNotIgnorePrivateMethods() throws Exception { ++ void throwsCountNotIgnorePrivateMethods() throws Exception { final String[] expected = { "25:20: " + getCheckMessage(MSG_KEY, 5, 4), "30:20: " + getCheckMessage(MSG_KEY, 5, 4), @@ -32019,8 +34053,8 @@ } @Test -- public void testMethodWithAnnotation() throws Exception { -+ void methodWithAnnotation() throws Exception { +- public void testThrowsCountMethodWithAnnotation() throws Exception { ++ void throwsCountMethodWithAnnotation() throws Exception { final String[] expected = { "26:26: " + getCheckMessage(MSG_KEY, 5, 4), }; @@ -32028,8 +34062,8 @@ } @Test -- public void testOverriding() throws Exception { -+ void overriding() throws Exception { +- public void testThrowsCountMaxAllowZero() throws Exception { ++ void throwsCountMaxAllowZero() throws Exception { final String[] expected = { "17:20: " + getCheckMessage(MSG_KEY, 1, 0), "21:20: " + getCheckMessage(MSG_KEY, 1, 0), @@ -32346,7 +34380,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", getPath("nonExistent.file")); final CheckstyleException ex = -@@ -106,7 +107,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -102,7 +103,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32355,7 +34389,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); checkConfig.addProperty("charset", "XSO-8859-1"); -@@ -133,7 +134,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -125,7 +126,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32364,7 +34398,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", ""); final CheckstyleException ex = -@@ -161,7 +162,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -149,7 +150,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32373,7 +34407,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", null); final CheckstyleException ex = -@@ -180,7 +181,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -164,7 +165,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32382,7 +34416,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); checkConfig.addProperty("ignoreLines", ""); -@@ -195,7 +196,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -179,7 +180,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32391,7 +34425,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); checkConfig.addProperty("ignoreLines", "2"); -@@ -204,7 +205,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -188,7 +189,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32400,7 +34434,7 @@ final HeaderCheck check = new HeaderCheck(); check.setHeader("Header"); final IllegalArgumentException ex = -@@ -220,7 +221,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -200,7 +201,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32409,7 +34443,7 @@ final HeaderCheck check = new HeaderCheck(); check.setHeaderFile(new URI("test://bad")); -@@ -236,12 +237,12 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -216,12 +217,12 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32424,7 +34458,7 @@ checkerConfig.addProperty("cacheFile", cacheFile.getPath()); final String[] expected = { -@@ -254,12 +255,12 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -234,12 +235,12 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32439,7 +34473,7 @@ checkerConfig.addProperty("cacheFile", cacheFile.getPath()); final String[] expected = { -@@ -270,7 +271,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -250,7 +251,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32448,7 +34482,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); checkConfig.addProperty("ignoreLines", "4,2,3"); -@@ -279,7 +280,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -259,7 +260,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32457,7 +34491,7 @@ final HeaderCheck check = new HeaderCheck(); check.setHeader("Header"); final ReflectiveOperationException ex = -@@ -294,21 +295,21 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -274,21 +275,21 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -32482,7 +34516,7 @@ final HeaderCheck check = new HeaderCheck(); final URI uri = CommonUtil.getUriByFilename(getPath("InputHeaderjava.header")); check.setHeaderFile(uri); -@@ -320,7 +321,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { +@@ -300,7 +301,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } @Test @@ -33540,7 +35574,19 @@ "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; +@@ -25,6 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck. + import static com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck.MSG_MISSING_FILE; + import static com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck.MSG_UNKNOWN_PKG; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; ++import static java.util.UUID.randomUUID; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +@@ -36,11 +37,10 @@ import java.io.File; + import java.nio.file.Files; + import java.util.Arrays; + import java.util.List; +-import java.util.UUID; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -33549,7 +35595,7 @@ @TempDir public File temporaryFolder; -@@ -49,7 +49,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -50,7 +50,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33558,7 +35604,7 @@ final ImportControlCheck checkObj = new ImportControlCheck(); final int[] expected = { TokenTypes.PACKAGE_DEF, TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, -@@ -60,14 +60,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -61,14 +61,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33575,7 +35621,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), -@@ -78,31 +78,31 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -79,31 +79,31 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33612,7 +35658,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputImportControl7.java"), expected); -@@ -118,7 +118,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -119,7 +119,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33621,7 +35667,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputImportControl8.java"), expected); -@@ -134,14 +134,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -135,14 +135,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33638,7 +35684,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), -@@ -152,14 +152,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -153,14 +153,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33655,7 +35701,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.stream.Stream"), "12:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.Date"), -@@ -171,7 +171,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -172,7 +172,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33664,7 +35710,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), -@@ -182,7 +182,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -183,7 +183,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33673,7 +35719,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), "14:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Button.ABORT"), -@@ -192,7 +192,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -193,7 +193,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33682,7 +35728,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), }; -@@ -201,7 +201,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -202,7 +202,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33691,7 +35737,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), -@@ -211,7 +211,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -212,7 +212,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33700,7 +35746,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -219,28 +219,28 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -220,28 +220,28 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33733,7 +35779,7 @@ final ImportControlCheck testCheckObject = new ImportControlCheck(); final int[] actual = testCheckObject.getAcceptableTokens(); final int[] expected = { -@@ -251,14 +251,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -252,14 +252,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33750,7 +35796,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputImportControl18.java"), expected); -@@ -274,14 +274,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -275,14 +275,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33767,7 +35813,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -298,7 +298,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -299,7 +299,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33776,21 +35822,21 @@ final DefaultConfiguration checkConfig = createModuleConfig(ImportControlCheck.class); checkConfig.addProperty("file", getPath("InputImportControlOneRegExp.xml")); -@@ -306,10 +306,11 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -307,11 +307,11 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { treeWalkerConfig.addChild(checkConfig); final DefaultConfiguration checkerConfig = createRootConfig(treeWalkerConfig); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); +- final String uniqueFileName1 = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName1 = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName1); checkerConfig.addProperty("cacheFile", cacheFile.getPath()); -- final String filePath = File.createTempFile("empty", ".java", temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "empty", ".java").toFile().getPath(); +- final String uniqueFileName2 = "empty_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName2 = "empty_" + randomUUID() + ".java"; + final File filePath = new File(temporaryFolder, uniqueFileName2); - execute(checkerConfig, filePath); - // One more time to use cache. -@@ -322,35 +323,35 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + execute(checkerConfig, filePath.toString()); +@@ -325,35 +325,35 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33831,7 +35877,7 @@ final String[] expected = { "12:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.Date"), }; -@@ -360,7 +361,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -363,7 +363,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33840,7 +35886,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), }; -@@ -369,7 +370,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -372,7 +372,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33849,7 +35895,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File"), }; -@@ -378,7 +379,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -381,7 +381,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33858,7 +35904,7 @@ final String[] expected = { "13:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), }; -@@ -387,7 +388,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -390,7 +390,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33867,7 +35913,7 @@ final String file1 = getPath("InputImportControlBeginTree1.java"); final String file2 = getPath("InputImportControlBeginTree2.java"); final List expectedFirstInput = -@@ -399,7 +400,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -402,7 +402,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33876,7 +35922,7 @@ final String[] expected = { "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), }; -@@ -408,14 +409,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { +@@ -411,14 +411,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } @Test @@ -33891,7 +35937,7 @@ - public void testImportControlTestException() { + void importControlTestException() { final CheckstyleException ex = - assertThrows( + getExpectedThrowable( CheckstyleException.class, --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java @@ -34186,7 +36232,7 @@ - public void testWildcard() throws Exception { + void wildcard() throws Exception { final String[] expected = { - "24:1: " + getCheckMessage(MSG_ORDERING, "javax.crypto.Cipher"), + "21:1: " + getCheckMessage(MSG_ORDERING, "javax.crypto.Cipher"), }; @@ -324,7 +324,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } @@ -34541,15 +36587,6 @@ final ImportOrderCheck check = new ImportOrderCheck(); final DetailAST root = JavaParser.parseFile( -@@ -753,7 +753,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- staticImport.get(), -+ staticImport.orElseThrow(), - "lastImportStatic", - lastImportStatic -> !((boolean) lastImportStatic))) - .isTrue(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportControlTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportControlTest.java @@ -24,7 +24,7 @@ import static com.google.common.truth.Truth.assertWithMessage; @@ -35010,7 +37047,7 @@ final String[] expected = { "11:8: " + getCheckMessage(MSG_KEY, "java.awt.Rectangle"), "13:8: " + getCheckMessage(MSG_KEY, "java.awt.event.KeyEvent"), -@@ -300,14 +301,15 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +@@ -300,19 +301,20 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } @Test @@ -35028,7 +37065,40 @@ + ImmutableList.of("10:8: " + getCheckMessage(MSG_KEY, "module")); verifyWithInlineConfigParser(file1, file2, expectedFirstInput, expectedSecondInput); } - } + + @Test +- public void testStaticMethodRefImports() throws Exception { ++ void staticMethodRefImports() throws Exception { + final String[] expected = { + "26:15: " + getCheckMessage(MSG_KEY, "java.lang.String.format"), + "27:15: " + getCheckMessage(MSG_KEY, "java.util.Arrays.sort"), +@@ -323,7 +325,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticMethodRefImportsExtended() throws Exception { ++ void staticMethodRefImportsExtended() throws Exception { + final String[] expected = { + "17:8: " + getCheckMessage(MSG_KEY, "java.util.Objects"), + "18:15: " + getCheckMessage(MSG_KEY, "java.util.Arrays.toString"), +@@ -336,7 +338,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticMethodRefImportsWithJavadocDisabled() throws Exception { ++ void staticMethodRefImportsWithJavadocDisabled() throws Exception { + final String[] expected = { + "24:8: " + getCheckMessage(MSG_KEY, "java.util.Arrays"), + "25:15: " + getCheckMessage(MSG_KEY, "java.lang.Integer.parseInt"), +@@ -349,7 +351,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticMethodRefImportsInDocsOnly() throws Exception { ++ void staticMethodRefImportsInDocsOnly() throws Exception { + final String[] expected = { + "11:8: " + getCheckMessage(MSG_KEY, "java.lang.Integer"), + "12:15: " + getCheckMessage(MSG_KEY, "java.util.Collections.emptyEnumeration"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckTest.java @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -36542,26 +38612,54 @@ final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); +@@ -2964,7 +2962,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationPatternMatchingForSwitch() throws Exception { ++ void indentationPatternMatchingForSwitch() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("forceStrictCondition", "true"); + checkConfig.addProperty("tabWidth", "4"); +@@ -2990,7 +2988,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationRecordPattern() throws Exception { ++ void indentationRecordPattern() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("forceStrictCondition", "true"); + checkConfig.addProperty("tabWidth", "4"); +@@ -3032,7 +3030,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationSealedClasses() throws Exception { ++ void indentationSealedClasses() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("forceStrictCondition", "true"); + checkConfig.addProperty("tabWidth", "4"); --- 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,7 +26,7 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec +@@ -26,7 +26,8 @@ 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 org.junit.jupiter.api.Assertions.assertDoesNotThrow; ++import static java.util.UUID.randomUUID; +import static org.assertj.core.api.Assertions.assertThatCode; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -@@ -35,6 +35,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; +@@ -35,7 +36,6 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; import java.io.File; -+import java.nio.file.Files; +-import java.util.UUID; import org.itsallcode.io.Capturable; import org.itsallcode.junit.sysextensions.SystemErrGuard; import org.itsallcode.junit.sysextensions.SystemErrGuard.SysErr; -@@ -44,7 +45,7 @@ import org.junit.jupiter.api.extension.ExtendWith; +@@ -45,7 +45,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.io.TempDir; @ExtendWith(SystemErrGuard.class) @@ -36570,7 +38668,7 @@ @TempDir public File temporaryFolder; -@@ -63,12 +64,12 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -64,12 +64,12 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { * @param systemErr wrapper for {@code System.err} */ @BeforeEach @@ -36585,7 +38683,7 @@ final String[] expected = { "16: " + getCheckMessage( -@@ -109,7 +110,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -110,7 +110,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36594,7 +38692,7 @@ final String[] expected = { "8: " + getCheckMessage( -@@ -123,13 +124,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -124,13 +124,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36610,7 +38708,7 @@ final String[] expected = { "9: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), "16: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), -@@ -139,19 +140,19 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -140,19 +140,19 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36633,7 +38731,7 @@ final String[] expected = { "9: " + getCheckMessage( -@@ -163,8 +164,8 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -164,8 +164,8 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36644,7 +38742,7 @@ final String[] expectedMessagesForFile1 = { "9: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), "16: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), -@@ -184,7 +185,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -185,7 +185,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36653,7 +38751,7 @@ final String[] expected = { "9: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), "16: " -@@ -196,7 +197,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -197,7 +197,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36662,7 +38760,23 @@ final String[] expected = { "12: " + getCheckMessage(SummaryJavadocCheck.class, MSG_SUMMARY_FIRST_SENTENCE), }; -@@ -207,7 +208,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -208,13 +208,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheWithBlockCommentInSingleLineComment() throws Exception { ++ void cacheWithBlockCommentInSingleLineComment() throws Exception { + final String[] expected = {}; + verifyWithInlineConfigParser(getPath("InputAbstractJavadocCache3.java"), expected); + } + + @Test +- public void testCacheWithTwoBlockCommentAtSameLine() throws Exception { ++ void cacheWithTwoBlockCommentAtSameLine() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(SummaryJavadocCheck.class, MSG_SUMMARY_FIRST_SENTENCE), + }; +@@ -222,7 +222,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36671,7 +38785,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionOne.java"), expected); -@@ -219,7 +220,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -232,7 +232,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36680,7 +38794,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionTwo.java"), expected); -@@ -231,7 +232,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -242,7 +242,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36689,7 +38803,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionThree.java"), expected); -@@ -243,7 +244,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -252,7 +252,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36698,7 +38812,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -256,7 +257,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -263,7 +263,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36707,7 +38821,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -269,7 +270,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -274,7 +274,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36716,7 +38830,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -282,7 +283,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -285,7 +285,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36725,7 +38839,7 @@ JavadocCatchCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -293,7 +294,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -296,7 +296,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36734,7 +38848,7 @@ final int[] defaultJavadocTokens = {JavadocTokenTypes.JAVADOC}; final AbstractJavadocCheck check = new AbstractJavadocCheck() { -@@ -329,7 +330,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -332,7 +332,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36743,7 +38857,7 @@ final int[] defaultJavadocTokens = { JavadocTokenTypes.JAVADOC, JavadocTokenTypes.AREA_HTML_TAG_NAME, -@@ -351,11 +352,11 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -354,11 +354,11 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } }; check.setJavadocTokens("RETURN_LITERAL"); @@ -36757,7 +38871,7 @@ final String path = getPath("InputAbstractJavadocTokensFail.java"); try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -374,16 +375,17 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -377,16 +377,16 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36772,13 +38886,12 @@ + void requiredTokenIsNotInDefaultTokens() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(RequiredTokenIsNotInDefaultsJavadocCheck.class); -- final String pathToEmptyFile = File.createTempFile("empty", ".java", temporaryFolder).getPath(); -+ final String pathToEmptyFile = -+ Files.createTempFile(temporaryFolder.toPath(), "empty", ".java").toFile().getPath(); +- final String uniqueFileName = "empty_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "empty_" + randomUUID() + ".java"; + final File pathToEmptyFile = new File(temporaryFolder, uniqueFileName); try { - execute(checkConfig, pathToEmptyFile); -@@ -402,7 +404,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -406,7 +406,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36787,7 +38900,7 @@ JavadocVisitLeaveCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenOne.java"), expected); -@@ -415,7 +417,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -419,7 +419,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36796,7 +38909,7 @@ JavadocVisitLeaveCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenTwo.java"), expected); -@@ -428,7 +430,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -432,7 +432,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36805,7 +38918,7 @@ JavadocVisitLeaveCheck.clearCounter(); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenThree.java"), expected); -@@ -441,7 +443,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -445,7 +445,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36814,7 +38927,7 @@ final String[] expected = { "18: " + getCheckMessage( -@@ -491,7 +493,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -495,7 +495,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36823,7 +38936,7 @@ final String[] expected = { "10: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "embed"), "17: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "keygen"), -@@ -504,7 +506,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -508,7 +508,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36832,7 +38945,7 @@ final String[] expected = { "12: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "19: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), -@@ -518,7 +520,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -522,7 +522,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36841,7 +38954,7 @@ final String[] expected = { "12: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "19: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), -@@ -530,21 +532,21 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -534,21 +534,21 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36866,7 +38979,7 @@ final String[] expected = { "13: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "20: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), -@@ -560,7 +562,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -564,7 +564,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36875,7 +38988,7 @@ final String[] expected = { "13: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), "20: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), -@@ -577,7 +579,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -581,7 +581,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -36884,7 +38997,7 @@ final String[] expected = { "11:4: " + getCheckMessage(NonTightHtmlTagCheck.MSG_KEY, "BODY_TAG_START"), "12:4: " + getCheckMessage(NonTightHtmlTagCheck.MSG_KEY, "P_TAG_START"), -@@ -619,7 +621,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +@@ -623,7 +623,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -37317,6 +39430,44 @@ final String[] expected = { "9:1: " + getCheckMessage(MSG_JAVADOC_CONTENT_SECOND_LINE), }; +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocLeadingAsteriskAlignCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocLeadingAsteriskAlignCheckTest extends AbstractModuleTestSupport { ++final class JavadocLeadingAsteriskAlignCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class JavadocLeadingAsteriskAlignCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testCorrectJavadoc() throws Exception { ++ void correctJavadoc() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final String filePath = getPath("InputJavadocLeadingAsteriskAlignCorrect.java"); +@@ -41,7 +41,7 @@ public class JavadocLeadingAsteriskAlignCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testIncorrectJavadoc() throws Exception { ++ void incorrectJavadoc() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(JavadocLeadingAsteriskAlignCheck.class, MSG_KEY, 1, 2), + "17:5: " + getCheckMessage(JavadocLeadingAsteriskAlignCheck.class, MSG_KEY, 5, 4), +@@ -65,7 +65,7 @@ public class JavadocLeadingAsteriskAlignCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testTabs() throws Exception { ++ void tabs() throws Exception { + final String[] expected = { + "49:5: " + getCheckMessage(JavadocLeadingAsteriskAlignCheck.class, MSG_KEY, 5, 4), + "60:5: " + getCheckMessage(JavadocLeadingAsteriskAlignCheck.class, MSG_KEY, 5, 6), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java @@ -34,7 +34,7 @@ import java.lang.reflect.Constructor; @@ -37337,7 +39488,7 @@ final JavadocMethodCheck javadocMethodCheck = new JavadocMethodCheck(); final int[] actual = javadocMethodCheck.getAcceptableTokens(); -@@ -61,19 +61,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -57,19 +57,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37360,7 +39511,7 @@ final String[] expected = { "25:19: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "UnsupportedOperationException"), "37:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "UnsupportedOperationException"), -@@ -94,7 +94,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -90,7 +90,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37369,7 +39520,7 @@ final String[] expected = { "54:56: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalStateException"), "70:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), -@@ -107,7 +107,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -103,7 +103,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37378,7 +39529,7 @@ final String[] expected = { "40:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), "43:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalStateException"), -@@ -119,7 +119,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -115,7 +115,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37387,7 +39538,7 @@ final String[] expected = { "30:9: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unused"), "37: " + getCheckMessage(MSG_RETURN_EXPECTED), -@@ -148,7 +148,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -144,7 +144,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37396,7 +39547,7 @@ final String[] expected = { "77:29: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), "82:22: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), -@@ -160,14 +160,14 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -156,14 +156,14 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37413,7 +39564,7 @@ final String[] expected = { "87:41: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), "92:37: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), -@@ -176,19 +176,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -172,19 +172,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37436,7 +39587,7 @@ final String[] expected = { "27: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), "29: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), -@@ -199,7 +199,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -195,7 +195,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37445,7 +39596,7 @@ final String[] expected = { "27: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), "29: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), -@@ -209,7 +209,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -205,7 +205,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37454,7 +39605,7 @@ final String[] expected = { "27: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), "31: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), -@@ -220,21 +220,21 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -216,21 +216,21 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37479,7 +39630,7 @@ final String[] expected = { "23: " + getCheckMessage(MSG_RETURN_EXPECTED), "34:26: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "number"), -@@ -247,13 +247,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -243,13 +243,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37495,7 +39646,7 @@ final String[] expected = { "37:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), "40:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), -@@ -264,7 +264,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -260,7 +260,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37504,7 +39655,7 @@ final String[] expected = { "33:6: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unexpectedParam"), "34:6: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unexpectedParam2"), -@@ -279,25 +279,25 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -275,25 +275,25 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37534,7 +39685,7 @@ final String[] expected = { "29:34: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "RE"), "46:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), -@@ -308,13 +308,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -304,13 +304,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37550,7 +39701,7 @@ final String[] expected = { "18:5: " + getCheckMessage(MSG_INVALID_INHERIT_DOC), "23:5: " + getCheckMessage(MSG_INVALID_INHERIT_DOC), -@@ -327,7 +327,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -323,7 +323,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37559,7 +39710,7 @@ final String[] expected = { "19:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), "30:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), -@@ -336,19 +336,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -332,19 +332,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37582,7 +39733,7 @@ final String[] expected = { "21:49: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "p1"), "24:50: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "p1"), -@@ -357,7 +357,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -353,7 +353,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37591,16 +39742,16 @@ final String[] expected = { "29:27: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), "43:27: " -@@ -375,7 +375,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -371,7 +371,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { - final int[] expected = { - TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.ENUM_DEF, TokenTypes.RECORD_DEF, - }; -@@ -385,7 +385,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + final int[] expected = CommonUtil.EMPTY_INT_ARRAY; + final JavadocMethodCheck check = new JavadocMethodCheck(); + final int[] actual = check.getRequiredTokens(); +@@ -379,7 +379,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37609,7 +39760,7 @@ final Class tokenType = Class.forName( "com.puppycrawl.tools.checkstyle.checks.javadoc." + "JavadocMethodCheck$Token"); -@@ -399,20 +399,20 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -393,20 +393,20 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37633,7 +39784,7 @@ final String[] expected = { "21:32: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "a"), "26:43: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "b"), -@@ -421,7 +421,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -415,7 +415,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37642,7 +39793,7 @@ final String[] expected = { "27:17: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "i"), }; -@@ -429,7 +429,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -423,7 +423,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37651,7 +39802,7 @@ final String msgReturnExpectedCustom = "@return tag should be present and have description :)"; final String msgUnusedTagCustom = "Unused @param tag for 'unused' :)"; final String msgExpectedTagCustom = "Expected @param tag for 'a' :)"; -@@ -443,7 +443,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -437,7 +437,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37660,7 +39811,7 @@ final String[] expected = { "23: " + getCheckMessage(MSG_RETURN_EXPECTED), }; -@@ -451,7 +451,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -445,7 +445,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37669,7 +39820,7 @@ final String[] expected = { "15:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "<"), "19:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), -@@ -460,7 +460,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +@@ -454,7 +454,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } @Test @@ -37909,7 +40060,7 @@ getPath("annotation" + File.separator + "package-info.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java -@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; @@ -37918,7 +40069,7 @@ @Override protected String getPackageLocation() { -@@ -38,7 +38,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { +@@ -39,7 +39,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } @Test @@ -37927,7 +40078,7 @@ final JavadocParagraphCheck checkObj = new JavadocParagraphCheck(); final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; assertWithMessage("Default required tokens are invalid") -@@ -47,14 +47,14 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { +@@ -48,14 +48,14 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } @Test @@ -37942,26 +40093,89 @@ - public void testIncorrect() throws Exception { + void incorrect() throws Exception { final String[] expected = { - "13: " + getCheckMessage(MSG_MISPLACED_TAG), - "13: " + getCheckMessage(MSG_LINE_BEFORE), -@@ -97,7 +97,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + "14:4: " + getCheckMessage(MSG_LINE_BEFORE), + "15:19: " + getCheckMessage(MSG_LINE_BEFORE), +@@ -88,7 +88,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrect2() throws Exception { ++ void incorrect2() throws Exception { + final String[] expected = { + "14:4: " + getCheckMessage(MSG_PRECEDED_BLOCK_TAG, "h1"), + "22:7: " + getCheckMessage(MSG_PRECEDED_BLOCK_TAG, "ul"), +@@ -102,7 +102,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } @Test - public void testAllowNewlineParagraph() throws Exception { + void allowNewlineParagraph() throws Exception { final String[] expected = { - "13: " + getCheckMessage(MSG_LINE_BEFORE), - "14: " + getCheckMessage(MSG_LINE_BEFORE), -@@ -123,7 +123,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + "16:4: " + getCheckMessage(MSG_MISPLACED_TAG), + "16:4: " + getCheckMessage(MSG_LINE_BEFORE), +@@ -142,7 +142,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowNewlineParagraph2() throws Exception { ++ void allowNewlineParagraph2() throws Exception { + final String[] expected = { + "16:12: " + getCheckMessage(MSG_REDUNDANT_PARAGRAPH), + "17:11: " + getCheckMessage(MSG_TAG_AFTER), +@@ -158,7 +158,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowNewlineParagraph3() throws Exception { ++ void allowNewlineParagraph3() throws Exception { + final String[] expected = { + "15:12: " + getCheckMessage(MSG_LINE_BEFORE), + "17:15: " + getCheckMessage(MSG_LINE_BEFORE), +@@ -178,7 +178,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } @Test - public void testJavadocParagraph() throws Exception { + void javadocParagraph() throws Exception { final String[] expected = { - "19: " + getCheckMessage(MSG_LINE_BEFORE), - "30: " + getCheckMessage(MSG_MISPLACED_TAG), + "19:4: " + getCheckMessage(MSG_LINE_BEFORE), + "28:7: " + getCheckMessage(MSG_REDUNDANT_PARAGRAPH), +@@ -193,7 +193,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocParagraphOpenClosedTag() throws Exception { ++ void javadocParagraphOpenClosedTag() throws Exception { + final String[] expected = { + "14:4: " + getCheckMessage(MSG_MISPLACED_TAG), + "21:7: " + getCheckMessage(MSG_LINE_BEFORE), +@@ -212,7 +212,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocParagraphOpenClosedTag2() throws Exception { ++ void javadocParagraphOpenClosedTag2() throws Exception { + final String[] expected = { + "14:4: " + getCheckMessage(MSG_MISPLACED_TAG), + "21:7: " + getCheckMessage(MSG_LINE_BEFORE), +@@ -236,7 +236,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocParagraphOpenClosedTag3() throws Exception { ++ void javadocParagraphOpenClosedTag3() throws Exception { + final String[] expected = { + "15:7: " + getCheckMessage(MSG_MISPLACED_TAG), + "23:7: " + getCheckMessage(MSG_MISPLACED_TAG), +@@ -248,7 +248,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrect3() throws Exception { ++ void incorrect3() throws Exception { + final String[] expected = { + "15:7: " + getCheckMessage(MSG_MISPLACED_TAG), + "23:7: " + getCheckMessage(MSG_MISPLACED_TAG), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java @@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -38018,7 +40232,15 @@ final String[] expected = { "30:33: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), "42: " + getCheckMessage(MSG_NO_PERIOD), -@@ -121,7 +121,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -121,14 +121,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleDefaultSettingsFive() throws Exception { ++ void javadocStyleDefaultSettingsFive() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleDefaultSettingsFive.java"), expected); } @Test @@ -38027,7 +40249,7 @@ final String[] expected = { "24: " + getCheckMessage(MSG_NO_PERIOD), "50: " + getCheckMessage(MSG_NO_PERIOD), -@@ -134,7 +134,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -141,7 +141,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38036,7 +40258,7 @@ final String[] expected = { "67: " + getCheckMessage(MSG_NO_PERIOD), "101: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -143,14 +143,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -150,14 +150,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38053,7 +40275,7 @@ final String[] expected = { "40: " + getCheckMessage(MSG_NO_PERIOD), "51: " + getCheckMessage(MSG_NO_PERIOD), -@@ -164,7 +164,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -171,7 +171,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38062,7 +40284,7 @@ final String[] expected = { "24: " + getCheckMessage(MSG_NO_PERIOD), "35: " + getCheckMessage(MSG_NO_PERIOD), -@@ -179,7 +179,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -186,7 +186,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38071,7 +40293,7 @@ final String[] expected = { "74: " + getCheckMessage(MSG_NO_PERIOD), "108: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -188,7 +188,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -195,7 +195,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38080,7 +40302,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -196,7 +196,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -203,7 +203,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38089,7 +40311,7 @@ final String[] expected = { "40: " + getCheckMessage(MSG_NO_PERIOD), "51: " + getCheckMessage(MSG_NO_PERIOD), -@@ -211,7 +211,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -218,7 +218,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38098,7 +40320,7 @@ final String[] expected = { "59:11: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), "62:7: " + getCheckMessage(MSG_EXTRA_HTML, ""), -@@ -228,7 +228,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -235,7 +235,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38107,7 +40329,7 @@ final String[] expected = { "68:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
"), }; -@@ -237,7 +237,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -244,7 +244,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38116,7 +40338,7 @@ final String[] expected = { "103:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -246,7 +246,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -253,7 +253,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38125,7 +40347,7 @@ final String[] expected = { "29:33: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), "47:11: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), -@@ -256,28 +256,28 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -263,28 +263,28 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38158,7 +40380,7 @@ final String[] expected = { "78: " + getCheckMessage(MSG_NO_PERIOD), "79:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), -@@ -288,7 +288,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -295,7 +295,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38167,7 +40389,7 @@ final String[] expected = { "83: " + getCheckMessage(MSG_EMPTY), "102: " + getCheckMessage(MSG_EMPTY), -@@ -299,7 +299,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -306,7 +306,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38176,7 +40398,7 @@ final String[] expected = { "104:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -308,7 +308,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -315,7 +315,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38185,7 +40407,7 @@ final String[] expected = { "51: " + getCheckMessage(MSG_NO_PERIOD), "56: " + getCheckMessage(MSG_NO_PERIOD), -@@ -319,7 +319,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -326,7 +326,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38194,7 +40416,7 @@ final String[] expected = { "67: " + getCheckMessage(MSG_NO_PERIOD), "68:23: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), -@@ -332,7 +332,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -339,7 +339,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38203,7 +40425,7 @@ final String[] expected = { "83: " + getCheckMessage(MSG_EMPTY), "87: " + getCheckMessage(MSG_EMPTY), -@@ -344,7 +344,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -351,7 +351,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38212,7 +40434,7 @@ final String[] expected = { "104:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -353,7 +353,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -360,7 +360,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38221,7 +40443,7 @@ final String[] expected = { "51: " + getCheckMessage(MSG_NO_PERIOD), "56: " + getCheckMessage(MSG_NO_PERIOD), -@@ -364,7 +364,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -371,7 +371,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38230,7 +40452,7 @@ final String[] expected = { "67: " + getCheckMessage(MSG_NO_PERIOD), "68:24: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), -@@ -379,7 +379,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -386,7 +386,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38239,7 +40461,7 @@ final String[] expected = { "83: " + getCheckMessage(MSG_EMPTY), "87: " + getCheckMessage(MSG_EMPTY), -@@ -392,7 +392,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -399,7 +399,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38248,7 +40470,7 @@ final String[] expected = { "104:21: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -401,7 +401,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -408,7 +408,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38257,7 +40479,7 @@ final String[] expected = { "51: " + getCheckMessage(MSG_NO_PERIOD), "56: " + getCheckMessage(MSG_NO_PERIOD), -@@ -414,14 +414,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -421,14 +421,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38274,7 +40496,7 @@ final String[] expected = { "75: " + getCheckMessage(MSG_EMPTY), "79: " + getCheckMessage(MSG_EMPTY), -@@ -434,21 +434,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -441,21 +441,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38299,7 +40521,7 @@ final String[] expected = { "24: " + getCheckMessage(MSG_NO_PERIOD), "50: " + getCheckMessage(MSG_NO_PERIOD), -@@ -465,7 +465,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -472,7 +472,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38308,7 +40530,7 @@ final String[] expected = { "69:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
"), "75: " + getCheckMessage(MSG_NO_PERIOD), -@@ -475,14 +475,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -482,14 +482,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38325,7 +40547,7 @@ final String[] expected = { "30:33: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), "42: " + getCheckMessage(MSG_NO_PERIOD), -@@ -495,7 +495,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -502,7 +502,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38334,7 +40556,7 @@ final String[] expected = { "16: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -507,7 +507,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -514,7 +514,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38343,7 +40565,7 @@ final String[] expected = { "17: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -519,7 +519,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -526,7 +526,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38352,7 +40574,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -528,7 +528,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -535,7 +535,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38361,7 +40583,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -536,7 +536,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -543,7 +543,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38370,7 +40592,7 @@ final String[] expected = { "16: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -546,14 +546,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -553,14 +553,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38387,7 +40609,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -562,7 +562,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -569,7 +569,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38396,7 +40618,7 @@ final String[] expected = { "74: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -571,21 +571,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -578,21 +578,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38421,7 +40643,7 @@ final String[] expected = { "53: " + getCheckMessage(MSG_NO_PERIOD), "86: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -594,7 +594,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -601,7 +601,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38430,7 +40652,7 @@ final String[] expected = { "24: " + getCheckMessage(MSG_NO_PERIOD), "45: " + getCheckMessage(MSG_NO_PERIOD), -@@ -614,7 +614,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -621,7 +621,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38439,7 +40661,7 @@ final HtmlTag tag = new HtmlTag("id", 3, 5, true, false, ""); assertWithMessage("Invalid toString result") .that(tag.toString()) -@@ -624,14 +624,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -631,14 +631,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38456,7 +40678,7 @@ final String[] expected = { "21: " + getCheckMessage(MSG_EMPTY), "25: " + getCheckMessage(MSG_EMPTY), }; -@@ -641,7 +641,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -648,7 +648,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38465,7 +40687,7 @@ final String[] expected = { "21: " + getCheckMessage(MSG_EMPTY), "25: " + getCheckMessage(MSG_EMPTY), -@@ -652,7 +652,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -659,7 +659,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38474,7 +40696,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -660,7 +660,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -667,7 +667,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38483,7 +40705,7 @@ final String[] expected = { "11: " + getCheckMessage(MSG_NO_PERIOD), "15: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -669,7 +669,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -676,7 +676,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38492,7 +40714,7 @@ final String[] expected = { "16: " + getCheckMessage(MSG_NO_PERIOD), "18:16: " -@@ -682,7 +682,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -689,7 +689,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38501,7 +40723,7 @@ final String[] expected = { "21:4: " + getCheckMessage(MSG_EXTRA_HTML, ""), }; -@@ -691,7 +691,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -698,7 +698,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -38510,7 +40732,7 @@ final String[] expected = { "11: " + getCheckMessage(MSG_NO_PERIOD), }; -@@ -700,7 +700,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +@@ -707,7 +707,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } @Test @@ -39072,13 +41294,31 @@ @@ -310,7 +310,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } + @Test +- public void testJavadocTypeParamDescriptionWithAngularTags() throws Exception { ++ void javadocTypeParamDescriptionWithAngularTags() throws Exception { + final String[] expected = { + "44:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "

"), + "46:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), +@@ -322,7 +322,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocTypeRecordParamDescriptionWithAngularTags() throws Exception { ++ void javadocTypeRecordParamDescriptionWithAngularTags() throws Exception { + final String[] expected = { + "51:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "

"), + "53:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), +@@ -338,7 +338,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testJavadocTypeRecordComponents2() throws Exception { + void javadocTypeRecordComponents2() throws Exception { final String[] expected = { "44:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), -@@ -331,7 +331,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -359,7 +359,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -39087,7 +41327,7 @@ final String[] expected = { "19:5: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), -@@ -342,7 +342,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -370,7 +370,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -39096,7 +41336,7 @@ final String[] expected = { "21:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), }; -@@ -350,13 +350,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -378,13 +378,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -39112,7 +41352,7 @@ final String[] expected = { "15:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), }; -@@ -364,7 +364,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -392,7 +392,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -39121,7 +41361,7 @@ final String[] expected = { "28:5: " + getCheckMessage(MSG_MISSING_TAG, "@param "), }; -@@ -372,7 +372,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { +@@ -400,7 +400,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } @Test @@ -40231,9 +42471,9 @@ - public void testIncorrect() throws Exception { + void incorrect() throws Exception { final String[] expected = { - "24: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), - "42: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), -@@ -85,7 +85,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + "20: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "25: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -86,7 +86,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40242,7 +42482,7 @@ final String[] expected = { "26: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), "31: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), -@@ -103,7 +103,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -104,7 +104,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40251,7 +42491,7 @@ final String[] expected = { "14: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), "19: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), -@@ -114,14 +114,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -115,14 +115,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40266,9 +42506,9 @@ - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { final String[] expected = { - "23: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), - "41: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), -@@ -142,7 +142,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + "19: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "24: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -144,7 +144,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40277,7 +42517,7 @@ final String[] expected = { "34: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), "41: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), -@@ -159,7 +159,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -161,7 +161,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40286,7 +42526,7 @@ final String[] expected = { "22: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), "26: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), -@@ -181,7 +181,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -183,7 +183,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40295,7 +42535,7 @@ final String[] expected = { "74: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), }; -@@ -190,7 +190,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -192,7 +192,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40304,7 +42544,7 @@ final String[] expected = { "15: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), }; -@@ -199,7 +199,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -201,7 +201,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40313,7 +42553,7 @@ final String[] expected = { "14: " + getCheckMessage(MSG_SUMMARY_JAVADOC), "21: " + getCheckMessage(MSG_SUMMARY_JAVADOC), -@@ -211,7 +211,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -213,7 +213,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40322,7 +42562,24 @@ final String[] expected = { "19: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), "26: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), -@@ -224,7 +224,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -227,7 +227,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForbiddenFragmentRelativeToPeriod() throws Exception { ++ void forbiddenFragmentRelativeToPeriod() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_SUMMARY_JAVADOC), + }; +@@ -237,14 +237,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJapanesePeriod() throws Exception { ++ void japanesePeriod() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSummaryJavadocJapanesePeriod.java"), expected); } @Test @@ -40331,7 +42588,7 @@ final String[] expected = { "22: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), "36: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), -@@ -235,7 +235,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -255,7 +255,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40340,7 +42597,7 @@ final String[] expected = { "10: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), }; -@@ -244,7 +244,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -264,7 +264,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40349,7 +42606,7 @@ final String[] expected = { "10: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), }; -@@ -253,7 +253,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -273,7 +273,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40358,7 +42615,7 @@ final String[] expected = { "14: " + getCheckMessage(MSG_SUMMARY_JAVADOC), }; -@@ -263,14 +263,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -283,14 +283,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40375,7 +42632,7 @@ final String[] expected = { "14: " + getCheckMessage(MSG_SUMMARY_JAVADOC), }; -@@ -280,7 +280,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -300,7 +300,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40384,7 +42641,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( -@@ -288,14 +288,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -308,14 +308,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40401,7 +42658,7 @@ final String[] expected = { "15: " + getCheckMessage(MSG_SUMMARY_JAVADOC), }; -@@ -304,7 +304,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +@@ -324,7 +324,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } @Test @@ -40522,14 +42779,14 @@ - public void testIgnoreMissing() throws Exception { + void ignoreMissing() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("InputWriteTagIgnore.java"), expected); + verifyWithInlineConfigParserTwice(getPath("InputWriteTagIgnore.java"), expected); } @Test - public void testRegularEx() throws Exception { + void regularEx() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("InputWriteTagRegularExpression.java"), expected); + verifyWithInlineConfigParserTwice(getPath("InputWriteTagRegularExpression.java"), expected); } @Test @@ -40767,6 +43024,15 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -125,7 +125,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testWhenExpression() throws Exception { ++ void whenExpression() throws Exception { + + final int max = 0; + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java @@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -41084,7 +43350,16 @@ final String[] expected = { "25:1: " + getCheckMessage(MSG_KEY, 2, 0), }; -@@ -277,9 +277,9 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { +@@ -272,7 +272,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSealedClasses() throws Exception { ++ void sealedClasses() throws Exception { + final String[] expected = { + "25:1: " + getCheckMessage(MSG_KEY, 2, 0), "32:1: " + getCheckMessage(MSG_KEY, 1, 0), + }; +@@ -287,9 +287,9 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { * * @throws Exception when code tested throws exception */ @@ -41096,16 +43371,7 @@ final ClassFanOutComplexityCheck check = new ClassFanOutComplexityCheck(); final DetailAST root = JavaParser.parseFile( -@@ -293,7 +293,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- importAst.get(), -+ importAst.orElseThrow(), - "importedClassPackages", - importedClssPackage -> ((Map) importedClssPackage).isEmpty())) - .isTrue(); -@@ -306,7 +306,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { +@@ -316,7 +316,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @Test @@ -41114,16 +43380,7 @@ final ClassFanOutComplexityCheck check = new ClassFanOutComplexityCheck(); final DetailAST root = JavaParser.parseFile( -@@ -320,7 +320,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- classDef.get(), -+ classDef.orElseThrow(), - "classesContexts", - classContexts -> ((Collection) classContexts).size() == 1)) - .isTrue(); -@@ -333,7 +333,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { +@@ -343,7 +343,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @Test @@ -41132,15 +43389,15 @@ final ClassFanOutComplexityCheck check = new ClassFanOutComplexityCheck(); final DetailAST root = JavaParser.parseFile( -@@ -347,7 +347,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- packageDef.get(), -+ packageDef.orElseThrow(), - "packageName", - packageName -> ((String) packageName).isEmpty())) - .isTrue(); +@@ -370,7 +370,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testLambdaNew() throws Exception { ++ void lambdaNew() throws Exception { + final String[] expected = {}; + // no violation until #14787 + verifyWithInlineConfigParser(getPath("InputClassFanOutComplexityLambdaNew.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -41206,7 +43463,7 @@ final CyclomaticComplexityCheck cyclomaticComplexityCheckObj = new CyclomaticComplexityCheck(); final int[] actual = cyclomaticComplexityCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -123,7 +123,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { +@@ -124,7 +124,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } @Test @@ -41215,7 +43472,7 @@ final CyclomaticComplexityCheck cyclomaticComplexityCheckObj = new CyclomaticComplexityCheck(); final int[] actual = cyclomaticComplexityCheckObj.getRequiredTokens(); final int[] expected = { -@@ -137,14 +137,14 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { +@@ -138,14 +138,14 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } @Test @@ -41232,6 +43489,24 @@ final String[] expected = { "14:5: " + getCheckMessage(MSG_KEY, 12, 10), }; +@@ -154,7 +154,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhenExpression() throws Exception { ++ void whenExpression() throws Exception { + final String[] expected = { + "13:4: " + getCheckMessage(MSG_KEY, 5, 0), + "19:4: " + getCheckMessage(MSG_KEY, 5, 0), +@@ -165,7 +165,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhenExpressionSwitchAsSinglePoint() throws Exception { ++ void whenExpressionSwitchAsSinglePoint() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, 5, 0), + "20:5: " + getCheckMessage(MSG_KEY, 4, 0), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; @@ -41393,15 +43668,6 @@ final NPathComplexityCheck check = new NPathComplexityCheck(); final Optional question = TestUtil.findTokenInAstByPredicate( -@@ -188,7 +188,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- question.get(), -+ question.orElseThrow(), - "processingTokenEnd", - processingTokenEnd -> { - return TestUtil.getInternalState(processingTokenEnd, "endLineNo") == 0 @@ -198,13 +198,13 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } @@ -41448,13 +43714,31 @@ @@ -257,7 +257,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } + @Test +- public void testPatternMatchingForSwitch() throws Exception { ++ void patternMatchingForSwitch() throws Exception { + + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, 3, 1), +@@ -277,7 +277,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhenExpression() throws Exception { ++ void whenExpression() throws Exception { + + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, 3, 1), +@@ -297,7 +297,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final NPathComplexityCheck npathComplexityCheckObj = new NPathComplexityCheck(); final int[] actual = npathComplexityCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -285,7 +285,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { +@@ -326,7 +326,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } @Test @@ -41463,7 +43747,7 @@ final NPathComplexityCheck npathComplexityCheckObj = new NPathComplexityCheck(); final int[] actual = npathComplexityCheckObj.getRequiredTokens(); final int[] expected = { -@@ -313,7 +313,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { +@@ -355,7 +355,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } @Test @@ -41472,7 +43756,7 @@ final NPathComplexityCheck npathComplexityCheckObj = new NPathComplexityCheck(); final DetailAstImpl ast = new DetailAstImpl(); ast.initialize(new CommonToken(TokenTypes.INTERFACE_DEF, "interface")); -@@ -341,7 +341,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { +@@ -383,7 +383,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { * @throws Exception if there is an error. */ @Test @@ -41481,7 +43765,7 @@ final NPathComplexityCheck check = new NPathComplexityCheck(); final Object tokenEnd = TestUtil.getInternalState(check, "processingTokenEnd"); final DetailAstImpl token = new DetailAstImpl(); -@@ -354,7 +354,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { +@@ -396,7 +396,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } @Test @@ -41801,6 +44085,15 @@ final DetailAstImpl init = new DetailAstImpl(); init.setType(TokenTypes.STATIC_INIT); final DetailAstImpl objBlock = new DetailAstImpl(); +@@ -358,7 +358,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testSealedClassInInterface() throws Exception { ++ void sealedClassInInterface() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_KEY, "final"), + "18:5: " + getCheckMessage(MSG_KEY, "public"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -41982,7 +44275,7 @@ final RedundantModifierCheck redundantModifierCheckObj = new RedundantModifierCheck(); final int[] actual = redundantModifierCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -146,7 +146,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -149,7 +149,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -41991,7 +44284,7 @@ final RedundantModifierCheck obj = new RedundantModifierCheck(); final DetailAstImpl ast = new DetailAstImpl(); ast.initialize(TokenTypes.LITERAL_NULL, "null"); -@@ -165,7 +165,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -166,7 +166,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42000,7 +44293,7 @@ final RedundantModifierCheck redundantModifierCheckObj = new RedundantModifierCheck(); final int[] actual = redundantModifierCheckObj.getRequiredTokens(); final int[] expected = CommonUtil.EMPTY_INT_ARRAY; -@@ -173,7 +173,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -174,7 +174,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42009,7 +44302,7 @@ final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY, "static"), "16:9: " + getCheckMessage(MSG_KEY, "static"), -@@ -184,7 +184,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -185,7 +185,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42018,7 +44311,7 @@ final String[] expected = { "22:20: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -193,7 +193,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -194,7 +194,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42027,7 +44320,7 @@ final String[] expected = { "38:14: " + getCheckMessage(MSG_KEY, "final"), "43:14: " + getCheckMessage(MSG_KEY, "final"), -@@ -204,7 +204,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -205,7 +205,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42036,7 +44329,7 @@ final String[] expected = { "12:33: " + getCheckMessage(MSG_KEY, "final"), "16:49: " + getCheckMessage(MSG_KEY, "final"), -@@ -217,7 +217,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -218,7 +218,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42045,7 +44338,7 @@ final String[] expected = { "15:16: " + getCheckMessage(MSG_KEY, "final"), "30:16: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -226,7 +226,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -227,7 +227,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42054,7 +44347,7 @@ final String[] expected = { "20:23: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -235,7 +235,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -236,7 +236,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42063,7 +44356,7 @@ final String[] expected = { "22:5: " + getCheckMessage(MSG_KEY, "private"), }; -@@ -244,7 +244,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -245,7 +245,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42072,7 +44365,7 @@ final String[] expected = { "13:17: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -253,7 +253,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -254,7 +254,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42081,7 +44374,7 @@ final String[] expected = { "18:19: " + getCheckMessage(MSG_KEY, "final"), }; -@@ -261,7 +261,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -262,7 +262,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42090,7 +44383,7 @@ final String[] expected = { "10:5: " + getCheckMessage(MSG_KEY, "public"), "11:5: " + getCheckMessage(MSG_KEY, "static"), -@@ -291,7 +291,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +@@ -292,7 +292,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } @Test @@ -42099,6 +44392,69 @@ final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY, "static"), "16:9: " + getCheckMessage(MSG_KEY, "final"), +@@ -312,7 +312,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSealedClasses() throws Exception { ++ void sealedClasses() throws Exception { + final String[] expected = { + "11:4: " + getCheckMessage(MSG_KEY, "final"), + "11:10: " + getCheckMessage(MSG_KEY, "public"), +@@ -333,7 +333,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictfpWithVersionBeforeJava9() throws Exception { ++ void strictfpWithVersionBeforeJava9() throws Exception { + final String[] expected = { + "25:5: " + getCheckMessage(MSG_KEY, "abstract"), + "27:9: " + getCheckMessage(MSG_KEY, "public"), +@@ -346,7 +346,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictfpWithOldVersion() throws Exception { ++ void strictfpWithOldVersion() throws Exception { + final String[] expected = { + "25:5: " + getCheckMessage(MSG_KEY, "abstract"), + "27:9: " + getCheckMessage(MSG_KEY, "public"), +@@ -358,7 +358,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictfpWithJava17() throws Exception { ++ void strictfpWithJava17() throws Exception { + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY, "strictfp"), + "18:5: " + getCheckMessage(MSG_KEY, "strictfp"), +@@ -378,7 +378,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictfpWithDefaultVersion() throws Exception { ++ void strictfpWithDefaultVersion() throws Exception { + final String[] expected = { + "14:19: " + getCheckMessage(MSG_KEY, "strictfp"), + "17:5: " + getCheckMessage(MSG_KEY, "strictfp"), +@@ -398,7 +398,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalUnnamedVariablesWithDefaultVersion() throws Exception { ++ void finalUnnamedVariablesWithDefaultVersion() throws Exception { + final String[] expected = { + "18:26: " + getCheckMessage(MSG_KEY, "final"), + "24:9: " + getCheckMessage(MSG_KEY, "final"), +@@ -415,7 +415,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalUnnamedVariablesWithOldVersion() throws Exception { ++ void finalUnnamedVariablesWithOldVersion() throws Exception { + final String[] expected = { + "40:14: " + getCheckMessage(MSG_KEY, "final"), "47:14: " + getCheckMessage(MSG_KEY, "final"), + }; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -42292,7 +44648,16 @@ final int expectedCapitalCount = 4; -@@ -406,14 +404,14 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport +@@ -402,7 +400,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testAbbreviationAsWordInNameCheckRecordPatterns() throws Exception { ++ void abbreviationAsWordInNameCheckRecordPatterns() throws Exception { + + final int expectedCapitalCount = 4; + +@@ -425,14 +423,14 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } @Test @@ -42309,7 +44674,7 @@ final String[] expected = { "13:20: " + getWarningMessage("FLAG_IS_FIRST_RUN", 4), "16:17: " + getWarningMessage("HYBRID_LOCK_PATH", 4), -@@ -431,7 +429,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport +@@ -450,7 +448,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } @Test @@ -42450,7 +44815,7 @@ @Test - public void testDefaultConfigurationOnFileWithViolations() throws Exception { + void defaultConfigurationOnFileWithViolations() throws Exception { - final String defaultFormat = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; + final String defaultFormat = "^(e|t|ex|[a-z][a-z][a-zA-Z]+|_)$"; final String[] expected = { @@ -73,7 +73,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { @@ -42471,6 +44836,15 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -92,7 +92,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCatchParameterNameUnnamed() throws Exception { ++ void catchParameterNameUnnamed() throws Exception { + final String defaultFormat = "^(e|t|ex|[a-z][a-z][a-zA-Z]+|_)$"; + + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -42651,7 +45025,7 @@ - public void testIllegalIdentifierNameDefault() throws Exception { + void illegalIdentifierNameDefault() throws Exception { - final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; + final String format = "(?i)^(?!(record|yield|var|permits|sealed)$).+$"; @@ -92,7 +92,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } @@ -42686,7 +45060,25 @@ @Test - public void testIllegalIdentifierNameLambda() throws Exception { + void illegalIdentifierNameLambda() throws Exception { - final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; + final String format = "(?i)^(?!(record|yield|var|permits|sealed)$).+$"; + + final String[] expected = { +@@ -151,7 +151,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameUnnamedVariable() throws Exception { ++ void illegalIdentifierNameUnnamedVariable() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -160,7 +160,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameRecordPattern() throws Exception { ++ void illegalIdentifierNameRecordPattern() throws Exception { + final String format = "(?i)^(?!(record|yield|var|permits|sealed)$).+$"; final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java @@ -42781,7 +45173,16 @@ - public void testLambdaParameterNameSwitchExpression() throws Exception { + void lambdaParameterNameSwitchExpression() throws Exception { - final String pattern = "^[a-z][a-zA-Z0-9]*$"; + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; + +@@ -88,7 +88,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaParameterNameUnnamed() throws Exception { ++ void lambdaParameterNameUnnamed() throws Exception { + + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java @@ -42810,7 +45211,7 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { - final String pattern = "^[a-z][a-zA-Z0-9]*$"; + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; @@ -56,7 +56,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } @@ -42855,6 +45256,15 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( +@@ -107,7 +107,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnamedVariables() throws Exception { ++ void unnamedVariables() throws Exception { + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; + + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -42882,7 +45292,7 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { - final String pattern = "^[a-z][a-zA-Z0-9]*$"; + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; @@ -59,13 +59,13 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { } @@ -42900,6 +45310,15 @@ final String pattern = "^[a-z]{2,}[a-zA-Z0-9]*$"; +@@ -82,7 +82,7 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnamedVariables() throws Exception { ++ void unnamedVariables() throws Exception { + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; + + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -43374,7 +45793,7 @@ - public void testDefault() throws Exception { + void testDefault() throws Exception { - final String pattern = "^[a-z][a-zA-Z0-9]*$"; + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; @@ -65,7 +65,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { } @@ -43385,6 +45804,24 @@ final String pattern = "^[a-z][a-zA-Z0-9]+$"; +@@ -96,7 +96,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPatternVariableNameUnnamed() throws Exception { ++ void patternVariableNameUnnamed() throws Exception { + + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; + +@@ -116,7 +116,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPatternVariableNameRecordPattern() throws Exception { ++ void patternVariableNameRecordPattern() throws Exception { + + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -44127,7 +46564,7 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java @@ -24,17 +24,17 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameChec import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck.MSG_MISMATCH; - import static org.junit.jupiter.api.Assertions.assertThrows; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.getExpectedThrowable; +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -44326,7 +46763,7 @@ final RegexpOnFilenameCheck check = new RegexpOnFilenameCheck(); @@ -244,7 +244,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { final CheckstyleException ex = - assertThrows( + getExpectedThrowable( CheckstyleException.class, - () -> check.process(file, new FileText(file, Collections.emptyList())), + () -> check.process(file, new FileText(file, ImmutableList.of())), @@ -45312,15 +47749,7 @@ final OuterTypeNumberCheck check = new OuterTypeNumberCheck(); final DetailAST root = JavaParser.parseFile( -@@ -123,14 +123,17 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( - check, -- classDef.get(), -+ classDef.orElseThrow(), - "currentDepth", - currentDepth -> ((Number) currentDepth).intValue() == 0)) - .isTrue(); +@@ -130,7 +130,10 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { assertWithMessage("State is not cleared on beginTree") .that( TestUtil.isStatefulFieldClearedDuringBeginTree( @@ -45413,6 +47842,24 @@ final String[] expected = { "15:10: " + getCheckMessage(MSG_KEY, 7, 8), "20:10: " + getCheckMessage(MSG_KEY, 7, 8), +@@ -104,7 +104,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAnnotatedBy() throws Exception { ++ void ignoreAnnotatedBy() throws Exception { + final String[] expected = { + "23:10: " + getCheckMessage(MSG_KEY, 2, 3), + "30:10: " + getCheckMessage(MSG_KEY, 2, 4), +@@ -120,7 +120,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAnnotatedByFullyQualifiedClassName() throws Exception { ++ void ignoreAnnotatedByFullyQualifiedClassName() throws Exception { + final String[] expected = { + "15:10: " + getCheckMessage(MSG_KEY, 2, 3), + "17:10: " + getCheckMessage(MSG_KEY, 2, 3), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; @@ -46278,10 +48725,10 @@ @Test - public void testBeforeRecordHeader() throws Exception { + void beforeRecordHeader() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser( - getNonCompilablePath("InputGenericWhitespaceBeforeRecordHeader.java"), expected); -@@ -226,7 +226,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + final String[] expected = { + "17:20: " + getCheckMessage(MSG_WS_FOLLOWED, '>'), + "18:20: " + getCheckMessage(MSG_WS_FOLLOWED, '<'), +@@ -264,7 +264,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { * @throws Exception if there is an error. */ @Test @@ -46290,16 +48737,7 @@ final GenericWhitespaceCheck check = new GenericWhitespaceCheck(); final FileText fileText = new FileText( -@@ -240,12 +240,15 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { - assertWithMessage("State is not cleared on beginTree") - .that( - TestUtil.isStatefulFieldClearedDuringBeginTree( -- check, genericStart.get(), "depth", depth -> ((Number) depth).intValue() == 0)) -+ check, -+ genericStart.orElseThrow(), -+ "depth", -+ depth -> ((Number) depth).intValue() == 0)) - .isTrue(); +@@ -286,7 +286,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } @Test @@ -46308,7 +48746,7 @@ final GenericWhitespaceCheck genericWhitespaceCheckObj = new GenericWhitespaceCheck(); final int[] actual = genericWhitespaceCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -255,7 +258,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { +@@ -296,7 +296,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } @Test @@ -46373,14 +48811,16 @@ final String[] expected = { "19:16: " + getCheckMessage(MSG_WS_PRECEDED, "("), "20:34: " + getCheckMessage(MSG_WS_PRECEDED, "("), -@@ -134,13 +134,13 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { +@@ -135,7 +135,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } @Test - public void test1322879() throws Exception { + void test1322879() throws Exception { - final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("InputMethodParamPadWhitespaceAround.java"), expected); + final String[] expected = { + "28:13: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + }; +@@ -143,7 +143,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } @Test @@ -46389,7 +48829,16 @@ final String[] expected = { "19:31: " + getCheckMessage(MSG_WS_PRECEDED, "("), "21:30: " + getCheckMessage(MSG_WS_PRECEDED, "("), -@@ -156,7 +156,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { +@@ -159,7 +159,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodParamPadCheckConstructors() throws Exception { ++ void methodParamPadCheckConstructors() throws Exception { + final String[] expected = { + "21:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "25:14: " + getCheckMessage(MSG_WS_PRECEDED, "("), +@@ -169,7 +169,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } @Test @@ -46398,7 +48847,7 @@ final MethodParamPadCheck methodParamPadCheckObj = new MethodParamPadCheck(); final int[] actual = methodParamPadCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -172,7 +172,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { +@@ -187,7 +187,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } @Test @@ -46407,7 +48856,7 @@ try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -190,7 +190,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { +@@ -205,7 +205,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } @Test @@ -46416,6 +48865,24 @@ final String[] expected = { "15:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), "26:27: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), +@@ -214,7 +214,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordPattern() throws Exception { ++ void recordPattern() throws Exception { + final String[] expected = { + "19:41: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "22:42: " + getCheckMessage(MSG_WS_PRECEDED, "("), +@@ -230,7 +230,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordPattern2() throws Exception { ++ void recordPattern2() throws Exception { + final String[] expected = { + "23:40: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "23:46: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -46634,6 +49101,15 @@ final String[] expected = { "18:9: " + getCheckMessage(MSG_KEY, "synchronized"), }; +@@ -348,7 +348,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWhitespaceAfterUnnamedPattern() throws Exception { ++ void noWhitespaceAfterUnnamedPattern() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCaseDefaultColonCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCaseDefaultColonCheckTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -46672,6 +49148,15 @@ final NoWhitespaceBeforeCaseDefaultColonCheck check = new NoWhitespaceBeforeCaseDefaultColonCheck(); assertWithMessage("Acceptable token should be colon") +@@ -83,7 +83,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT + } + + @Test +- public void testPatternMatchingForSwitch() throws Exception { ++ void patternMatchingForSwitch() throws Exception { + final String[] expected = { + "14:62: " + getCheckMessage(MSG_KEY, ":"), + "16:21: " + getCheckMessage(MSG_KEY, ":"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -46881,6 +49366,24 @@ final String[] expected = { "18:21: " + getCheckMessage(MSG_LINE_PREVIOUS, ":"), "19:21: " + getCheckMessage(MSG_LINE_PREVIOUS, "?"), +@@ -176,7 +176,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInstanceOfOperator() throws Exception { ++ void instanceOfOperator() throws Exception { + final String[] expected = { + "17:15: " + getCheckMessage(MSG_LINE_NEW, "instanceof"), + "23:15: " + getCheckMessage(MSG_LINE_NEW, "instanceof"), +@@ -192,7 +192,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInstanceOfOperatorEndOfLine() throws Exception { ++ void instanceOfOperatorEndOfLine() throws Exception { + final String[] expected = { + "28:17: " + getCheckMessage(MSG_LINE_PREVIOUS, "instanceof"), + "43:17: " + getCheckMessage(MSG_LINE_PREVIOUS, "instanceof"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java @@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -47112,6 +49615,33 @@ final ParenPadCheck check = new ParenPadCheck(); final DetailAstImpl ast = new DetailAstImpl(); final String message = +@@ -540,7 +540,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadWithWhenExpression() throws Exception { ++ void parenPadWithWhenExpression() throws Exception { + final String[] expected = { + "21:38: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "25:33: " + getCheckMessage(MSG_WS_FOLLOWED, "("), +@@ -553,7 +553,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadForRecordPattern() throws Exception { ++ void parenPadForRecordPattern() throws Exception { + final String[] expected = { + "14:40: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "16:40: " + getCheckMessage(MSG_WS_FOLLOWED, "("), +@@ -585,7 +585,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadForRecordPatternWithSpaceOption() throws Exception { ++ void parenPadForRecordPatternWithSpaceOption() throws Exception { + final String[] expected = { + "14:40: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "14:58: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -47625,6 +50155,24 @@ final String[] expected = { "13:48: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), "13:52: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), +@@ -284,7 +284,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralWhen() throws Exception { ++ void literalWhen() throws Exception { + final String[] expected = { + "14:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "when"), + "16:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "when"), +@@ -298,7 +298,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnamedPattern() throws Exception { ++ void unnamedPattern() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhitespaceAfterUnnamedPattern.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -47760,7 +50308,15 @@ final String[] expected = { "26:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "switch"), }; -@@ -239,7 +239,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -239,14 +239,14 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpressionWhitespaceAround() throws Exception { ++ void switchExpressionWhitespaceAround() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhitespaceAroundSwitchExpressions.java"), expected); } @Test @@ -47769,7 +50325,7 @@ final String[] expected = { "29:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), }; -@@ -247,13 +247,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -254,13 +254,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47785,7 +50341,7 @@ final WhitespaceAroundCheck whitespaceAroundCheckObj = new WhitespaceAroundCheck(); final int[] actual = whitespaceAroundCheckObj.getAcceptableTokens(); final int[] expected = { -@@ -318,7 +318,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -326,7 +326,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47794,7 +50350,7 @@ final String[] expected = { "31:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), "35:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), -@@ -341,7 +341,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -349,7 +349,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47803,7 +50359,7 @@ final String[] expected = { "30:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), "34:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), -@@ -360,7 +360,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -368,7 +368,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47812,7 +50368,7 @@ final String[] expected = { "27:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), "27:28: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), -@@ -374,7 +374,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -382,7 +382,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47821,7 +50377,7 @@ final String[] expected = { "32:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), "32:30: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), -@@ -386,7 +386,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -394,7 +394,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47830,7 +50386,7 @@ final String[] expected = { "28:48: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "->"), "28:48: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"), -@@ -395,13 +395,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -403,13 +403,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47846,7 +50402,7 @@ final String[] expected = { "19:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "..."), "20:37: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "..."), -@@ -416,7 +416,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -424,7 +424,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47855,7 +50411,7 @@ final String[] expected = { "26:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), "26:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), -@@ -445,7 +445,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -453,7 +453,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47864,7 +50420,7 @@ final String[] expected = { "26:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), "26:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), -@@ -474,14 +474,14 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -482,14 +482,14 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47881,7 +50437,7 @@ final String[] expected = { "27:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "<"), "27:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "<"), -@@ -497,7 +497,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +@@ -505,7 +505,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } @Test @@ -47890,6 +50446,50 @@ final String[] expected = { "25:22: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "+"), "26:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "+"), +@@ -528,7 +528,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralWhen() throws Exception { ++ void literalWhen() throws Exception { + final String[] expected = { + "21:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "when"), + "23:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "when"), +@@ -546,7 +546,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundAfterPermitsList() throws Exception { ++ void whitespaceAroundAfterPermitsList() throws Exception { + final String[] expected = { + "25:53: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "25:53: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), +@@ -563,14 +563,14 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundUnnamedPatterns() throws Exception { ++ void whitespaceAroundUnnamedPatterns() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhitespaceAroundUnnamedPattern.java"), expected); + } + + @Test +- public void testSwitchCasesParens() throws Exception { ++ void switchCasesParens() throws Exception { + final String[] expected = { + "33:21: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "33:22: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -609,7 +609,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCasesParensWithAllowEmptySwitchBlockStatements() throws Exception { ++ void switchCasesParensWithAllowEmptySwitchBlockStatements() throws Exception { + final String fileName = + "InputWhitespaceAroundSwitchCasesParensWithAllowEmptySwitchBlockStatements.java"; + --- a/src/test/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -49220,11 +51820,19 @@ 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 -@@ -36,10 +36,11 @@ import java.io.IOException; +@@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.filters; + + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; ++import static java.util.UUID.randomUUID; + import static org.junit.jupiter.api.Assumptions.assumeTrue; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; +@@ -36,11 +37,10 @@ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; -+import java.nio.file.Files; +-import java.util.UUID; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -49233,7 +51841,7 @@ @TempDir public File temporaryFolder; -@@ -49,7 +50,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -50,7 +50,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49242,7 +51850,7 @@ final String fileName = getPath("InputSuppressionFilterNone.xml"); final boolean optional = false; final SuppressionFilter filter = createSuppressionFilter(fileName, optional); -@@ -62,7 +63,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -63,7 +63,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49251,7 +51859,7 @@ final String fileName = getPath("InputSuppressionFilterSuppress.xml"); final boolean optional = false; final SuppressionFilter filter = createSuppressionFilter(fileName, optional); -@@ -77,7 +78,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -78,7 +78,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49260,7 +51868,7 @@ final String fileName = null; final boolean optional = false; final SuppressionFilter filter = createSuppressionFilter(fileName, optional); -@@ -89,7 +90,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -90,7 +90,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49269,7 +51877,7 @@ final String fileName = "non_existent_suppression_file.xml"; try { final boolean optional = false; -@@ -103,7 +104,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -104,7 +104,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49278,7 +51886,7 @@ final String fileName = getPath("InputSuppressionFilterInvalidFile.xml"); try { final boolean optional = true; -@@ -118,7 +119,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -119,7 +119,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49287,7 +51895,7 @@ final String fileName = getPath("InputSuppressionFilterNone.xml"); final boolean optional = true; final SuppressionFilter filter = createSuppressionFilter(fileName, optional); -@@ -131,7 +132,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -132,7 +132,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49296,7 +51904,7 @@ final String fileName = "non_existent_suppression_file.xml"; final boolean optional = true; final SuppressionFilter filter = createSuppressionFilter(fileName, optional); -@@ -144,7 +145,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -145,7 +145,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49305,7 +51913,7 @@ final String fileName = "https://checkstyle.org/non_existent_suppression.xml"; final boolean optional = true; final SuppressionFilter filter = createSuppressionFilter(fileName, optional); -@@ -157,15 +158,16 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -158,12 +158,12 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49315,17 +51923,12 @@ filterConfig.addProperty("file", getPath("InputSuppressionFilterNone.xml")); final DefaultConfiguration checkerConfig = createRootConfig(filterConfig); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName); checkerConfig.addProperty("cacheFile", cacheFile.getPath()); -- final String filePath = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String filePath = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); - - execute(checkerConfig, filePath); - // One more time to use cache. -@@ -173,7 +175,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -175,7 +175,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49334,21 +51937,21 @@ final String[] urlCandidates = { "https://checkstyle.org/files/suppressions_none.xml", "https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/site/resources/" -@@ -194,10 +196,11 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -196,11 +196,11 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { firstFilterConfig.addProperty("file", urlForTest); final DefaultConfiguration firstCheckerConfig = createRootConfig(firstFilterConfig); -- final File cacheFile = File.createTempFile("junit", null, temporaryFolder); -+ final File cacheFile = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); +- final String uniqueFileName1 = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName1 = "junit_" + randomUUID() + ".java"; + final File cacheFile = new File(temporaryFolder, uniqueFileName1); firstCheckerConfig.addProperty("cacheFile", cacheFile.getPath()); -- final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); -+ final String pathToEmptyFile = -+ Files.createTempFile(temporaryFolder.toPath(), "file", ".java").toFile().getPath(); - - execute(firstCheckerConfig, pathToEmptyFile); +- final String uniqueFileName2 = "file_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName2 = "file_" + randomUUID() + ".java"; + final File pathToEmptyFile = new File(temporaryFolder, uniqueFileName2); -@@ -262,7 +265,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + execute(firstCheckerConfig, pathToEmptyFile.toString()); +@@ -266,7 +266,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49357,7 +51960,7 @@ for (int test = 1; test <= 6; test++) { final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; final String[] expected = { -@@ -280,7 +283,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -284,7 +284,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49366,7 +51969,7 @@ final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; final String[] expected = { "19:29: " -@@ -295,7 +298,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { +@@ -299,7 +299,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } @Test @@ -49868,8 +52471,17 @@ * @throws Exception when there is problem to load Input file */ @Test -- public void testUpdateFilterSettingsInRunTime() throws Exception { -+ void updateFilterSettingsInRunTime() throws Exception { +- public void testUpdateFilterFileSettingInRunTime() throws Exception { ++ void updateFilterFileSettingInRunTime() throws Exception { + final File file = new File(getPath("InputSuppressionXpathSingleFilterComplexQuery.java")); + + final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); +@@ -478,7 +478,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + * @throws Exception when there is problem to load Input file + */ + @Test +- public void testUpdateFilterChecksSettingInRunTime() throws Exception { ++ void updateFilterChecksSettingInRunTime() throws Exception { final File file = new File(getPath("InputSuppressionXpathSingleFilterComplexQuery.java")); final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); @@ -50691,7 +53303,7 @@ final String message = "A token's number has changed. Please open" + " 'GeneratedJavaTokenTypesTest' and confirm which token is at fault.\n" -@@ -332,17 +332,15 @@ public class GeneratedJavaTokenTypesTest { +@@ -325,17 +325,15 @@ public class GeneratedJavaTokenTypesTest { * unused tokens and cause Collections#lastIndexOfSubList to return a -1 and fail the test. */ @Test @@ -51416,82 +54028,6 @@ verifyAst( getNonCompilablePath("ExpectedAntlr4AstRegressionCaseDefault.txt"), getNonCompilablePath("InputAntlr4AstRegressionCaseDefault.java")); ---- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllBlockCommentsTest.java -+++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllBlockCommentsTest.java -@@ -20,6 +20,7 @@ - package com.puppycrawl.tools.checkstyle.grammar.comments; - - import static com.google.common.truth.Truth.assertWithMessage; -+import static java.nio.charset.StandardCharsets.UTF_8; - - import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; - import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -@@ -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 java.nio.charset.StandardCharsets; - import java.util.Arrays; - import java.util.LinkedHashSet; - import java.util.Set; - import org.junit.jupiter.api.Test; - --public class AllBlockCommentsTest extends AbstractModuleTestSupport { -+final class AllBlockCommentsTest extends AbstractModuleTestSupport { - - private static final Set ALL_COMMENTS = new LinkedHashSet<>(); - -@@ -45,10 +45,10 @@ public class AllBlockCommentsTest extends AbstractModuleTestSupport { - } - - @Test -- public void testAllBlockComments() throws Exception { -+ void allBlockComments() throws Exception { - final DefaultConfiguration checkConfig = createModuleConfig(BlockCommentListenerCheck.class); - final String path = getPath("InputFullOfBlockComments.java"); -- lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); -+ lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); - 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 @@ - package com.puppycrawl.tools.checkstyle.grammar.comments; - - import static com.google.common.truth.Truth.assertWithMessage; -+import static java.nio.charset.StandardCharsets.UTF_8; - - import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; - import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -@@ -27,12 +28,11 @@ 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 java.nio.charset.StandardCharsets; - import java.util.LinkedHashSet; - import java.util.Set; - import org.junit.jupiter.api.Test; - --public class AllSinglelineCommentsTest extends AbstractModuleTestSupport { -+final class AllSinglelineCommentsTest extends AbstractModuleTestSupport { - - private static final Set ALL_COMMENTS = new LinkedHashSet<>(); - -@@ -44,11 +44,11 @@ public class AllSinglelineCommentsTest extends AbstractModuleTestSupport { - } - - @Test -- public void testAllSinglelineComments() throws Exception { -+ void allSinglelineComments() throws Exception { - final DefaultConfiguration checkConfig = - createModuleConfig(SinglelineCommentListenerCheck.class); - final String path = getPath("InputFullOfSinglelineComments.java"); -- lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); -+ lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); - execute(checkConfig, path); - assertWithMessage("All comments should be empty").that(ALL_COMMENTS).isEmpty(); - } --- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.JavaParser; @@ -51524,13 +54060,31 @@ @@ -50,7 +50,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } + @Test +- public void testInputFullOfBlockComments() throws Exception { ++ void inputFullOfBlockComments() throws Exception { + verifyAst( + getPath("InputFullOfBlockCommentsAst.txt"), + getPath("InputFullOfBlockComments.java"), +@@ -58,7 +58,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + + @Test +- public void testInputFullOfSinglelineComments() throws Exception { ++ void inputFullOfSinglelineComments() throws Exception { + verifyAst( + getPath("InputFullOfSinglelineCommentsAst.txt"), + getPath("InputFullOfSinglelineComments.java"), +@@ -66,7 +66,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + @Test - public void testToString() { + void testToString() { final Comment comment = new Comment(new String[] {"value"}, 1, 2, 3); assertWithMessage("Invalid toString result") .that(comment.toString()) -@@ -59,7 +59,7 @@ public class CommentsTest extends AbstractTreeTestSupport { +@@ -75,7 +75,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } @Test @@ -51539,7 +54093,7 @@ final String[] commentText = { "/**", " * Creates new instance.", -@@ -84,7 +84,7 @@ public class CommentsTest extends AbstractTreeTestSupport { +@@ -100,7 +100,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } @Test @@ -51695,24 +54249,7 @@ @Override protected String getPackageLocation() { -@@ -36,7 +36,7 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { - } - - @Test -- public void testBasicStringTemplate() throws Exception { -+ void basicStringTemplate() throws Exception { - verifyAst( - getNonCompilablePath("ExpectedStringTemplateBasic.txt"), - getNonCompilablePath("InputStringTemplateBasic.java")); -@@ -48,28 +48,28 @@ 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")); +@@ -36,21 +36,21 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { } @Test @@ -51737,7 +54274,7 @@ verifyAst( getNonCompilablePath("ExpectedTextBlockConsecutiveEscapes.txt"), getNonCompilablePath("InputTextBlockConsecutiveEscapes.java")); -@@ -83,7 +83,7 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { +@@ -64,7 +64,7 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { * @throws Exception if an error occurs */ @Test @@ -53464,16 +56001,16 @@ // we have no need to block specific token text CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "IllegalTokenText", -@@ -295,7 +295,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -294,7 +294,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "STRING_LITERAL", "CHAR_LITERAL", - "TEXT_BLOCK_CONTENT", - "STRING_TEMPLATE_CONTENT") + "TEXT_BLOCK_CONTENT") - .collect(Collectors.toUnmodifiableSet())); + .collect(toUnmodifiableSet())); // we do not use this check as it is deprecated CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "WriteTag", -@@ -306,7 +306,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -305,7 +305,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "ANNOTATION_FIELD_DEF", "RECORD_DEF", "COMPACT_CTOR_DEF") @@ -53482,7 +56019,7 @@ // 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( -@@ -320,7 +320,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -319,7 +319,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "VARIABLE_DEF", "RECORD_DEF", "COMPACT_CTOR_DEF") @@ -53491,7 +56028,7 @@ CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoLineWrap", Stream.of( -@@ -335,33 +335,33 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -334,33 +334,33 @@ public class AllChecksTest extends AbstractModuleTestSupport { "ENUM_DEF", "INTERFACE_DEF", "RECORD_DEF") @@ -53530,7 +56067,7 @@ CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "WhitespaceAround", Stream.of( -@@ -372,7 +372,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -371,7 +371,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "WILDCARD_TYPE", "GENERIC_END", "GENERIC_START") @@ -53539,7 +56076,7 @@ // google GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( -@@ -381,13 +381,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -380,13 +380,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") @@ -53555,7 +56092,7 @@ GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoLineWrap", Stream.of( -@@ -400,7 +400,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -399,7 +399,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "INTERFACE_DEF", "RECORD_DEF", "COMPACT_CTOR_DEF") @@ -53564,7 +56101,7 @@ GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "SeparatorWrap", Stream.of( -@@ -417,13 +417,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -416,13 +416,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { // which this check does not provide "LPAREN", "RPAREN") @@ -53580,7 +56117,7 @@ GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "EmptyBlock", Stream.of( -@@ -442,7 +442,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -441,7 +441,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "LITERAL_SYNCHRONIZED", "LITERAL_WHILE", "STATIC_INIT") @@ -53589,7 +56126,7 @@ GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "WhitespaceAround", Stream.of( -@@ -454,7 +454,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -453,7 +453,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { "GENERIC_START", "GENERIC_END", "WILDCARD_TYPE") @@ -53598,16 +56135,16 @@ GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "IllegalTokenText", Stream.of( -@@ -470,7 +470,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -468,7 +468,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "COMMENT_CONTENT", // until #14291 - "TEXT_BLOCK_CONTENT", - "STRING_TEMPLATE_CONTENT") + "TEXT_BLOCK_CONTENT") - .collect(Collectors.toUnmodifiableSet())); + .collect(toUnmodifiableSet())); GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "OperatorWrap", Stream.of( -@@ -491,7 +491,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -489,7 +489,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { // COLON token ignored in check config, explained in // https://github.com/checkstyle/checkstyle/issues/4122 "COLON") @@ -53616,7 +56153,7 @@ GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( "NoWhitespaceBefore", Stream.of( -@@ -501,7 +501,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -499,7 +499,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { // whitespace is necessary between a type annotation and ellipsis // according '4.6.2 Horizontal whitespace point 9' "ELLIPSIS") @@ -53625,7 +56162,7 @@ INTERNAL_MODULES = Definitions.INTERNAL_MODULES.stream() .map( -@@ -509,7 +509,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -507,7 +507,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { final String[] packageTokens = moduleName.split("\\."); return packageTokens[packageTokens.length - 1]; }) @@ -53634,7 +56171,7 @@ } @Override -@@ -518,7 +518,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -516,7 +516,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53643,7 +56180,7 @@ final String inputFilePath = getPath("InputAllChecksDefaultConfig.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; -@@ -538,7 +538,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -536,7 +536,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53652,7 +56189,7 @@ for (Class check : CheckUtil.getCheckstyleChecks()) { if (AbstractCheck.class.isAssignableFrom(check)) { final AbstractCheck testedCheck = -@@ -555,7 +555,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -553,7 +553,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53661,7 +56198,7 @@ for (Class check : CheckUtil.getCheckstyleChecks()) { if (AbstractCheck.class.isAssignableFrom(check)) { final AbstractCheck testedCheck = -@@ -572,7 +572,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -570,7 +570,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53670,7 +56207,7 @@ for (Class check : CheckUtil.getCheckstyleChecks()) { if (AbstractCheck.class.isAssignableFrom(check)) { final AbstractCheck testedCheck = -@@ -589,7 +589,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -587,7 +587,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53679,7 +56216,7 @@ for (Class module : CheckUtil.getCheckstyleModules()) { if (ModuleReflectionUtil.isRootModule(module) || ModuleReflectionUtil.isFilterModule(module) -@@ -609,7 +609,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -607,7 +607,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53688,7 +56225,7 @@ final Set modulesReferencedInConfig = CheckUtil.getConfigCheckStyleModules(); final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); -@@ -626,7 +626,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -624,7 +624,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53697,7 +56234,7 @@ final Configuration configuration = ConfigurationUtil.loadConfiguration("config/checkstyle-checks.xml"); -@@ -635,7 +635,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -633,7 +633,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53706,7 +56243,7 @@ final Configuration configuration = ConfigurationUtil.loadConfiguration("src/main/resources/google_checks.xml"); -@@ -733,7 +733,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -731,7 +731,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53715,7 +56252,7 @@ final Set checkstyleModulesNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); final Set modulesNamesWhichHaveXdocs = XdocUtil.getModulesNamesWhichHaveXdoc(); -@@ -755,7 +755,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -753,7 +753,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53724,7 +56261,7 @@ final Set configChecks = CheckUtil.getConfigCheckStyleModules(); final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); moduleNames.removeAll(INTERNAL_MODULES); -@@ -767,7 +767,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -765,7 +765,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53733,7 +56270,7 @@ for (Class module : CheckUtil.getCheckstyleChecks()) { final String name = module.getSimpleName(); final Set messages = CheckUtil.getCheckMessages(module, false); -@@ -786,7 +786,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { +@@ -784,7 +784,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } @Test @@ -53764,7 +56301,7 @@ + void allInputsHaveTest() throws Exception { final Map> allTests = new HashMap<>(); - walk( + walkVisible( - Paths.get("src/test/java"), + Path.of("src/test/java"), filePath -> { @@ -53773,13 +56310,13 @@ @@ -57,23 +56,23 @@ public class AllTestsTest { assertWithMessage("found tests").that(allTests.keySet()).isNotEmpty(); - walk( + walkVisible( - Paths.get("src/test/resources/com/puppycrawl"), + Path.of("src/test/resources/com/puppycrawl"), filePath -> { verifyInputFile(allTests, filePath.toFile()); }); - walk( + walkVisible( - Paths.get("src/test/resources-noncompilable/com/puppycrawl"), + Path.of("src/test/resources-noncompilable/com/puppycrawl"), filePath -> { @@ -53792,7 +56329,7 @@ + void allTestsHaveProductionCode() throws Exception { final Map> allTests = new HashMap<>(); - walk( + walkVisible( - Paths.get("src/main/java"), + Path.of("src/main/java"), filePath -> { @@ -53801,7 +56338,7 @@ @@ -81,7 +80,7 @@ public class AllTestsTest { assertWithMessage("found tests").that(allTests.keySet()).isNotEmpty(); - walk( + walkVisible( - Paths.get("src/test/java"), + Path.of("src/test/java"), filePath -> { @@ -53867,20 +56404,21 @@ .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 -@@ -20,11 +20,11 @@ +@@ -20,11 +20,12 @@ package com.puppycrawl.tools.checkstyle.internal; import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.stream.Collectors.toUnmodifiableList; +import static java.util.stream.Collectors.toUnmodifiableSet; import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; + import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; - import java.util.List; -@@ -32,7 +32,6 @@ import java.util.Map; +@@ -33,7 +34,6 @@ import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -53888,7 +56426,7 @@ import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Node; -@@ -40,10 +39,10 @@ import org.w3c.dom.NodeList; +@@ -41,10 +41,10 @@ import org.w3c.dom.NodeList; import picocli.CommandLine; import picocli.CommandLine.Model.OptionSpec; @@ -53898,10 +56436,10 @@ @Test - public void validateCliDocSections() throws Exception { + void validateCliDocSections() throws Exception { - final Map cmdDesc = new HashMap<>(); - final NodeList sections = getSectionsFromXdoc("src/xdocs/cmdline.xml.vm"); -@@ -85,7 +84,7 @@ public class CliOptionsXdocsSyncTest { + final Node cmdUsageSection = sections.item(2); + final Map cmdOptions = getOptions(cmdUsageSection); +@@ -81,7 +81,7 @@ public class CliOptionsXdocsSyncTest { } @Test @@ -53910,7 +56448,7 @@ final NodeList sections = getSectionsFromXdoc("src/xdocs/cmdline.xml.vm"); final Node usageSource = XmlUtil.getFirstChildElement(sections.item(2)); final String usageText = XmlUtil.getFirstChildElement(usageSource).getTextContent(); -@@ -99,12 +98,12 @@ public class CliOptionsXdocsSyncTest { +@@ -95,12 +95,12 @@ public class CliOptionsXdocsSyncTest { final Set shortParamsMain = commandLine.getCommandSpec().options().stream() .map(OptionSpec::shortestName) @@ -53925,7 +56463,7 @@ assertWithMessage("Short parameters in Main.java and cmdline" + ".xml.vm should match") .that(shortParamsMain) -@@ -125,7 +124,7 @@ public class CliOptionsXdocsSyncTest { +@@ -121,7 +121,7 @@ public class CliOptionsXdocsSyncTest { } private static NodeList getSectionsFromXdoc(String xdocPath) throws Exception { @@ -53934,15 +56472,15 @@ final String input = Files.readString(path); final Document document = XmlUtil.getRawXml(path.getFileName().toString(), input, input); return document.getElementsByTagName("section"); -@@ -138,7 +137,7 @@ public class CliOptionsXdocsSyncTest { - result = - XmlUtil.getChildrenElements(node).stream() - .map(Node::getTextContent) -- .collect(Collectors.toUnmodifiableSet()); -+ .collect(toUnmodifiableSet()); - } - return result; - } +@@ -139,7 +139,7 @@ public class CliOptionsXdocsSyncTest { + final List> columns = + rows.stream() + .map(row -> new ArrayList<>(XmlUtil.getChildrenElements(row))) +- .collect(Collectors.toUnmodifiableList()); ++ .collect(toUnmodifiableList()); + for (List column : columns) { + final Node command = column.get(1); + final Node description = column.get(2); --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java @@ -20,16 +20,17 @@ @@ -54166,7 +56704,7 @@ private static final Map> FULLY_QUALIFIED_CLASS_NAMES = ImmutableMap.>builder() .put("int", int.class) -@@ -115,7 +114,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { +@@ -115,14 +114,14 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { } @BeforeEach @@ -54175,16 +56713,15 @@ final DefaultConfiguration checkConfig = new DefaultConfiguration(JavaDocCapture.class.getName()); checker = createChecker(checkConfig); -@@ -129,7 +128,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { - * method - */ + } + @Test - public void testAllCheckSectionJavaDocs() throws Exception { + void allCheckSectionJavaDocs() throws Exception { final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { -@@ -532,7 +531,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { +@@ -525,7 +524,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { value = currentXdocPath .getParent() @@ -54267,7 +56804,7 @@ private static final String LINK_TEMPLATE = "(?s).*([\\r\\n\\s])*%1$s([\\r\\n\\s])*.*"; -@@ -151,7 +152,7 @@ public class XdocsPagesTest { +@@ -153,7 +154,7 @@ public class XdocsPagesTest { "CustomImportOrder.customImportOrderRules"); private static final Set SUN_MODULES = @@ -54276,7 +56813,7 @@ // ignore the not yet properly covered modules while testing newly added ones // add proper sections to the coverage report and integration tests // and then remove this list eventually -@@ -221,7 +222,7 @@ public class XdocsPagesTest { +@@ -223,7 +224,7 @@ public class XdocsPagesTest { "WhitespaceAround"); private static final Set GOOGLE_MODULES = @@ -54285,7 +56822,7 @@ /** * Generate xdoc content from templates before validation. This method will be removed once summaries = readSummaries(); for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { -@@ -331,7 +332,7 @@ public class XdocsPagesTest { +@@ -333,7 +334,7 @@ public class XdocsPagesTest { } @Test @@ -54329,7 +56866,7 @@ final Map summaries = readSummaries(); for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { final String fileName = path.getFileName().toString(); -@@ -384,7 +385,7 @@ public class XdocsPagesTest { +@@ -386,7 +387,7 @@ public class XdocsPagesTest { } @Test @@ -54338,7 +56875,7 @@ for (Path path : XdocUtil.getXdocsFilePaths()) { final String input = Files.readString(path); final String fileName = path.getFileName().toString(); -@@ -441,7 +442,7 @@ public class XdocsPagesTest { +@@ -443,7 +444,7 @@ public class XdocsPagesTest { } @Test @@ -54347,7 +56884,7 @@ for (Path path : XdocUtil.getXdocsFilePaths()) { final String input = Files.readString(path); final String fileName = path.getFileName().toString(); -@@ -564,7 +565,7 @@ public class XdocsPagesTest { +@@ -566,7 +567,7 @@ public class XdocsPagesTest { } @Test @@ -54356,9 +56893,9 @@ final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { -@@ -624,10 +625,10 @@ public class XdocsPagesTest { - * method - */ +@@ -619,10 +620,10 @@ public class XdocsPagesTest { + } + @Test - public void testAllCheckSectionsEx() throws Exception { + void allCheckSectionsEx() throws Exception { @@ -54369,7 +56906,7 @@ final String fileName = path.getFileName().toString(); final String input = Files.readString(path); -@@ -1081,7 +1082,7 @@ public class XdocsPagesTest { +@@ -1076,7 +1077,7 @@ public class XdocsPagesTest { Optional.ofNullable(field) .map(nonNullField -> nonNullField.getAnnotation(XdocsPropertyType.class)) .map(propertyType -> propertyType.value().getDescription()) @@ -54378,7 +56915,7 @@ final String expectedValue = getModulePropertyExpectedValue(sectionName, propertyName, field, fieldClass, instance); -@@ -1364,7 +1365,7 @@ public class XdocsPagesTest { +@@ -1359,7 +1360,7 @@ public class XdocsPagesTest { final Object[] array = (Object[]) value; valuesStream = Arrays.stream(array); } @@ -54387,7 +56924,7 @@ } if (result.isEmpty()) { -@@ -1393,8 +1394,7 @@ public class XdocsPagesTest { +@@ -1388,8 +1389,7 @@ public class XdocsPagesTest { } else { stream = Arrays.stream((int[]) value); } @@ -54397,7 +56934,7 @@ if (result.isEmpty()) { result = "{}"; } -@@ -1470,7 +1470,7 @@ public class XdocsPagesTest { +@@ -1465,7 +1465,7 @@ public class XdocsPagesTest { result = XmlUtil.getChildrenElements(node).stream() .map(Node::getTextContent) @@ -54406,7 +56943,7 @@ } return result; } -@@ -1684,7 +1684,7 @@ public class XdocsPagesTest { +@@ -1679,7 +1679,7 @@ public class XdocsPagesTest { } @Test @@ -54415,7 +56952,7 @@ for (Path path : XdocUtil.getXdocsStyleFilePaths(XdocUtil.getXdocsFilePaths())) { final String fileName = path.getFileName().toString(); final String styleName = fileName.substring(0, fileName.lastIndexOf('_')); -@@ -1989,7 +1989,7 @@ public class XdocsPagesTest { +@@ -2151,7 +2151,7 @@ public class XdocsPagesTest { } @Test @@ -54525,7 +57062,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 { +@@ -80,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 = @@ -54534,8 +57071,8 @@ JavadocStyleCheck.class, JavadocMethodCheck.class, JavadocTypeCheck.class, -@@ -110,7 +112,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { - "VisibilityModifier"); +@@ -99,7 +101,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + "SuperFinalize"); // Modules that will never have xpath support ever because they not report violations - private static final Set NO_VIOLATION_MODULES = Set.of("SuppressWarningsHolder"); @@ -54543,7 +57080,7 @@ private static final Set SIMPLE_CHECK_NAMES = getSimpleCheckNames(); private static final Map ALLOWED_DIRECTORY_AND_CHECKS = -@@ -131,9 +133,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -120,9 +122,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { private static Map getAllowedDirectoryAndChecks() { return SIMPLE_CHECK_NAMES.stream() @@ -54554,7 +57091,7 @@ } private static Set getInternalModules() { -@@ -143,13 +143,13 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -132,13 +132,13 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { final String[] packageTokens = moduleName.split("\\."); return packageTokens[packageTokens.length - 1]; }) @@ -54572,7 +57109,7 @@ } @Override -@@ -163,12 +163,12 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -152,12 +152,12 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } @Test @@ -54587,7 +57124,7 @@ // add the extra checks abstractJavadocCheckNames.addAll(REGEXP_JAVADOC_CHECKS); final Set abstractJavadocCheckSimpleNames = -@@ -182,7 +182,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -171,7 +171,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } @Test @@ -54596,7 +57133,7 @@ final Set compatibleChecks = new HashSet<>(); final Pattern pattern = Pattern.compile("^XpathRegression(.+)Test\\.java$"); try (DirectoryStream javaPaths = Files.newDirectoryStream(javaDir)) { -@@ -226,7 +226,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -215,7 +215,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); @@ -54605,7 +57142,7 @@ allChecks.removeAll(MISSING_CHECK_NAMES); allChecks.removeAll(NO_VIOLATION_MODULES); allChecks.removeAll(compatibleChecks); -@@ -241,7 +241,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { +@@ -230,7 +230,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } @Test @@ -55051,7 +57588,7 @@ @Test - public void test() { + void test() { - assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny()).hasSize(200); + assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny()).hasSize(207); } @Test @@ -55066,7 +57603,7 @@ @Test - public void testBadPackage() { + void badPackage() { - assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny("DOES.NOT.EXIST")).hasSize(200); + assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny("DOES.NOT.EXIST")).hasSize(207); } @Test @@ -55629,14 +58166,6 @@ final String[] expected = { "25:39: " + getCheckMessage(JavadocMethodCheck.class, MSG_EXPECTED_TAG, "@param", "i"), }; -@@ -402,6 +402,6 @@ public class CheckUtilTest extends AbstractModuleTestSupport { - .that(node.isPresent()) - .isTrue(); - -- return node.get(); -+ return node.orElseThrow(); - } - } --- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CodePointUtilTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CodePointUtilTest.java @@ -24,10 +24,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsCla @@ -56037,7 +58566,7 @@ final String filename = "/" + getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; final URI uri = CommonUtil.getUriByFilename(filename); -@@ -491,7 +492,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -492,7 +493,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -56046,7 +58575,7 @@ final String filename = getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; final URI uri = CommonUtil.getUriByFilename(filename); -@@ -507,7 +508,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -509,7 +510,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { * interpreted relative to the current package "com/puppycrawl/tools/checkstyle/utils/" */ @Test @@ -56055,13 +58584,15 @@ final String filename = getPackageLocation() + "/InputCommonUtilTest_resource.txt"; final URI uri = CommonUtil.getUriByFilename(filename); assertWithMessage("URI is null for: " + filename).that(uri).isNotNull(); -@@ -518,12 +519,12 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -520,14 +521,14 @@ public class CommonUtilTest extends AbstractPathTestSupport { assertWithMessage("URI is relative to package " + uriRelativeToPackage) - .that(uri.toString()) + .that(uri.toASCIIString()) .doesNotContain(uriRelativeToPackage); - final String content = IOUtils.toString(uri.toURL(), StandardCharsets.UTF_8); + final String content = IOUtils.toString(uri.toURL(), UTF_8); - assertWithMessage("Content mismatches for: " + uri).that(content).startsWith("good"); + assertWithMessage("Content mismatches for: " + uri.toASCIIString()) + .that(content) + .startsWith("good"); } @Test @@ -56070,7 +58601,7 @@ final String filename = CommonUtil.CLASSPATH_URL_PROTOCOL + getPackageLocation() -@@ -537,7 +538,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -542,7 +543,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -56079,7 +58610,7 @@ final String filename = CommonUtil.CLASSPATH_URL_PROTOCOL + getPackageLocation() -@@ -551,14 +552,14 @@ public class CommonUtilTest extends AbstractPathTestSupport { +@@ -557,14 +558,14 @@ public class CommonUtilTest extends AbstractPathTestSupport { } @Test @@ -56098,11 +58629,14 @@ try (MockedStatic utilities = mockStatic(CommonUtil.class, CALLS_REAL_METHODS)) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java -@@ -23,30 +23,31 @@ import static com.google.common.truth.Truth.assertWithMessage; +@@ -21,26 +21,26 @@ package com.puppycrawl.tools.checkstyle.utils; + + import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; ++import static java.util.UUID.randomUUID; import java.io.File; -+import java.nio.file.Files; +-import java.util.UUID; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -56121,12 +58655,13 @@ @Test - public void testExistingFile() throws Exception { -- final File file = File.createTempFile("junit", null, temporaryFolder); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; + void existingFile() throws Exception { -+ final File file = Files.createTempFile(temporaryFolder.toPath(), "junit", null).toFile(); ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File file = new File(temporaryFolder, uniqueFileName); + file.createNewFile(); assertWithMessage("Suppression file exists") - .that(FilterUtil.isFileExists(file.getPath())) - .isTrue(); +@@ -49,7 +49,7 @@ public class FilterUtilTest { } @Test @@ -56805,7 +59340,7 @@ + void getTokenTypesTotalNumber() { final int tokenTypesTotalNumber = TokenUtil.getTokenTypesTotalNumber(); - assertWithMessage("Invalid token total number").that(tokenTypesTotalNumber).isEqualTo(195); + assertWithMessage("Invalid token total number").that(tokenTypesTotalNumber).isEqualTo(189); } @Test @@ -56897,21 +59432,23 @@ .isTrue(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/XpathUtilTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/XpathUtilTest.java -@@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; +@@ -23,6 +23,8 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.AbstractPathTestSupport.addEndOfLine; import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; import static com.puppycrawl.tools.checkstyle.utils.XpathUtil.getTextAttributeValue; +import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.UUID.randomUUID; import com.puppycrawl.tools.checkstyle.DetailAstImpl; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; -@@ -32,25 +33,24 @@ import com.puppycrawl.tools.checkstyle.xpath.AbstractNode; +@@ -32,26 +34,24 @@ import com.puppycrawl.tools.checkstyle.xpath.AbstractNode; import com.puppycrawl.tools.checkstyle.xpath.RootNode; import java.io.File; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.List; +-import java.util.UUID; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -56934,7 +59471,7 @@ assertWithMessage("Should return true for supported token types") .that(XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.IDENT))) .isTrue(); -@@ -78,7 +78,7 @@ public class XpathUtilTest { +@@ -79,7 +79,7 @@ public class XpathUtilTest { } @Test @@ -56943,63 +59480,67 @@ assertWithMessage("Returned value differs from expected") .that(getTextAttributeValue(createDetailAST(TokenTypes.STRING_LITERAL, "\"HELLO WORLD\""))) .isEqualTo("HELLO WORLD"); -@@ -94,10 +94,10 @@ public class XpathUtilTest { +@@ -95,11 +95,11 @@ public class XpathUtilTest { } @Test - public void testPrintXpathNotComment() throws Exception { + void printXpathNotComment() throws Exception { final String fileContent = "class Test { public void method() {int a = 5;}}"; -- final File file = File.createTempFile("junit", null, tempFolder); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File file = new File(tempFolder, uniqueFileName); - Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); -+ final File file = Files.createTempFile(tempFolder.toPath(), "junit", null).toFile(); + Files.write(file.toPath(), fileContent.getBytes(UTF_8)); final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -113,10 +113,10 @@ public class XpathUtilTest { +@@ -115,11 +115,11 @@ public class XpathUtilTest { } @Test - public void testPrintXpathComment() throws Exception { + void printXpathComment() throws Exception { final String fileContent = "class Test { /* comment */ }"; -- final File file = File.createTempFile("junit", null, tempFolder); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File file = new File(tempFolder, uniqueFileName); - Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); -+ final File file = Files.createTempFile(tempFolder.toPath(), "junit", null).toFile(); + Files.write(file.toPath(), fileContent.getBytes(UTF_8)); final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -128,10 +128,10 @@ public class XpathUtilTest { +@@ -131,11 +131,11 @@ public class XpathUtilTest { } @Test - public void testPrintXpathTwo() throws Exception { + void printXpathTwo() throws Exception { final String fileContent = "class Test { public void method() {int a = 5; int b = 5;}}"; -- final File file = File.createTempFile("junit", null, tempFolder); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File file = new File(tempFolder, uniqueFileName); - Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); -+ final File file = Files.createTempFile(tempFolder.toPath(), "junit", null).toFile(); + Files.write(file.toPath(), fileContent.getBytes(UTF_8)); final String expected = addEndOfLine( "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", -@@ -155,10 +155,10 @@ public class XpathUtilTest { +@@ -159,11 +159,11 @@ public class XpathUtilTest { } @Test - public void testInvalidXpath() throws IOException { + void invalidXpath() throws IOException { final String fileContent = "class Test { public void method() {int a = 5; int b = 5;}}"; -- final File file = File.createTempFile("junit", null, tempFolder); +- final String uniqueFileName = "junit_" + UUID.randomUUID() + ".java"; ++ final String uniqueFileName = "junit_" + randomUUID() + ".java"; + final File file = new File(tempFolder, uniqueFileName); - Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); -+ final File file = Files.createTempFile(tempFolder.toPath(), "junit", null).toFile(); + Files.write(file.toPath(), fileContent.getBytes(UTF_8)); final String invalidXpath = "\\//CLASS_DEF" + "//METHOD_DEF//VARIABLE_DEF//IDENT"; try { XpathUtil.printXpathBranch(invalidXpath, file); -@@ -176,7 +176,7 @@ public class XpathUtilTest { +@@ -181,7 +181,7 @@ public class XpathUtilTest { } @Test @@ -57054,7 +59595,7 @@ - public void testGetDepth() { + void getDepth() { final UnsupportedOperationException exception = - assertThrows(UnsupportedOperationException.class, attributeNode::getDepth); + getExpectedThrowable(UnsupportedOperationException.class, attributeNode::getDepth); assertWithMessage("Invalid exception message") @@ -74,14 +74,14 @@ public class AttributeNodeTest { } @@ -57080,7 +59621,7 @@ - public void testGetChildren() { + void getChildren() { final UnsupportedOperationException exception = - assertThrows(UnsupportedOperationException.class, attributeNode::getChildren); + getExpectedThrowable(UnsupportedOperationException.class, attributeNode::getChildren); assertWithMessage("Invalid exception message") @@ -103,7 +103,7 @@ public class AttributeNodeTest { } @@ -59147,6 +61688,15 @@ final String[] expected = { "19:27: " + getCheckMessage(MSG_KEY, "args"), }; +@@ -57,7 +57,7 @@ public class FinalParametersCheckExamplesTest extends AbstractExamplesModuleTest + } + + @Test +- public void testExample4() throws Exception { ++ void example4() throws Exception { + final String[] expected = { + "22:12: " + getCheckMessage(MSG_KEY, "e"), "44:10: " + getCheckMessage(MSG_KEY, "number"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckExamplesTest.java @@ -26,21 +26,21 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; @@ -59282,7 +61832,7 @@ - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = { - "11:1: " + getCheckMessage(MSG_KEY), + "12:1: " + getCheckMessage(MSG_KEY), }; @@ -47,7 +47,7 @@ public class OuterTypeFilenameCheckExamplesTest extends AbstractExamplesModuleTe } @@ -59291,7 +61841,7 @@ - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = { - "11:1: " + getCheckMessage(MSG_KEY), + "12:1: " + getCheckMessage(MSG_KEY), }; @@ -56,7 +56,7 @@ public class OuterTypeFilenameCheckExamplesTest extends AbstractExamplesModuleTe } @@ -59300,7 +61850,7 @@ - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = { - "11:1: " + getCheckMessage(MSG_KEY), + "12:1: " + getCheckMessage(MSG_KEY), }; @@ -65,7 +65,7 @@ public class OuterTypeFilenameCheckExamplesTest extends AbstractExamplesModuleTe } @@ -59309,7 +61859,7 @@ - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = { - "11:1: " + getCheckMessage(MSG_KEY), + "12:1: " + getCheckMessage(MSG_KEY), }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckExamplesTest.java @@ -59337,14 +61887,14 @@ - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = { - "1:3: " + getCheckMessage(MSG_KEY, "(TODO)|(FIXME)"), - "18:14: " + getCheckMessage(MSG_KEY, "(TODO)|(FIXME)"), + "1:3: " + getCheckMessage(MSG_KEY, "(?i)(TODO)|(FIXME)"), + "18:14: " + getCheckMessage(MSG_KEY, "(?i)(TODO)|(FIXME)"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck.MSG_KE + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class TrailingCommentCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class TrailingCommentCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -59355,33 +61905,36 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:16: " + getCheckMessage(MSG_KEY), + }; +@@ -40,7 +40,7 @@ public class TrailingCommentCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "21:16: " + getCheckMessage(MSG_KEY), "24:8: " + getCheckMessage(MSG_KEY), + }; +@@ -49,7 +49,7 @@ public class TrailingCommentCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "22:10: " + getCheckMessage(MSG_KEY), + }; +@@ -58,7 +58,7 @@ public class TrailingCommentCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "25:10: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; @@ -59560,8 +62113,8 @@ - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = { - "16:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), - "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Override"), + "17:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), + "34:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Override"), @@ -43,7 +43,7 @@ public class AnnotationOnSameLineCheckExamplesTest extends AbstractExamplesModul } @@ -59569,8 +62122,8 @@ - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = { - "25:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), - "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Nullable"), + "26:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), + "35:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Nullable"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckExamplesTest.java @@ -28,14 +28,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseSty @@ -59829,8 +62382,8 @@ - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = { - "24:16: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), - }; + "19:16: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "case"), + "22:15: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "case"), --- 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,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck @@ -60030,9 +62583,9 @@ - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = { - "35:16: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "16"), - }; -@@ -62,7 +62,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo + "24:22: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "22"), + "38:16: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "16"), +@@ -63,7 +63,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test @@ -60041,14 +62594,14 @@ final String[] expected = { "22:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "5"), }; -@@ -71,7 +71,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo +@@ -72,7 +72,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = { - "41:16: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "16"), + "44: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 @@ -60096,14 +62649,14 @@ - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = { - "16:43: " + getCheckMessage(MSG_KEY, "list1"), "21:42: " + getCheckMessage(MSG_KEY, "list2"), + "17:43: " + getCheckMessage(MSG_KEY, "list1"), "23:42: " + getCheckMessage(MSG_KEY, "list2"), }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidInlineConditionalsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidInlineConditionalsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60114,15 +62667,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:27: " + getCheckMessage(AvoidInlineConditionalsCheck.MSG_KEY), + "25:44: " + getCheckMessage(AvoidInlineConditionalsCheck.MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidNoArgumentSuperConstructorCallCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidNoArgumentSuperConstructorCallCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AvoidNoArgumentSuper + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidNoArgumentSuperConstructorCallCheckExamplesTest +final class AvoidNoArgumentSuperConstructorCallCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60134,20 +62687,21 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); ---- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckExamplesTest.java -+++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; + final String[] expected = { + "17:5: " + getCheckMessage(MSG_CTOR), + }; +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ConstructorsDeclarationGroupingCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ConstructorsDeclarationGroupingCheckExamplesTest.java +@@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") --public class CovariantEqualsCheckExamplesTest extends AbstractExamplesModuleTestSupport { -+final class CovariantEqualsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +-public class ConstructorsDeclarationGroupingCheckExamplesTest ++final class ConstructorsDeclarationGroupingCheckExamplesTest + extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { - return "com/puppycrawl/tools/checkstyle/checks/coding/covariantequals"; +@@ -30,14 +30,14 @@ public class ConstructorsDeclarationGroupingCheckExamplesTest } @Test @@ -60155,37 +62709,49 @@ + 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 = {}; + final String[] expected = { + "22:3: " + getCheckMessage(ConstructorsDeclarationGroupingCheck.MSG_KEY, 18), + "24:3: " + getCheckMessage(ConstructorsDeclarationGroupingCheck.MSG_KEY, 18), +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckExamplesTest.java +@@ -25,14 +25,14 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); +-public class CovariantEqualsCheckExamplesTest extends AbstractExamplesModuleTestSupport { ++final class CovariantEqualsCheckExamplesTest extends AbstractExamplesModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/puppycrawl/tools/checkstyle/checks/coding/covariantequals"; } @Test -- public void testExample3() throws Exception { -+ void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); +- public void testExample1() throws Exception { ++ void example1() throws Exception { + final String[] expected = { + "13:18: " + getCheckMessage(MSG_KEY, "covariant.equals"), + "18:20: " + getCheckMessage(MSG_KEY, "covariant.equals"), +@@ -42,7 +42,7 @@ public class CovariantEqualsCheckExamplesTest extends AbstractExamplesModuleTest } @Test -- public void testExample4() throws Exception { -+ void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); +- public void testExample2() throws Exception { ++ void example2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getNonCompilablePath("Example2.java"), expected); + } --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class DeclarationOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class DeclarationOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60196,31 +62762,33 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:3: " + getCheckMessage(MSG_ACCESS), + "26:3: " + getCheckMessage(MSG_CONSTRUCTOR), +@@ -44,7 +44,7 @@ public class DeclarationOrderCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:3: " + getCheckMessage(MSG_ACCESS), "32:3: " + getCheckMessage(MSG_INSTANCE), + }; +@@ -53,7 +53,7 @@ public class DeclarationOrderCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "28:3: " + getCheckMessage(MSG_CONSTRUCTOR), "32:3: " + getCheckMessage(MSG_INSTANCE), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class DefaultComesLastCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class DefaultComesLastCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60231,17 +62799,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "34:7: " + getCheckMessage(MSG_KEY), "50:7: " + getCheckMessage(MSG_KEY), + }; +@@ -41,7 +41,7 @@ public class DefaultComesLastCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "36:7: " + getCheckMessage(MSG_KEY), + "45:7: " + getCheckMessage(MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE), --- 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 static com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck. @@ -60290,10 +62859,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck. + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class EqualsHashCodeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EqualsHashCodeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60304,15 +62873,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "11:3: " + getCheckMessage(MSG_KEY_EQUALS), + "18:3: " + getCheckMessage(MSG_KEY_HASHCODE), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializati + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ExplicitInitializationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ExplicitInitializationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60323,17 +62892,18 @@ @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, "intField1", "0"), + "17:16: " + getCheckMessage(MSG_KEY, "charField1", "\\0"), +@@ -44,7 +44,7 @@ public class ExplicitInitializationCheckExamplesTest extends AbstractExamplesMod } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "26:18: " + getCheckMessage(MSG_KEY, "objField1", "null"), + "30:15: " + getCheckMessage(MSG_KEY, "arrField1", "null"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckExamplesTest.java @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck.MSG @@ -60352,7 +62922,7 @@ - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = { - "21:9: " + getCheckMessage(MSG_FALL_THROUGH), "32:9: " + getCheckMessage(MSG_FALL_THROUGH), + "33:9: " + getCheckMessage(MSG_FALL_THROUGH), }; @@ -42,7 +42,7 @@ public class FallThroughCheckExamplesTest extends AbstractExamplesModuleTestSupp } @@ -60374,54 +62944,57 @@ }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCh + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,28 +32,28 @@ public class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleT +@@ -32,7 +32,7 @@ public class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "29:9: " + getCheckMessage(MSG_KEY, "result"), + }; +@@ -41,7 +41,7 @@ public class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "17:22: " + getCheckMessage(MSG_KEY, "x"), + "17:29: " + getCheckMessage(MSG_KEY, "y"), +@@ -53,7 +53,7 @@ public class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "26:17: " + getCheckMessage(MSG_KEY, "i"), "29:9: " + getCheckMessage(MSG_KEY, "result"), + }; +@@ -62,7 +62,7 @@ public class FinalLocalVariableCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "17:22: " + getCheckMessage(MSG_KEY, "x"), + "17:29: " + getCheckMessage(MSG_KEY, "y"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckExamplesTest.java -@@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.MSG + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60432,63 +63005,69 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:19: " + getCheckMessage(MSG_KEY, "testField"), + "19:12: " + getCheckMessage(MSG_KEY, "field"), +@@ -44,7 +44,7 @@ public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "21:12: " + getCheckMessage(MSG_KEY, "field"), + }; +@@ -53,7 +53,7 @@ public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "21:12: " + getCheckMessage(MSG_KEY, "field"), + "26:28: " + getCheckMessage(MSG_KEY, "field"), +@@ -64,7 +64,7 @@ public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "21:12: " + getCheckMessage(MSG_KEY, "field"), + "23:28: " + getCheckMessage(MSG_KEY, "testField"), +@@ -76,7 +76,7 @@ public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "18:19: " + getCheckMessage(MSG_KEY, "testField"), + "21:12: " + getCheckMessage(MSG_KEY, "field"), +@@ -88,7 +88,7 @@ public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample6() throws Exception { + void example6() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example6.txt"), expected); + final String[] expected = { + "19:19: " + getCheckMessage(MSG_KEY, "testField"), + "22:12: " + getCheckMessage(MSG_KEY, "field"), +@@ -99,7 +99,7 @@ public class HiddenFieldCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample7() throws Exception { + void example7() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example7.txt"), expected); + final String[] expected = { + "18:16: " + getCheckMessage(MSG_KEY, "field"), + "22:12: " + getCheckMessage(MSG_KEY, "field"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalCatchCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalCatchCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60499,23 +63078,24 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "15:7: " + getCheckMessage(IllegalCatchCheck.MSG_KEY, "Exception"), + "25:7: " + getCheckMessage(IllegalCatchCheck.MSG_KEY, "Exception"), +@@ -39,7 +39,7 @@ public class IllegalCatchCheckExamplesTest extends AbstractExamplesModuleTestSup } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "26:7: " + getCheckMessage(IllegalCatchCheck.MSG_KEY, "ArithmeticException"), + "37:7: " + getCheckMessage(IllegalCatchCheck.MSG_KEY, "OutOfMemoryError"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -23,20 +23,20 @@ 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 IllegalInstantiationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalInstantiationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60526,31 +63106,31 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + 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 = { + "27:27: " + getCheckMessage(IllegalInstantiationCheck.MSG_KEY, "java.lang.Boolean"), + "29:17: " + getCheckMessage(IllegalInstantiationCheck.MSG_KEY, "java.lang.Integer"), +@@ -46,7 +46,7 @@ public class IllegalInstantiationCheckExamplesTest extends AbstractExamplesModul } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("Example3.java"), expected); + } --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck.M + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalThrowsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalThrowsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60561,39 +63141,42 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "12:20: " + getCheckMessage(MSG_KEY, "RuntimeException"), + "14:20: " + getCheckMessage(MSG_KEY, "Error"), +@@ -42,7 +42,7 @@ public class IllegalThrowsCheckExamplesTest extends AbstractExamplesModuleTestSu } @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, "NullPointerException"), + }; +@@ -51,7 +51,7 @@ public class IllegalThrowsCheckExamplesTest 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_KEY, "Error"), + "17:20: " + getCheckMessage(MSG_KEY, "Throwable"), +@@ -61,7 +61,7 @@ public class IllegalThrowsCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "14:20: " + getCheckMessage(MSG_KEY, "RuntimeException"), + "16:20: " + getCheckMessage(MSG_KEY, "Error"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalTokenCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalTokenCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60604,17 +63187,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "13:10: " + getCheckMessage(IllegalTokenCheck.MSG_KEY, "outer:"), + }; +@@ -38,7 +38,7 @@ public class IllegalTokenCheckExamplesTest extends AbstractExamplesModuleTestSup } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "14:3: " + getCheckMessage(IllegalTokenCheck.MSG_KEY, "native"), + }; --- 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,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextChec @@ -60747,6 +63331,15 @@ final String[] expected = { "21:11: " + getCheckMessage(MSG_KEY), "22:11: " + getCheckMessage(MSG_KEY), +@@ -46,7 +46,7 @@ public class InnerAssignmentCheckExamplesTest extends AbstractExamplesModuleTest + } + + @Test +- public void testExample2() throws Exception { ++ void example2() throws Exception { + final String[] expected = { + "18:19: " + getCheckMessage(MSG_KEY), + "20:17: " + 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; @@ -60808,10 +63401,10 @@ verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MatchXpathCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MatchXpathCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60822,39 +63415,42 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "19:3: " + "Private methods must appear after public methods", + "21:3: " + "Private methods must appear after public methods", +@@ -39,7 +39,7 @@ public class MatchXpathCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "19:3: " + "Parameterized constructors are not allowed", + "20:3: " + "Parameterized constructors are not allowed", +@@ -49,7 +49,7 @@ public class MatchXpathCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "17:3: " + "Method name should not be test or foo", + "19:3: " + "Method name should not be test or foo", +@@ -59,7 +59,7 @@ public class MatchXpathCheckExamplesTest extends AbstractExamplesModuleTestSuppo } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "20:5: " + + "New instances should be created via var keyword" --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MissingCtorCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingCtorCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60865,9 +63461,28 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; + final String[] expected = { + "23:1: " + getCheckMessage(MissingCtorCheck.MSG_KEY), + }; +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingNullCaseInSwitchCheckExamplesTest.java +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.MissingNullCaseInSwi + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import org.junit.jupiter.api.Test; - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); +-public class MissingNullCaseInSwitchCheckExamplesTest extends AbstractExamplesModuleTestSupport { ++final class MissingNullCaseInSwitchCheckExamplesTest extends AbstractExamplesModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/puppycrawl/tools/checkstyle/checks/coding/missingnullcaseinswitch"; + } + + @Test +- public void testExample1() throws Exception { ++ void example1() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_KEY), "30:5: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; @@ -60905,10 +63520,10 @@ verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ModifiedControlVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ModifiedControlVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -60919,17 +63534,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "14:8: " + getCheckMessage(ModifiedControlVariableCheck.MSG_KEY, "i"), + "18:11: " + getCheckMessage(ModifiedControlVariableCheck.MSG_KEY, "arg"), +@@ -39,7 +39,7 @@ public class ModifiedControlVariableCheckExamplesTest extends AbstractExamplesMo } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "16:8: " + getCheckMessage(ModifiedControlVariableCheck.MSG_KEY, "i"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckExamplesTest.java @@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; @@ -60975,10 +63591,10 @@ verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDecl + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MultipleVariableDeclarationsCheckExamplesTest +final class MultipleVariableDeclarationsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60990,15 +63606,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:5: " + getCheckMessage(MSG_MULTIPLE_COMMA), + "19:5: " + getCheckMessage(MSG_MULTIPLE_COMMA), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck. + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NestedForDepthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NestedForDepthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61009,17 +63625,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "22:9: " + getCheckMessage(MSG_KEY, 2, 1), + "31:9: " + getCheckMessage(MSG_KEY, 2, 1), +@@ -42,7 +42,7 @@ public class NestedForDepthCheckExamplesTest extends AbstractExamplesModuleTestS } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "32:11: " + getCheckMessage(MSG_KEY, 3, 2), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckExamplesTest.java @@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; @@ -61116,10 +63733,10 @@ verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NoArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61130,15 +63747,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "15:12: " + getCheckMessage(NoArrayTrailingCommaCheck.MSG_KEY), + "18:35: " + getCheckMessage(NoArrayTrailingCommaCheck.MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NoCloneCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoCloneCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61149,15 +63766,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "12:3: " + getCheckMessage(NoCloneCheck.MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NoEnumTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoEnumTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61168,15 +63785,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "22:8: " + getCheckMessage(NoEnumTrailingCommaCheck.MSG_KEY), + "26:8: " + getCheckMessage(NoEnumTrailingCommaCheck.MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NoFinalizerCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoFinalizerCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61187,15 +63804,15 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "13:3: " + getCheckMessage(NoFinalizerCheck.MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class OneStatementPerLineCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class OneStatementPerLineCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61206,17 +63823,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:59: " + getCheckMessage(OneStatementPerLineCheck.MSG_KEY), + "23:23: " + getCheckMessage(OneStatementPerLineCheck.MSG_KEY), +@@ -43,7 +43,7 @@ public class OneStatementPerLineCheckExamplesTest extends AbstractExamplesModule } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "19:59: " + getCheckMessage(OneStatementPerLineCheck.MSG_KEY), + "24:23: " + getCheckMessage(OneStatementPerLineCheck.MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; @@ -61352,10 +63970,10 @@ verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckExamplesTest.java -@@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck.MSG + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ReturnCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ReturnCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61366,47 +63984,51 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "25:5: " + getCheckMessage(MSG_KEY, 4, 3), + }; +@@ -41,7 +41,7 @@ public class ReturnCountCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:5: " + getCheckMessage(MSG_KEY_VOID, 1, 0), + "25:5: " + getCheckMessage(MSG_KEY, 4, 2), +@@ -52,7 +52,7 @@ public class ReturnCountCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "26:5: " + getCheckMessage(MSG_KEY, 4, 2), + }; +@@ -61,7 +61,7 @@ public class ReturnCountCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "26:5: " + getCheckMessage(MSG_KEY, 4, 3), + }; +@@ -70,7 +70,7 @@ public class ReturnCountCheckExamplesTest extends AbstractExamplesModuleTestSupp } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + final String[] expected = { + "27:5: " + getCheckMessage(MSG_KEY_VOID, 1, 0), + "34:5: " + getCheckMessage(MSG_KEY, 4, 2), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SimplifyBooleanExpressionCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SimplifyBooleanExpressionCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61417,9 +64039,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "18:9: " + getCheckMessage(SimplifyBooleanExpressionCheck.MSG_KEY), + "19:11: " + getCheckMessage(SimplifyBooleanExpressionCheck.MSG_KEY), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; @@ -61441,10 +64063,10 @@ verifyWithInlineConfigParser(getPath("Example1.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -22,14 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class StringLiteralEqualityCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class StringLiteralEqualityCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61455,9 +64077,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "18:16: " + getCheckMessage(StringLiteralEqualityCheck.MSG_KEY, "=="), + "20:19: " + getCheckMessage(StringLiteralEqualityCheck.MSG_KEY, "!="), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckExamplesTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck.M @@ -61480,10 +64102,10 @@ }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck.M + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuperFinalizeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuperFinalizeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61494,9 +64116,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "18:18: " + getCheckMessage(MSG_KEY, "finalize", "super.finalize"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckExamplesTest.java @@ -28,14 +28,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthes @@ -61527,38 +64149,39 @@ }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolon + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest +final class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,14 +33,14 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest +@@ -33,7 +33,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "17:2: " + getCheckMessage(MSG_SEMI), + "21:2: " + getCheckMessage(MSG_SEMI), +@@ -44,7 +44,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "19:2: " + getCheckMessage(MSG_SEMI), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolon + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest +final class UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61570,71 +64193,113 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "12:3: " + getCheckMessage(MSG_SEMI), + "13:5: " + getCheckMessage(MSG_SEMI), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolon + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonInEnumerationCheckExamplesTest +final class UnnecessarySemicolonInEnumerationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,14 +32,14 @@ public class UnnecessarySemicolonInEnumerationCheckExamplesTest +@@ -32,7 +32,7 @@ public class UnnecessarySemicolonInEnumerationCheckExamplesTest } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "13:8: " + getCheckMessage(MSG_SEMI), + "16:9: " + getCheckMessage(MSG_SEMI), +@@ -45,7 +45,7 @@ public class UnnecessarySemicolonInEnumerationCheckExamplesTest } @Test - public void testExample2() throws Exception { + 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/coding/UnnecessarySemicolonInTryWithResourcesCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInTryWithResourcesCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolon + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest +final class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -33,14 +33,14 @@ public class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest +@@ -33,7 +33,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "18:39: " + getCheckMessage(MSG_SEMI), "20:10: " + getCheckMessage(MSG_SEMI), + }; +@@ -42,7 +42,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; + final String[] expected = { + "20:39: " + getCheckMessage(MSG_SEMI), + "22:10: " + getCheckMessage(MSG_SEMI), +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedCatchParameterShouldBeUnnamedCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedCatchParameterShouldBeUnnamedCheckExamplesTest.java +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnusedCatchParameter + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import org.junit.jupiter.api.Test; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); +-public class UnusedCatchParameterShouldBeUnnamedCheckExamplesTest ++final class UnusedCatchParameterShouldBeUnnamedCheckExamplesTest + extends AbstractExamplesModuleTestSupport { + + @Override +@@ -33,7 +33,7 @@ public class UnusedCatchParameterShouldBeUnnamedCheckExamplesTest + } + + @Test +- public void testExample1() throws Exception { ++ void example1() throws Exception { + final String[] expected = { + "20:14: " + getCheckMessage(MSG_UNUSED_CATCH_PARAMETER, "exception"), + }; +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLambdaParameterShouldBeUnnamedCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLambdaParameterShouldBeUnnamedCheckExamplesTest.java +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnusedLambdaParamete + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class UnusedLambdaParameterShouldBeUnnamedCheckExamplesTest ++final class UnusedLambdaParameterShouldBeUnnamedCheckExamplesTest + extends AbstractExamplesModuleTestSupport { + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class UnusedLambdaParameterShouldBeUnnamedCheckExamplesTest + } + + @Test +- public void testExample1() throws Exception { ++ void example1() throws Exception { + final String[] expected = { + "22:38: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "x"), + "28:53: " + getCheckMessage(MSG_UNUSED_LAMBDA_PARAMETER, "y"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.UnusedLocalVariableC + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnusedLocalVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UnusedLocalVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61645,29 +64310,39 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; + final String[] expected = { + "16:5: " + getCheckMessage(MSG_UNUSED_NAMED_LOCAL_VARIABLE, "k"), + "26:5: " + getCheckMessage(MSG_UNUSED_NAMED_LOCAL_VARIABLE, "arr"), +@@ -45,7 +45,7 @@ public class UnusedLocalVariableCheckExamplesTest extends AbstractExamplesModule + } - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + @Test +- public void testExample2() throws Exception { ++ void example2() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "k"), + "27:5: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "arr"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationU + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class VariableDeclarationUsageDistanceCheckExamplesTest +final class VariableDeclarationUsageDistanceCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,35 +32,35 @@ public class VariableDeclarationUsageDistanceCheckExamplesTest +@@ -33,7 +33,7 @@ public class VariableDeclarationUsageDistanceCheckExamplesTest } @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY_EXT, "num", 4, 3), + }; +@@ -42,21 +42,21 @@ public class VariableDeclarationUsageDistanceCheckExamplesTest } @Test @@ -61675,7 +64350,7 @@ + void example2() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + verifyWithInlineConfigParser(getPath("Example2.java"), expected); } @Test @@ -61683,29 +64358,49 @@ + void example3() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + verifyWithInlineConfigParser(getPath("Example3.java"), expected); } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY_EXT, "num", 4, 3), + "28:5: " + getCheckMessage(MSG_KEY_EXT, "count", 4, 3), +@@ -66,7 +66,7 @@ public class VariableDeclarationUsageDistanceCheckExamplesTest } @Test - public void testExample5() throws Exception { + void example5() throws Exception { - final String[] expected = {}; + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY, "num", 4, 3), + "17:5: " + getCheckMessage(MSG_KEY, "PI", 5, 3), +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/WhenShouldBeUsedCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/WhenShouldBeUsedCheckExamplesTest.java +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.WhenShouldBeUsedChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import org.junit.jupiter.api.Test; - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); +-public class WhenShouldBeUsedCheckExamplesTest extends AbstractExamplesModuleTestSupport { ++final class WhenShouldBeUsedCheckExamplesTest extends AbstractExamplesModuleTestSupport { + @Override + protected String getPackageLocation() { + return "com/puppycrawl/tools/checkstyle/checks/coding/whenshouldbeused"; + } + + @Test +- public void testExample1() throws Exception { ++ void example1() throws Exception { + final String[] expected = { + "18:7: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCh + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class DesignForExtensionCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class DesignForExtensionCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61716,33 +64411,36 @@ @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, "Example1", "m1"), + "16:3: " + getCheckMessage(MSG_KEY, "Example1", "m2"), +@@ -42,7 +42,7 @@ public class DesignForExtensionCheckExamplesTest extends AbstractExamplesModuleT } @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, "Example2", "m1"), + "18:3: " + getCheckMessage(MSG_KEY, "Example2", "m2"), +@@ -52,7 +52,7 @@ public class DesignForExtensionCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "16:3: " + getCheckMessage(MSG_KEY, "Example3", "m1"), + "18:3: " + getCheckMessage(MSG_KEY, "Example3", "m2"), +@@ -65,7 +65,7 @@ public class DesignForExtensionCheckExamplesTest extends AbstractExamplesModuleT } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "17:3: " + getCheckMessage(MSG_KEY, "Example4", "m1"), + "19:3: " + getCheckMessage(MSG_KEY, "Example4", "m2"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.MSG_ @@ -61764,10 +64462,10 @@ }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckExamplesTest.java -@@ -24,15 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,15 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassCons + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class HideUtilityClassConstructorCheckExamplesTest - extends AbstractExamplesModuleTestSupport { +final class HideUtilityClassConstructorCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61779,9 +64477,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; + final String[] expected = { + "13:1: " + getCheckMessage(MSG_KEY), + "39:1: " + getCheckMessage(MSG_KEY), +@@ -43,7 +42,7 @@ public class HideUtilityClassConstructorCheckExamplesTest + } - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + @Test +- public void testExample2() throws Exception { ++ void example2() throws Exception { + final String[] expected = { + "42:1: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck.M @@ -61831,10 +64538,10 @@ }; --- 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; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MutableExceptionCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MutableExceptionCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61845,31 +64552,33 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "23:3: " + getCheckMessage(MSG_KEY, "code"), + "32:3: " + getCheckMessage(MSG_KEY, "message"), +@@ -42,7 +42,7 @@ public class MutableExceptionCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "23:3: " + getCheckMessage(MSG_KEY, "code"), "41:3: " + getCheckMessage(MSG_KEY, "code"), + }; +@@ -51,7 +51,7 @@ public class MutableExceptionCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "32:3: " + getCheckMessage(MSG_KEY, "message"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class OneTopLevelClassCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class OneTopLevelClassCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -61880,17 +64589,39 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:1: " + getCheckMessage(MSG_KEY, "ViolationExample1"), + }; +@@ -40,7 +40,7 @@ public class OneTopLevelClassCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; + final String[] expected = { + "16:1: " + getCheckMessage(MSG_KEY, "ViolationExample2"), + }; +--- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/SealedShouldHavePermitsListCheckExamplesTest.java ++++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/SealedShouldHavePermitsListCheckExamplesTest.java +@@ -24,8 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.design.SealedShouldHavePerm + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import org.junit.jupiter.api.Test; - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); +-public class SealedShouldHavePermitsListCheckExamplesTest +- extends AbstractExamplesModuleTestSupport { ++final class SealedShouldHavePermitsListCheckExamplesTest extends AbstractExamplesModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +32,7 @@ public class SealedShouldHavePermitsListCheckExamplesTest + } + + @Test +- public void testExample1() throws Exception { ++ void example1() throws Exception { + final String[] expected = { + "18:3: " + getCheckMessage(MSG_KEY), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; @@ -62581,7 +65312,7 @@ 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 +@@ -42,7 +42,7 @@ public class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSu } @Test @@ -62726,10 +65457,10 @@ verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckExamplesTest.java -@@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck. + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AtclauseOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AtclauseOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -62740,9 +65471,27 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; + final String tagOrder = + "[@author, @version, @param, @return, @throws" + + ", @exception, @see," +@@ -49,7 +49,7 @@ public class AtclauseOrderCheckExamplesTest extends AbstractExamplesModuleTestSu + } - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + @Test +- public void testExample2() throws Exception { ++ void example2() throws Exception { + final String tagOrder = + "[@author, @since, @version, @param, @return" + + ", @throws, @exception," +@@ -63,7 +63,7 @@ public class AtclauseOrderCheckExamplesTest extends AbstractExamplesModuleTestSu + } + + @Test +- public void testExample3() throws Exception { ++ void example3() throws Exception { + final String tagOrder = + "[@author, @since, @version, @param, @return" + + ", @throws, @exception," --- 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 static com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPosit @@ -62953,10 +65702,10 @@ verifyWithInlineConfigParser(getPath("Example1.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -28,14 +28,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphChe + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocParagraphCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocParagraphCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -62967,17 +65716,18 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:4: " + getCheckMessage(MSG_LINE_BEFORE), + "21:4: " + getCheckMessage(MSG_MISPLACED_TAG), +@@ -48,7 +48,7 @@ public class JavadocParagraphCheckExamplesTest extends AbstractExamplesModuleTes } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "18:4: " + getCheckMessage(MSG_LINE_BEFORE), + "20:4: " + getCheckMessage(MSG_MISPLACED_TAG), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckExamplesTest.java @@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; @@ -63150,10 +65900,10 @@ verifyWithInlineConfigParser(getPath("Example8.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableChec + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocVariableCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -63164,33 +65914,36 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "12:3: " + getCheckMessage(MSG_JAVADOC_MISSING), + "18:3: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -42,7 +42,7 @@ public class JavadocVariableCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String[] expected = { + "21:3: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -51,7 +51,7 @@ public class JavadocVariableCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample3() throws Exception { + void example3() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + final String[] expected = { + "15:3: " + getCheckMessage(MSG_JAVADOC_MISSING), + "23:15: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -61,7 +61,7 @@ public class JavadocVariableCheckExamplesTest extends AbstractExamplesModuleTest } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "14:3: " + getCheckMessage(MSG_JAVADOC_MISSING), + "20:3: " + getCheckMessage(MSG_JAVADOC_MISSING), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheckExamplesTest.java @@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; @@ -63370,10 +66123,10 @@ verifyWithInlineConfigParser(getPath("Example1.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckExamplesTest.java -@@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; +@@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.SingleLineJavadocCh + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SingleLineJavadocCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SingleLineJavadocCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -63384,9 +66137,10 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "12: " + getCheckMessage(MSG_KEY), + }; +@@ -41,14 +41,14 @@ public class SingleLineJavadocCheckExamplesTest extends AbstractExamplesModuleTe } @Test @@ -63394,23 +66148,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 = { + "14: " + getCheckMessage(MSG_KEY), "26: " + getCheckMessage(MSG_KEY), + }; +@@ -57,7 +57,7 @@ public class SingleLineJavadocCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "14: " + getCheckMessage(MSG_KEY), "32: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), + }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckExamplesTest.java @@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; @@ -63553,16 +66308,16 @@ }; --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckExamplesTest.java -@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; + import java.util.List; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ClassDataAbstractionCouplingCheckExamplesTest +final class ClassDataAbstractionCouplingCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { -@@ -32,77 +32,77 @@ public class ClassDataAbstractionCouplingCheckExamplesTest +@@ -33,14 +33,14 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } @Test @@ -63570,15 +66325,16 @@ + 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 = {}; - - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + final String expectedClasses = + List.of( + "AtomicInteger", +@@ -61,14 +61,14 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } @Test @@ -63586,15 +66342,16 @@ + void example3() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + verifyWithInlineConfigParser(getPath("Example3.java"), expected); } @Test - public void testExample4() throws Exception { + void example4() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example4.txt"), expected); + final String[] expected = { + "22:1: " + getCheckMessage(MSG_KEY, 3, 2, "[AtomicInteger, BigDecimal, BigInteger]"), + }; +@@ -77,14 +77,14 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } @Test @@ -63602,15 +66359,16 @@ + void example5() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example5.txt"), expected); + verifyWithInlineConfigParser(getPath("ignore/deeper/Example5.java"), expected); } @Test - public void testExample6() throws Exception { + void example6() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example6.txt"), expected); + final String expectedClasses = + List.of( + "AtomicInteger", +@@ -105,14 +105,14 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } @Test @@ -63618,15 +66376,16 @@ + void example7() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example7.txt"), expected); + verifyWithInlineConfigParser(getPath("ignore/Example7.java"), expected); } @Test - public void testExample8() throws Exception { + void example8() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example8.txt"), expected); + final String expectedClasses = + List.of( + "AtomicInteger", +@@ -133,14 +133,14 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } @Test @@ -63634,15 +66393,16 @@ + void example9() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example9.txt"), expected); + verifyWithInlineConfigParser(getPath("ignore/Example9.java"), expected); } @Test - public void testExample10() throws Exception { + void example10() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example10.txt"), expected); + final String expectedClasses = + List.of( + "AtomicInteger", +@@ -161,7 +161,7 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } @Test @@ -63650,7 +66410,7 @@ + void example11() throws Exception { final String[] expected = {}; - verifyWithInlineConfigParser(getPath("Example11.txt"), expected); + verifyWithInlineConfigParser(getPath("Example11.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckExamplesTest.java @@ -24,84 +24,84 @@ import org.junit.jupiter.api.Disabled; @@ -63923,10 +66683,10 @@ verifyWithInlineConfigParser(getPath("Example1.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckExamplesTest.java -@@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierC + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RedundantModifierCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RedundantModifierCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -63937,17 +66697,27 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:10: " + getCheckMessage(MSG_KEY, "final"), + "24:3: " + getCheckMessage(MSG_KEY, "abstract"), +@@ -46,7 +46,7 @@ public class RedundantModifierCheckExamplesTest extends AbstractExamplesModuleTe } @Test - public void testExample2() throws Exception { + void example2() throws Exception { - final String[] expected = {}; + final String[] expected = { + "25:5: " + getCheckMessage(MSG_KEY, "public"), + "25:12: " + getCheckMessage(MSG_KEY, "abstract"), +@@ -56,7 +56,7 @@ public class RedundantModifierCheckExamplesTest extends AbstractExamplesModuleTe + } - verifyWithInlineConfigParser(getPath("Example2.txt"), expected); + @Test +- public void testExample3() throws Exception { ++ void example3() throws Exception { + final String[] expected = { + "18:10: " + getCheckMessage(MSG_KEY, "final"), + "26:3: " + getCheckMessage(MSG_KEY, "abstract"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameExamplesTest.java @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; @@ -64021,7 +66791,7 @@ + void example7() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - verifyWithInlineConfigParser(getPath("Example7.java"), expected); + verifyWithInlineXmlConfig(getPath("Example7.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckExamplesTest.java @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameChe @@ -64078,7 +66848,7 @@ -public class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { - 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_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 } @@ -64189,7 +66959,7 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; + final String format = "(?i)^(?!(record|yield|var|permits|sealed)$).+$"; final String[] expected = { @@ -46,7 +46,7 @@ public class IllegalIdentifierNameCheckExamplesTest extends AbstractExamplesModu @@ -64246,7 +67016,7 @@ - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = { - "17:11: " + getCheckMessage(MSG_INVALID_PATTERN, "S", "^[a-z][a-zA-Z0-9]*$"), + "17:11: " + getCheckMessage(MSG_INVALID_PATTERN, "S", "^([a-z][a-zA-Z0-9]*|_)$"), }; @@ -40,7 +40,7 @@ public class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModule } @@ -64310,7 +67080,7 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String pattern = "^[a-z][a-zA-Z0-9]*$"; + 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 @@ -64567,7 +67337,7 @@ - public void testExample1() throws Exception { + void example1() throws Exception { - final String pattern = "^[a-z][a-zA-Z0-9]*$"; + final String pattern = "^([a-z][a-zA-Z0-9]*|_)$"; @@ -44,7 +44,7 @@ public class PatternVariableNameCheckExamplesTest extends AbstractExamplesModule } @@ -64587,6 +67357,15 @@ final String pattern = "^[a-z][_a-zA-Z0-9]{2,}$"; +@@ -69,7 +69,7 @@ public class PatternVariableNameCheckExamplesTest extends AbstractExamplesModule + } + + @Test +- public void testExample4() throws Exception { ++ void example4() throws Exception { + + final String[] expected = { + "37:30: " + getCheckMessage(MSG_INVALID_PATTERN, "BAD", "^([a-z][a-zA-Z0-9]*|_)$"), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; @@ -64833,7 +67612,7 @@ verifyWithInlineConfigParser(getPath("Example13.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckExamplesTest.java -@@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; +@@ -24,49 +24,49 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") @@ -64890,14 +67669,6 @@ final String[] expected = {}; verifyWithInlineConfigParser(getPath("Example6.txt"), expected); - } - - @Test -- public void testExample7() throws Exception { -+ void example7() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example7.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; @@ -65378,10 +68149,10 @@ verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckExamplesTest.java -@@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; +@@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck. + import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ParameterNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ParameterNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -65392,9 +68163,10 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; - - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { + "16:3: " + getCheckMessage(MSG_KEY, 7, 8), + "20:3: " + getCheckMessage(MSG_KEY, 7, 8), +@@ -43,14 +43,14 @@ public class ParameterNumberCheckExamplesTest extends AbstractExamplesModuleTest } @Test @@ -65402,15 +68174,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 = {}; + final String[] expected = { + "18:3: " + getCheckMessage(MSG_KEY, 7, 8), + "22:3: " + getCheckMessage(MSG_KEY, 7, 8), +@@ -61,7 +61,7 @@ public class ParameterNumberCheckExamplesTest extends AbstractExamplesModuleTest + } - verifyWithInlineConfigParser(getPath("Example3.txt"), expected); + @Test +- public void testExample4() throws Exception { ++ void example4() throws Exception { + final String[] expected = { + "22:3: " + getCheckMessage(MSG_KEY, 7, 8), + "27:15: " + getCheckMessage(MSG_KEY, 7, 8), --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; @@ -66131,10 +68912,10 @@ verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterExamplesTest.java -@@ -24,14 +24,14 @@ 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 SeverityMatchFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SeverityMatchFilterExamplesTest extends AbstractExamplesModuleTestSupport { @Override @@ -66145,9 +68926,9 @@ @Test - public void testExample1() throws Exception { + void example1() throws Exception { - final String[] expected = {}; + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - verifyWithInlineConfigParser(getPath("Example1.txt"), expected); + final String[] expected = { --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; diff --git a/integration-tests/checkstyle-expected-warnings.txt b/integration-tests/checkstyle-expected-warnings.txt index feb368d3ac..cc17b25676 100644 --- a/integration-tests/checkstyle-expected-warnings.txt +++ b/integration-tests/checkstyle-expected-warnings.txt @@ -1,30 +1,59 @@ -src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java:[35,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java:[35,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) +src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/NonRequiredJavadocTest.java:[33,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java:[35,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/XpathRegressionAbbreviationAsWordInNameTest.java:[117,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/XpathRegressionAbbreviationAsWordInNameTest.java:[169,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/XpathRegressionAbbreviationAsWordInNameTest.java:[116,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/XpathRegressionAbbreviationAsWordInNameTest.java:[166,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/XpathRegressionAbbreviationAsWordInNameTest.java:[91,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) -src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java:[104,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/XpathRegressionAnnotationLocationTest.java:[101,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/XpathRegressionAnnotationLocationTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) -src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java:[71,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/XpathRegressionAnnotationLocationTest.java:[69,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/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/XpathRegressionCatchParameterNameTest.java:[161,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:[187,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/XpathRegressionClassMemberImpliedModifierTest.java:[39,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/XpathRegressionClassMemberImpliedModifierTest.java:[71,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/XpathRegressionClassTypeParameterNameTest.java:[40,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassTypeParameterNameTest.java:[69,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/XpathRegressionConstructorsDeclarationGroupingTest.java:[40,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstructorsDeclarationGroupingTest.java:[70,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/XpathRegressionDeclarationOrderTest.java:[64,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `static` 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/XpathRegressionFinalClassTest.java:[38,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/XpathRegressionIllegalImportTest.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/XpathRegressionIllegalImportTest.java:[53,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `static` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalInstantiationTest.java:[91,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/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/XpathRegressionIllegalTokenTest.java:[56,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `native` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java:[91,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/XpathRegressionIndentationTest.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/XpathRegressionLambdaParameterNameTest.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/XpathRegressionMemberNameTest.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/XpathRegressionMethodCountTest.java:[109,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `protected` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java:[134,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `public` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java:[37,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/XpathRegressionMethodCountTest.java:[61,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `private` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java:[85,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `package` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.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/XpathRegressionMissingJavadocTypeTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `class` is not a valid identifier) -src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java:[67,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/XpathRegressionMissingOverrideTest.java:[66,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/XpathRegressionMultipleStringLiteralsTest.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/XpathRegressionMutableExceptionTest.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/XpathRegressionNeedBracesTest.java:[40,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `do` is not a valid identifier) +src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java:[37,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/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/XpathRegressionOverloadMethodsDeclarationOrderTest.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/XpathRegressionParameterNumberTest.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/XpathRegressionRecordComponentNameTest.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/XpathRegressionRecordComponentNumberTest.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/XpathRegressionReturnCountTest.java:[38,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `void` is not a valid identifier) src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanExpressionTest.java:[90,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/XpathRegressionThrowsCountTest.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/XpathRegressionTypeNameTest.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/XpathRegressionUncommentedMainTest.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/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java:[57,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/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) @@ -46,6 +75,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCh src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckTest.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/AvoidInlineConditionalsCheckTest.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/AvoidNoArgumentSuperConstructorCallCheckTest.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/ConstructorsDeclarationGroupingCheckTest.java:[35,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/CovariantEqualsCheckTest.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/DeclarationOrderCheckTest.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/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) @@ -70,8 +100,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolon src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInTryWithResourcesCheckTest.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/design/InterfaceIsTypeCheckTest.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/design/MutableExceptionCheckTest.java:[54,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/design/ThrowsCountCheckTest.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/imports/ImportControlCheckTest.java:[99,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `null` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java:[100,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `null` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java:[81,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/InvalidJavadocPositionCheckTest.java:[59,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/JavadocContentLocationCheckTest.java:[57,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) @@ -133,7 +162,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentF 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) +src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java:[69,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/grammar/java8/DefaultMethodsTest.java:[40,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `switch` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/gui/BaseCellEditorTest.java:[31,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/utils/CheckUtilTest.java:[71,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) diff --git a/integration-tests/checkstyle-init.patch b/integration-tests/checkstyle-init.patch index 2b6b5d2adc..19c466289e 100644 --- a/integration-tests/checkstyle-init.patch +++ b/integration-tests/checkstyle-init.patch @@ -1,7 +1,7 @@ --- a/pom.xml +++ b/pom.xml -@@ -366,6 +366,12 @@ - 1.4.1 +@@ -368,6 +368,12 @@ + 1.4.4 test + @@ -13,7 +13,7 @@ nl.jqno.equalsverifier equalsverifier -@@ -2422,6 +2428,8 @@ +@@ -2420,6 +2426,8 @@ -Xplugin:ErrorProne ${error-prone.configuration-args} @@ -22,7 +22,7 @@ -@@ -2434,6 +2442,11 @@ +@@ -2432,6 +2440,11 @@ error-prone-contrib ${error-prone-support.version} @@ -34,7 +34,7 @@ -@@ -2476,9 +2489,10 @@ +@@ -2474,9 +2487,10 @@ -XDcompilePolicy=simple -Xplugin:ErrorProne \ @@ -46,7 +46,7 @@ -@@ -2491,6 +2505,11 @@ +@@ -2489,6 +2503,11 @@ error-prone-contrib ${error-prone-support.version} @@ -58,6 +58,39 @@ +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/FileNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/FileNameTest.java +@@ -23,6 +23,8 @@ import org.junit.jupiter.api.Test; + + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + ++// This class is referenced from another package. ++@SuppressWarnings("JUnitClassModifiers") + public class FileNameTest extends AbstractGoogleModuleTestSupport { + + @Override +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/SourceFileStructureTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/SourceFileStructureTest.java +@@ -23,6 +23,8 @@ import org.junit.jupiter.api.Test; + + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + ++// This class is referenced from another package. ++@SuppressWarnings("JUnitClassModifiers") + public class SourceFileStructureTest extends AbstractGoogleModuleTestSupport { + + @Override +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/toolongpackagetotestcoveragegooglesjavastylerule/PackageStatementTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/toolongpackagetotestcoveragegooglesjavastylerule/PackageStatementTest.java +@@ -23,6 +23,8 @@ import org.junit.jupiter.api.Test; + + import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + ++// This class is referenced from another package. ++@SuppressWarnings("JUnitClassModifiers") + public class PackageStatementTest extends AbstractGoogleModuleTestSupport { + + @Override --- a/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java @@ -63,6 +63,8 @@ public final class DetailNodeTreeStringPrinter { @@ -71,7 +104,7 @@ final ParseStatus status = parser.parseJavadocAsDetailNode(blockComment); --- a/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java -@@ -139,6 +139,9 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener +@@ -157,6 +157,9 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener @Override public void auditFinished(AuditEvent event) { final String version = SarifLogger.class.getPackage().getImplementationVersion(); @@ -83,7 +116,7 @@ .replace(RESULTS_PLACEHOLDER, String.join(",\n", results)); --- a/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java -@@ -93,6 +93,8 @@ import de.thetaphi.forbiddenapis.SuppressForbidden; +@@ -97,6 +97,8 @@ import de.thetaphi.forbiddenapis.SuppressForbidden; * @noinspectionreason ClassWithTooManyDependencies - complex tests require a large number * of imports */ @@ -125,7 +158,7 @@ assertWithMessage("Exception is expected but got " + test).fail(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java -@@ -80,6 +80,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -84,6 +84,8 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; * @noinspectionreason ClassWithTooManyDependencies - complex tests require a * large number of imports */ diff --git a/integration-tests/checkstyle.sh b/integration-tests/checkstyle.sh index e38cd21d28..356c2b5b87 100755 --- a/integration-tests/checkstyle.sh +++ b/integration-tests/checkstyle.sh @@ -5,7 +5,7 @@ set -e -u -o pipefail test_name="$(basename "${0}" .sh)" project='checkstyle' repository='https://github.com/checkstyle/checkstyle.git' -revision='checkstyle-10.14.0' +revision='checkstyle-10.20.1' # XXX: Configure Renovate to manage the AssertJ version declared here. additional_build_flags='-Perror-prone-compile,error-prone-test-compile -Dassertj.version=3.24.2 -Dmaven.compiler.failOnError=true' additional_source_directories='${project.basedir}${file.separator}src${file.separator}it${file.separator}java,${project.basedir}${file.separator}src${file.separator}xdocs-examples${file.separator}java'