From 65dbef0cc5b552be0cd4df481356321362ce9f59 Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Wed, 31 Jan 2024 13:33:42 +0100 Subject: [PATCH] Reset update --- .../checkstyle-expected-changes.patch | 19296 ++++++++-------- .../checkstyle-expected-warnings.txt | 10 +- 2 files changed, 9653 insertions(+), 9653 deletions(-) diff --git a/integration-tests/checkstyle-expected-changes.patch b/integration-tests/checkstyle-expected-changes.patch index 1ddd8a4acd..d54a795a85 100644 --- a/integration-tests/checkstyle-expected-changes.patch +++ b/integration-tests/checkstyle-expected-changes.patch @@ -253,15 +253,15 @@ @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; 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 { } - + @Test - public void testCustomImport1() throws Exception { + void customImport1() throws Exception { @@ -270,7 +270,7 @@ + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), @@ -68,7 +68,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCustomImport2() throws Exception { + void customImport2() throws Exception { @@ -279,7 +279,7 @@ + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), @@ -113,7 +113,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCustomImport3() throws Exception { + void customImport3() throws Exception { @@ -288,7 +288,7 @@ "5:1: " @@ -155,7 +155,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCustomImport4() throws Exception { + void customImport4() throws Exception { @@ -297,7 +297,7 @@ "15:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "java.util.StringTokenizer"), @@ -172,7 +172,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCustomImport5() throws Exception { + void customImport5() throws Exception { @@ -306,92 +306,92 @@ "13:1: " @@ -195,7 +195,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testValid() throws Exception { + void valid() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + final Configuration checkConfig = getModuleConfig("CustomImportOrder"); @@ -206,7 +206,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testValid2() throws Exception { + void valid2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + final Configuration checkConfig = getModuleConfig("CustomImportOrder"); @@ -217,7 +217,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testValidGoogleStyleOrderOfImports() throws Exception { + void validGoogleStyleOrderOfImports() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + 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; import org.junit.jupiter.api.Test; - + -public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { +final class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { } - + @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 { } - + @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 { } - + @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 { } - + @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; import org.junit.jupiter.api.Test; - + -public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { +final class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes } - + @Test - public void testOverloadMethods() throws Exception { + void overloadMethods() throws Exception { @@ -400,67 +400,67 @@ final String messageKey = "overload.methods.declaration"; @@ -53,7 +53,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes } - + @Test - public void testOverloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { + void overloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java +++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; 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 { } - + @Test - public void testEmptyLineSeparator() throws Exception { + void emptyLineSeparator() throws Exception { final Class clazz = EmptyLineSeparatorCheck.class; final String messageKey = "empty.line.separator"; - + --- 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; import org.junit.jupiter.api.Test; - + -public class NeedBracesTest extends AbstractGoogleModuleTestSupport { +final class NeedBracesTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class NeedBracesTest 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; import org.junit.jupiter.api.Test; - + -public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { +final class LeftCurlyTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testLeftCurlyBraces() throws Exception { + void leftCurlyBraces() throws Exception { @@ -469,7 +469,7 @@ "7:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -53,7 +53,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testLeftCurlyAnnotations() throws Exception { + void leftCurlyAnnotations() throws Exception { @@ -478,7 +478,7 @@ "14:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -70,7 +70,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testLeftCurlyMethods() throws Exception { + void leftCurlyMethods() throws Exception { @@ -490,15 +490,15 @@ @@ -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 { - + private static final String[] MODULES = { "RightCurlySame", "RightCurlyAlone", @@ -41,7 +41,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testRightCurly() throws Exception { + void rightCurly() throws Exception { @@ -507,16 +507,16 @@ "32:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), @@ -58,7 +58,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { } - + @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 { } - + @Test - public void testRightCurlyLiteralDoDefault() throws Exception { + void rightCurlyLiteralDoDefault() throws Exception { @@ -525,7 +525,7 @@ "67:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), @@ -84,7 +84,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testRightCurlyOther() throws Exception { + void rightCurlyOther() throws Exception { @@ -534,7 +534,7 @@ "32:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), @@ -101,7 +101,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testRightCurlyLiteralDo() throws Exception { + void rightCurlyLiteralDo() throws Exception { @@ -543,7 +543,7 @@ "67:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), @@ -116,7 +116,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testRightCurlySwitch() throws Exception { + void rightCurlySwitch() throws Exception { @@ -555,15 +555,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; import org.junit.jupiter.api.Test; - + -public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +final class EmptyBlockTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testEmptyBlock() throws Exception { + void emptyBlock() throws Exception { @@ -572,7 +572,7 @@ "22:34: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), @@ -77,7 +77,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testEmptyBlockCatch() throws Exception { + void emptyBlockCatch() throws Exception { @@ -584,15 +584,15 @@ @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { +final class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testEmptyBlockCatch() throws Exception { + void emptyBlockCatch() throws Exception { @@ -601,16 +601,16 @@ "49:35: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), @@ -50,7 +50,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testNoViolations() throws Exception { + void noViolations() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + final Configuration checkConfig = getModuleConfig("EmptyCatchBlock"); @@ -61,7 +61,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testViolationsByComment() throws Exception { + void violationsByComment() throws Exception { @@ -619,7 +619,7 @@ "28:18: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), @@ -75,7 +75,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testViolationsByVariableName() throws Exception { + void violationsByVariableName() throws Exception { @@ -631,44 +631,44 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck; import org.junit.jupiter.api.Test; - + -public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { +final class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testOneStatement() throws Exception { + void oneStatement() throws Exception { final String msg = getCheckMessage(OneStatementPerLineCheck.class, "multiple.statements.line"); - + final String[] expected = { @@ -67,7 +67,7 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { } - + @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; import org.junit.jupiter.api.Test; - + -public class LineLengthTest extends AbstractGoogleModuleTestSupport { +final class LineLengthTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class LineLengthTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testLineLength() throws Exception { + void lineLength() throws Exception { @@ -680,15 +680,15 @@ @@ -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 { } - + @Test - public void testOperatorWrap() throws Exception { + void operatorWrap() throws Exception { @@ -700,35 +700,35 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck; import org.junit.jupiter.api.Test; - + -public class OperatorWrapTest extends AbstractGoogleModuleTestSupport { +final class OperatorWrapTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class OperatorWrapTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testOperatorWrap() throws Exception { + void operatorWrap() throws Exception { final Class clazz = OperatorWrapCheck.class; final String messageKey = "line.new"; - + --- 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; - + -public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { +final class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testSeparatorWrapDot() throws Exception { + void separatorWrapDot() throws Exception { @@ -737,7 +737,7 @@ }; @@ -47,7 +47,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testSeparatorWrapComma() throws Exception { + void separatorWrapComma() throws Exception { @@ -746,7 +746,7 @@ }; @@ -60,7 +60,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testSeparatorWrapMethodRef() throws Exception { + void separatorWrapMethodRef() throws Exception { @@ -755,7 +755,7 @@ }; @@ -73,7 +73,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testEllipsis() throws Exception { + void ellipsis() throws Exception { @@ -764,7 +764,7 @@ }; @@ -86,7 +86,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testArrayDeclarator() throws Exception { + void arrayDeclarator() throws Exception { @@ -776,35 +776,35 @@ @@ -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 { } - + @Test - public void testEmptyLineSeparator() throws Exception { + void emptyLineSeparator() throws Exception { final Class clazz = EmptyLineSeparatorCheck.class; final String messageKey = "empty.line.separator"; - + --- 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; - + -public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { +final class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testWhitespaceAroundGenerics() throws Exception { + void whitespaceAroundGenerics() throws Exception { @@ -813,7 +813,7 @@ final Configuration checkConfig = getModuleConfig("GenericWhitespace"); @@ -65,7 +65,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testGenericWhitespace() throws Exception { + void genericWhitespace() throws Exception { @@ -822,7 +822,7 @@ final String msgNotPreceded = "ws.notPreceded"; @@ -109,7 +109,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void genericEndsTheLine() throws Exception { + void genericEndsTheLine() throws Exception { @@ -834,73 +834,73 @@ @@ -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 { } - + @Test - public void testOperatorWrap() throws Exception { + void operatorWrap() throws Exception { final Class clazz = MethodParamPadCheck.class; final String messageKeyPreceded = "ws.preceded"; - + --- 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; import org.junit.jupiter.api.Test; - + -public class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModuleTestSupport { +final class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModule } - + @Test - public void test() throws Exception { + void test() throws Exception { final Class clazz = NoWhitespaceBeforeCheck.class; final String messageKeyPreceded = "ws.preceded"; - + --- 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; import org.junit.jupiter.api.Test; - + -public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { +final class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testEmptyForLoop() throws Exception { + void emptyForLoop() throws Exception { final Class clazz = NoWhitespaceBeforeCheck.class; final String messageKeyPreceded = "ws.preceded"; - + @@ -49,7 +49,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testColonOfLabel() throws Exception { + void colonOfLabel() throws Exception { final Class clazz = NoWhitespaceBeforeCheck.class; final String messageKeyPreceded = "ws.preceded"; - + @@ -64,7 +64,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testAnnotations() throws Exception { + void annotations() throws Exception { @@ -912,15 +912,15 @@ @@ -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 class ParenPadTest extends AbstractGoogleModuleTestSupport { +final class ParenPadTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class ParenPadTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testMethodParen() throws Exception { + void methodParen() throws Exception { @@ -932,24 +932,24 @@ @@ -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 class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { +final class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testWhitespaceAfterBad() throws Exception { + void whitespaceAfterBad() throws Exception { final Class clazz = WhitespaceAfterCheck.class; final String message = "ws.notFollowed"; - + @@ -70,7 +70,7 @@ public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testWhitespaceAfterGood() throws Exception { + void whitespaceAfterGood() throws Exception { @@ -961,15 +961,15 @@ @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { +final class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testWhitespaceAroundBasic() throws Exception { + void whitespaceAroundBasic() throws Exception { @@ -978,27 +978,27 @@ final String msgFollowed = "ws.notFollowed"; @@ -75,7 +75,7 @@ public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testWhitespaceAroundEmptyTypesCycles() throws Exception { + void whitespaceAroundEmptyTypesCycles() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + 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; import org.junit.jupiter.api.Test; - + -public class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSupport { +final class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSu } - + @Test - public void testMultipleVariableDeclarations() throws Exception { + void multipleVariableDeclarations() throws Exception { @@ -1010,15 +1010,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck; import org.junit.jupiter.api.Test; - + -public class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTestSupport { +final class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTe } - + @Test - public void testArrayTypeStyle() throws Exception { + void arrayTypeStyle() throws Exception { @@ -1030,15 +1030,15 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck; import org.junit.jupiter.api.Test; - + -public class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { +final class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testArrayTypeStyle() throws Exception { + void arrayTypeStyle() throws Exception { @@ -1050,96 +1050,96 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class IndentationTest extends AbstractIndentationTestSupport { +final class IndentationTest extends AbstractIndentationTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ 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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 { } - + @Test - public void testWarnChained() throws Exception { + void warnChained() throws Exception { @@ -1148,67 +1148,67 @@ "23:5: " + getCheckMessage(IndentationCheck.class, MSG_ERROR, ".", 4, 8), @@ -151,7 +151,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { } - + @Test - public void testCorrectAnnotationArrayInit() throws Exception { + void correctAnnotationArrayInit() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + 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; import org.junit.jupiter.api.Test; - + -public class FallThroughTest extends AbstractGoogleModuleTestSupport { +final class FallThroughTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class FallThroughTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testFallThrough() throws Exception { + void fallThrough() throws Exception { final String msg = getCheckMessage(FallThroughCheck.class, "fall.through"); - + 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; import org.junit.jupiter.api.Test; - + -public class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { +final class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testMissingSwitchDefault() throws Exception { + void missingSwitchDefault() throws Exception { final String msg = getCheckMessage(MissingSwitchDefaultCheck.class, "missing.switch.default"); - + 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; import org.junit.jupiter.api.Test; - + -public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { +final class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { @@ -1217,7 +1217,7 @@ final Configuration checkConfig = @@ -62,7 +62,7 @@ public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testAnnotationVariables() throws Exception { + void annotationVariables() throws Exception { @@ -1229,15 +1229,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck; import org.junit.jupiter.api.Test; - + -public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { +final class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlock() throws Exception { + void commentIsAtTheEndOfBlock() throws Exception { @@ -1246,7 +1246,7 @@ + getCheckMessage( @@ -125,7 +125,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCommentIsInsideSwitchBlock() throws Exception { + void commentIsInsideSwitchBlock() throws Exception { @@ -1255,7 +1255,7 @@ + getCheckMessage( @@ -228,7 +228,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCommentIsInsideEmptyBlock() throws Exception { + void commentIsInsideEmptyBlock() throws Exception { @@ -1264,7 +1264,7 @@ + getCheckMessage( @@ -255,7 +255,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testSurroundingCode() throws Exception { + void surroundingCode() throws Exception { @@ -1276,15 +1276,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck; import org.junit.jupiter.api.Test; - + -public class ModifierOrderTest extends AbstractGoogleModuleTestSupport { +final class ModifierOrderTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class ModifierOrderTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testModifierOrder() throws Exception { + void modifierOrder() throws Exception { @@ -1296,15 +1296,15 @@ @@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.Configuration; import org.junit.jupiter.api.Test; - + -public class UpperEllTest extends AbstractGoogleModuleTestSupport { +final class UpperEllTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,7 +31,7 @@ public class UpperEllTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testUpperEll() throws Exception { + void upperEll() throws Exception { @@ -1316,15 +1316,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { +final class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testCatchParameterName() throws Exception { + void catchParameterName() throws Exception { @@ -1336,24 +1336,24 @@ @@ -26,7 +26,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"; - + @@ -40,7 +40,7 @@ public class PackageNameTest 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 { } - + @Test - public void testBadPackageName() throws Exception { + void badPackageName() throws Exception { @@ -1362,7 +1362,7 @@ final Configuration checkConfig = getModuleConfig("PackageName"); @@ -69,7 +69,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testBadPackageName2() throws Exception { + void badPackageName2() throws Exception { @@ -1371,7 +1371,7 @@ final String format = checkConfig.getProperty("format"); @@ -86,7 +86,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testBadPackageName3() throws Exception { + void badPackageName3() throws Exception { @@ -1383,15 +1383,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class TypeNameTest extends AbstractGoogleModuleTestSupport { +final class TypeNameTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class TypeNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testTypeName() throws Exception { + void typeName() throws Exception { @@ -1403,15 +1403,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class MethodNameTest extends AbstractGoogleModuleTestSupport { +final class MethodNameTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class MethodNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testMethodName() throws Exception { + void methodName() throws Exception { @@ -1423,15 +1423,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class MemberNameTest extends AbstractGoogleModuleTestSupport { +final class MemberNameTest extends AbstractGoogleModuleTestSupport { - + private static final String MSG_KEY = "name.invalidPattern"; - + @@ -34,7 +34,7 @@ public class MemberNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testMemberName() throws Exception { + void memberName() throws Exception { @@ -1440,7 +1440,7 @@ final Map messages = checkConfig.getMessages(); @@ -61,7 +61,7 @@ public class MemberNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testSimple() throws Exception { + void simple() throws Exception { @@ -1452,15 +1452,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { +final class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { - + public static final String MSG_INVALID_PATTERN = "name.invalidPattern"; - + @@ -34,7 +34,7 @@ public class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testLambdaParameterName() throws Exception { + void lambdaParameterName() throws Exception { @@ -1472,15 +1472,15 @@ @@ -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 { } - + @Test - public void testGeneralParameterName() throws Exception { + void generalParameterName() throws Exception { @@ -1492,15 +1492,15 @@ @@ -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"; - + @@ -34,7 +34,7 @@ public class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testGeneralParameterName() throws Exception { + void generalParameterName() throws Exception { @@ -1512,15 +1512,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { +final class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { - + private static final String MSG_KEY = "name.invalidPattern"; - + @@ -34,7 +34,7 @@ public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testLocalVariableName() throws Exception { + void localVariableName() throws Exception { @@ -1529,7 +1529,7 @@ final Map messages = checkConfig.getMessages(); @@ -58,7 +58,7 @@ public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testOneChar() throws Exception { + void oneChar() throws Exception { @@ -1541,15 +1541,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { +final class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { - + private static final String MSG_KEY = "name.invalidPattern"; - + @@ -34,7 +34,7 @@ public class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testPatternVariableName() throws Exception { + void patternVariableName() throws Exception { @@ -1561,15 +1561,15 @@ @@ -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 } - + @Test - public void testClassDefault() throws Exception { + void classDefault() throws Exception { @@ -1581,15 +1581,15 @@ @@ -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 } - + @Test - public void testInterfaceDefault() throws Exception { + void interfaceDefault() throws Exception { @@ -1601,15 +1601,15 @@ @@ -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 { @@ -1621,15 +1621,15 @@ @@ -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 } - + @Test - public void testRecordDefault() throws Exception { + void recordDefault() throws Exception { @@ -1641,35 +1641,35 @@ @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameChe import java.io.IOException; 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 } - + @Test - public void testAbbreviationAsWordInName() throws Exception { + void abbreviationAsWordInName() throws Exception { final int maxCapitalCount = 1; - + 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; import org.junit.jupiter.api.Test; - + -public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { +final class EmptyBlockTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testEmptyBlockCatch() throws Exception { + void emptyBlockCatch() throws Exception { @@ -1681,93 +1681,93 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck; import org.junit.jupiter.api.Test; - + -public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { +final class NoFinalizerTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class NoFinalizerTest 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 { } - + @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; import org.junit.jupiter.api.Test; - + -public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { +final class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest 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 { } - + @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; import org.junit.jupiter.api.Test; - + -public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { +final class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testJavadocParagraphCorrect() throws Exception { + void javadocParagraphCorrect() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + final Configuration checkConfig = getModuleConfig("JavadocParagraph"); @@ -44,7 +44,7 @@ public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { } - + @Test - public void testJavadocParagraphIncorrect() throws Exception { + void javadocParagraphIncorrect() throws Exception { @@ -1779,24 +1779,24 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.IOException; import org.junit.jupiter.api.Test; - + -public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModuleTestSupport { +final class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModul } - + @Test - public void testJavadocParagraphCorrect() throws Exception { + void javadocParagraphCorrect() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + final Configuration checkConfig = getModuleConfig("RequireEmptyLineBeforeBlockTagGroup"); @@ -45,7 +45,7 @@ public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModul } - + @Test - public void testJavadocParagraphIncorrect() throws Exception { + void javadocParagraphIncorrect() throws Exception { @@ -1808,138 +1808,138 @@ @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { +final class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class AtclauseOrderTest 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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 { } - + @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 } - + @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 } - + @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 } - + @Test - public void testSpaceSequence() throws Exception { + void spaceSequence() throws Exception { final String msg = getCheckMessage(NonEmptyAtclauseDescriptionCheck.class, "non.empty.atclause"); - + --- 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; import org.junit.jupiter.api.Test; - + -public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { +final class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class SummaryJavadocTest 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 { } - + @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { @@ -1951,124 +1951,124 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocMethodTest extends AbstractGoogleModuleTestSupport { +final class JavadocMethodTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class JavadocMethodTest extends AbstractGoogleModuleTestSupport { } - + @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; import org.junit.jupiter.api.Test; - + -public class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { +final class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class MissingJavadocMethodTest 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; import org.junit.jupiter.api.Test; - + -public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { +final class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest 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/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; import org.junit.jupiter.api.Test; - + -public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { +final class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class MissingJavadocTypeTest 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 { } - + @Test - public void testJavadocTypeNoViolations() throws Exception { + void javadocTypeNoViolations() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- 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 import com.sun.checkstyle.test.base.AbstractSunModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class InvalidJavadocPositionTest extends AbstractSunModuleTestSupport { +final class InvalidJavadocPositionTest extends AbstractSunModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest extends AbstractSunModuleTestSupport { } - + @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/sun/checkstyle/test/chapter6declarations/rule61numberperline/MultipleVariableDeclarationsTest.java +++ b/src/it/java/com/sun/checkstyle/test/chapter6declarations/rule61numberperline/MultipleVariableDeclarationsTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclaration import com.sun.checkstyle.test.base.AbstractSunModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MultipleVariableDeclarationsTest extends AbstractSunModuleTestSupport { +final class MultipleVariableDeclarationsTest extends AbstractSunModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class MultipleVariableDeclarationsTest extends AbstractSunModuleTestSuppo } - + @Test - public void testMultipleVariableDeclarations() throws Exception { + void multipleVariableDeclarations() throws Exception { @@ -2079,14 +2079,14 @@ +++ b/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java @@ -20,6 +20,7 @@ package org.checkstyle.base; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.AbstractPathTestSupport; import com.puppycrawl.tools.checkstyle.Checker; @@ -397,8 +398,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor - + // process each of the lines try (ByteArrayInputStream inputStream = new ByteArrayInputStream(stream.toByteArray()); - LineNumberReader lnr = @@ -2109,15 +2109,15 @@ @@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.checkstyle.base.AbstractCheckstyleModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { +final class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { } - + @Test - public void testAndroid() throws Exception { + void android() throws Exception { @@ -2126,7 +2126,7 @@ "groups", "android,androidx,com.android,dalvik,com,gov,junit,libcore,net,org,java,javax"); @@ -52,7 +52,7 @@ public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { } - + @Test - public void testSpotify() throws Exception { + void spotify() throws Exception { @@ -2135,7 +2135,7 @@ checkConfig.addProperty("option", "bottom"); @@ -68,7 +68,7 @@ public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { } - + @Test - public void testTwitter() throws Exception { + void twitter() throws Exception { @@ -2146,10 +2146,10 @@ +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java @@ -20,6 +20,7 @@ package org.checkstyle.suppressionxpathfilter; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.JavaParser; @@ -114,7 +115,7 @@ public abstract class AbstractXpathTestSupport extends AbstractCheckstyleModuleT @@ -2164,9 +2164,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbbreviationAsWordInNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbbreviationAsWordInNameTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck; @@ -2174,24 +2174,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTestSupport { +final class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTestSupport { - + private final String checkName = AbbreviationAsWordInNameCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameAnnotation.java")); - + @@ -53,7 +53,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2200,16 +2200,16 @@ + "/OBJBLOCK/ANNOTATION_DEF/IDENT[@text='ANNOTATION']"); @@ -62,7 +62,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testAnnotationField() throws Exception { + void annotationField() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField.java")); - + @@ -79,7 +79,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2218,16 +2218,16 @@ + "/OBJBLOCK/ANNOTATION_FIELD_DEF/IDENT[@text='ANNOTATION_FIELD']"); @@ -88,7 +88,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testClass() throws Exception { + void testClass() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameClass.java")); - + @@ -105,7 +105,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2236,16 +2236,16 @@ + "/OBJBLOCK/CLASS_DEF/IDENT[@text='CLASS']"); @@ -114,7 +114,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameEnum.java")); - + @@ -131,7 +131,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2254,16 +2254,16 @@ + "/OBJBLOCK/ENUM_DEF/IDENT[@text='ENUMERATION']"); @@ -140,7 +140,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testField() throws Exception { + void field() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameField.java")); - + @@ -157,7 +157,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2272,16 +2272,16 @@ + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='FIELD']"); @@ -166,7 +166,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameInterface.java")); - + @@ -183,7 +183,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2290,16 +2290,16 @@ + "/OBJBLOCK/INTERFACE_DEF/IDENT[@text='INTERFACE']"); @@ -192,7 +192,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testMethod() throws Exception { + void method() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameMethod.java")); - + @@ -209,7 +209,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2308,16 +2308,16 @@ + "/OBJBLOCK/METHOD_DEF/IDENT[@text='METHOD']"); @@ -218,7 +218,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testParameter() throws Exception { + void parameter() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameParameter.java")); - + @@ -235,7 +235,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2326,16 +2326,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" @@ -245,7 +245,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe } - + @Test - public void testVariable() throws Exception { + void variable() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameVariable.java")); - + @@ -262,7 +262,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2347,148 +2347,148 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSupport { +final class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSupport { - + private final String checkName = AbstractClassNameCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo } - + @Test - public void testClassNameTop() throws Exception { + void classNameTop() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbstractClassNameTop.java")); - + @@ -66,7 +66,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo } - + @Test - public void testClassNameInner() throws Exception { + void classNameInner() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbstractClassNameInner.java")); - + @@ -97,7 +97,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo } - + @Test - public void testClassNameNoModifier() throws Exception { + void classNameNoModifier() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAbstractClassNameNoModifier.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupport { +final class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupport { - + private final String checkName = AnnotationLocationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } - + @Test - public void testClass() throws Exception { + void testClass() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationLocationClass.java")); - + @@ -68,7 +68,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } - + @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationLocationInterface.java")); - + @@ -101,7 +101,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } - + @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationLocationEnum.java")); - + @@ -133,7 +133,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } - + @Test - public void testMethod() throws Exception { + void method() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationLocationMethod.java")); - + @@ -169,7 +169,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } - + @Test - public void testVariable() throws Exception { + void variable() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationLocationVariable.java")); - + @@ -205,7 +205,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp } - + @Test - public void testConstructor() throws Exception { + void constructor() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationLocationCTOR.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSupport { +final class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSupport { - + private final String checkName = AnnotationOnSameLineCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineOne.java")); - + @@ -78,7 +78,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineTwo.java")); - + @@ -113,7 +113,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineThree.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.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.annotation.AnnotationUseStyleCheck; @@ -2497,51 +2497,51 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupport { +final class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupport { - + private final String checkName = AnnotationUseStyleCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleOne.java")); - + @@ -64,7 +64,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleTwo.java")); - + @@ -99,7 +99,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleThree.java")); - + @@ -136,7 +136,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleFour.java")); - + @@ -154,7 +154,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2550,43 +2550,43 @@ + "/MODIFIERS/ANNOTATION[./IDENT[@text='SuppressWarnings']]" @@ -164,7 +164,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleFive.java")); - + @@ -200,7 +200,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testSix() throws Exception { + void six() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleSix.java")); - + @@ -236,7 +236,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testSeven() throws Exception { + void seven() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleSeven.java")); - + @@ -263,7 +263,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp } - + @Test - public void testEight() throws Exception { + void eight() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnnotationUseStyleEight.java")); - + @@ -281,7 +281,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2598,36 +2598,36 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport { +final class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport { - + private final String checkName = AnonInnerLengthCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnonInnerLengthDefault.java")); - + @@ -63,7 +63,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")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.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.ArrayTrailingCommaCheck; @@ -2636,33 +2636,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupport { +final class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupport { - + private final String checkName = ArrayTrailingCommaCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionArrayTrailingCommaOne.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionArrayTrailingCommaTwo.java")); - + @@ -73,7 +73,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2672,9 +2672,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck; @@ -2682,24 +2682,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport { +final class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport } - + @Test - public void testVariable() throws Exception { + void variable() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionArrayTypeStyleVariable.java")); - + @@ -45,7 +45,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2708,16 +2708,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='strings']]/TYPE[" @@ -55,7 +55,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport } - + @Test - public void testMethodDef() throws Exception { + void methodDef() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionArrayTypeStyleMethodDef.java")); - + @@ -66,7 +66,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2729,53 +2729,53 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractXpathTestSupport { +final class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractXpathTestSupport { - + private final Class clazz = AvoidDoubleBraceInitializationCheck.class; @@ -37,7 +37,7 @@ public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractX } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidDoubleBraceInitialization.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractX } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidDoubleBraceInitializationTwo.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java @@ -28,7 +28,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXpathTestSupport { +final class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXpathTestSupport { private final String checkName = AvoidEscapedUnicodeCharactersCheck.class.getSimpleName(); - + @Override @@ -37,7 +37,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersDefault.java")); - + @@ -63,7 +63,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } - + @Test - public void testControlCharacters() throws Exception { + void controlCharacters() throws Exception { @@ -2784,7 +2784,7 @@ getPath( @@ -94,7 +94,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } - + @Test - public void testTailComment() throws Exception { + void tailComment() throws Exception { @@ -2793,16 +2793,16 @@ getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersTailComment.java")); @@ -124,7 +124,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } - + @Test - public void testAllCharactersEscaped() throws Exception { + void allCharactersEscaped() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersAllEscaped.java")); - + @@ -153,7 +153,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp } - + @Test - public void testNonPrintableCharacters() throws Exception { + void nonPrintableCharacters() throws Exception { @@ -2812,9 +2812,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.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.AvoidInlineConditionalsCheck; @@ -2823,33 +2823,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTestSupport { +final class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -35,7 +35,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes } - + @Test - public void testInlineConditionalsVariableDef() throws Exception { + void inlineConditionalsVariableDef() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsVariableDef.java")); - + @@ -63,7 +63,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes } - + @Test - public void testInlineConditionalsAssign() throws Exception { + void inlineConditionalsAssign() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsAssign.java")); - + @@ -77,7 +77,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2858,19 +2858,19 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='setB']]/SLIST" @@ -87,7 +87,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes } - + @Test - public void testInlineConditionalsAssert() throws Exception { + void inlineConditionalsAssert() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsAssert.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.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.blocks.AvoidNestedBlocksCheck; @@ -2879,24 +2879,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSupport { +final class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -35,7 +35,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } - + @Test - public void testEmpty() throws Exception { + void empty() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksEmpty.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2905,16 +2905,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='empty']]/SLIST/SLIST"); @@ -57,7 +57,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } - + @Test - public void testVariableAssignment() throws Exception { + void variableAssignment() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksVariable.java")); - + @@ -70,7 +70,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2923,28 +2923,28 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='varAssign']]/SLIST/SLIST"); @@ -79,7 +79,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } - + @Test - public void testSwitchAllowInSwitchCaseFalse() throws Exception { + void switchAllowInSwitchCaseFalse() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksSwitch1.java")); - + @@ -112,7 +112,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo } - + @Test - public void testSwitchAllowInSwitchCaseTrue() throws Exception { + void switchAllowInSwitchCaseTrue() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksSwitch2.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.AvoidNoArgumentSuperConstructorCallCheck; @@ -2952,24 +2952,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest +final class XpathRegressionAvoidNoArgumentSuperConstructorCallTest extends AbstractXpathTestSupport { - + private static final Class CLASS = @@ -38,7 +38,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall.java")); - + @@ -49,7 +49,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2978,7 +2978,7 @@ + "/OBJBLOCK/CTOR_DEF[./IDENT[" @@ -60,7 +60,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest } - + @Test - public void testInnerClass() throws Exception { + void innerClass() throws Exception { @@ -2987,7 +2987,7 @@ getPath( @@ -73,7 +73,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -2997,9 +2997,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; @@ -3007,53 +3007,53 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport { +final class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport { - + private static final Class CLASS = AvoidStarImportCheck.class; - + @@ -36,7 +36,7 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStarImport1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -47,13 +47,13 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); + ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStarImport2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -62,8 +62,7 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport "4:15: " + getCheckMessage(CLASS, AvoidStarImportCheck.MSG_KEY, "java.io.*"), }; - + - final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT/DOT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT/DOT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStaticImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStaticImportTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck; @@ -3061,53 +3061,53 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSupport { +final class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSupport { - + private static final Class CLASS = AvoidStaticImportCheck.class; - + @@ -36,7 +36,7 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStaticImport1.java")); - + @@ -48,13 +48,13 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); + ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStaticImport2.java")); - + @@ -66,8 +66,7 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( - "/COMPILATION_UNIT/STATIC_IMPORT/DOT[./IDENT[@text='createTempFile']]"); + ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT/DOT[./IDENT[@text='createTempFile']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionBooleanExpressionComplexityTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionBooleanExpressionComplexityTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck; @@ -3115,24 +3115,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpathTestSupport { +final class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat } - + @Test - public void testMethodOne() throws Exception { + void methodOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityOne.java")); - + @@ -51,7 +51,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3141,16 +3141,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodOne']]/SLIST" @@ -62,7 +62,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat } - + @Test - public void testMethodTwo() throws Exception { + void methodTwo() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionBooleanExpressionComplexityTwo.java")); - + @@ -79,7 +79,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3159,16 +3159,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='methodTwo']]/SLIST/VARIABLE_DEF" @@ -89,7 +89,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat } - + @Test - public void testMethodThree() throws Exception { + void methodThree() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionBoolean" + "ExpressionComplexityThree.java")); - + @@ -106,7 +106,7 @@ public class XpathRegressionBooleanExpressionComplexityTest extends AbstractXpat }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3178,9 +3178,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCatchParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCatchParameterNameTest.java @@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; - + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck; @@ -3188,24 +3188,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupport { +final class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupport { private final String checkName = CatchParameterNameCheck.class.getSimpleName(); - + @Override @@ -37,7 +37,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testSimple() throws Exception { + void simple() throws Exception { final String pattern = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -50,7 +50,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3214,16 +3214,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" @@ -60,7 +60,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testNested() throws Exception { + void nested() throws Exception { final String pattern = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -73,7 +73,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3232,16 +3232,16 @@ + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='NestedClass']]" @@ -85,7 +85,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testStaticInit() throws Exception { + void staticInit() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]+$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -99,7 +99,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3250,16 +3250,16 @@ + "/OBJBLOCK/STATIC_INIT/SLIST" @@ -109,7 +109,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testAnonymous() throws Exception { + void anonymous() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]+$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -124,7 +124,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3268,16 +3268,16 @@ + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" @@ -137,7 +137,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testLambda() throws Exception { + void lambda() throws Exception { final String pattern = "^[A-Z][a-z]+$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -151,7 +151,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3286,16 +3286,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='lambdaFunction']]" @@ -163,7 +163,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { final String pattern = "^[A-Z][a-z]+$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -178,7 +178,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3304,16 +3304,16 @@ + "/OBJBLOCK/ENUM_CONSTANT_DEF[./IDENT[@text='VALUE']]" @@ -190,7 +190,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp } - + @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { final String pattern = "^[A-Z][a-z]+$"; - + final DefaultConfiguration moduleConfig = createModuleConfig(CatchParameterNameCheck.class); @@ -204,7 +204,7 @@ public class XpathRegressionCatchParameterNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3325,36 +3325,36 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpathTestSupport { +final class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpathTestSupport { - + private final String checkName = ClassMemberImpliedModifierCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpath } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierOne.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")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck; @@ -3362,24 +3362,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSupport { +final class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSupport { - + private final String checkName = CommentsIndentationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } - + @Test - public void testSingleLine() throws Exception { + void singleLine() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "SingleLine.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3388,16 +3388,16 @@ + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]"); @@ -57,7 +57,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")); - + @@ -69,7 +69,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3406,16 +3406,16 @@ + "VARIABLE_DEF[./IDENT[@text='f']]/TYPE/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" @@ -79,7 +79,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")); - + @@ -92,7 +92,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3424,7 +3424,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/MODIFIERS/SINGLE_LINE_COMMENT" @@ -102,7 +102,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } - + @Test - public void testDistributedStatement() throws Exception { + void distributedStatement() throws Exception { @@ -3433,7 +3433,7 @@ getPath("SuppressionXpathRegressionCommentsIndentation" + "DistributedStatement.java")); @@ -116,7 +116,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3442,16 +3442,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" @@ -126,7 +126,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")); - + @@ -138,7 +138,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3460,16 +3460,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" @@ -148,7 +148,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")); - + @@ -161,7 +161,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3478,16 +3478,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" @@ -171,7 +171,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")); - + @@ -184,7 +184,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3496,7 +3496,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" @@ -194,7 +194,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup } - + @Test - public void testWithinBlockStatement() throws Exception { + void withinBlockStatement() throws Exception { @@ -3505,7 +3505,7 @@ getPath("SuppressionXpathRegressionCommentsIndentation" + "WithinBlockStatement.java")); @@ -208,7 +208,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3515,9 +3515,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.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.ConstantNameCheck; @@ -3525,24 +3525,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { +final class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { - + private static final Class CLASS = ConstantNameCheck.class; private static final String PATTERN = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; @@ -40,7 +40,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } - + @Test - public void testLowercase() throws Exception { + void lowercase() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionConstantNameLowercase.java")); - + @@ -51,7 +51,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3551,16 +3551,16 @@ + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='number']"); @@ -60,7 +60,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } - + @Test - public void testCamelCase() throws Exception { + void camelCase() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionConstantNameCamelCase.java")); - + @@ -71,7 +71,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3569,16 +3569,16 @@ + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='badConstant']"); @@ -80,7 +80,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } - + @Test - public void testWithBeginningUnderscore() throws Exception { + void withBeginningUnderscore() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java")); - + @@ -91,7 +91,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3587,16 +3587,16 @@ + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='_CONSTANT']"); @@ -100,7 +100,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { } - + @Test - public void testWithTwoUnderscores() throws Exception { + void withTwoUnderscores() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionConstantNameWithTwoUnderscores.java")); - + @@ -111,7 +111,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3606,9 +3606,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck; @@ -3616,24 +3616,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport { +final class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport { - + private final String checkName = CovariantEqualsCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport } - + @Test - public void testCovariantEqualsInClass() throws Exception { + void covariantEqualsInClass() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCovariantEqualsInClass.java")); - + @@ -47,7 +47,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3642,16 +3642,16 @@ + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); @@ -56,7 +56,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport } - + @Test - public void testCovariantEqualsInEnum() throws Exception { + void covariantEqualsInEnum() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCovariantEqualsInEnum.java")); - + @@ -67,7 +67,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3660,16 +3660,16 @@ + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); @@ -76,7 +76,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport } - + @Test - public void testCovariantEqualsInRecord() throws Exception { + void covariantEqualsInRecord() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionCovariantEqualsInRecord.java")); - + @@ -87,7 +87,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3679,9 +3679,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; @@ -3689,108 +3689,108 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSupport { +final class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSupport { - + private final String checkName = CustomImportOrderCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCustomImportOrderOne.java")); - + @@ -54,13 +54,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); + ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCustomImportOrderTwo.java")); - + @@ -76,13 +76,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='File']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='File']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCustomImportOrderThree.java")); - + @@ -98,13 +98,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); + ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCustomImportOrderFour.java")); - + @@ -120,13 +120,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCustomImportOrderFive.java")); - + @@ -143,13 +143,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); + ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testSix() throws Exception { + void six() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCustomImportOrderSix.java")); - + @@ -168,7 +168,7 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCyclomaticComplexityTest.java @@ -3798,65 +3798,65 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSupport { +final class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSupport { - + private final String checkName = CyclomaticComplexityCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSu } - + @Test - public void testOne() throws Exception { + void one() throws Exception { - + final File fileToProcess = new File(getPath("SuppressionXpathRegressionCyclomaticComplexityOne.java")); @@ -66,7 +66,7 @@ public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSu } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionCyclomaticComplexityTwo.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSupport { +final class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSupport { - + private final String checkName = DeclarationOrderCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSuppor } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionDeclarationOrderOne.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSuppor } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionDeclarationOrderTwo.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.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.DefaultComesLastCheck; @@ -3865,33 +3865,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSupport { +final class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSupport { - + private final String checkName = DefaultComesLastCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionDefaultComesLastOne.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionDefaultComesLastTwo.java")); - + @@ -77,7 +77,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3901,9 +3901,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; @@ -3911,15 +3911,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { +final class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { private final String checkName = EmptyBlockCheck.class.getSimpleName(); - + @Override @@ -35,7 +35,7 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { } - + @Test - public void testEmptyForLoopEmptyBlock() throws Exception { + void emptyForLoopEmptyBlock() throws Exception { @@ -3937,7 +3937,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]" @@ -52,14 +52,14 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { } - + @Test - public void testEmptyForLoopEmptyStatement() throws Exception { + void emptyForLoopEmptyStatement() throws Exception { @@ -3955,9 +3955,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck; @@ -3965,24 +3965,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport { +final class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport { - + private final Class clazz = EmptyCatchBlockCheck.class; - + @@ -36,7 +36,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyCatchBlock1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); @@ -46,7 +46,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -3991,16 +3991,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]" @@ -56,7 +56,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyCatchBlock2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); @@ -66,7 +66,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4012,65 +4012,65 @@ @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTestSupport { +final class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTestSupport { - + private final String checkName = EmptyForInitializerPadCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTest } - + @Test - public void testPreceded() throws Exception { + void preceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyForInitializerPadPreceded.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTest } - + @Test - public void testNotPreceded() throws Exception { + void notPreceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyForInitializerPadNotPreceded.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSupport { +final class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSupport { - + private final String checkName = EmptyForIteratorPadCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSup } - + @Test - public void testFollowed() throws Exception { + void followed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadFollowed.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSup } - + @Test - public void testNotFollowed() throws Exception { + void notFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadNotFollowed.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.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.whitespace.EmptyLineSeparatorCheck; @@ -4079,51 +4079,51 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupport { +final class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -35,7 +35,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyLineSeparator1.java")); - + @@ -57,7 +57,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyLineSeparator2.java")); - + @@ -77,7 +77,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyLineSeparator3.java")); - + @@ -110,7 +110,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyLineSeparator4.java")); - + @@ -124,7 +124,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4132,16 +4132,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo1']]/SLIST/RCURLY"); @@ -133,7 +133,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyLineSeparator5.java")); - + @@ -148,7 +148,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4151,9 +4151,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck; @@ -4161,15 +4161,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport { +final class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport { - + private final String checkName = EmptyStatementCheck.class.getSimpleName(); - + @@ -36,14 +36,14 @@ public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport } - + @Test - public void testForLoopEmptyStatement() throws Exception { + void forLoopEmptyStatement() throws Exception { @@ -4186,7 +4186,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -52,14 +52,14 @@ public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport } - + @Test - public void testIfBlockEmptyStatement() throws Exception { + void ifBlockEmptyStatement() throws Exception { @@ -4206,73 +4206,73 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport { +final class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport { - + private final Class clazz = EqualsAvoidNullCheck.class; - + @@ -36,7 +36,7 @@ public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport } - + @Test - public void testEquals() throws Exception { + void testEquals() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsAvoidNull.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); @@ -58,7 +58,7 @@ public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport } - + @Test - public void testEqualsIgnoreCase() throws Exception { + void equalsIgnoreCase() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsAvoidNullIgnoreCase.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsHashCodeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsHashCodeTest.java @@ -26,14 +26,14 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport { +final class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport { @Override protected String getCheckName() { return EqualsHashCodeCheck.class.getSimpleName(); } - + @Test - public void testEqualsOnly() throws Exception { + void equalsOnly() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCode1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); @@ -58,7 +58,7 @@ public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport } - + @Test - public void testHashCodeOnly() throws Exception { + void hashCodeOnly() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCode2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(EqualsHashCodeCheck.class); @@ -83,7 +83,7 @@ public class XpathRegressionEqualsHashCodeTest extends AbstractXpathTestSupport } - + @Test - public void testNestedCase() throws Exception { + void nestedCase() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsHashCodeNestedCase.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck; @@ -4280,24 +4280,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionExplicitInitializationTest extends AbstractXpathTestSupport { +final class XpathRegressionExplicitInitializationTest extends AbstractXpathTestSupport { - + private final String checkName = ExplicitInitializationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionExplicitInitializationOne.java")); - + @@ -49,7 +49,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4306,16 +4306,16 @@ + "/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")); - + @@ -74,7 +74,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4327,89 +4327,89 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { +final class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { - + private final String checkName = FallThroughCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFallThroughOne.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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(FallThroughCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { +final class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { private final String checkName = FinalClassCheck.class.getSimpleName(); - + @Override @@ -35,7 +35,7 @@ public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalLocalVariableTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalLocalVariableTest.java @@ -19,13 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck; import java.io.File; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupport { +final class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupport { - + private final String checkName = FinalLocalVariableCheck.class.getSimpleName(); - + @@ -35,7 +36,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable1.java")); - + @@ -47,7 +48,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4418,16 +4418,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]" @@ -57,7 +58,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable2.java")); - + @@ -69,7 +70,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4436,16 +4436,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method2']]/SLIST/" @@ -79,7 +80,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable3.java")); - + @@ -91,7 +92,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4454,16 +4454,16 @@ + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" @@ -102,7 +103,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable4.java")); - + @@ -115,7 +116,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4472,16 +4472,16 @@ + "/OBJBLOCK/CLASS_DEF[./IDENT[@text='InnerClass']]" @@ -126,7 +127,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable5.java")); - + @@ -139,7 +140,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4490,16 +4490,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" @@ -149,7 +150,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testSix() throws Exception { + void six() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable6.java")); - + @@ -162,7 +163,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4508,16 +4508,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method1']]" @@ -172,7 +173,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testSeven() throws Exception { + void seven() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable7.java")); - + @@ -185,7 +186,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4526,16 +4526,16 @@ + "/OBJBLOCK/CTOR_DEF[./IDENT" @@ -196,7 +197,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testEight() throws Exception { + void eight() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable8.java")); - + @@ -209,7 +210,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4544,16 +4544,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkCodeBlock']]" @@ -219,7 +220,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp } - + @Test - public void testNine() throws Exception { + void nine() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalLocalVariable9.java")); - + @@ -231,7 +232,7 @@ public class XpathRegressionFinalLocalVariableTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4563,33 +4563,33 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalParametersTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalParametersTest.java @@ -19,13 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck; import java.io.File; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport { +final class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport { - + private final String checkName = FinalParametersCheck.class.getSimpleName(); - + @@ -35,7 +36,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); @@ -46,7 +47,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4598,16 +4598,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" @@ -72,7 +73,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); @@ -85,7 +86,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4616,16 +4616,16 @@ + "/OBJBLOCK/CTOR_DEF[./IDENT[" @@ -116,7 +117,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalParameters3.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(FinalParametersCheck.class); @@ -129,7 +130,7 @@ public class XpathRegressionFinalParametersTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -4635,9 +4635,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.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.whitespace.GenericWhitespaceCheck; @@ -4646,24 +4646,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSupport { +final class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSupport { - + private final String checkName = GenericWhitespaceCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessEnd() throws Exception { + void processEnd() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceEnd.java")); - + @@ -50,7 +50,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4672,16 +4672,16 @@ + "/METHOD_DEF[./IDENT[@text='bad']]" @@ -61,7 +61,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessNestedGenericsOne() throws Exception { + void processNestedGenericsOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne.java")); - + @@ -74,7 +74,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4690,16 +4690,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" @@ -85,7 +85,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessNestedGenericsTwo() throws Exception { + void processNestedGenericsTwo() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo.java")); - + @@ -98,7 +98,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4708,16 +4708,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" @@ -109,7 +109,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessNestedGenericsThree() throws Exception { + void processNestedGenericsThree() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree.java")); - + @@ -122,7 +122,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4726,16 +4726,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" @@ -133,7 +133,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessSingleGenericOne() throws Exception { + void processSingleGenericOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericOne.java")); - + @@ -146,7 +146,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4744,16 +4744,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/METHOD_CALL" @@ -157,7 +157,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessSingleGenericTwo() throws Exception { + void processSingleGenericTwo() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo.java")); - + @@ -170,7 +170,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4762,37 +4762,37 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS/GENERIC_END"); @@ -179,7 +179,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessStartOne() throws Exception { + void processStartOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartOne.java")); - + @@ -204,7 +204,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessStartTwo() throws Exception { + void processStartTwo() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartTwo.java")); - + @@ -233,7 +233,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo } - + @Test - public void testProcessStartThree() throws Exception { + void processStartThree() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartThree.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck; @@ -4800,24 +4800,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { +final class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { - + private final String checkName = HiddenFieldCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionHiddenFieldOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(HiddenFieldCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4826,16 +4826,16 @@ + "/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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(HiddenFieldCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4845,9 +4845,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck; @@ -4855,24 +4855,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalCatchCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalCatchOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalCatchCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4881,16 +4881,16 @@ + "/METHOD_DEF[./IDENT[@text='fun']]/SLIST" @@ -57,7 +57,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalCatchTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalCatchCheck.class); @@ -69,7 +69,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4900,9 +4900,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -4911,15 +4911,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalIdentifierNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -4928,7 +4928,7 @@ getNonCompilablePath("SuppressionXpathRegressionIllegalIdentifierNameTestOne.java")); @@ -56,7 +56,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4937,7 +4937,7 @@ + "]]/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='yield']"); @@ -65,7 +65,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { @@ -4946,7 +4946,7 @@ getNonCompilablePath("SuppressionXpathRegressionIllegalIdentifierNameTestTwo.java")); @@ -84,7 +84,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -4956,9 +4956,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck; @@ -4966,15 +4966,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalImportCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -4987,16 +4987,16 @@ }; - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalImportTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalImportCheck.class); - + @@ -61,8 +61,7 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { + getCheckMessage( IllegalImportCheck.class, IllegalImportCheck.MSG_KEY, "java.lang.Math.pow"), @@ -5004,15 +5004,15 @@ - final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck; @@ -5020,24 +5020,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalThrowsCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalThrowsOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalThrowsCheck.class); @@ -48,7 +48,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5046,16 +5046,16 @@ + "/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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalThrowsCheck.class); @@ -70,7 +70,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5065,9 +5065,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck; @@ -5075,15 +5075,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalTokenCheck.class.getSimpleName(); - + @@ -36,14 +36,14 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -5100,13 +5100,13 @@ + "/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")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); - + @@ -63,7 +63,7 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { "4:10: " + getCheckMessage(IllegalTokenCheck.class, IllegalTokenCheck.MSG_KEY, "native"), }; @@ -5119,9 +5119,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTextTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck; @@ -5130,15 +5130,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalTokenTextCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -5147,7 +5147,7 @@ final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); @@ -62,7 +62,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { @@ -5156,7 +5156,7 @@ final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenTextCheck.class); @@ -90,7 +90,7 @@ public class XpathRegressionIllegalTokenTextTest extends AbstractXpathTestSuppor } - + @Test - public void testThree() throws Exception { + void three() throws Exception { @@ -5175,9 +5175,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck; @@ -5185,15 +5185,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { +final class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { - + private final String checkName = IllegalTypeCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -5211,13 +5211,13 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/TYPE_PARAMETER" @@ -56,7 +56,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalTypeTwo.java")); final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTypeCheck.class); - + @@ -66,7 +66,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { "6:20: " + getCheckMessage(IllegalTypeCheck.class, IllegalTypeCheck.MSG_KEY, "Boolean"), }; @@ -5230,9 +5230,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.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.imports.ImportControlCheck; @@ -5241,70 +5241,70 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { +final class XpathRegressionImportControlTest extends AbstractXpathTestSupport { - + private final String checkName = ImportControlCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); @@ -49,13 +49,13 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { ImportControlCheck.class, ImportControlCheck.MSG_DISALLOWED, "java.util.Scanner"), }; - + - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); @@ -72,7 +72,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlThree.java")); - + @@ -89,7 +89,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlFour.java")); - + @@ -103,7 +103,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportOrderTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; @@ -5312,101 +5312,101 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { +final class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { - + private final String checkName = ImportOrderCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -46,13 +46,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + getCheckMessage(ImportOrderCheck.class, ImportOrderCheck.MSG_ORDERING, "java.util.Set"), }; - + - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -64,13 +64,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Set']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Set']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderThree.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -83,13 +83,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/DOT/IDENT[@text='org']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/DOT/IDENT[@text='org']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderFour.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -101,14 +101,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { ImportOrderCheck.class, ImportOrderCheck.MSG_ORDERING, "java.lang.Math.PI"), }; - + - final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderFive.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); @@ -121,7 +120,7 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Date']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Date']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIndentationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIndentationTest.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.indentation.IndentationCheck; @@ -5415,51 +5415,51 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { +final class XpathRegressionIndentationTest extends AbstractXpathTestSupport { private final String checkName = IndentationCheck.class.getSimpleName(); - + @Override @@ -36,7 +36,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationTestOne.java")); - + @@ -67,7 +67,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testBasicOffset() throws Exception { + void basicOffset() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationTestTwo.java")); - + @@ -106,7 +106,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testCaseIndent() throws Exception { + void caseIndent() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationTestThree.java")); - + @@ -141,7 +141,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testLambda() throws Exception { + void lambda() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationLambdaTest1.java")); - + @@ -160,7 +160,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5468,16 +5468,16 @@ + "']]/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF" @@ -170,7 +170,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testLambda2() throws Exception { + void lambda2() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationLambdaTest2.java")); - + @@ -195,7 +195,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5486,16 +5486,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[" @@ -205,7 +205,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testIfWithNoCurlies() throws Exception { + void ifWithNoCurlies() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationIfWithoutCurly.java")); - + @@ -226,7 +226,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5504,16 +5504,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/EXPR/" @@ -236,7 +236,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { } - + @Test - public void testElseWithNoCurlies() throws Exception { + void elseWithNoCurlies() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionIndentationElseWithoutCurly.java")); - + @@ -258,7 +258,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5523,9 +5523,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerAssignmentTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerAssignmentTest.java @@ -19,6 +19,7 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck; @@ -5533,24 +5533,24 @@ @@ -26,7 +27,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport { +final class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport { - + private final String checkName = InnerAssignmentCheck.class.getSimpleName(); - + @@ -36,7 +37,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport } - + @Test - public void testFile1() throws Exception { + void file1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerAssignment1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class); @@ -46,7 +47,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -5559,49 +5559,49 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='testMethod']]" @@ -56,7 +57,7 @@ public class XpathRegressionInnerAssignmentTest extends AbstractXpathTestSupport } - + @Test - public void testFile2() throws Exception { + void file2() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerAssignment2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(InnerAssignmentCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerTypeLastTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInnerTypeLastTest.java @@ -28,7 +28,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { +final class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { - + private final String checkName = InnerTypeLastCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(InnerTypeLastCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { - + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastTwo.java")); - + @@ -99,7 +99,7 @@ public class XpathRegressionInnerTypeLastTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { - + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInnerTypeLastThree.java")); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java @@ -5609,74 +5609,74 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport { +final class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport { - + private final String checkName = InterfaceIsTypeCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceIsType1.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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(InterfaceIsTypeCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractXpathTestSupport { +final class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier1.java")); - + @@ -67,7 +67,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier2.java")); - + @@ -100,7 +100,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier3.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionCheck; @@ -5684,24 +5684,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTestSupport { +final class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTestSupport { - + private final String checkName = InvalidJavadocPositionCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionOne.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5710,16 +5710,16 @@ + "/MODIFIERS/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" @@ -58,7 +58,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionTwo.java")); - + @@ -70,7 +70,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5728,16 +5728,16 @@ + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" @@ -80,7 +80,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionThree.java")); - + @@ -92,7 +92,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5746,16 +5746,16 @@ + "OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" @@ -102,7 +102,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionFour.java")); - + @@ -114,7 +114,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5764,16 +5764,16 @@ + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" @@ -124,7 +124,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionFive.java")); - + @@ -136,7 +136,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5782,16 +5782,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -147,7 +147,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest } - + @Test - public void testSix() throws Exception { + void six() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionSix.java")); - + @@ -159,7 +159,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5801,34 +5801,34 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavaNCSSTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavaNCSSTest.java @@ -19,6 +19,7 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck; import java.io.File; @@ -26,7 +27,7 @@ import java.util.List; import org.junit.jupiter.api.Test; - + // -@cs[AbbreviationAsWordInName] Test should be named as its main class. -public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { +final class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { - + private final String checkName = JavaNCSSCheck.class.getSimpleName(); - + @@ -36,7 +37,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); @@ -46,7 +47,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -5837,16 +5837,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]", @@ -61,7 +62,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); @@ -73,7 +74,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -5855,28 +5855,28 @@ "/COMPILATION_UNIT/CLASS_DEF" @@ -86,7 +87,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavaNCSSThree.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavaNCSSCheck.class); @@ -98,7 +99,7 @@ public class XpathRegressionJavaNCSSTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - List.of("/COMPILATION_UNIT", "/COMPILATION_UNIT/PACKAGE_DEF"); + ImmutableList.of("/COMPILATION_UNIT", "/COMPILATION_UNIT/PACKAGE_DEF"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocContentLocationCheck; @@ -5884,24 +5884,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTestSupport { +final class XpathRegressionJavadocContentLocationTest extends AbstractXpathTestSupport { - + private final String checkName = JavadocContentLocationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocContentLocationOne.java")); - + @@ -50,7 +50,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5910,16 +5910,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE/BLOCK_COMMENT_BEGIN" @@ -60,7 +60,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocContentLocationTwo.java")); - + @@ -76,7 +76,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5931,7 +5931,7 @@ @@ -22,15 +22,15 @@ package org.checkstyle.suppressionxpathfilter; import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.MSG_EXPECTED_TAG; import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.MSG_INVALID_INHERIT_DOC; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck; @@ -5940,33 +5940,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { +final class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { - + private final String checkName = JavadocMethodCheck.class.getSimpleName(); - + @@ -40,7 +40,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); @@ -76,7 +76,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -5975,25 +5975,25 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkParam']]/PARAMETERS" @@ -86,7 +86,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodThree.java")); - + @@ -111,7 +111,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodFour.java")); - + @@ -125,7 +125,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6002,16 +6002,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -135,7 +135,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodFive.java")); - + @@ -153,7 +153,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6023,74 +6023,74 @@ @@ -30,7 +30,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { +final class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { - + private final String checkName = JavadocTypeCheck.class.getSimpleName(); - + @@ -40,7 +40,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); @@ -91,7 +91,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeThree.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport { +final class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport { - + private final String checkName = JavadocVariableCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocVariableOne.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")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck; @@ -6098,15 +6098,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSupport { +final class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSupport { - + private static final Class CLASS = LambdaBodyLengthCheck.class; - + @@ -36,7 +36,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -6115,7 +6115,7 @@ final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -45,7 +45,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6124,7 +6124,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST" @@ -55,7 +55,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor } - + @Test - public void testMaxIsNotDefault() throws Exception { + void maxIsNotDefault() throws Exception { @@ -6133,7 +6133,7 @@ final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -65,7 +65,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6143,9 +6143,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java @@ -19,16 +19,16 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -6155,24 +6155,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSupport { +final class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSupport { - + private final String checkName = LambdaParameterNameCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionLambdaParameterName1.java")); - + @@ -55,7 +55,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6181,19 +6181,19 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[" @@ -65,7 +65,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionLambdaParameterName2.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java @@ -19,16 +19,16 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck; @@ -6203,42 +6203,42 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { +final class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { - + private final String checkName = LeftCurlyCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); @@ -58,7 +58,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 DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); @@ -79,7 +79,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 DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); @@ -90,7 +90,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6248,9 +6248,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMagicNumberTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMagicNumberTest.java @@ -19,6 +19,7 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck; @@ -6258,42 +6258,42 @@ @@ -26,7 +27,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { +final class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +35,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { } - + @Test - public void testVariable() throws Exception { + void variable() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMagicNumberVariable.java")); - + @@ -59,7 +60,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { } - + @Test - public void testMethodDef() throws Exception { + void methodDef() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMagicNumberMethodDef.java")); - + @@ -85,7 +86,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { } - + @Test - public void testAnotherVariable() throws Exception { + void anotherVariable() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMagicNumberAnotherVariable.java")); - + @@ -96,7 +97,7 @@ public class XpathRegressionMagicNumberTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -6303,9 +6303,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java @@ -19,16 +19,16 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck; @@ -6315,33 +6315,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { +final class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { - + private final String checkName = MatchXpathCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); @@ -75,7 +75,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6350,124 +6350,124 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='func1']]" @@ -85,7 +85,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedQuoteString() throws Exception { + void encodedQuoteString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedQuoteString.java")); - + @@ -113,7 +113,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedLessString() throws Exception { + void encodedLessString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedLessString.java")); - + @@ -140,7 +140,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedNewLineString() throws Exception { + void encodedNewLineString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedNewLineString.java")); - + @@ -167,7 +167,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testGreaterString() throws Exception { + void greaterString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedGreaterString.java")); - + @@ -194,7 +194,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedAmpString() throws Exception { + void encodedAmpString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAmpString.java")); - + @@ -221,7 +221,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedAposString() throws Exception { + void encodedAposString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAposString.java")); - + @@ -249,7 +249,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedCarriageString() throws Exception { + void encodedCarriageString() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedCarriageString.java")); - + @@ -277,7 +277,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedAmpersandChars() throws Exception { + void encodedAmpersandChars() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAmpChar.java")); - + @@ -307,7 +307,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedQuoteChar() throws Exception { + void encodedQuoteChar() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedQuotChar.java")); - + @@ -334,7 +334,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedLessChar() throws Exception { + void encodedLessChar() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedLessChar.java")); - + @@ -361,7 +361,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedAposChar() throws Exception { + void encodedAposChar() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAposChar.java")); - + @@ -388,7 +388,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { } - + @Test - public void testEncodedGreaterChar() throws Exception { + void encodedGreaterChar() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathEncodedGreaterChar.java")); - + @@ -417,7 +417,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 DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); @@ -428,7 +428,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6477,9 +6477,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -6488,24 +6488,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { +final class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { - + private final String checkName = MemberNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { } - + @Test - public void test1() throws Exception { + void test1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMemberName1.java")); - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; @@ -50,7 +50,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6514,16 +6514,16 @@ + "='SuppressionXpathRegressionMemberName1']]" @@ -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")); - + final String pattern = "^m[A-Z][a-zA-Z0-9]*$"; @@ -75,7 +75,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6535,63 +6535,63 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { +final class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); @@ -59,7 +59,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); @@ -84,7 +84,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); @@ -109,7 +109,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount3.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); @@ -135,7 +135,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount4.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -6600,24 +6600,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { +final class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { - + private final String checkName = MethodNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { } - + @Test - public void test1() throws Exception { + void test1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName1.java")); - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; @@ -53,7 +53,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6626,16 +6626,16 @@ + "='SuppressionXpathRegressionMethodName1']]" @@ -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")); - + final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; @@ -76,7 +76,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6644,16 +6644,16 @@ + "='SuppressionXpathRegressionMethodName2']]" @@ -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")); - + final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; @@ -102,7 +102,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6663,9 +6663,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodParamPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodParamPadTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck; @@ -6673,24 +6673,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport { +final class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport { - + private final String checkName = MethodParamPadCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodParamPadOne.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6699,16 +6699,16 @@ + "/METHOD_DEF[./IDENT[@text='InputMethodParamPad']]/LPAREN"); @@ -57,7 +57,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodParamPadTwo.java")); - + @@ -69,7 +69,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6717,16 +6717,16 @@ + "/METHOD_DEF[./IDENT[@text='sayHello']]/LPAREN"); @@ -78,7 +78,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodParamPadThree.java")); - + @@ -92,7 +92,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6738,224 +6738,224 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { +final class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { - + private final String checkName = MissingCtorCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingCtor1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MissingCtorCheck.class); @@ -58,7 +58,7 @@ public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingCtor2.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MissingCtorCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSupport { +final class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSu } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocMethod1.java")); - + @@ -68,7 +68,7 @@ public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSu } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocMethod2.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestSupport { +final class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestSupport { - + private final String checkName = MissingJavadocPackageCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestS } - + @Test - public void testBlockComment() throws Exception { + void blockComment() throws Exception { final File fileToProcess = new File(getPath("blockcomment/package-info.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocPackageCheck.class); @@ -53,7 +53,7 @@ public class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestS } - + @Test - public void testNoJavadoc() throws Exception { + void noJavadoc() throws Exception { final File fileToProcess = new File(getPath("nojavadoc/package-info.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocPackageCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupport { +final class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupport { - + private final String checkName = MissingJavadocTypeCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } - + @Test - public void testClass() throws Exception { + void testClass() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocTypeClass.java")); - + @@ -65,7 +65,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } - + @Test - public void testScope() throws Exception { + void scope() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocTypeScope.java")); - + @@ -96,7 +96,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } - + @Test - public void testExcluded() throws Exception { + void excluded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocTypeExcluded.java")); - + @@ -128,7 +128,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocTypeAnnotation.java")); - + @@ -164,7 +164,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp } - + @Test - public void testToken() throws Exception { + void token() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingJavadocTypeToken.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport { +final class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport { - + private final String checkName = MissingOverrideCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testClass() throws Exception { + void testClass() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideClass.java")); - + @@ -64,7 +64,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideInterface.java")); - + @@ -95,7 +95,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testAnonymous() throws Exception { + void anonymous() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideAnonymous.java")); - + @@ -129,7 +129,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testInheritDocInvalid1() throws Exception { + void inheritDocInvalid1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideInheritDocInvalid1.java")); - + @@ -159,7 +159,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testInheritDocInvalid2() throws Exception { + void inheritDocInvalid2() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideInheritDocInvalid2.java")); - + @@ -189,7 +189,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testJavaFiveCompatibility1() throws Exception { + void javaFiveCompatibility1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideClass.java")); - + @@ -218,7 +218,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport } - + @Test - public void testJavaFiveCompatibility2() throws Exception { + void javaFiveCompatibility2() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingOverrideInterface.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.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.MissingSwitchDefaultCheck; @@ -6964,24 +6964,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSupport { +final class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSupport { - + private final Class clss = MissingSwitchDefaultCheck.class; - + @@ -37,7 +37,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingSwitchDefaultOne.java")); - + @@ -47,7 +47,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -6990,19 +6990,19 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test1']]" @@ -57,7 +57,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingSwitchDefaultTwo.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.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.modifier.ModifierOrderCheck; @@ -7011,33 +7011,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { +final class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { - + private final Class clazz = ModifierOrderCheck.class; - + @@ -37,7 +37,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { } - + @Test - public void testMethod() throws Exception { + void method() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionModifierOrderMethod.java")); - + @@ -63,7 +63,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { } - + @Test - public void testVariable() throws Exception { + void variable() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionModifierOrderVariable.java")); - + @@ -74,7 +74,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7046,48 +7046,48 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='var']]/MODIFIERS/LITERAL_PRIVATE"); @@ -83,7 +83,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionModifierOrderAnnotation.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpathTestSupport { +final class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpathTestSupport { - + private final String checkName = MultipleVariableDeclarationsCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpa } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionMultipleVariableDeclarationsOne.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")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java @@ -19,16 +19,16 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck; @@ -7096,34 +7096,34 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + // -@cs[AbbreviationAsWordInName] Test should be named as its main class. -public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport { +final class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport { - + private final String checkName = NPathComplexityCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNPathComplexityOne.java")); - + @@ -65,7 +65,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNPathComplexityTwo.java")); - + @@ -77,7 +77,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7133,9 +7133,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java @@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; - + import static com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.MSG_KEY_NEED_BRACES; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck; @@ -7143,24 +7143,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { +final class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { private final String checkName = NeedBracesCheck.class.getSimpleName(); - + @Override @@ -37,7 +37,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } - + @Test - public void testDo() throws Exception { + void testDo() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNeedBracesDo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NeedBracesCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7169,16 +7169,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_DO"); @@ -56,7 +56,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } - + @Test - public void testSingleLine() throws Exception { + void singleLine() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNeedBracesSingleLine.java")); - + @@ -68,7 +68,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7187,16 +7187,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF"); @@ -77,7 +77,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } - + @Test - public void testSingleLineLambda() throws Exception { + void singleLineLambda() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNeedBracesSingleLineLambda.java")); - + @@ -90,7 +90,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7205,16 +7205,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='r3']]/ASSIGN/LAMBDA"); @@ -99,7 +99,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { } - + @Test - public void testEmptyLoopBody() throws Exception { + void emptyLoopBody() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNeedBracesEmptyLoopBody.java")); - + @@ -110,7 +110,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7224,9 +7224,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck; @@ -7234,24 +7234,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport { +final class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport { - + private final String checkName = NestedForDepthCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedForDepth.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NestedForDepthCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7260,16 +7260,16 @@ + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_FOR" @@ -56,7 +56,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport } - + @Test - public void testMax() throws Exception { + void max() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedForDepthMax.java")); - + @@ -68,7 +68,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7279,9 +7279,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck; @@ -7289,24 +7289,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { +final class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { - + private final String checkName = NestedIfDepthCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedIfDepth.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NestedIfDepthCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7315,16 +7315,16 @@ + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF" @@ -56,7 +56,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { } - + @Test - public void testMax() throws Exception { + void max() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedIfDepthMax.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NestedIfDepthCheck.class); @@ -67,7 +67,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7334,9 +7334,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck; @@ -7344,24 +7344,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport { +final class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport { - + private final String checkName = NestedTryDepthCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedTryDepth.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NestedTryDepthCheck.class); @@ -46,7 +46,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7370,16 +7370,16 @@ + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_TRY/SLIST" @@ -56,7 +56,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport } - + @Test - public void testMax() throws Exception { + void max() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedTryDepthMax.java")); - + @@ -68,7 +68,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7389,9 +7389,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingCommaCheck; @@ -7399,24 +7399,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSupport { +final class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSupport { - + private final String checkName = NoArrayTrailingCommaCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoArrayTrailingCommaOne.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7425,16 +7425,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='t1']]/ASSIGN/EXPR" @@ -58,7 +58,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoArrayTrailingCommaTwo.java")); - + @@ -70,7 +70,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7446,36 +7446,36 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { +final class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { - + private final String checkName = NoCloneCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoCloneOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NoCloneCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoCloneTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NoCloneCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.NoEnumTrailingCommaCheck; @@ -7483,24 +7483,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSupport { +final class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSupport { - + private final String checkName = NoEnumTrailingCommaCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoEnumTrailingCommaOne.java")); - + @@ -47,7 +47,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7509,16 +7509,16 @@ + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Foo3']]/OBJBLOCK/COMMA[2]"); @@ -56,7 +56,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoEnumTrailingCommaTwo.java")); - + @@ -67,7 +67,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7530,74 +7530,74 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { +final class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoFinalizer1.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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NoFinalizerCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { +final class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +34,7 @@ public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap1.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")); - + 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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.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.whitespace.NoWhitespaceAfterCheck; @@ -7606,33 +7606,33 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSupport { +final class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSupport { - + private final String checkName = NoWhitespaceAfterCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo } - + @Test - public void testNoWhitespaceAfter() throws Exception { + void noWhitespaceAfter() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceAfter.java")); - + @@ -61,7 +61,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo } - + @Test - public void testTokens() throws Exception { + void tokens() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceAfterTokens.java")); - + @@ -73,7 +73,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7641,19 +7641,19 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" @@ -84,7 +84,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo } - + @Test - public void testAllowLineBreaks() throws Exception { + void allowLineBreaks() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceAfterLineBreaks.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java @@ -19,15 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck; @@ -7661,25 +7661,25 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest - extends AbstractXpathTestSupport { +final class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest extends AbstractXpathTestSupport { - + private final String checkName = NoWhitespaceBeforeCaseDefaultColonCheck.class.getSimpleName(); - + @@ -37,7 +36,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonOne.java")); - + @@ -53,7 +52,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7688,16 +7688,16 @@ + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP/LITERAL_CASE/COLON"); @@ -62,7 +61,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonTwo.java")); - + @@ -78,7 +77,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7706,16 +7706,16 @@ + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" @@ -88,7 +87,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonThree.java")); - + @@ -104,7 +103,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7724,16 +7724,16 @@ + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" @@ -114,7 +113,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonFour.java")); - + @@ -130,7 +129,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7743,9 +7743,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck; @@ -7753,24 +7753,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupport { +final class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupport { - + private final String checkName = NoWhitespaceBeforeCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp } - + @Test - public void testNoWhitespaceBefore() throws Exception { + void noWhitespaceBefore() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBefore.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7779,16 +7779,16 @@ + "/VARIABLE_DEF[./IDENT[@text='bad']]/SEMI"); @@ -57,7 +57,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp } - + @Test - public void testTokens() throws Exception { + void tokens() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeTokens.java")); - + @@ -70,7 +70,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7797,16 +7797,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" @@ -81,7 +81,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp } - + @Test - public void testAllowLineBreaks() throws Exception { + void allowLineBreaks() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeLineBreaks.java")); - + @@ -94,7 +94,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7816,9 +7816,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck; @@ -7826,24 +7826,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSupport { +final class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSupport { - + private final String checkName = OneStatementPerLineCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOneStatementPerLineOne.java")); - + @@ -47,7 +47,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7852,16 +7852,16 @@ + "/VARIABLE_DEF[./IDENT[@text='j']]/SEMI"); @@ -56,7 +56,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOneStatementPerLineTwo.java")); - + @@ -67,7 +67,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7873,36 +7873,36 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSupport { +final class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSupport { - + private final String checkName = OneTopLevelClassCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSuppor } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOneTopLevelClassFirst.java")); - + @@ -58,7 +58,7 @@ public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSuppor } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOneTopLevelClassSecond.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck; @@ -7910,24 +7910,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { +final class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { - + private final String checkName = OperatorWrapCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { } - + @Test - public void testOperatorWrapNewLine() throws Exception { + void operatorWrapNewLine() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOperatorWrapNewLine.java")); - + @@ -47,7 +47,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7936,16 +7936,16 @@ + "='SuppressionXpathRegressionOperatorWrapNewLine']]" @@ -60,7 +60,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { } - + @Test - public void testOperatorWrapPreviousLine() throws Exception { + void operatorWrapPreviousLine() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOperatorWrapPreviousLine.java")); - + @@ -73,7 +73,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -7957,152 +7957,152 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSupport { +final class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSupport { - + private final String checkName = OuterTypeFilenameCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSuppo } - + @Test - public void testNoPublic() throws Exception { + void noPublic() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOuterTypeFilename1.java")); - + @@ -56,7 +56,7 @@ public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSuppo } - + @Test - public void testNested() throws Exception { + void nested() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOuterTypeFilename2.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport { +final class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport { - + private final String checkName = OuterTypeNumberCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOuterTypeNumberDefault.java")); - + @@ -53,7 +53,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 DefaultConfiguration moduleConfig = createModuleConfig(OuterTypeNumberCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionOverloadMethodsDeclarationOrderTest extends AbstractXpathTestSupport { +final class XpathRegressionOverloadMethodsDeclarationOrderTest extends AbstractXpathTestSupport { - + private final Class clazz = OverloadMethodsDeclarationOrderCheck.class; @@ -37,7 +37,7 @@ public class XpathRegressionOverloadMethodsDeclarationOrderTest extends Abstract } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder1.java")); - + @@ -64,7 +64,7 @@ public class XpathRegressionOverloadMethodsDeclarationOrderTest extends Abstract } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder2.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSupport { +final class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSupport { - + private final String checkName = PackageAnnotationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSuppo } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPackageAnnotationOne.java")); - + @@ -53,7 +53,7 @@ public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSuppo } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPackageAnnotationTwo.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupport { +final class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupport { - + private final String checkName = PackageDeclarationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupp } - + @Test - public void test1() throws Exception { + void test1() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression1.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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageNameTest.java @@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; - + import static com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck; @@ -8110,24 +8110,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { +final class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { - + private final String checkName = PackageNameCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { - + final File fileToProcess = new File(getPath("SuppressionXpathRegressionPackageNameOne.java")); - + @@ -57,7 +57,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8136,16 +8136,16 @@ + "[./IDENT[@text='suppressionxpathfilter']]" @@ -67,7 +67,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { - + final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPackageName.java")); @@ -86,7 +86,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8154,16 +8154,16 @@ + "[@text='suppressionxpathfilter']]" @@ -96,7 +96,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { - + final File fileToProcess = new File(getPath("SuppressionXpathRegressionPackageNameTwo.java")); - + @@ -115,7 +115,7 @@ public class XpathRegressionPackageNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8173,9 +8173,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParameterNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -8184,24 +8184,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { +final class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { - + private final String checkName = ParameterNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } - + @Test - public void testDefaultPattern() throws Exception { + void defaultPattern() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParameterNameDefaultPattern.java")); - + @@ -51,7 +51,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8210,16 +8210,16 @@ + "='SuppressionXpathRegressionParameterNameDefaultPattern']]" @@ -61,7 +61,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } - + @Test - public void testDifferentPattern() throws Exception { + void differentPattern() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParameterNameDifferentPattern.java")); - + @@ -76,7 +76,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8228,16 +8228,16 @@ + "='SuppressionXpathRegressionParameterNameDifferentPattern']]" @@ -86,7 +86,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } - + @Test - public void testIgnoreOverridden() throws Exception { + void ignoreOverridden() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParameterNameIgnoreOverridden.java")); - + @@ -101,7 +101,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8246,16 +8246,16 @@ + "='SuppressionXpathRegressionParameterNameIgnoreOverridden']]" @@ -111,7 +111,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { } - + @Test - public void testAccessModifiers() throws Exception { + void accessModifiers() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParameterNameAccessModifier.java")); - + @@ -127,7 +127,7 @@ public class XpathRegressionParameterNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8265,9 +8265,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java @@ -19,16 +19,16 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck; @@ -8277,24 +8277,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { +final class XpathRegressionParenPadTest extends AbstractXpathTestSupport { - + private final String checkName = ParenPadCheck.class.getSimpleName(); - + @@ -38,7 +38,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } - + @Test - public void testLeftFollowed() throws Exception { + void leftFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParenPadLeftFollowed.java")); - + @@ -49,7 +49,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8303,16 +8303,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/LPAREN"); @@ -58,7 +58,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } - + @Test - public void testLeftNotFollowed() throws Exception { + void leftNotFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParenPadLeftNotFollowed.java")); - + @@ -71,7 +71,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8321,16 +8321,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/LPAREN"); @@ -80,7 +80,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } - + @Test - public void testRightPreceded() throws Exception { + void rightPreceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParenPadRightPreceded.java")); - + @@ -91,7 +91,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8339,16 +8339,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/RPAREN"); @@ -100,7 +100,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { } - + @Test - public void testRightNotPreceded() throws Exception { + void rightNotPreceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionParenPadRightNotPreceded.java")); - + @@ -113,7 +113,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8358,9 +8358,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -8369,24 +8369,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSupport { +final class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSupport { - + private final String checkName = PatternVariableNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName1.java")); - + @@ -54,7 +54,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8395,16 +8395,16 @@ + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" @@ -65,7 +65,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName2.java")); - + @@ -84,7 +84,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8413,16 +8413,16 @@ + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" @@ -95,7 +95,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName3.java")); - + @@ -114,7 +114,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8431,16 +8431,16 @@ + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/" @@ -125,7 +125,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName4.java")); - + @@ -144,7 +144,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8450,9 +8450,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -8461,42 +8461,42 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSupport { +final class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSupport { - + private final String checkName = RecordComponentNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRecordComponentName1.java")); - + @@ -53,7 +53,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentName1']]" + "/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 { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRecordComponentName2.java")); - + @@ -78,7 +78,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8508,65 +8508,65 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestSupport { +final class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestSupport { - + private final String checkName = RecordComponentNumberCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestS } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRecordComponentNumber1.java")); - + @@ -60,7 +60,7 @@ public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestS } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRecordComponentNumber2.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTestSupport { +final class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTestSupport { - + private final String checkName = RecordTypeParameterNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTes } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionRecordTypeParameterName1.java")); - + @@ -66,7 +66,7 @@ public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTes } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionRecordTypeParameterName2.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck; @@ -8574,15 +8574,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport { +final class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport { - + private final String checkName = RedundantImportCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -8595,10 +8595,10 @@ }; - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { @@ -8611,10 +8611,10 @@ }; - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testThree() throws Exception { + void three() throws Exception { @@ -8627,15 +8627,15 @@ final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); + ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRequireThisTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRequireThisTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck; @@ -8643,24 +8643,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { +final class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { - + private final String checkName = RequireThisCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionRequireThisOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(RequireThisCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8669,16 +8669,16 @@ + "/METHOD_DEF[./IDENT[@text='changeAge']]/SLIST/EXPR/ASSIGN" @@ -57,7 +57,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionRequireThisTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(RequireThisCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8688,9 +8688,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionReturnCountTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionReturnCountTest.java @@ -19,6 +19,7 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck; @@ -8698,69 +8698,69 @@ @@ -26,7 +27,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { +final class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -34,7 +35,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionReturnCount1.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")); - + 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")); - + 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")); - + 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")); - + 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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(ReturnCountCheck.class); @@ -186,7 +187,7 @@ public class XpathRegressionReturnCountTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - List.of( + ImmutableList.of( @@ -8770,9 +8770,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.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.blocks.RightCurlyCheck; @@ -8781,24 +8781,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { +final class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { - + private final String checkName = RightCurlyCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -47,7 +47,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8807,16 +8807,16 @@ + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/SLIST/RCURLY"); @@ -56,7 +56,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8825,16 +8825,16 @@ + "/METHOD_DEF[./IDENT[@text='fooMethod']]/SLIST/LITERAL_TRY/SLIST/RCURLY"); @@ -77,7 +77,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } - + @Test - public void testThree() throws Exception { + void three() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyThree.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -89,7 +89,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8843,16 +8843,16 @@ + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST/RCURLY"); @@ -98,7 +98,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyFour.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); @@ -111,7 +111,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8862,9 +8862,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java @@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; - + import static com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck; @@ -8872,15 +8872,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestSupport { +final class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestSupport { - + private static final Class CLASS = SimplifyBooleanReturnCheck.class; private final String checkName = CLASS.getSimpleName(); @@ -39,7 +39,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS } - + @Test - public void testIfBooleanEqualsBoolean() throws Exception { + void ifBooleanEqualsBoolean() throws Exception { @@ -8889,7 +8889,7 @@ getPath("SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanEqualsBoolean.java")); @@ -51,7 +51,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8898,7 +8898,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='toTest']]/SLIST/LITERAL_IF"); @@ -60,7 +60,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS } - + @Test - public void testIfBooleanReturnBoolean() throws Exception { + void ifBooleanReturnBoolean() throws Exception { @@ -8907,7 +8907,7 @@ getPath("SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanReturnBoolean.java")); @@ -72,7 +72,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8917,9 +8917,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck; @@ -8927,24 +8927,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSupport { +final class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSupport { - + private final String checkName = SingleSpaceSeparatorCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu } - + @Test - public void testSingleSpaceSeparator() throws Exception { + void singleSpaceSeparator() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionSingleSpaceSeparator.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8953,16 +8953,16 @@ + "/VARIABLE_DEF/IDENT[@text='bad']"); @@ -57,7 +57,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu } - + @Test - public void testValidateComments() throws Exception { + void validateComments() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionSingleSpaceSeparatorValidateComments.java")); - + @@ -70,7 +70,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -8972,9 +8972,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStaticVariableNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStaticVariableNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -8983,24 +8983,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupport { +final class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupport { - + private final String checkName = StaticVariableNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp } - + @Test - public void test1() throws Exception { + void test1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionStaticVariableName1.java")); - + @@ -54,7 +54,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9009,16 +9009,16 @@ + "='SuppressionXpathRegressionStaticVariableName1']]" @@ -63,7 +63,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp } - + @Test - public void test2() throws Exception { + void test2() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionStaticVariableName2.java")); - + @@ -80,7 +80,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9027,16 +9027,16 @@ + "='SuppressionXpathRegressionStaticVariableName2']]" @@ -91,7 +91,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp } - + @Test - public void test3() throws Exception { + void test3() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegressionStaticVariableName3.java")); - + @@ -108,7 +108,7 @@ public class XpathRegressionStaticVariableNameTest extends AbstractXpathTestSupp }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9046,9 +9046,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.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.StringLiteralEqualityCheck; @@ -9057,15 +9057,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestSupport { +final class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestSupport { - + private final String checkName = StringLiteralEqualityCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -9074,7 +9074,7 @@ final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); @@ -61,7 +61,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { @@ -9083,7 +9083,7 @@ final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); @@ -85,7 +85,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS } - + @Test - public void testThree() throws Exception { + void three() throws Exception { @@ -9102,9 +9102,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuperCloneTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSuperCloneTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck; @@ -9113,24 +9113,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { +final class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -35,7 +35,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { } - + @Test - public void testInnerClone() throws Exception { + void innerClone() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionSuperCloneInnerClone.java")); - + @@ -46,7 +46,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9139,16 +9139,16 @@ + "RegressionSuperCloneInnerClone']]" @@ -57,7 +57,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { } - + @Test - public void testNoSuperClone() throws Exception { + void noSuperClone() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionSuperCloneNoSuperClone.java")); - + @@ -68,7 +68,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9157,16 +9157,16 @@ + "RegressionSuperCloneNoSuperClone']]" @@ -79,7 +79,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { } - + @Test - public void testPlainAndSubclasses() throws Exception { + void plainAndSubclasses() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionSuperClonePlainAndSubclasses.java")); - + @@ -90,7 +90,7 @@ public class XpathRegressionSuperCloneTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9176,9 +9176,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck; @@ -9186,15 +9186,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { +final class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { - + private final String checkName = ThrowsCountCheck.class.getSimpleName(); - + @@ -36,14 +36,14 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -9211,13 +9211,13 @@ + "/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")); final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); - + @@ -63,7 +63,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { "4:30: " + getCheckMessage(ThrowsCountCheck.class, ThrowsCountCheck.MSG_KEY, 3, 2), }; @@ -9229,13 +9229,13 @@ + "/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")); final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); - + @@ -83,7 +83,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { "9:40: " + getCheckMessage(ThrowsCountCheck.class, ThrowsCountCheck.MSG_KEY, 5, 4), }; @@ -9248,9 +9248,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java @@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; - + import static com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck; @@ -9258,24 +9258,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { +final class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { private final String checkName = TodoCommentCheck.class.getSimpleName(); - + @Override @@ -37,7 +37,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTodoCommentOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(TodoCommentCheck.class); @@ -48,7 +48,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9284,16 +9284,16 @@ + "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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(TodoCommentCheck.class); @@ -68,7 +68,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9303,9 +9303,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck; @@ -9313,24 +9313,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport { +final class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport { private final String checkName = TrailingCommentCheck.class.getSimpleName(); - + @Override @@ -35,7 +35,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTrailingComment1.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(TrailingCommentCheck.class); @@ -45,7 +45,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9339,16 +9339,16 @@ + "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")); - + final DefaultConfiguration moduleConfig = createModuleConfig(TrailingCommentCheck.class); @@ -65,7 +65,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9358,9 +9358,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java @@ -19,15 +19,15 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; @@ -9369,24 +9369,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { +final class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { - + private final String checkName = TypeNameCheck.class.getSimpleName(); - + @@ -37,7 +37,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { } - + @Test - public void test1() throws Exception { + void test1() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypeName1.java")); - + final String pattern = "^[A-Z][a-zA-Z0-9]*$"; @@ -50,7 +50,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9395,16 +9395,16 @@ + "='SuppressionXpathRegressionTypeName1']]" @@ -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")); - + final String pattern = "^I_[a-zA-Z0-9]*$"; @@ -74,7 +74,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9414,9 +9414,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java @@ -19,17 +19,17 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck; @@ -9427,42 +9427,42 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSupport { +final class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSupport { - + private final String checkName = TypecastParenPadCheck.class.getSimpleName(); - + @@ -39,7 +39,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } - + @Test - public void testLeftFollowed() throws Exception { + void leftFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypecastParenPadLeftFollowed.java")); - + @@ -64,7 +64,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } - + @Test - public void testLeftNotFollowed() throws Exception { + void leftNotFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypecastParenPadLeftNotFollowed.java")); - + @@ -90,7 +90,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } - + @Test - public void testRightPreceded() throws Exception { + void rightPreceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypecastParenPadRightPreceded.java")); - + @@ -103,7 +103,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9471,16 +9471,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); @@ -112,7 +112,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor } - + @Test - public void testRightNotPreceded() throws Exception { + void rightNotPreceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypecastParenPadRightNotPreceded.java")); - + @@ -126,7 +126,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9492,36 +9492,36 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport { +final class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport { - + private final Class clazz = UncommentedMainCheck.class; - + @@ -36,7 +36,7 @@ public class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUncommentedMain.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")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.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.UnnecessaryParenthesesCheck; @@ -9530,42 +9530,42 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTestSupport { +final class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTestSupport { - + @Override protected String getCheckName() { @@ -35,7 +35,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses1.java")); - + @@ -62,7 +62,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses2.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")); - + @@ -102,7 +102,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9574,16 +9574,16 @@ + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='predicate']]" @@ -112,7 +112,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testFour() throws Exception { + void four() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses4.java")); - + @@ -125,7 +125,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9592,16 +9592,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -136,7 +136,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testFive() throws Exception { + void five() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses5.java")); - + @@ -151,7 +151,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9610,16 +9610,16 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -162,7 +162,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testSix() throws Exception { + void six() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses6.java")); - + @@ -175,7 +175,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9628,28 +9628,28 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" @@ -186,7 +186,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testSeven() throws Exception { + void seven() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses7.java")); - + @@ -213,7 +213,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest } - + @Test - public void testEight() throws Exception { + void eight() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses8.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck; @@ -9657,15 +9657,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest +final class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest extends AbstractXpathTestSupport { - + private static final Class CLASS = @@ -38,7 +38,7 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest } - + @Test - public void testOne() throws Exception { + void one() throws Exception { @@ -9675,13 +9675,13 @@ @@ -48,13 +48,13 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest "5:2: " + getCheckMessage(CLASS, UnnecessarySemicolonAfterOuterTypeDeclarationCheck.MSG_SEMI), }; - + - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/SEMI"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/SEMI"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { @@ -9691,18 +9691,18 @@ @@ -66,7 +66,7 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + getCheckMessage(CLASS, UnnecessarySemicolonAfterOuterTypeDeclarationCheck.MSG_SEMI), }; - + - final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/SEMI"); + final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/SEMI"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterTypeMemberDeclarationCheck; @@ -9710,15 +9710,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest +final class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest extends AbstractXpathTestSupport { - + private static final Class CLASS = @@ -38,7 +38,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -9727,7 +9727,7 @@ getPath( @@ -50,7 +50,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9736,7 +9736,7 @@ + "'SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMemberDeclaration']]" @@ -60,7 +60,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest } - + @Test - public void testTokens() throws Exception { + void tokens() throws Exception { @@ -9745,7 +9745,7 @@ getPath( @@ -75,7 +75,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9755,9 +9755,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonInEnumerationCheck; @@ -9765,40 +9765,40 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends AbstractXpathTestSupport { +final class XpathRegressionUnnecessarySemicolonInEnumerationTest extends AbstractXpathTestSupport { - + private final String checkName = UnnecessarySemicolonInEnumerationCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInEnumeration.java")); - + @@ -51,13 +51,13 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra }; - + final List expectedXpathQueries = - Collections.singletonList("/COMPILATION_UNIT/ENUM_DEF[./IDENT[@text='Bad']]/OBJBLOCK/SEMI"); + ImmutableList.of("/COMPILATION_UNIT/ENUM_DEF[./IDENT[@text='Bad']]/OBJBLOCK/SEMI"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInEnumerationAll.java")); - + @@ -72,7 +72,7 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9808,9 +9808,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonInTryWithResourcesCheck; @@ -9818,15 +9818,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest +final class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest extends AbstractXpathTestSupport { - + private final String checkName = @@ -38,7 +38,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -9844,7 +9844,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='m']]/SLIST/LITERAL_TRY" @@ -63,7 +63,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest } - + @Test - public void testAllowWhenNoBraceAfterSemicolon() throws Exception { + void allowWhenNoBraceAfterSemicolon() throws Exception { @@ -9853,7 +9853,7 @@ getPath( @@ -81,7 +81,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9863,9 +9863,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck; @@ -9873,41 +9873,41 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { +final class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { - + private final String checkName = UnusedImportsCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedImportsOne.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(UnusedImportsCheck.class); @@ -47,14 +47,14 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( "/COMPILATION_UNIT/IMPORT/DOT[./IDENT[@text='List']]/DOT/IDENT[@text='java']"); - + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedImportsTwo.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(UnusedImportsCheck.class); @@ -66,7 +66,7 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -9919,94 +9919,94 @@ @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSupport { +final class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSupport { private final String checkName = UnusedLocalVariableCheck.class.getSimpleName(); - + @Override @@ -35,7 +35,7 @@ public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSup } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedLocalVariableOne.java")); - + @@ -71,7 +71,7 @@ public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSup } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedLocalVariableTwo.java")); - + --- 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; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { +final class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { - + private final String checkName = UpperEllCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { } - + @Test - public void testUpperEllOne() throws Exception { + void upperEllOne() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUpperEllFirst.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(UpperEllCheck.class); @@ -59,7 +59,7 @@ public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { } - + @Test - public void testUpperEllTwo() throws Exception { + void upperEllTwo() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionUpperEllSecond.java")); - + final DefaultConfiguration moduleConfig = createModuleConfig(UpperEllCheck.class); --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java @@ -26,7 +26,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionVariableDeclarationUsageDistanceTest extends AbstractXpathTestSupport { +final class XpathRegressionVariableDeclarationUsageDistanceTest extends AbstractXpathTestSupport { private final String checkName = VariableDeclarationUsageDistanceCheck.class.getSimpleName(); - + @Override @@ -35,7 +35,7 @@ public class XpathRegressionVariableDeclarationUsageDistanceTest extends Abstrac } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionVariableDeclarationUsageDistance1.java")); - + @@ -79,7 +79,7 @@ public class XpathRegressionVariableDeclarationUsageDistanceTest extends Abstrac } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionVariableDeclarationUsageDistance2.java")); - + --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck; @@ -10014,24 +10014,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport { +final class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport { - + private final String checkName = WhitespaceAfterCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport } - + @Test - public void testWhitespaceAfterTypecast() throws Exception { + void whitespaceAfterTypecast() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionWhitespaceAfterTypecast.java")); - + @@ -48,7 +48,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -10040,16 +10040,16 @@ + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); @@ -57,7 +57,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport } - + @Test - public void testWhitespaceAfterNotFollowed() throws Exception { + void whitespaceAfterNotFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionWhitespaceAfterNotFollowed.java")); - + @@ -70,7 +70,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -10059,9 +10059,9 @@ --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java @@ -19,14 +19,14 @@ - + package org.checkstyle.suppressionxpathfilter; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck; @@ -10069,24 +10069,24 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSupport { +final class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSupport { - + private final String checkName = WhitespaceAroundCheck.class.getSimpleName(); - + @@ -36,7 +36,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor } - + @Test - public void testWhitespaceAroundNotPreceded() throws Exception { + void whitespaceAroundNotPreceded() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionWhitespaceAroundNotPreceded.java")); - + @@ -49,7 +49,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -10095,16 +10095,16 @@ + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN"); @@ -58,7 +58,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor } - + @Test - public void testWhitespaceAroundNotFollowed() throws Exception { + void whitespaceAroundNotFollowed() throws Exception { final File fileToProcess = new File(getPath("SuppressionXpathRegressionWhitespaceAroundNotFollowed.java")); - + @@ -71,7 +71,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor }; - + final List expectedXpathQueries = - Collections.singletonList( + ImmutableList.of( @@ -10116,7 +10116,7 @@ @@ -275,8 +275,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts a string to a pattern. */ private static final class PatternConverter implements Converter { - + - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") @@ -10126,7 +10126,7 @@ @@ -285,8 +285,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts strings to severity level. */ private static final class SeverityLevelConverter implements Converter { - + - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") @@ -10136,7 +10136,7 @@ @@ -295,8 +295,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts strings to scope. */ private static final class ScopeConverter implements Converter { - + - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") @@ -10146,7 +10146,7 @@ @@ -305,8 +305,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** A converter that converts strings to uri. */ private static final class UriConverter implements Converter { - + - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") @@ -10156,7 +10156,7 @@ @@ -329,8 +329,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali */ private static final class RelaxedStringArrayConverter implements Converter { - + - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") @@ -10166,7 +10166,7 @@ @@ -355,8 +355,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali /** Constant for optimization. */ private static final AccessModifierOption[] EMPTY_MODIFIER_ARRAY = new AccessModifierOption[0]; - + - @SuppressWarnings("unchecked") @Override + @SuppressWarnings("unchecked") @@ -10176,9 +10176,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static java.util.stream.Collectors.toUnmodifiableList; +import static java.util.stream.Collectors.toUnmodifiableSet; + @@ -10200,7 +10200,7 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); processFiles(targetFiles); - + // Finish up @@ -244,7 +246,7 @@ public class Checker extends AbstractAutomaticBean implements MessageDispatcher, resource -> { @@ -10209,14 +10209,14 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + /** Notify all listeners about the audit start. */ --- a/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkState; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -10232,13 +10232,13 @@ + checkState(METADATA.equals(qName), "Unknown name:%s.", qName); } } - + --- a/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.nio.charset.StandardCharsets.UTF_8; + @@ -10250,7 +10250,7 @@ import java.io.PrintWriter; import java.io.Writer; -import java.nio.charset.StandardCharsets; - + /** * Simple plain logger for text output. This is maybe not very suitable for a text output into a @@ -126,21 +128,17 @@ public class DefaultLogger extends AbstractAutomaticBean implements AuditListene @@ -10270,7 +10270,7 @@ - final Writer infoStreamWriter = new OutputStreamWriter(infoStream, StandardCharsets.UTF_8); + final Writer infoStreamWriter = new OutputStreamWriter(infoStream, UTF_8); infoWriter = new PrintWriter(infoStreamWriter); - + if (infoStream == errorStream) { errorWriter = infoWriter; } else { @@ -10282,28 +10282,28 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle; - + +import com.google.common.collect.ImmutableSet; import java.util.Set; - + /** Contains constant definitions common to the package. */ @@ -29,7 +30,7 @@ public final class Definitions { - + /** Name of modules which are not checks, but are internal modules. */ public static final Set INTERNAL_MODULES = - Set.of( + ImmutableSet.of( "com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper", "com.puppycrawl.tools.checkstyle.site.ClassAndPropertiesSettersJavadocScraper"); - + --- a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java @@ -19,20 +19,22 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static java.util.Objects.requireNonNullElseGet; +import static java.util.stream.Collectors.toCollection; +import static java.util.stream.Collectors.toUnmodifiableList; @@ -10332,7 +10332,7 @@ .filter(child -> !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) - .collect(Collectors.toUnmodifiableList())); + .collect(toUnmodifiableList())); - + // 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 !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) - .collect(Collectors.toUnmodifiableList())); + .collect(toUnmodifiableList())); - + // We add C style array declarator brackets to TYPE ast final DetailAstImpl typeAst = @@ -862,7 +864,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); + requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); - + DetailAstPair.addAstChild(currentAst, expressionList); DetailAstPair.addAstChild(currentAst, create(ctx.RPAREN())); @@ -1458,8 +1459,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); + requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); - + methodCall.addChild(expressionList); methodCall.addChild(create((Token) ctx.RPAREN().getPayload())); @@ -1526,7 +1526,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor descendantList = binOpList.parallelStream() .map(this::getInnerBopAst) - .collect(Collectors.toCollection(ConcurrentLinkedQueue::new)); + .collect(toCollection(ConcurrentLinkedQueue::new)); - + bop.addChild(descendantList.poll()); DetailAstImpl pointer = bop.getFirstChild(); @@ -1602,8 +1602,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); + requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); - + final DetailAstImpl dot = create(ctx.DOT()); dot.addChild(visit(ctx.expr())); @@ -1636,8 +1635,8 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor buildSimpleStringTemplateArgument(ctx)); } - + @@ -1773,7 +1772,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); + requireNonNullElseGet( + visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); root.addChild(expressionList); - + root.addChild(create(ctx.RPAREN())); @@ -2127,8 +2126,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor(packageNames); @@ -147,14 +150,10 @@ public class PackageObjectFactory implements ModuleFactory { @@ -10700,12 +10700,12 @@ - } + checkArgument(moduleClassLoader != null, NULL_LOADER_MESSAGE); + checkArgument(packageName != null, NULL_PACKAGE_MESSAGE); - + - packages = Collections.singleton(packageName); + packages = ImmutableSet.of(packageName); this.moduleClassLoader = moduleClassLoader; } - + @@ -272,7 +271,7 @@ public class PackageObjectFactory implements ModuleFactory { returnValue = createObject(fullModuleNames.iterator().next()); } else { @@ -10740,7 +10740,7 @@ + .map(Entry::getKey) .orElse(fullName); } - + @@ -333,7 +331,7 @@ public class PackageObjectFactory implements ModuleFactory { private static String joinPackageNamesWithClassName(String className, Set packages) { return packages.stream() @@ -10762,9 +10762,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java @@ -19,10 +19,12 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.toUnmodifiableMap; @@ -10773,7 +10773,7 @@ import java.util.Properties; -import java.util.function.Function; -import java.util.stream.Collectors; - + /** Resolves external properties from an underlying {@code Properties} object. */ public final class PropertiesExpander implements PropertyResolver { @@ -37,12 +39,10 @@ public final class PropertiesExpander implements PropertyResolver { @@ -10789,14 +10789,14 @@ - .collect(Collectors.toUnmodifiableMap(Function.identity(), properties::getProperty)); + .collect(toUnmodifiableMap(identity(), properties::getProperty)); } - + @Override --- a/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkArgument; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -10820,9 +10820,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.nio.charset.StandardCharsets.UTF_8; + @@ -10862,9 +10862,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinter.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static java.util.stream.Collectors.joining; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -10875,7 +10875,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.stream.Collectors; - + /** Class for constructing xpath queries to suppress nodes with specified line and column number. */ public final class SuppressionsStringPrinter { @@ -98,6 +99,6 @@ public final class SuppressionsStringPrinter { @@ -10889,13 +10889,13 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/ThreadModeSettings.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/ThreadModeSettings.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkArgument; + import java.io.Serializable; - + /** @@ -93,14 +95,12 @@ public class ThreadModeSettings implements Serializable { */ @@ -10916,14 +10916,14 @@ + !TREE_WALKER_MODULE_NAME.equals(name), + "Multi thread mode for TreeWalker module is not implemented"); } - + return name; --- a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java @@ -19,6 +19,10 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static java.util.Comparator.naturalOrder; +import static java.util.Comparator.nullsLast; +import static java.util.stream.Collectors.toUnmodifiableSet; @@ -10937,7 +10937,7 @@ import java.util.TreeSet; -import java.util.stream.Collectors; 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 resource -> { @@ -10946,7 +10946,7 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + /** @@ -403,8 +406,8 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe private static SortedSet createNewCheckSortedSet() { @@ -10957,14 +10957,14 @@ + .thenComparing(AbstractCheck::getId, nullsLast(naturalOrder())) + .thenComparingInt(AbstractCheck::hashCode)); } - + /** State of AST. Indicates whether tree contains certain nodes. */ --- a/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java @@ -19,6 +19,10 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Collections.synchronizedList; @@ -10994,26 +10994,26 @@ + checkArgument(outputStreamOptions != null, "Parameter outputStreamOptions can not be null"); closeStream = outputStreamOptions == OutputStreamOptions.CLOSE; } - + @@ -328,10 +328,10 @@ public class XMLLogger extends AbstractAutomaticBean implements AuditListener { private static final class FileMessages { - + /** The file error events. */ - private final List errors = Collections.synchronizedList(new ArrayList<>()); + private final List errors = synchronizedList(new ArrayList<>()); - + /** The file exceptions. */ - private final List exceptions = Collections.synchronizedList(new ArrayList<>()); + private final List exceptions = synchronizedList(new ArrayList<>()); - + /** * Returns the file error events. --- a/src/main/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListener.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListener.java @@ -19,13 +19,14 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static java.nio.charset.StandardCharsets.UTF_8; + import com.puppycrawl.tools.checkstyle.api.AuditEvent; @@ -11023,7 +11023,7 @@ import java.io.OutputStreamWriter; import java.io.PrintWriter; -import java.nio.charset.StandardCharsets; - + /** * Generates suppressions.xml file, based on violations occurred. See issue { @@ -11241,7 +11241,7 @@ +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java @@ -265,8 +265,8 @@ public class AvoidEscapedUnicodeCharactersCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -11252,14 +11252,14 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java @@ -19,7 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks; - + -import java.nio.charset.StandardCharsets; +import static java.nio.charset.StandardCharsets.US_ASCII; + import java.util.Arrays; - + /** @@ -55,7 +56,7 @@ public enum LineSeparatorOption { * @param sep the line separator, e.g. "\r\n" @@ -11268,14 +11268,14 @@ - lineSeparator = sep.getBytes(StandardCharsets.US_ASCII); + lineSeparator = sep.getBytes(US_ASCII); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks; - + +import static java.util.Collections.enumeration; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -11296,14 +11296,14 @@ - return Collections.enumeration(keyList); + return enumeration(keyList); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java @@ -19,12 +19,14 @@ - + package com.puppycrawl.tools.checkstyle.checks; - + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.common.collect.ImmutableList; @@ -11348,9 +11348,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.Definitions; @@ -11363,7 +11363,7 @@ -import java.util.stream.Collectors; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - + @@ -228,7 +229,7 @@ public class TranslationCheck extends AbstractFileSetCheck { * @since 6.11 */ @@ -11372,7 +11372,7 @@ + requiredTranslations = Arrays.stream(translationCodes).collect(toUnmodifiableSet()); validateUserSpecifiedLanguageCodes(requiredTranslations); } - + @@ -501,7 +502,7 @@ public class TranslationCheck extends AbstractFileSetCheck { final Set missingKeys = keysThatMustExist.stream() @@ -11385,15 +11385,15 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -60,7 +61,7 @@ public class UncommentedMainCheck extends AbstractCheck { - + /** Set of possible String array types. */ private static final Set STRING_PARAMETER_NAMES = - Set.of( @@ -11404,9 +11404,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.annotation; - + +import static java.util.Objects.requireNonNullElse; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -11425,9 +11425,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java @@ -19,13 +19,14 @@ - + package com.puppycrawl.tools.checkstyle.checks.annotation; - + +import static java.util.Objects.requireNonNullElse; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -11439,20 +11439,20 @@ -import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; - + @@ -162,7 +163,7 @@ public class SuppressWarningsCheck extends AbstractCheck { final DetailAST token = warningHolder.findFirstToken(TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR); - + // case like '@SuppressWarnings(value = UNUSED)' - final DetailAST parent = Objects.requireNonNullElse(token, warningHolder); + final DetailAST parent = requireNonNullElse(token, warningHolder); DetailAST warning = parent.findFirstToken(TokenTypes.EXPR); - + // rare case with empty array ex: @SuppressWarnings({}) @@ -242,10 +243,10 @@ public class SuppressWarningsCheck extends AbstractCheck { final DetailAST annValuePair = annotation.findFirstToken(TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR); - + - final DetailAST annArrayInitParent = Objects.requireNonNullElse(annValuePair, annotation); + final DetailAST annArrayInitParent = requireNonNullElse(annValuePair, annotation); final DetailAST annArrayInit = @@ -11460,7 +11460,7 @@ - return Objects.requireNonNullElse(annArrayInit, annotation); + return requireNonNullElse(annArrayInit, annotation); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java @@ -11477,9 +11477,9 @@ --- 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 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import static java.util.stream.Collectors.toCollection; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -11490,7 +11490,7 @@ import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; - + /** * Checks that certain exception types do not appear in a {@code catch} statement. @@ -74,7 +75,7 @@ public final class IllegalCatchCheck extends AbstractCheck { @@ -11499,15 +11499,15 @@ }) - .collect(Collectors.toCollection(HashSet::new)); + .collect(toCollection(HashSet::new)); - + /** * Setter to specify exception class names to reject. --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -11518,7 +11518,7 @@ import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; - + /** * Checks for illegal instantiations where a factory method is preferred. @@ -314,6 +315,6 @@ public class IllegalInstantiationCheck extends AbstractCheck { @@ -11532,9 +11532,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import static java.util.stream.Collectors.toCollection; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -11545,7 +11545,7 @@ import java.util.HashSet; import java.util.Set; -import java.util.stream.Collectors; - + /** * Checks that specified types are not declared to be thrown. Declaring that a method throws {@code @@ -69,7 +70,7 @@ public final class IllegalThrowsCheck extends AbstractCheck { @@ -11554,7 +11554,7 @@ }) - .collect(Collectors.toCollection(HashSet::new)); + .collect(toCollection(HashSet::new)); - + /** Specify throw class names to reject. */ private final Set illegalClassNames = @@ -82,7 +83,7 @@ public final class IllegalThrowsCheck extends AbstractCheck { @@ -11563,15 +11563,15 @@ }) - .collect(Collectors.toCollection(HashSet::new)); + .collect(toCollection(HashSet::new)); - + /** * Allow to ignore checking overridden methods (marked with {@code Override} or {@code --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java @@ -19,12 +19,14 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import static java.util.Objects.requireNonNullElse; +import static java.util.regex.Pattern.CASE_INSENSITIVE; + @@ -11582,7 +11582,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; -import java.util.Objects; import java.util.regex.Pattern; - + /** @@ -125,7 +127,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { * @since 3.2 @@ -11591,7 +11591,7 @@ - this.message = Objects.requireNonNullElse(message, ""); + this.message = requireNonNullElse(message, ""); } - + /** @@ -157,7 +159,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { private void updateRegexp() { @@ -11605,9 +11605,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.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; @@ -11633,9 +11633,9 @@ --- 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 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -11646,7 +11646,7 @@ import java.util.List; import java.util.Set; -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 { @@ -11656,14 +11656,14 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -11683,14 +11683,14 @@ - parameterNames = Collections.emptySet(); + parameterNames = ImmutableSet.of(); } - + @Override --- 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 @@ - + package com.puppycrawl.tools.checkstyle.checks.coding; - + +import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -11701,7 +11701,7 @@ import java.util.Optional; import java.util.Set; -import java.util.stream.Collectors; - + /** * Checks that a local variable is declared and/or assigned, but not used. Doesn't support DEFAULT_IGNORE_ANNOTATIONS = - Set.of( @@ -11848,14 +11848,14 @@ - .collect(Collectors.toCollection(HashSet::new)); + .collect(toCollection(HashSet::new)); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.checks.header; - + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.common.collect.ImmutableSet; @@ -11882,11 +11882,11 @@ + readerLines.isEmpty(), + "header has already been set - " + "set either header or headerFile, not both"); } - + /** @@ -190,9 +191,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck final Set result; - + if (headerFile == null) { - result = Collections.emptySet(); + result = ImmutableSet.of(); @@ -11894,14 +11894,14 @@ - result = Collections.singleton(headerFile.toString()); + result = ImmutableSet.of(headerFile.toString()); } - + return result; --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.header; - + +import static com.google.common.base.Preconditions.checkArgument; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -11921,9 +11921,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.imports; - + +import static com.google.common.base.Preconditions.checkArgument; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -11947,9 +11947,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.imports; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -11961,10 +11961,10 @@ -import java.util.Collections; import java.util.Set; import java.util.regex.Pattern; - + @@ -167,8 +167,8 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -11973,20 +11973,20 @@ currentImportControl = null; processCurrentFile = path.matcher(getFilePath()).find(); @@ -207,7 +207,7 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc - + @Override public Set getExternalResourceLocations() { - return Collections.singleton(file.toString()); + return ImmutableSet.of(file.toString()); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.imports; - + +import static com.google.common.base.Preconditions.checkArgument; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -12006,9 +12006,9 @@ --- 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 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser; @@ -12019,7 +12019,7 @@ import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; - + /** * Base class for Checks that process Javadoc comments. @@ -182,9 +183,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { @@ -12036,9 +12036,9 @@ --- 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 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -12049,7 +12049,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.stream.Collectors; - + /** * Checks that a allowedAnnotations = Set.of("Override"); + private Set allowedAnnotations = ImmutableSet.of("Override"); - + /** * Setter to control whether to validate {@code throws} tags. --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java @@ -257,8 +257,8 @@ public class JavadocStyleCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12095,9 +12095,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java @@ -19,6 +19,10 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.toUnmodifiableMap; @@ -12111,7 +12111,7 @@ import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - + /** * This enum defines the various Javadoc tags and their properties. @@ -299,11 +301,9 @@ public enum JavadocTagInfo { @@ -12126,7 +12126,7 @@ - .collect(Collectors.toUnmodifiableMap(JavadocTagInfo::getName, Function.identity())); + Arrays.stream(values).collect(toUnmodifiableMap(JavadocTagInfo::getName, identity())); } - + /** The tag text. * */ @@ -376,15 +376,11 @@ public enum JavadocTagInfo { * @throws IllegalArgumentException if the text is not a valid tag @@ -12136,14 +12136,14 @@ - throw new IllegalArgumentException("the text is null"); - } + checkArgument(text != null, "the text is null"); - + final JavadocTagInfo tag = TEXT_TO_TAG.get(text); - + - if (tag == null) { - throw new IllegalArgumentException("the text [" + text + "] is not a valid Javadoc tag text"); - } + checkArgument(tag != null, "the text [%s] is not a valid Javadoc tag text", text); - + return tag; } @@ -399,15 +395,11 @@ public enum JavadocTagInfo { @@ -12154,22 +12154,22 @@ - throw new IllegalArgumentException("the name is null"); - } + checkArgument(name != null, "the name is null"); - + final JavadocTagInfo tag = NAME_TO_TAG.get(name); - + - if (tag == null) { - throw new IllegalArgumentException("the name [" + name + "] is not a valid Javadoc tag name"); - } + checkArgument(tag != null, "the name [%s] is not a valid Javadoc tag name", name); - + return tag; } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -12180,12 +12180,12 @@ */ - private Set allowedAnnotations = Set.of("Generated"); + private Set allowedAnnotations = ImmutableSet.of("Generated"); - + /** * Setter to specify the visibility scope where Javadoc comments are checked. @@ -256,8 +257,8 @@ public class JavadocTypeCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12197,7 +12197,7 @@ +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java @@ -126,8 +126,8 @@ public class JavadocVariableCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12208,25 +12208,25 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -141,7 +142,7 @@ public class MissingJavadocMethodCheck extends AbstractCheck { private Pattern ignoreMethodNamesRegex; - + /** Configure annotations that allow missed documentation. */ - private Set allowedAnnotations = Set.of("Override"); + private Set allowedAnnotations = ImmutableSet.of("Override"); - + /** * Setter to configure annotations that allow missed documentation. @@ -225,8 +226,8 @@ public class MissingJavadocMethodCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12237,9 +12237,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -12250,12 +12250,12 @@ */ - private Set skipAnnotations = Set.of("Generated"); + private Set skipAnnotations = ImmutableSet.of("Generated"); - + /** * Setter to specify the visibility scope where Javadoc comments are checked. @@ -143,8 +144,8 @@ public class MissingJavadocTypeCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12266,9 +12266,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.javadoc; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -12279,14 +12279,14 @@ */ - private Set ignoredTags = Set.of(); + private Set ignoredTags = ImmutableSet.of(); - + /** * Control whether DEFAULT_EXCLUDED_PACKAGES = Collections.emptySet(); + private static final Set DEFAULT_EXCLUDED_PACKAGES = ImmutableSet.of(); - + /** Pattern to match brackets in a full type name. */ private static final Pattern BRACKET_PATTERN = Pattern.compile("\\[[^]]*]"); @@ -208,12 +210,12 @@ public abstract class AbstractClassCouplingCheck extends AbstractCheck { @@ -12391,15 +12391,15 @@ + invalidIdentifiers.isEmpty(), + "the following values are not valid identifiers: %s", + invalidIdentifiers); - + this.excludedPackages = Set.of(excludedPackages); } --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.checks.naming; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; @@ -12410,7 +12410,7 @@ import java.util.List; import java.util.Set; -import java.util.stream.Collectors; - + /** * Validates abbreviations (consecutive capital letters) length in identifier name, it also allows @@ -199,8 +200,7 @@ public class AbbreviationAsWordInNameCheck extends AbstractCheck { @@ -12422,7 +12422,7 @@ + this.allowedAbbreviations = Arrays.stream(allowedAbbreviations).collect(toUnmodifiableSet()); } } - + --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheck.java @@ -22,7 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.naming; @@ -12430,13 +12430,13 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.TokenUtil; -import java.util.Objects; - + /** * 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; - + - if (Objects.nonNull(ast.findFirstToken(TokenTypes.PARAMETERS))) { + if (ast.findFirstToken(TokenTypes.PARAMETERS) != null) { final DetailAST parametersNode = ast.findFirstToken(TokenTypes.PARAMETERS); @@ -12445,9 +12445,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.checks.regexp; - + +import static java.util.Objects.requireNonNullElse; +import static java.util.regex.Pattern.CASE_INSENSITIVE; + @@ -12477,16 +12477,16 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.checks.regexp; - + +import com.google.common.base.Strings; import com.puppycrawl.tools.checkstyle.api.FileText; import com.puppycrawl.tools.checkstyle.api.LineColumn; import java.util.regex.Matcher; @@ -69,7 +70,7 @@ class MultilineDetector { resetState(); - + final String format = options.getFormat(); - if (format == null || format.isEmpty()) { + if (Strings.isNullOrEmpty(format)) { @@ -12496,9 +12496,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.checks.regexp; - + +import static java.util.regex.Pattern.MULTILINE; + +import com.google.common.base.Strings; @@ -12507,11 +12507,11 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -151,7 +154,7 @@ public class RegexpCheck extends AbstractCheck { private int errorCount; - + /** 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 { @@ -12521,11 +12521,11 @@ - format = CommonUtil.createPattern(pattern.pattern(), Pattern.MULTILINE); + format = CommonUtil.createPattern(pattern.pattern(), MULTILINE); } - + @Override @@ -237,8 +240,8 @@ public class RegexpCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12536,7 +12536,7 @@ @@ -336,7 +339,7 @@ public class RegexpCheck extends AbstractCheck { private String getMessage() { String msg; - + - if (message == null || message.isEmpty()) { + if (Strings.isNullOrEmpty(message)) { msg = format.pattern(); @@ -12545,9 +12545,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java @@ -19,13 +19,15 @@ - + package com.puppycrawl.tools.checkstyle.checks.regexp; - + +import static java.util.regex.Pattern.DOTALL; +import static java.util.regex.Pattern.MULTILINE; + @@ -12558,12 +12558,12 @@ import com.puppycrawl.tools.checkstyle.api.FileText; import java.io.File; -import java.util.regex.Pattern; - + /** * 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; - + if (matchAcrossLines) { - result = Pattern.DOTALL; + result = DOTALL; @@ -12571,13 +12571,13 @@ - result = Pattern.MULTILINE; + result = MULTILINE; } - + return result; --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java @@ -102,8 +102,8 @@ public class RegexpSinglelineJavaCheck extends AbstractCheck { } - + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 - @SuppressWarnings("deprecation") @Override @@ -12610,9 +12610,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilter.java @@ -19,13 +19,13 @@ - + package com.puppycrawl.tools.checkstyle.filters; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean; import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; @@ -12625,20 +12625,20 @@ import java.util.Objects; import java.util.Set; @@ -186,7 +186,7 @@ public class SuppressionXpathFilter extends AbstractAutomaticBean - + @Override public Set getExternalResourceLocations() { - return Collections.singleton(file); + return ImmutableSet.of(file); } - + @Override --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElement.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElement.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.filters; - + +import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; @@ -12666,9 +12666,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTable.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTable.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.gui; - + +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toCollection; + @@ -12699,14 +12699,14 @@ - .collect(Collectors.joining(NEWLINE, "", NEWLINE)); + .collect(joining(NEWLINE, "", NEWLINE)); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraper.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraper.java @@ -19,6 +19,10 @@ - + package com.puppycrawl.tools.checkstyle.meta; - + +import static java.util.Collections.unmodifiableMap; +import static java.util.stream.Collectors.joining; + @@ -12729,7 +12729,7 @@ -import java.util.stream.Collectors; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; - + @@ -98,7 +100,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { * files. */ @@ -12746,7 +12746,7 @@ - .collect(Collectors.joining(" ")); + .collect(joining(" ")); } - + /** @@ -594,7 +596,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { * @return map containing module details of supplied checks. @@ -12755,7 +12755,7 @@ - return Collections.unmodifiableMap(MODULE_DETAILS_STORE); + return unmodifiableMap(MODULE_DETAILS_STORE); } - + /** Reset the module detail store of any previous information. */ @@ -673,7 +675,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { return getFirstChildOfType(ast, JavadocTokenTypes.TEXT, 0) @@ -12770,9 +12770,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtil.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.meta; - + +import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; @@ -12784,7 +12784,7 @@ import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; - + /** Class which handles all the metadata generation and writing calls. */ @@ -98,7 +99,7 @@ public final class MetadataGeneratorUtil { || fileName.endsWith("Check.java") @@ -12794,19 +12794,19 @@ + .collect(toUnmodifiableList())); } } - + --- a/src/main/java/com/puppycrawl/tools/checkstyle/meta/ModuleDetails.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/meta/ModuleDetails.java @@ -19,8 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.meta; - + +import static java.util.Collections.unmodifiableList; + import java.util.ArrayList; -import java.util.Collections; import java.util.List; - + /** Simple POJO class for module details. */ @@ -125,7 +126,7 @@ public final class ModuleDetails { * @return property list of module @@ -12815,7 +12815,7 @@ - return Collections.unmodifiableList(properties); + return unmodifiableList(properties); } - + /** @@ -152,7 +153,7 @@ public final class ModuleDetails { * @return violation message keys of module @@ -12824,14 +12824,14 @@ - return Collections.unmodifiableList(violationMessageKeys); + return unmodifiableList(violationMessageKeys); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/ClassAndPropertiesSettersJavadocScraper.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/ClassAndPropertiesSettersJavadocScraper.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.site; - + +import static java.util.Collections.unmodifiableMap; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; @@ -12852,14 +12852,14 @@ - return Collections.unmodifiableMap(JAVADOC_FOR_MODULE_OR_PROPERTY); + return unmodifiableMap(JAVADOC_FOR_MODULE_OR_PROPERTY); } - + @Override --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/ExampleMacro.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/ExampleMacro.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.site; - + +import static java.util.stream.Collectors.joining; + import java.io.IOException; @@ -12880,7 +12880,7 @@ - .collect(Collectors.joining(NEWLINE)); + .collect(joining(NEWLINE)); } - + /** @@ -136,7 +137,7 @@ public class ExampleMacro extends AbstractMacro { .dropWhile(line -> !line.contains(CODE_SNIPPET_START)) @@ -12889,14 +12889,14 @@ - .collect(Collectors.joining(NEWLINE)); + .collect(joining(NEWLINE)); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/PropertiesMacro.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/PropertiesMacro.java @@ -19,6 +19,10 @@ - + package com.puppycrawl.tools.checkstyle.site; - + +import static java.util.Collections.unmodifiableSet; +import static java.util.stream.Collectors.toUnmodifiableList; + @@ -12920,7 +12920,7 @@ import org.apache.maven.doxia.macro.Macro; import org.apache.maven.doxia.macro.MacroExecutionException; @@ -54,16 +56,15 @@ public class PropertiesMacro extends AbstractMacro { - + /** Set of properties not inherited from the base token configuration. */ public static final Set NON_BASE_TOKEN_PROPERTIES = - Collections.unmodifiableSet( @@ -12942,7 +12942,7 @@ + "MagicNumber - constantWaiverParentToken", + "MultipleStringLiterals - ignoreOccurrenceContext", + })); - + /** The precompiled pattern for a comma followed by a space. */ private static final Pattern COMMA_SPACE_PATTERN = Pattern.compile(", "); @@ -334,7 +335,7 @@ public class PropertiesMacro extends AbstractMacro { @@ -12952,7 +12952,7 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); sink.text("subset of tokens"); - + writeTokensList(sink, configurableTokens, SiteUtil.PATH_TO_TOKEN_TYPES, true); @@ -346,7 +347,7 @@ public class PropertiesMacro extends AbstractMacro { check.getAcceptableJavadocTokens(), check.getRequiredJavadocTokens()) @@ -12984,9 +12984,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java @@ -19,6 +19,14 @@ - + package com.puppycrawl.tools.checkstyle.site; - + +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toCollection; +import static java.util.stream.Collectors.toUnmodifiableList; @@ -13007,13 +13007,13 @@ import java.util.stream.Stream; import javax.annotation.Nullable; @@ -156,7 +163,7 @@ public final class SiteUtil { - + /** Set of properties that are undocumented. Those are internal properties. */ private static final Set UNDOCUMENTED_PROPERTIES = - Set.of( + ImmutableSet.of( "SuppressWithNearbyCommentFilter.fileContents", "SuppressionCommentFilter.fileContents"); - + /** Properties that can not be gathered from class instance. */ @@ -480,7 +487,7 @@ public final class SiteUtil { (path, attr) -> { @@ -13026,7 +13026,7 @@ } @@ -507,7 +514,7 @@ public final class SiteUtil { } - + // If parent class is not found, check interfaces - if (parentModuleName == null || parentModuleName.isEmpty()) { + if (Strings.isNullOrEmpty(parentModuleName)) { @@ -13036,7 +13036,7 @@ @@ -517,7 +524,7 @@ public final class SiteUtil { } } - + - if (parentModuleName == null || parentModuleName.isEmpty()) { + if (Strings.isNullOrEmpty(parentModuleName)) { final String message = @@ -13069,7 +13069,7 @@ - .collect(Collectors.joining(COMMA_SPACE))); + Arrays.stream((Pattern[]) value).map(Pattern::pattern).collect(joining(COMMA_SPACE))); } - + if (result.isEmpty()) { @@ -1021,8 +1026,7 @@ public final class SiteUtil { result = ""; @@ -13080,7 +13080,7 @@ + result = valuesStream.map(String.class::cast).sorted().collect(joining(COMMA_SPACE)); } } - + @@ -1063,10 +1067,7 @@ public final class SiteUtil { private static String getIntArrayPropertyValue(Object value) { try (IntStream stream = getIntStream(value)) { @@ -13105,14 +13105,14 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/site/XdocsTemplateParser.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/site/XdocsTemplateParser.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.site; - + +import com.google.common.base.Strings; import java.io.File; import java.io.IOException; @@ -13120,7 +13120,7 @@ @@ -119,7 +120,7 @@ public class XdocsTemplateParser extends XdocParser { private void processMacroStart(XmlPullParser parser) throws MacroExecutionException { macroName = parser.getAttributeValue(null, Attribute.NAME.toString()); - + - if (macroName == null || macroName.isEmpty()) { + if (Strings.isNullOrEmpty(macroName)) { final String message = @@ -13134,13 +13134,13 @@ + if (!Strings.isNullOrEmpty(macroName)) { final String paramName = parser.getAttributeValue(null, Attribute.NAME.toString()); final String paramValue = parser.getAttributeValue(null, Attribute.VALUE.toString()); - + --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtil.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.common.collect.ImmutableSet; @@ -13149,11 +13149,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -38,7 +41,7 @@ public final class AnnotationUtil { private static final String FQ_OVERRIDE = "java.lang." + OVERRIDE; - + /** Simple and fully-qualified {@link Override Override} annotation names. */ - private static final Set OVERRIDE_ANNOTATIONS = Set.of(OVERRIDE, FQ_OVERRIDE); + private static final Set OVERRIDE_ANNOTATIONS = ImmutableSet.of(OVERRIDE, FQ_OVERRIDE); - + /** * Private utility constructor. @@ -92,9 +95,7 @@ public final class AnnotationUtil { @@ -13175,9 +13175,9 @@ - throw new IllegalArgumentException(THE_AST_IS_NULL); - } + checkArgument(ast != null, THE_AST_IS_NULL); - + final DetailAST annotationHolder; - + @@ -182,17 +181,11 @@ public final class AnnotationUtil { * @throws IllegalArgumentException when ast or annotations are null; when annotation is blank */ @@ -13186,25 +13186,25 @@ - throw new IllegalArgumentException(THE_AST_IS_NULL); - } + checkArgument(ast != null, THE_AST_IS_NULL); - + - if (annotation == null) { - throw new IllegalArgumentException("the annotation is null"); - } + checkArgument(annotation != null, "the annotation is null"); - + - if (CommonUtil.isBlank(annotation)) { - throw new IllegalArgumentException("the annotation is empty or spaces"); - } + checkArgument(!CommonUtil.isBlank(annotation), "the annotation is empty or spaces"); - + return findFirstAnnotation( ast, --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtil.java @@ -19,6 +19,11 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.function.Predicate.not; +import static java.util.stream.Collectors.joining; @@ -13221,7 +13221,7 @@ import java.util.regex.Pattern; -import java.util.stream.Collectors; import java.util.stream.Stream; - + /** Contains utility methods for the checks. */ @@ -315,9 +318,7 @@ public final class CheckUtil { */ @@ -13231,7 +13231,7 @@ - throw new IllegalArgumentException("expected non-null AST-token with type 'MODIFIERS'"); - } + checkArgument(modifiersToken != null, "expected non-null AST-token with type 'MODIFIERS'"); - + AccessModifierOption accessModifier = AccessModifierOption.PACKAGE; for (DetailAST token = modifiersToken.getFirstChild(); @@ -369,8 +370,8 @@ public final class CheckUtil { @@ -13243,16 +13243,16 @@ + .filter(not(String::isEmpty)) + .collect(toUnmodifiableSet()); } - + /** @@ -391,7 +392,7 @@ public final class CheckUtil { - + return lines.stream() .map(line -> stripIndentAndTrailingWhitespaceFromLine(line, indent)) - .collect(Collectors.joining(System.lineSeparator(), suffix, suffix)); + .collect(joining(System.lineSeparator(), suffix, suffix)); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java @@ -13271,14 +13271,14 @@ - return Objects.isNull(value) || indexOfNonWhitespace(value) >= value.length(); + return value == null || indexOfNonWhitespace(value) >= value.length(); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtil.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static com.google.common.base.Preconditions.checkArgument; + import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -13294,7 +13294,7 @@ + checkArgument(name != null, "%s%s", UNKNOWN_JAVADOC_TOKEN_ID_EXCEPTION_MESSAGE, id); return name; } - + @@ -277,9 +277,7 @@ public final class JavadocUtil { */ public static int getTokenId(String name) { @@ -13305,13 +13305,13 @@ + checkArgument(id != null, "Unknown javadoc token name. Given name %s", name); return id; } - + --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtil.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import com.google.common.reflect.ClassPath; @@ -13322,7 +13322,7 @@ import java.util.Collection; import java.util.Set; -import java.util.stream.Collectors; - + /** Contains utility methods for module reflection. */ public final class ModuleReflectionUtil { @@ -57,7 +58,7 @@ public final class ModuleReflectionUtil { @@ -13332,14 +13332,14 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtil.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static java.util.Objects.requireNonNullElseGet; + import com.puppycrawl.tools.checkstyle.api.DetailAST; @@ -13353,14 +13353,14 @@ - .orElseGet(() -> getDefaultScope(aMods)); + return requireNonNullElseGet(getDeclaredScopeFromMods(aMods), () -> getDefaultScope(aMods)); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java @@ -19,6 +19,10 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.function.Predicate.not; +import static java.util.stream.Collectors.toUnmodifiableMap; @@ -13374,7 +13374,7 @@ 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 { public static Map nameToValueMapFromPublicIntFields(Class cls) { @@ -13383,7 +13383,7 @@ - .collect(Collectors.toUnmodifiableMap(Field::getName, fld -> getIntFromField(fld, null))); + .collect(toUnmodifiableMap(Field::getName, fld -> getIntFromField(fld, null))); } - + /** @@ -102,7 +105,7 @@ public final class TokenUtil { */ @@ -13392,7 +13392,7 @@ - .collect(Collectors.toUnmodifiableMap(Map.Entry::getValue, Map.Entry::getKey)); + .collect(toUnmodifiableMap(Map.Entry::getValue, Map.Entry::getKey)); } - + /** @@ -134,9 +137,7 @@ public final class TokenUtil { */ @@ -13404,7 +13404,7 @@ + checkArgument(name != null, String.format(Locale.ROOT, TOKEN_ID_EXCEPTION_FORMAT, id)); return name; } - + @@ -149,10 +150,7 @@ public final class TokenUtil { */ public static int getTokenId(String name) { @@ -13416,7 +13416,7 @@ + checkArgument(id != null, String.format(Locale.ROOT, TOKEN_NAME_EXCEPTION_FORMAT, name)); return id; } - + @@ -164,10 +162,9 @@ public final class TokenUtil { * @throws IllegalArgumentException when name is unknown */ @@ -13428,7 +13428,7 @@ + checkArgument( + TOKEN_NAME_TO_VALUE.containsKey(name), + String.format(Locale.ROOT, TOKEN_NAME_EXCEPTION_FORMAT, name)); - + 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 { @@ -13443,9 +13443,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/UnmodifiableCollectionUtil.java @@ -19,13 +19,15 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static java.util.stream.Collectors.toUnmodifiableList; + +import com.google.common.collect.ImmutableSet; @@ -13456,7 +13456,7 @@ import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; - + /** * Note: it simply wraps the existing JDK methods to provide a workaround for Pitest survival on @@ -68,7 +70,7 @@ public final class UnmodifiableCollectionUtil { @@ -13466,7 +13466,7 @@ - return items.stream().map(elementType::cast).collect(Collectors.toUnmodifiableList()); + return items.stream().map(elementType::cast).collect(toUnmodifiableList()); } - + /** @@ -103,6 +105,6 @@ public final class UnmodifiableCollectionUtil { * @return immutable set @@ -13479,9 +13479,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static java.util.stream.Collectors.joining; + import com.puppycrawl.tools.checkstyle.AstTreeStringPrinter; @@ -13507,9 +13507,9 @@ --- a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java @@ -19,7 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.xpath; - + -import java.util.Collections; +import static java.util.Collections.unmodifiableList; + @@ -13523,14 +13523,14 @@ - return Collections.unmodifiableList(children); + return unmodifiableList(children); } - + /** --- a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGenerator.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGenerator.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.xpath; - + +import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; @@ -13541,7 +13541,7 @@ import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; - + /** * Generates xpath queries. Xpath queries are generated based on received {@code DetailAst} element, @@ -145,7 +146,7 @@ public class XpathQueryGenerator { @@ -13551,14 +13551,14 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); } - + /** --- 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; import org.apache.commons.beanutils.Converter; import org.junit.jupiter.api.Test; - + -public class AbstractAutomaticBeanTest { +final class AbstractAutomaticBeanTest { @Test @@ -13569,7 +13569,7 @@ conf.addProperty("NonExistent", "doesn't matter"); @@ -53,7 +53,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testConfigureNoSuchAttribute2() { + void configureNoSuchAttribute2() { @@ -13578,7 +13578,7 @@ conf.addProperty("privateField", "doesn't matter"); @@ -70,7 +70,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testSetupChildFromBaseClass() throws CheckstyleException { + void setupChildFromBaseClass() throws CheckstyleException { @@ -13587,7 +13587,7 @@ testBean.setupChild(null); @@ -90,7 +90,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testSetupInvalidChildFromBaseClass() { + void setupInvalidChildFromBaseClass() { @@ -13596,7 +13596,7 @@ final DefaultConfiguration childConf = new DefaultConfiguration("childConf"); @@ -111,7 +111,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testContextualizeInvocationTargetException() { + void contextualizeInvocationTargetException() { @@ -13605,7 +13605,7 @@ context.add("exceptionalMethod", 123.0f); @@ -132,7 +132,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testContextualizeConversionException() { + void contextualizeConversionException() { @@ -13614,7 +13614,7 @@ context.add("val", "some string"); @@ -153,7 +153,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testTestBean() { + void bean() { @@ -13623,7 +13623,7 @@ testBean.setWrong("wrongVal"); @@ -170,7 +170,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testRegisterIntegralTypes() throws Exception { + void registerIntegralTypes() throws Exception { @@ -13632,16 +13632,16 @@ AbstractAutomaticBean.class, "registerIntegralTypes", convertUtilsBean); @@ -180,7 +180,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testBeanConverters() throws Exception { + void beanConverters() throws Exception { final ConverterBean bean = new ConverterBean(); - + // methods are not seen as used by reflection @@ -214,7 +214,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testBeanConvertersUri2() throws Exception { + void beanConvertersUri2() throws Exception { @@ -13650,7 +13650,7 @@ config.addProperty("uri", ""); @@ -224,7 +224,7 @@ public class AbstractAutomaticBeanTest { } - + @Test - public void testBeanConvertersUri3() { + void beanConvertersUri3() { @@ -13661,12 +13661,12 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java @@ -20,7 +20,11 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.stream.Collectors.toCollection; +import static java.util.stream.Collectors.toUnmodifiableList; - + +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; @@ -13676,9 +13676,9 @@ import java.util.Map; import java.util.ResourceBundle; -import java.util.stream.Collectors; - + public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport { - + @@ -422,8 +425,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport */ protected final void execute(Configuration config, String... filenames) throws Exception { @@ -13734,9 +13734,9 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java @@ -19,13 +19,14 @@ - + package com.puppycrawl.tools.checkstyle; - + +import static java.util.stream.Collectors.joining; + import java.io.File; @@ -13748,7 +13748,7 @@ -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.junit.jupiter.api.BeforeEach; - + public abstract class AbstractPathTestSupport { @@ -103,7 +104,7 @@ public abstract class AbstractPathTestSupport { * @return joined strings @@ -13757,16 +13757,16 @@ - return Stream.of(strings).collect(Collectors.joining(EOL, "", EOL)); + return Arrays.stream(strings).collect(joining(EOL, "", EOL)); } - + /** --- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractXmlTestSupport.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractXmlTestSupport.java @@ -21,10 +21,10 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; import java.io.ByteArrayOutputStream; -import java.nio.charset.StandardCharsets; @@ -13779,7 +13779,7 @@ throws ParserConfigurationException { - final String xml = outputStream.toString(StandardCharsets.UTF_8); + final String xml = outputStream.toString(UTF_8); - + return XmlUtil.getRawXml("audit output", xml, xml); } --- a/src/test/java/com/puppycrawl/tools/checkstyle/AstTreeStringPrinterTest.java @@ -13787,15 +13787,15 @@ @@ -32,7 +32,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import org.junit.jupiter.api.Test; - + -public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { +final class AstTreeStringPrinterTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -40,14 +40,14 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -13803,7 +13803,7 @@ .that(isUtilsClassHasPrivateConstructor(AstTreeStringPrinter.class)) .isTrue(); } - + @Test - public void testParseFileThrowable() throws Exception { + void parseFileThrowable() throws Exception { @@ -13812,7 +13812,7 @@ AstTreeStringPrinter.printFileAst(input, JavaParser.Options.WITHOUT_COMMENTS); @@ -63,7 +63,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testParseFile() throws Exception { + void parseFile() throws Exception { @@ -13821,7 +13821,7 @@ getPath("InputAstTreeStringPrinterComments.java"), @@ -71,7 +71,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testPrintBranch() throws Exception { + void printBranch() throws Exception { @@ -13830,7 +13830,7 @@ new File(getPath("InputAstTreeStringPrinterPrintBranch.java")), @@ -89,7 +89,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testPrintAst() throws Exception { + void printAst() throws Exception { @@ -13839,7 +13839,7 @@ new File(getPath("InputAstTreeStringPrinterComments.java")).getAbsoluteFile(), @@ -103,7 +103,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testParseFileWithComments() throws Exception { + void parseFileWithComments() throws Exception { @@ -13848,7 +13848,7 @@ getPath("InputAstTreeStringPrinterComments.java"), @@ -111,35 +111,35 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testParseFileWithJavadoc1() throws Exception { + void parseFileWithJavadoc1() throws Exception { @@ -13856,7 +13856,7 @@ getPath("ExpectedAstTreeStringPrinterJavadoc.txt"), getPath("InputAstTreeStringPrinterJavadoc.java")); } - + @Test - public void testParseFileWithJavadoc2() throws Exception { + void parseFileWithJavadoc2() throws Exception { @@ -13864,7 +13864,7 @@ getPath("ExpectedAstTreeStringPrinterJavaAndJavadoc.txt"), getPath("InputAstTreeStringPrinterJavaAndJavadoc.java")); } - + @Test - public void testParseFileWithJavadoc3() throws Exception { + void parseFileWithJavadoc3() throws Exception { @@ -13872,7 +13872,7 @@ getPath("ExpectedAstTreeStringPrinterAttributesAndMethodsJavadoc.txt"), getPath("InputAstTreeStringPrinterAttributesAndMethodsJavadoc.java")); } - + @Test - public void testJavadocPosition() throws Exception { + void javadocPosition() throws Exception { @@ -13880,7 +13880,7 @@ getPath("ExpectedAstTreeStringPrinterJavadocPosition.txt"), getPath("InputAstTreeStringPrinterJavadocPosition.java")); } - + @Test - public void testAstTreeBlockComments() throws Exception { + void astTreeBlockComments() throws Exception { @@ -13889,7 +13889,7 @@ getPath("InputAstTreeStringPrinterFullOfBlockComments.java"), @@ -147,7 +147,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testAstTreeBlockCommentsCarriageReturn() throws Exception { + void astTreeBlockCommentsCarriageReturn() throws Exception { @@ -13898,7 +13898,7 @@ getPath("InputAstTreeStringPrinterFullOfBlockCommentsCR.java"), @@ -155,7 +155,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testAstTreeSingleLineComments() throws Exception { + void astTreeSingleLineComments() throws Exception { @@ -13907,7 +13907,7 @@ getPath("InputAstTreeStringPrinterFullOfSinglelineComments.java"), @@ -163,7 +163,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testTextBlocksEscapesAreOneChar() throws Exception { + void textBlocksEscapesAreOneChar() throws Exception { @@ -13919,10 +13919,10 @@ @@ -27,10 +27,10 @@ import com.puppycrawl.tools.checkstyle.api.Violation; import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import org.junit.jupiter.api.Test; - + -public class AuditEventDefaultFormatterTest { +final class AuditEventDefaultFormatterTest { - + @Test - public void testFormatFullyQualifiedModuleNameContainsCheckSuffix() { + void formatFullyQualifiedModuleNameContainsCheckSuffix() { @@ -13931,7 +13931,7 @@ 1, @@ -53,7 +53,7 @@ public class AuditEventDefaultFormatterTest { } - + @Test - public void testFormatFullyQualifiedModuleNameDoesNotContainCheckSuffix() { + void formatFullyQualifiedModuleNameDoesNotContainCheckSuffix() { @@ -13940,7 +13940,7 @@ 1, @@ -76,7 +76,7 @@ public class AuditEventDefaultFormatterTest { } - + @Test - public void testFormatModuleWithModuleId() { + void formatModuleWithModuleId() { @@ -13949,7 +13949,7 @@ 1, @@ -97,7 +97,7 @@ public class AuditEventDefaultFormatterTest { } - + @Test - public void testCalculateBufferLength() throws Exception { + void calculateBufferLength() throws Exception { @@ -13965,7 +13965,7 @@ +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Collections.unmodifiableList; +import static java.util.stream.Collectors.toUnmodifiableList; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; @@ -13985,10 +13985,10 @@ -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 { } - + @Test - public void testDestroy() throws Exception { + void destroy() throws Exception { @@ -13997,7 +13997,7 @@ checker.addListener(auditAdapter); @@ -132,7 +134,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.destroy(); - + final File tempFile = File.createTempFile("junit", null, temporaryFolder); - checker.process(Collections.singletonList(tempFile)); + checker.process(ImmutableList.of(tempFile)); @@ -14006,7 +14006,7 @@ new Violation( @@ -154,7 +156,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddListener() throws Exception { + void addListener() throws Exception { @@ -14015,7 +14015,7 @@ checker.addListener(auditAdapter); @@ -210,7 +212,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testRemoveListener() throws Exception { + void removeListener() throws Exception { @@ -14024,15 +14024,15 @@ final DebugAuditAdapter aa2 = new DebugAuditAdapter(); @@ -267,21 +269,21 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddBeforeExecutionFileFilter() throws Exception { + void addBeforeExecutionFileFilter() throws Exception { final Checker checker = new Checker(); final TestBeforeExecutionFileFilter filter = new TestBeforeExecutionFileFilter(); - + checker.addBeforeExecutionFileFilter(filter); - + filter.resetFilter(); - checker.process(Collections.singletonList(new File("dummy.java"))); + checker.process(ImmutableList.of(new File("dummy.java"))); @@ -14040,7 +14040,7 @@ .that(filter.wasCalled()) .isTrue(); } - + @Test - public void testRemoveBeforeExecutionFileFilter() throws Exception { + void removeBeforeExecutionFileFilter() throws Exception { @@ -14049,7 +14049,7 @@ final TestBeforeExecutionFileFilter f2 = new TestBeforeExecutionFileFilter(); @@ -290,7 +292,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.removeBeforeExecutionFileFilter(filter); - + f2.resetFilter(); - checker.process(Collections.singletonList(new File("dummy.java"))); + checker.process(ImmutableList.of(new File("dummy.java"))); @@ -14058,16 +14058,16 @@ .isTrue(); @@ -300,7 +302,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddFilter() { + void addFilter() { final Checker checker = new Checker(); final DebugFilter filter = new DebugFilter(); - + @@ -316,7 +318,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testRemoveFilter() { + void removeFilter() { @@ -14076,7 +14076,7 @@ final DebugFilter f2 = new DebugFilter(); @@ -337,7 +339,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testFileExtensions() throws Exception { + void fileExtensions() throws Exception { @@ -14085,7 +14085,7 @@ checkerConfig.addProperty( @@ -378,7 +380,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoredFileExtensions() throws Exception { + void ignoredFileExtensions() throws Exception { @@ -14094,7 +14094,7 @@ final File tempFile = File.createTempFile("junit", null, temporaryFolder); @@ -413,7 +415,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetters() { + void setters() { @@ -14103,25 +14103,25 @@ checker.setBasedir("some"); @@ -437,7 +439,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testNoClassLoaderNoModuleFactory() { + void noClassLoaderNoModuleFactory() { final Checker checker = new Checker(); - + try { @@ -451,7 +453,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testNoModuleFactory() throws Exception { + void noModuleFactory() throws Exception { final Checker checker = new Checker(); final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - + @@ -465,7 +467,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testFinishLocalSetupFullyInitialized() throws Exception { + void finishLocalSetupFullyInitialized() throws Exception { @@ -14130,7 +14130,7 @@ checker.setModuleClassLoader(contextClassLoader); @@ -496,7 +498,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetupChildExceptions() { + void setupChildExceptions() { @@ -14139,7 +14139,7 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -514,7 +516,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetupChildInvalidProperty() throws Exception { + void setupChildInvalidProperty() throws Exception { @@ -14148,7 +14148,7 @@ try { @@ -533,7 +535,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetupChildListener() throws Exception { + void setupChildListener() throws Exception { @@ -14157,7 +14157,7 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -550,7 +552,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testDestroyCheckerWithWrongCacheFileNameLength() throws Exception { + void destroyCheckerWithWrongCacheFileNameLength() throws Exception { @@ -14165,7 +14165,7 @@ final PackageObjectFactory factory = new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -572,8 +574,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - + /** It is OK to have long test method name here as it describes the test purpose. */ @Test - public void testCacheAndCheckWhichDoesNotImplementExternalResourceHolderInterface() @@ -14176,7 +14176,7 @@ .isFalse(); @@ -610,7 +611,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testWithCacheWithNoViolation() throws Exception { + void withCacheWithNoViolation() throws Exception { @@ -14185,7 +14185,7 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -651,7 +652,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testClearExistingCache() throws Exception { + void clearExistingCache() throws Exception { @@ -14194,7 +14194,7 @@ final File cacheFile = File.createTempFile("junit", null, temporaryFolder); @@ -700,7 +701,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testClearCache() throws Exception { + void clearCache() throws Exception { @@ -14204,7 +14204,7 @@ @@ -713,7 +714,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.configure(checkerConfig); checker.addListener(getBriefUtLogger()); - + - checker.process(Collections.singletonList(new File("dummy.java"))); + checker.process(ImmutableList.of(new File("dummy.java"))); checker.clearCache(); @@ -14212,7 +14212,7 @@ final PropertyCacheFile cache = TestUtil.getInternalState(checker, "cacheFile"); @@ -728,7 +729,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void setFileExtension() { + void setFileExtension() { @@ -14221,7 +14221,7 @@ final String[] actual = TestUtil.getInternalState(checker, "fileExtensions"); @@ -738,7 +739,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testClearCacheWhenCacheFileIsNotSet() { + void clearCacheWhenCacheFileIsNotSet() { @@ -14247,7 +14247,7 @@ final String errorMessage = "Java Virtual Machine is broken" @@ -871,8 +872,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - + /** It is OK to have long test method name here as it describes the test purpose. */ @Test - public void testCacheAndFilterWhichDoesNotImplementExternalResourceHolderInterface() @@ -14268,7 +14268,7 @@ // New release contains update to a some check to have additional external resource. @@ -1000,7 +999,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testClearLazyLoadCacheInDetailAST() throws Exception { + void clearLazyLoadCacheInDetailAST() throws Exception { @@ -14277,7 +14277,7 @@ final DefaultConfiguration checkConfig2 = @@ -1019,7 +1018,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheOnViolationSuppression() throws Exception { + void cacheOnViolationSuppression() throws Exception { @@ -14286,7 +14286,7 @@ createModuleConfig(DummyFileSetViolationCheck.class); @@ -1048,7 +1047,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testHaltOnException() throws Exception { + void haltOnException() throws Exception { @@ -14295,15 +14295,15 @@ try { @@ -1062,7 +1061,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testExceptionWithCache() throws Exception { + void exceptionWithCache() throws Exception { final File cacheFile = File.createTempFile("junit", null, temporaryFolder); - + final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); @@ -1079,7 +1078,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - + final String filePath = getPath("InputChecker.java"); try { - checker.process(Collections.singletonList(new File(filePath))); @@ -14318,7 +14318,7 @@ - public void testCatchErrorWithCache() throws Exception { + void catchErrorWithCache() throws Exception { final File cacheFile = File.createTempFile("junit", null, temporaryFolder); - + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); @@ -1183,7 +1182,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization @@ -14327,7 +14327,7 @@ - public void testCatchErrorWithCacheWithNoFileName() throws Exception { + void catchErrorWithCacheWithNoFileName() throws Exception { final File cacheFile = File.createTempFile("junit", null, temporaryFolder); - + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); @@ -1254,7 +1253,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization @@ -14337,7 +14337,7 @@ + void exceptionWithNoFileName() { final String errorMessage = "Security Exception"; final RuntimeException expectedError = new SecurityException(errorMessage); - + @@ -1302,7 +1301,7 @@ public class CheckerTest extends AbstractModuleTestSupport { * does not require serialization */ @@ -14345,20 +14345,20 @@ - public void testExceptionWithCacheAndNoFileName() throws Exception { + void exceptionWithCacheAndNoFileName() throws Exception { final File cacheFile = File.createTempFile("junit", null, temporaryFolder); - + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); @@ -1361,7 +1360,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); @@ -1381,7 +1380,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testTabViolationDefault() throws Exception { + void tabViolationDefault() throws Exception { @@ -14367,7 +14367,7 @@ final String[] expected = { @@ -1391,7 +1390,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testTabViolation() throws Exception { + void tabViolation() throws Exception { @@ -14376,7 +14376,7 @@ final DefaultConfiguration checkerConfig = createRootConfig(checkConfig); @@ -1403,11 +1402,11 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckerProcessCallAllNeededMethodsOfFileSets() throws Exception { + void checkerProcessCallAllNeededMethodsOfFileSets() throws Exception { @@ -14390,7 +14390,7 @@ .that(fileSet.getMethodCalls()) @@ -1415,7 +1414,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetFileSetCheckSetsMessageDispatcher() { + void setFileSetCheckSetsMessageDispatcher() { @@ -14399,7 +14399,7 @@ checker.addFileSetCheck(fileSet); @@ -1425,7 +1424,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddAuditListenerAsChild() throws Exception { + void addAuditListenerAsChild() throws Exception { @@ -14416,7 +14416,7 @@ .that(auditAdapter.wasCalled()) .isTrue(); } - + @Test - public void testAddBeforeExecutionFileFilterAsChild() throws Exception { + void addBeforeExecutionFileFilterAsChild() throws Exception { @@ -14433,7 +14433,7 @@ .that(fileFilter.wasCalled()) .isTrue(); } - + @Test - public void testFileSetCheckInitWhenAddedAsChild() throws Exception { + void fileSetCheckInitWhenAddedAsChild() throws Exception { @@ -14441,7 +14441,7 @@ final DummyFileSet fileSet = new DummyFileSet(); final PackageObjectFactory factory = @@ -1494,7 +1493,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - + // -@cs[CheckstyleTestMakeup] must use raw class to directly initialize DefaultLogger @Test - public void testDefaultLoggerClosesItStreams() throws Exception { @@ -14450,7 +14450,7 @@ try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = new CloseAndFlushTestByteArrayOutputStream(); @@ -1530,7 +1529,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - + // -@cs[CheckstyleTestMakeup] must use raw class to directly initialize DefaultLogger @Test - public void testXmlLoggerClosesItStreams() throws Exception { @@ -14460,7 +14460,7 @@ new CloseAndFlushTestByteArrayOutputStream()) { @@ -1552,7 +1551,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testDuplicatedModule() throws Exception { + void duplicatedModule() throws Exception { @@ -14468,7 +14468,7 @@ final DefaultConfiguration moduleConfig1 = createModuleConfig(NewlineAtEndOfFileCheck.class); final DefaultConfiguration moduleConfig2 = createModuleConfig(NewlineAtEndOfFileCheck.class); @@ -1584,10 +1583,9 @@ public class CheckerTest extends AbstractModuleTestSupport { - + // super.verify does not work here, for we change the logger out.flush(); - final int errs = checker.process(Collections.singletonList(new File(path))); @@ -14487,11 +14487,11 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); Arrays.sort(expected); - + for (int i = 0; i < expected.length; i++) { @@ -1612,7 +1610,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testCachedFile() throws Exception { + void cachedFile() throws Exception { @@ -14500,15 +14500,15 @@ final OutputStream errorStream = new ByteArrayOutputStream(); @@ -1625,7 +1623,7 @@ public class CheckerTest extends AbstractModuleTestSupport { checker.setCacheFile(cacheFile.getAbsolutePath()); - + final File testFile = File.createTempFile("testFile", ".java", temporaryFolder); - final List files = List.of(testFile, testFile); + final List files = ImmutableList.of(testFile, testFile); checker.process(files); - + assertWithMessage("Cached file should not be processed twice") @@ -1637,7 +1635,7 @@ public class CheckerTest extends AbstractModuleTestSupport { - + @SuppressForbidden @Test - public void testUnmappableCharacters() throws Exception { @@ -14518,28 +14518,28 @@ }; @@ -1652,7 +1650,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + @Test - public void testViolationMessageOnIoException() throws Exception { + void violationMessageOnIoException() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); - + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); @@ -1939,7 +1937,7 @@ public class CheckerTest extends AbstractModuleTestSupport { } - + public List getMethodCalls() { - return Collections.unmodifiableList(methodCalls); + return unmodifiableList(methodCalls); } - + public boolean isInitCalled() { --- a/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java @@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mockConstruction; import static org.mockito.Mockito.when; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.ConfigurationLoader.IgnoredModulesOptions; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -14554,34 +14554,34 @@ import org.junit.jupiter.api.Test; @@ -75,7 +75,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testResourceLoadConfiguration() throws Exception { + void resourceLoadConfiguration() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -93,7 +93,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testResourceLoadConfigurationWithMultiThreadConfiguration() throws Exception { + void resourceLoadConfigurationWithMultiThreadConfiguration() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -113,7 +113,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testResourceLoadConfigurationWithSingleThreadConfiguration() throws Exception { + void resourceLoadConfigurationWithSingleThreadConfiguration() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -134,14 +134,14 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testEmptyConfiguration() throws Exception { + void emptyConfiguration() throws Exception { @@ -14589,7 +14589,7 @@ (DefaultConfiguration) loadConfiguration("InputConfigurationLoaderEmpty.xml"); verifyConfigNode(config, "Checker", 0, new Properties()); } - + @Test - public void testEmptyModuleResolver() throws Exception { + void emptyModuleResolver() throws Exception { @@ -14598,7 +14598,7 @@ loadConfiguration("InputConfigurationLoaderEmpty.xml", new Properties()); @@ -149,7 +149,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMissingPropertyName() throws Exception { + void missingPropertyName() throws Exception { @@ -14607,7 +14607,7 @@ assertWithMessage("missing property name").fail(); @@ -167,7 +167,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMissingPropertyNameInMethodWithBooleanParameter() throws Exception { + void missingPropertyNameInMethodWithBooleanParameter() throws Exception { @@ -14616,7 +14616,7 @@ ConfigurationLoader.loadConfiguration( @@ -188,7 +188,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMissingPropertyValue() throws Exception { + void missingPropertyValue() throws Exception { @@ -14625,7 +14625,7 @@ assertWithMessage("missing property value").fail(); @@ -206,7 +206,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMissingConfigName() throws Exception { + void missingConfigName() throws Exception { @@ -14634,7 +14634,7 @@ assertWithMessage("missing module name").fail(); @@ -224,7 +224,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMissingConfigParent() throws Exception { + void missingConfigParent() throws Exception { @@ -14643,22 +14643,22 @@ assertWithMessage("missing module parent").fail(); @@ -242,7 +242,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testCheckstyleChecks() throws Exception { + void checkstyleChecks() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -280,7 +280,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testCustomMessages() throws Exception { + void customMessages() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -293,8 +293,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { final List messages = new ArrayList<>(grandchildren[0].getMessages().values()); final String expectedKey = "name.invalidPattern"; @@ -14671,7 +14671,7 @@ .containsKey(expectedKey); @@ -321,7 +320,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testReplacePropertiesNoReplace() throws Exception { + void replacePropertiesNoReplace() throws Exception { @@ -14680,7 +14680,7 @@ }; @@ -336,7 +335,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testReplacePropertiesSyntaxError() throws Exception { + void replacePropertiesSyntaxError() throws Exception { @@ -14689,7 +14689,7 @@ final String value = @@ -353,7 +352,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testReplacePropertiesMissingProperty() throws Exception { + void replacePropertiesMissingProperty() throws Exception { @@ -14698,7 +14698,7 @@ final String value = @@ -371,7 +370,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testReplacePropertiesReplace() throws Exception { + void replacePropertiesReplace() throws Exception { @@ -14707,43 +14707,43 @@ {"x${a}", "xA"}, @@ -404,7 +403,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testSystemEntity() throws Exception { + void systemEntity() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -419,7 +418,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testExternalEntity() throws Exception { + void externalEntity() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -436,7 +435,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testExternalEntitySubdirectory() throws Exception { + void externalEntitySubdirectory() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -453,7 +452,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testExternalEntityFromUri() throws Exception { + void externalEntityFromUri() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.basedir", "basedir"); - + @@ -472,7 +471,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testIncorrectTag() throws Exception { + void incorrectTag() throws Exception { @@ -14752,7 +14752,7 @@ aClassParent.getDeclaredConstructor( @@ -501,7 +500,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testNonExistentPropertyName() throws Exception { + void nonExistentPropertyName() throws Exception { @@ -14761,7 +14761,7 @@ assertWithMessage("exception in expected").fail(); @@ -525,7 +524,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testConfigWithIgnore() throws Exception { + void configWithIgnore() throws Exception { @@ -14770,7 +14770,7 @@ ConfigurationLoader.loadConfiguration( @@ -539,7 +538,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testConfigWithIgnoreUsingInputSource() throws Exception { + void configWithIgnoreUsingInputSource() throws Exception { @@ -14779,7 +14779,7 @@ ConfigurationLoader.loadConfiguration( @@ -556,7 +555,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testConfigCheckerWithIgnore() throws Exception { + void configCheckerWithIgnore() throws Exception { @@ -14788,7 +14788,7 @@ ConfigurationLoader.loadConfiguration( @@ -569,7 +568,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadConfigurationWrongUrl() { + void loadConfigurationWrongUrl() { @@ -14797,7 +14797,7 @@ ";InputConfigurationLoaderModuleIgnoreSeverity.xml", @@ -585,7 +584,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadConfigurationDeprecated() throws Exception { + void loadConfigurationDeprecated() throws Exception { @@ -14806,16 +14806,16 @@ ConfigurationLoader.loadConfiguration( @@ -601,7 +600,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testReplacePropertiesDefault() throws Exception { + void replacePropertiesDefault() throws Exception { final Properties props = new Properties(); final String defaultValue = "defaultValue"; - + @@ -614,7 +613,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadConfigurationFromClassPath() throws Exception { + void loadConfigurationFromClassPath() throws Exception { @@ -14824,16 +14824,16 @@ ConfigurationLoader.loadConfiguration( @@ -628,7 +627,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 { } - + @Test - public void testConstructors() throws Exception { + void constructors() throws Exception { @@ -14842,7 +14842,7 @@ final String fName = getPath("InputConfigurationLoaderChecks.xml"); @@ -663,7 +662,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testConfigWithIgnoreExceptionalAttributes() { + void configWithIgnoreExceptionalAttributes() { @@ -14851,7 +14851,7 @@ DefaultConfiguration.class, @@ -691,7 +690,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadConfiguration3() throws Exception { + void loadConfiguration3() throws Exception { @@ -14860,22 +14860,22 @@ "InputConfigurationLoaderOldConfig1.xml", @@ -739,7 +738,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testDefaultValuesForNonDefinedProperties() throws Exception { + void defaultValuesForNonDefinedProperties() throws Exception { final Properties props = new Properties(); props.setProperty("checkstyle.charset.base", "UTF"); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java @@ -26,10 +26,10 @@ import java.util.Map; import java.util.TreeMap; import org.junit.jupiter.api.Test; - + -public class DefaultConfigurationTest { +final class DefaultConfigurationTest { - + @Test - public void testGetPropertyNames() { + void getPropertyNames() { @@ -14884,7 +14884,7 @@ final String[] actual = config.getPropertyNames(); @@ -38,7 +38,7 @@ public class DefaultConfigurationTest { } - + @Test - public void testAddPropertyAndGetProperty() throws CheckstyleException { + void addPropertyAndGetProperty() throws CheckstyleException { @@ -14902,14 +14902,14 @@ final String[] actual = config.getAttributeNames(); @@ -72,13 +72,13 @@ public class DefaultConfigurationTest { } - + @Test - public void testGetName() { + void getName() { final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); assertWithMessage("Invalid configuration name").that(config.getName()).isEqualTo("MyConfig"); } - + @Test - public void testRemoveChild() { + void removeChild() { @@ -14918,7 +14918,7 @@ assertWithMessage("Invalid children count").that(config.getChildren().length).isEqualTo(0); @@ -89,7 +89,7 @@ public class DefaultConfigurationTest { } - + @Test - public void testAddMessageAndGetMessages() { + void addMessageAndGetMessages() { @@ -14927,7 +14927,7 @@ final Map expected = new TreeMap<>(); @@ -98,7 +98,7 @@ public class DefaultConfigurationTest { } - + @Test - public void testExceptionForNonExistentProperty() { + void exceptionForNonExistentProperty() { @@ -14936,7 +14936,7 @@ final String propertyName = "NonExistent#$%"; @@ -113,7 +113,7 @@ public class DefaultConfigurationTest { } - + @Test - public void testDefaultMultiThreadConfiguration() { + void defaultMultiThreadConfiguration() { @@ -14945,7 +14945,7 @@ final ThreadModeSettings singleThreadMode = ThreadModeSettings.SINGLE_THREAD_MODE_INSTANCE; @@ -123,7 +123,7 @@ public class DefaultConfigurationTest { } - + @Test - public void testMultiThreadConfiguration() { + void multiThreadConfiguration() { @@ -14956,12 +14956,12 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assumptions.assumeFalse; - + @@ -32,7 +33,6 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -14973,18 +14973,18 @@ @@ -40,17 +40,17 @@ import java.util.ResourceBundle; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; - + -public class DefaultLoggerTest { +final class DefaultLoggerTest { - + private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; - + @AfterEach - public void tearDown() { + void tearDown() { ResourceBundle.clearCache(); } - + @Test - public void testCtor() { + void ctor() { @@ -15001,7 +15001,7 @@ final String message = addExceptionMessage.getMessage(); assertWithMessage("Invalid exception").that(output).contains(message); @@ -69,7 +69,7 @@ public class DefaultLoggerTest { - + /** We keep this test for 100% coverage. Until #12873. */ @Test - public void testCtorWithTwoParameters() { @@ -15010,7 +15010,7 @@ final DefaultLogger dl = new DefaultLogger(infoStream, OutputStreamOptions.CLOSE); dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss")); @@ -82,7 +82,7 @@ public class DefaultLoggerTest { - + /** We keep this test for 100% coverage. Until #12873. */ @Test - public void testCtorWithTwoParametersCloseStreamOptions() { @@ -15019,7 +15019,7 @@ final DefaultLogger dl = new DefaultLogger(infoStream, AutomaticBean.OutputStreamOptions.CLOSE); final boolean closeInfo = TestUtil.getInternalState(dl, "closeInfo"); @@ -92,7 +92,7 @@ public class DefaultLoggerTest { - + /** We keep this test for 100% coverage. Until #12873. */ @Test - public void testCtorWithTwoParametersNoneStreamOptions() { @@ -15029,7 +15029,7 @@ final boolean closeInfo = TestUtil.getInternalState(dl, "closeInfo"); @@ -101,7 +101,7 @@ public class DefaultLoggerTest { } - + @Test - public void testCtorWithNullParameter() { + void ctorWithNullParameter() { @@ -15038,7 +15038,7 @@ dl.addException(new AuditEvent(5000), new IllegalStateException("upsss")); @@ -113,7 +113,7 @@ public class DefaultLoggerTest { } - + @Test - public void testNewCtorWithTwoParameters() { + void newCtorWithTwoParameters() { @@ -15047,7 +15047,7 @@ dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss")); @@ -124,7 +124,7 @@ public class DefaultLoggerTest { } - + @Test - public void testNullInfoStreamOptions() { + void nullInfoStreamOptions() { @@ -15056,7 +15056,7 @@ assertThrows( @@ -138,7 +138,7 @@ public class DefaultLoggerTest { } - + @Test - public void testNullErrorStreamOptions() { + void nullErrorStreamOptions() { @@ -15065,7 +15065,7 @@ assertThrows( @@ -158,7 +158,7 @@ public class DefaultLoggerTest { } - + @Test - public void testAddError() { + void addError() { @@ -15074,7 +15074,7 @@ final String auditStartMessage = getAuditStartMessage(); @@ -188,7 +188,7 @@ public class DefaultLoggerTest { } - + @Test - public void testAddErrorModuleId() { + void addErrorModuleId() { @@ -15083,7 +15083,7 @@ final String auditFinishMessage = getAuditFinishMessage(); @@ -217,7 +217,7 @@ public class DefaultLoggerTest { } - + @Test - public void testAddErrorIgnoreSeverityLevel() { + void addErrorIgnoreSeverityLevel() { @@ -15092,7 +15092,7 @@ final DefaultLogger defaultLogger = @@ -235,7 +235,7 @@ public class DefaultLoggerTest { } - + @Test - public void testFinishLocalSetup() { + void finishLocalSetup() { @@ -15100,7 +15100,7 @@ final DefaultLogger dl = new DefaultLogger(infoStream, OutputStreamOptions.CLOSE); dl.finishLocalSetup(); @@ -246,7 +246,7 @@ public class DefaultLoggerTest { - + /** Verifies that the language specified with the system property {@code user.language} exists. */ @Test - public void testLanguageIsValid() { @@ -15109,7 +15109,7 @@ assumeFalse(language.isEmpty(), "Locale not set"); assertWithMessage("Invalid language") @@ -256,7 +256,7 @@ public class DefaultLoggerTest { - + /** Verifies that the country specified with the system property {@code user.country} exists. */ @Test - public void testCountryIsValid() { @@ -15119,7 +15119,7 @@ assertWithMessage("Invalid country") @@ -265,7 +265,7 @@ public class DefaultLoggerTest { } - + @Test - public void testNewCtor() throws Exception { + void newCtor() throws Exception { @@ -15134,12 +15134,12 @@ - errorOutput = errorStream.toString(StandardCharsets.UTF_8); + infoOutput = infoStream.toString(UTF_8); + errorOutput = errorStream.toString(UTF_8); - + assertWithMessage("Info stream should be closed") .that(infoStream.closedCount) @@ -310,7 +310,7 @@ public class DefaultLoggerTest { } - + @Test - public void testStreamsNotClosedByLogger() throws IOException { + void streamsNotClosedByLogger() throws IOException { @@ -15149,12 +15149,12 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java @@ -24,10 +24,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsCla - + import org.junit.jupiter.api.Test; - + -public class DefinitionsTest { +final class DefinitionsTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -15165,10 +15165,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -28,7 +29,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -15181,16 +15181,16 @@ import java.util.ArrayList; @@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - + /** TestCase to check DetailAST. */ -public class DetailAstImplTest extends AbstractModuleTestSupport { +final class DetailAstImplTest extends AbstractModuleTestSupport { - + // Ignores file which are not meant to have root node intentionally. public static final Set NO_ROOT_FILES = @@ -74,7 +74,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testInitialize() { + void initialize() { @@ -15199,7 +15199,7 @@ ast.setType(1); @@ -94,7 +94,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testInitializeToken() { + void initializeToken() { @@ -15208,7 +15208,7 @@ token.setLine(2); @@ -110,7 +110,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testGetChildCount() throws Exception { + void getChildCount() throws Exception { @@ -15217,7 +15217,7 @@ final DetailAstImpl firstLevelB = new DetailAstImpl(); @@ -146,7 +146,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testHasChildren() { + void hasChildren() { @@ -15226,7 +15226,7 @@ root.setFirstChild(child); @@ -156,7 +156,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testGetChildCountType() throws Exception { + void getChildCountType() throws Exception { @@ -15235,16 +15235,16 @@ final DetailAstImpl firstLevelB = new DetailAstImpl(); @@ -185,7 +185,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testSetSiblingNull() throws Exception { + void setSiblingNull() throws Exception { final DetailAstImpl root = new DetailAstImpl(); final DetailAstImpl firstLevelA = new DetailAstImpl(); - + @@ -201,7 +201,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddPreviousSibling() { + void addPreviousSibling() { @@ -15253,16 +15253,16 @@ final DetailAstImpl parent = new DetailAstImpl(); @@ -250,7 +250,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddPreviousSiblingNullParent() { + void addPreviousSiblingNullParent() { final DetailAstImpl child = new DetailAstImpl(); final DetailAST newSibling = new DetailAstImpl(); - + @@ -261,7 +261,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testInsertSiblingBetween() throws Exception { + void insertSiblingBetween() throws Exception { @@ -15271,7 +15271,7 @@ final DetailAST firstLevelB = new DetailAstImpl(); @@ -291,7 +291,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testBranchContains() { + void branchContains() { @@ -15280,7 +15280,7 @@ createToken(modifiers, TokenTypes.LITERAL_PUBLIC); @@ -312,7 +312,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testClearBranchTokenTypes() throws Exception { + void clearBranchTokenTypes() throws Exception { @@ -15289,7 +15289,7 @@ parent.setFirstChild(child); @@ -348,7 +348,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheBranchTokenTypes() { + void cacheBranchTokenTypes() { @@ -15298,7 +15298,7 @@ bitSet.set(999); @@ -358,7 +358,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testClearChildCountCache() { + void clearChildCountCache() { @@ -15307,16 +15307,16 @@ parent.setFirstChild(child); @@ -384,7 +384,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheGetChildCount() { + void cacheGetChildCount() { final DetailAST root = new DetailAstImpl(); - + TestUtil.setInternalState(root, "childCount", 999); @@ -392,7 +392,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddNextSibling() { + void addNextSibling() { @@ -15325,7 +15325,7 @@ final DetailAstImpl sibling = new DetailAstImpl(); @@ -425,7 +425,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddNextSibling2() { + void addNextSibling2() { @@ -15334,7 +15334,7 @@ parent.setFirstChild(child); @@ -443,7 +443,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddNextSibling3() { + void addNextSibling3() { @@ -15343,7 +15343,7 @@ final DetailAstImpl sibling = new DetailAstImpl(); @@ -456,7 +456,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddNextSibling4() { + void addNextSibling4() { @@ -15352,7 +15352,7 @@ final DetailAstImpl child = new DetailAstImpl(); @@ -470,7 +470,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddNextSiblingNullParent() { + void addNextSiblingNullParent() { @@ -15361,7 +15361,7 @@ final DetailAstImpl oldParent = new DetailAstImpl(); @@ -483,7 +483,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testGetLineNo() { + void getLineNo() { @@ -15370,7 +15370,7 @@ assertWithMessage("Invalid line number").that(root1.getLineNo()).isEqualTo(1); @@ -509,7 +509,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testGetColumnNo() { + void getColumnNo() { @@ -15379,7 +15379,7 @@ assertWithMessage("Invalid column number").that(root1.getColumnNo()).isEqualTo(1); @@ -537,7 +537,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testFindFirstToken() { + void findFirstToken() { @@ -15388,12 +15388,12 @@ firstChild.setType(TokenTypes.IDENT); @@ -559,10 +559,10 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testManyComments() throws Exception { + void manyComments() throws Exception { final File file = new File(temporaryFolder, "InputDetailASTManyComments.java"); - + - try (Writer bw = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { + try (Writer bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { bw.write("/*\ncom.puppycrawl.tools.checkstyle.checks.TodoCommentCheck\n\n\n\n*/\n"); @@ -15401,16 +15401,16 @@ for (int i = 0; i <= 30000; i++) { @@ -576,7 +576,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testTreeStructure() throws Exception { + void treeStructure() throws Exception { final List files = getAllFiles(new File("src/test/resources/com/puppycrawl/tools/checkstyle")); - + @@ -592,7 +592,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testToString() { + void testToString() { @@ -15419,7 +15419,7 @@ ast.setColumnNo(1); @@ -601,7 +601,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testRemoveChildren() { + void removeChildren() { @@ -15428,7 +15428,7 @@ parent.setFirstChild(child1); @@ -614,7 +614,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { } - + @Test - public void testAddChild() { + void addChild() { @@ -15440,15 +15440,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import java.io.File; import org.junit.jupiter.api.Test; - + -public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { +final class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -38,21 +38,21 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -15456,7 +15456,7 @@ .that(isUtilsClassHasPrivateConstructor(DetailNodeTreeStringPrinter.class)) .isTrue(); } - + @Test - public void testParseFile() throws Exception { + void parseFile() throws Exception { @@ -15464,7 +15464,7 @@ getPath("ExpectedDetailNodeTreeStringPrinterJavadocComment.txt"), getPath("InputDetailNodeTreeStringPrinterJavadocComment.javadoc")); } - + @Test - public void testParseFileWithError() throws Exception { + void parseFileWithError() throws Exception { @@ -15473,7 +15473,7 @@ DetailNodeTreeStringPrinter.printFileAst(file); @@ -70,14 +70,14 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testNoUnnecessaryTextInJavadocAst() throws Exception { + void noUnnecessaryTextInJavadocAst() throws Exception { @@ -15481,7 +15481,7 @@ getPath("ExpectedDetailNodeTreeStringPrinterNoUnnecessaryTextInJavadocAst.txt"), getPath("InputDetailNodeTreeStringPrinterNoUnnecessaryTextInJavadocAst.javadoc")); } - + @Test - public void testMissedHtmlTagParseErrorMessage() throws Exception { + void missedHtmlTagParseErrorMessage() throws Exception { @@ -15490,7 +15490,7 @@ DetailNodeTreeStringPrinter.class, @@ -98,7 +98,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testParseErrorMessage() throws Exception { + void parseErrorMessage() throws Exception { @@ -15499,7 +15499,7 @@ DetailNodeTreeStringPrinter.class, @@ -124,7 +124,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testWrongSingletonParseErrorMessage() throws Exception { + void wrongSingletonParseErrorMessage() throws Exception { @@ -15508,7 +15508,7 @@ DetailNodeTreeStringPrinter.class, @@ -146,7 +146,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testUnescapedJavaCodeWithGenericsInJavadoc() throws Exception { + void unescapedJavaCodeWithGenericsInJavadoc() throws Exception { @@ -15517,7 +15517,7 @@ getPath( @@ -168,7 +168,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testNoViableAltException() throws Exception { + void noViableAltException() throws Exception { @@ -15526,7 +15526,7 @@ try { @@ -192,7 +192,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testHtmlTagCloseBeforeTagOpen() throws Exception { + void htmlTagCloseBeforeTagOpen() throws Exception { @@ -15535,7 +15535,7 @@ try { @@ -216,7 +216,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testWrongHtmlTagOrder() throws Exception { + void wrongHtmlTagOrder() throws Exception { @@ -15544,7 +15544,7 @@ try { @@ -235,7 +235,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testOmittedStartTagForHtmlElement() throws Exception { + void omittedStartTagForHtmlElement() throws Exception { @@ -15555,10 +15555,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.stream.Collectors.toUnmodifiableSet; - + import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.FileContents; @@ -37,13 +38,12 @@ import java.util.ArrayList; @@ -15570,28 +15570,28 @@ import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; import org.junit.jupiter.api.Test; - + -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 { } - + @Test - public void testAllVisitMethodsAreOverridden() { + void allVisitMethodsAreOverridden() { final Method[] baseVisitMethods = JavaLanguageParserBaseVisitor.class.getDeclaredMethods(); final Method[] visitMethods = JavaAstVisitor.class.getDeclaredMethods(); - + @@ -107,7 +107,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { .filter(method -> method.getName().contains("visit")) .filter(method -> method.getModifiers() == Modifier.PUBLIC) .map(Method::getName) - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); - + final Set filteredVisitMethodNames = Arrays.stream(visitMethods) @@ -117,7 +117,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { @@ -15600,12 +15600,12 @@ .map(Method::getName) - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); - + final String message = "Visit methods in 'JavaLanguageParserBaseVisitor' generated from " @@ -131,7 +131,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } - + @Test - public void testOrderOfVisitMethodsAndProductionRules() throws Exception { + void orderOfVisitMethodsAndProductionRules() throws Exception { @@ -15614,7 +15614,7 @@ final String baseVisitorFilename = @@ -200,7 +200,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { } - + @Test - public void testNullSelfInAddLastSibling() throws Exception { + void nullSelfInAddLastSibling() throws Exception { @@ -15635,15 +15635,15 @@ @@ -34,7 +34,7 @@ import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; - + -public class JavaParserTest extends AbstractModuleTestSupport { +final class JavaParserTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,21 +42,21 @@ public class JavaParserTest extends AbstractModuleTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -15651,7 +15651,7 @@ .that(TestUtil.isUtilsClassHasPrivateConstructor(JavaParser.class)) .isTrue(); } - + @Test - public void testNullRootWithComments() { + void nullRootWithComments() { @@ -15659,7 +15659,7 @@ .that(JavaParser.appendHiddenCommentNodes(null)) .isNull(); } - + @Test - public void testAppendHiddenBlockCommentNodes() throws Exception { + void appendHiddenBlockCommentNodes() throws Exception { @@ -15667,17 +15667,17 @@ 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 { } - + @Test - public void testAppendHiddenSingleLineCommentNodes() throws Exception { + void appendHiddenSingleLineCommentNodes() throws Exception { @@ -15687,15 +15687,15 @@ @@ -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 { } - + @Test - public void testAppendHiddenSingleLineCommentNodes2() throws Exception { + void appendHiddenSingleLineCommentNodes2() throws Exception { @@ -15705,15 +15705,15 @@ @@ -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 { } - + @Test - public void testDontAppendCommentNodes() throws Exception { + void dontAppendCommentNodes() throws Exception { @@ -15722,7 +15722,7 @@ new File(getPath("InputJavaParserHiddenComments.java")), @@ -163,7 +163,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } - + @Test - public void testParseException() throws Exception { + void parseException() throws Exception { @@ -15731,7 +15731,7 @@ JavaParser.parseFile(input, JavaParser.Options.WITH_COMMENTS); @@ -188,7 +188,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } - + @Test - public void testComments() throws Exception { + void comments() throws Exception { @@ -15740,7 +15740,7 @@ new File(getPath("InputJavaParserHiddenComments3.java")), @@ -204,7 +204,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } - + @Test - public void testJava14TextBlocks() throws Exception { + void java14TextBlocks() throws Exception { @@ -15750,15 +15750,15 @@ @@ -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 { } - + @Test - public void testNoFreezeOnDeeplyNestedLambdas() throws Exception { + void noFreezeOnDeeplyNestedLambdas() throws Exception { @@ -15767,7 +15767,7 @@ assertWithMessage("File parsing should complete successfully.") @@ -238,7 +238,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } - + @Test - public void testFullJavaIdentifierSupport() throws Exception { + void fullJavaIdentifierSupport() throws Exception { @@ -15776,7 +15776,7 @@ assertWithMessage("File parsing should complete successfully.") @@ -247,7 +247,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { } - + @Test - public void testReturnValueOfAppendHiddenCommentNodes() throws Exception { + void returnValueOfAppendHiddenCommentNodes() throws Exception { @@ -15788,15 +15788,15 @@ @@ -27,7 +27,7 @@ import java.nio.file.Files; import java.nio.file.Paths; import org.junit.jupiter.api.Test; - + -public class JavadocDetailNodeParserTest extends AbstractModuleTestSupport { +final class JavadocDetailNodeParserTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class JavadocDetailNodeParserTest extends AbstractModuleTestSupport { } - + @Test - public void testParseJavadocAsDetailNode() throws Exception { + void parseJavadocAsDetailNode() throws Exception { @@ -15807,10 +15807,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGeneratorTest.java @@ -20,13 +20,13 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import java.io.File; @@ -15822,11 +15822,11 @@ import org.itsallcode.io.Capturable; @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; - + @ExtendWith({SystemErrGuard.class, SystemOutGuard.class}) -public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { +final class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { - + private static final String EOL = System.lineSeparator(); private static final String USAGE = @@ -87,7 +87,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { @@ -15837,10 +15837,10 @@ + void setUp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { systemErr.captureMuted(); systemOut.captureMuted(); - + @@ -95,14 +95,14 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -15848,34 +15848,34 @@ .that(TestUtil.isUtilsClassHasPrivateConstructor(JavadocPropertiesGenerator.class)) .isTrue(); } - + @Test - public void testNonExistentArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void nonExistentArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { JavadocPropertiesGenerator.main("--nonexistent-argument"); - + @@ -117,7 +117,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testNoDestfileSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void noDestfileSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { JavadocPropertiesGenerator.main(getPath("InputMain.java")); - + @@ -128,7 +128,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testNoInputSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void noInputSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { JavadocPropertiesGenerator.main("--destfile", DESTFILE_ABSOLUTE_PATH); - + @@ -139,8 +139,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testNotClass(@SysErr Capturable systemErr, @SysOut Capturable systemOut) - throws Exception { @@ -15885,7 +15885,7 @@ DESTFILE_ABSOLUTE_PATH, @@ -150,8 +149,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testNotExistentInputSpecified( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -15895,7 +15895,7 @@ assertWithMessage("Exception was expected").fail(); @@ -177,8 +175,8 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testInvalidDestinationSpecified( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { @@ -15906,7 +15906,7 @@ JavadocPropertiesGenerator.main( @@ -202,8 +200,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testCorrect(@SysErr Capturable systemErr, @SysOut Capturable systemOut) - throws Exception { @@ -15922,7 +15922,7 @@ + final String fileContent = FileUtils.readFileToString(DESTFILE, UTF_8); assertWithMessage("File content is not expected").that(fileContent).isEqualTo(expectedContent); } - + @Test - public void testEmptyJavadoc(@SysErr Capturable systemErr, @SysOut Capturable systemOut) - throws Exception { @@ -15932,7 +15932,7 @@ "--destfile", @@ -242,8 +238,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testNotConstants(@SysErr Capturable systemErr, @SysOut Capturable systemOut) - throws Exception { @@ -15942,7 +15942,7 @@ "--destfile", @@ -255,15 +250,14 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testHelp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) - throws Exception { @@ -15951,7 +15951,7 @@ assertWithMessage("Unexpected error log").that(systemErr.getCapturedData()).isEqualTo(""); assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(USAGE); } - + @Test - public void testJavadocParseError() throws Exception { + void javadocParseError() throws Exception { @@ -15960,7 +15960,7 @@ JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); @@ -278,7 +272,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testNotImplementedTag() throws Exception { + void notImplementedTag() throws Exception { @@ -15969,7 +15969,7 @@ JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); @@ -293,7 +287,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testParseError() throws Exception { + void parseError() throws Exception { @@ -15978,14 +15978,14 @@ JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); @@ -315,8 +309,8 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { } - + @Test - public void testGetFirstJavadocSentence( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + void getFirstJavadocSentence(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws Exception { final String expectedContent = "EOF1=First Javadoc Sentence."; - + JavadocPropertiesGenerator.main( @@ -325,7 +319,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { DESTFILE_ABSOLUTE_PATH); @@ -16004,9 +16004,9 @@ */ -public class LocalizedMessageTest { +final class LocalizedMessageTest { - + private static final Locale DEFAULT_LOCALE = Locale.ENGLISH; - + @DefaultLocale("en") @Test - public void testNullArgs() { @@ -16016,7 +16016,7 @@ Definitions.CHECKSTYLE_BUNDLE, @@ -71,7 +71,7 @@ public class LocalizedMessageTest { } - + @Test - public void testBundleReloadUrlNull() throws IOException { + void bundleReloadUrlNull() throws IOException { @@ -16030,7 +16030,7 @@ - public void testBundleReloadUrlNotNull() throws IOException { + void bundleReloadUrlNotNull() throws IOException { final AtomicBoolean closed = new AtomicBoolean(); - + final InputStream inputStream = @@ -157,7 +157,7 @@ public class LocalizedMessageTest { * @noinspectionreason IOResourceOpenedButNotSafelyClosed - no need to close resources in testing @@ -16039,11 +16039,11 @@ - public void testBundleReloadUrlNotNullFalseReload() throws IOException { + void bundleReloadUrlNotNullFalseReload() throws IOException { final AtomicBoolean closed = new AtomicBoolean(); - + final InputStream inputStream = @@ -214,7 +214,7 @@ public class LocalizedMessageTest { } - + @Test - public void testBundleReloadUrlNotNullStreamNull() throws IOException { + void bundleReloadUrlNotNullStreamNull() throws IOException { @@ -16051,7 +16051,7 @@ new URL( "test", @@ -241,7 +241,7 @@ public class LocalizedMessageTest { - + /** Verifies that the language specified with the system property {@code user.language} exists. */ @Test - public void testLanguageIsValid() { @@ -16060,7 +16060,7 @@ assumeFalse(language.isEmpty(), "Locale not set"); assertWithMessage("Invalid language") @@ -252,14 +252,14 @@ public class LocalizedMessageTest { - + /** Verifies that the country specified with the system property {@code user.country} exists. */ @Test - public void testCountryIsValid() { @@ -16069,40 +16069,40 @@ assumeFalse(country.isEmpty(), "Locale not set"); assertWithMessage("Invalid country").that(Locale.getISOCountries()).asList().contains(country); } - + @Test - public void testMessageInFrench() { + void messageInFrench() { final LocalizedMessage violation = createSampleViolation(); LocalizedMessage.setLocale(Locale.FRENCH); - + @@ -270,7 +270,7 @@ public class LocalizedMessageTest { - + @DefaultLocale("fr") @Test - public void testEnforceEnglishLanguageBySettingUnitedStatesLocale() { + void enforceEnglishLanguageBySettingUnitedStatesLocale() { LocalizedMessage.setLocale(Locale.US); final LocalizedMessage violation = createSampleViolation(); - + @@ -281,7 +281,7 @@ public class LocalizedMessageTest { - + @DefaultLocale("fr") @Test - public void testEnforceEnglishLanguageBySettingRootLocale() { + void enforceEnglishLanguageBySettingRootLocale() { LocalizedMessage.setLocale(Locale.ROOT); final LocalizedMessage violation = createSampleViolation(); - + @@ -298,7 +298,7 @@ public class LocalizedMessageTest { } - + @AfterEach - public void tearDown() { + void tearDown() { LocalizedMessage.setLocale(DEFAULT_LOCALE); } - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java @@ -22,6 +22,8 @@ package com.puppycrawl.tools.checkstyle; @@ -16132,11 +16132,11 @@ import org.itsallcode.junit.sysextensions.SystemErrGuard.SysErr; @@ -65,7 +65,7 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; - + @ExtendWith({SystemErrGuard.class, SystemOutGuard.class}) -public class MainTest { +final class MainTest { - + private static final String SHORT_USAGE = String.format( @@ -222,7 +222,7 @@ public class MainTest { @@ -16147,10 +16147,10 @@ + void setUp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { systemErr.captureMuted(); systemOut.captureMuted(); - + @@ -247,14 +247,14 @@ public class MainTest { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -16158,7 +16158,7 @@ .that(isUtilsClassHasPrivateConstructor(Main.class)) .isTrue(); } - + @Test - public void testVersionPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void versionPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16167,7 +16167,7 @@ .that(systemOut.getCapturedData()) @@ -265,7 +265,7 @@ public class MainTest { } - + @Test - public void testUsageHelpPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void usageHelpPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16176,7 +16176,7 @@ assertWithMessage("Unexpected system error log") @@ -274,7 +274,7 @@ public class MainTest { } - + @Test - public void testWrongArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void wrongArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16185,7 +16185,7 @@ // picocli verifies required parameters before checking unknown options @@ -287,8 +287,7 @@ public class MainTest { } - + @Test - public void testWrongArgumentMissingFiles( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16195,7 +16195,7 @@ // picocli verifies required parameters before checking unknown options @@ -300,7 +299,7 @@ public class MainTest { } - + @Test - public void testNoConfigSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void noConfigSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16204,7 +16204,7 @@ .that(systemOut.getCapturedData()) @@ -311,8 +310,7 @@ public class MainTest { } - + @Test - public void testNonExistentTargetFile( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16214,7 +16214,7 @@ .that(systemOut.getCapturedData()) @@ -323,7 +321,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFileButWithoutReadAccess( + void existingTargetFileButWithoutReadAccess( @@ -16223,7 +16223,7 @@ File.createTempFile("testExistingTargetFileButWithoutReadAccess", null, temporaryFolder); @@ -342,8 +340,7 @@ public class MainTest { } - + @Test - public void testNonExistentConfigFile( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16233,7 +16233,7 @@ assertWithMessage("Unexpected output log") @@ -358,8 +355,7 @@ public class MainTest { } - + @Test - public void testNonExistentOutputFormat( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16243,7 +16243,7 @@ assertWithMessage("Unexpected system error log") @@ -372,7 +368,7 @@ public class MainTest { } - + @Test - public void testNonExistentClass(@SysErr Capturable systemErr) { + void nonExistentClass(@SysErr Capturable systemErr) { @@ -16252,7 +16252,7 @@ final String cause = @@ -384,7 +380,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void existingTargetFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16261,7 +16261,7 @@ assertWithMessage("Unexpected output log") @@ -396,8 +392,8 @@ public class MainTest { } - + @Test - public void testExistingTargetFileXmlOutput( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { @@ -16291,7 +16291,7 @@ TestUtil.invokeStaticMethod(Main.class, "getOutputStreamOptions", path); @@ -466,8 +461,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFilePlainOutput( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16301,7 +16301,7 @@ "-c", @@ -484,8 +478,8 @@ public class MainTest { } - + @Test - public void testExistingTargetFileWithViolations( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { @@ -16312,7 +16312,7 @@ final Violation invalidPatternMessageMain = @@ -529,7 +523,7 @@ public class MainTest { } - + @Test - public void testViolationsByGoogleAndXpathSuppressions( + void violationsByGoogleAndXpathSuppressions( @@ -16321,7 +16321,7 @@ "org.checkstyle.google.suppressionxpathfilter.config", @@ -545,7 +539,7 @@ public class MainTest { } - + @Test - public void testViolationsByGoogleAndSuppressions( + void violationsByGoogleAndSuppressions( @@ -16330,7 +16330,7 @@ "org.checkstyle.google.suppressionfilter.config", @@ -561,8 +555,8 @@ public class MainTest { } - + @Test - public void testExistingTargetFileWithError( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { @@ -16352,7 +16352,7 @@ final Violation errorCounterTwoMessage = @@ -662,7 +656,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFileWithOneErrorAgainstSunCheck( + void existingTargetFileWithOneErrorAgainstSunCheck( @@ -16361,7 +16361,7 @@ final Violation errorCounterTwoMessage = @@ -697,7 +691,7 @@ public class MainTest { } - + @Test - public void testExistentTargetFilePlainOutputToNonExistentFile( + void existentTargetFilePlainOutputToNonExistentFile( @@ -16370,7 +16370,7 @@ 0, @@ -715,7 +709,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFilePlainOutputToFile( + void existingTargetFilePlainOutputToFile( @@ -16379,7 +16379,7 @@ File.createTempFile("file", ".output", temporaryFolder).getCanonicalPath(); @@ -736,7 +730,7 @@ public class MainTest { } - + @Test - public void testCreateNonExistentOutputFile() throws IOException { + void createNonExistentOutputFile() throws IOException { @@ -16388,7 +16388,7 @@ assertMainReturnCode( @@ -752,7 +746,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFilePlainOutputProperties( + void existingTargetFilePlainOutputProperties( @@ -16397,7 +16397,7 @@ 0, @@ -770,7 +764,7 @@ public class MainTest { } - + @Test - public void testPropertyFileWithPropertyChaining( + void propertyFileWithPropertyChaining( @@ -16406,7 +16406,7 @@ 0, @@ -789,7 +783,7 @@ public class MainTest { } - + @Test - public void testPropertyFileWithPropertyChainingUndefinedProperty( + void propertyFileWithPropertyChainingUndefinedProperty( @@ -16415,7 +16415,7 @@ -2, @@ -806,7 +800,7 @@ public class MainTest { } - + @Test - public void testExistingTargetFilePlainOutputNonexistentProperties( + void existingTargetFilePlainOutputNonexistentProperties( @@ -16424,7 +16424,7 @@ -1, @@ -824,7 +818,7 @@ public class MainTest { } - + @Test - public void testExistingIncorrectConfigFile(@SysErr Capturable systemErr) { + void existingIncorrectConfigFile(@SysErr Capturable systemErr) { @@ -16433,7 +16433,7 @@ final String errorOutput = @@ -836,7 +830,7 @@ public class MainTest { } - + @Test - public void testExistingIncorrectChildrenInConfigFile(@SysErr Capturable systemErr) { + void existingIncorrectChildrenInConfigFile(@SysErr Capturable systemErr) { @@ -16442,7 +16442,7 @@ final String errorOutput = @@ -849,7 +843,7 @@ public class MainTest { } - + @Test - public void testExistingIncorrectChildrenInConfigFile2(@SysErr Capturable systemErr) { + void existingIncorrectChildrenInConfigFile2(@SysErr Capturable systemErr) { @@ -16451,7 +16451,7 @@ final String errorOutput = @@ -863,7 +857,7 @@ public class MainTest { } - + @Test - public void testLoadPropertiesIoException() throws Exception { + void loadPropertiesIoException() throws Exception { @@ -16460,7 +16460,7 @@ final Class cliOptionsClass = Class.forName(Main.class.getName()); @@ -905,8 +899,8 @@ public class MainTest { } - + @Test - public void testExistingDirectoryWithViolations( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { @@ -16489,7 +16489,7 @@ new File("") { @@ -1015,7 +1009,7 @@ public class MainTest { } - + @Test - public void testFileReferenceDuringException(@SysErr Capturable systemErr) { + void fileReferenceDuringException(@SysErr Capturable systemErr) { @@ -16498,25 +16498,25 @@ -2, @@ -1033,7 +1027,7 @@ public class MainTest { } - + @Test - public void testRemoveLexerDefaultErrorListener(@SysErr Capturable systemErr) { + void removeLexerDefaultErrorListener(@SysErr Capturable systemErr) { assertMainReturnCode(-2, "-t", getNonCompilablePath("InputMainIncorrectClass.java")); - + assertWithMessage("First line of exception message should not contain lexer error.") @@ -1042,7 +1036,7 @@ public class MainTest { } - + @Test - public void testRemoveParserDefaultErrorListener(@SysErr Capturable systemErr) { + void removeParserDefaultErrorListener(@SysErr Capturable systemErr) { assertMainReturnCode(-2, "-t", getNonCompilablePath("InputMainIncorrectClass.java")); final String capturedData = systemErr.getCapturedData(); - + @@ -1057,8 +1051,7 @@ public class MainTest { } - + @Test - public void testPrintTreeOnMoreThanOneFile( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16526,7 +16526,7 @@ .that(systemOut.getCapturedData()) @@ -1069,7 +1062,7 @@ public class MainTest { } - + @Test - public void testPrintTreeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void printTreeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16535,7 +16535,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -1111,7 +1104,7 @@ public class MainTest { } - + @Test - public void testPrintXpathOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void printXpathOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16544,7 +16544,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -1136,8 +1129,7 @@ public class MainTest { } - + @Test - public void testPrintXpathCommentNode( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16554,7 +16554,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -1159,8 +1151,7 @@ public class MainTest { } - + @Test - public void testPrintXpathNodeParentNull( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16564,7 +16564,7 @@ assertWithMessage("Unexpected output log") @@ -1172,7 +1163,7 @@ public class MainTest { } - + @Test - public void testPrintXpathFullOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void printXpathFullOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16573,7 +16573,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -1194,7 +1185,7 @@ public class MainTest { } - + @Test - public void testPrintXpathTwoResults(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void printXpathTwoResults(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16582,7 +16582,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -1220,7 +1211,7 @@ public class MainTest { } - + @Test - public void testPrintXpathInvalidXpath(@SysErr Capturable systemErr) throws Exception { + void printXpathInvalidXpath(@SysErr Capturable systemErr) throws Exception { @@ -16591,7 +16591,7 @@ final String filePath = getFilePath("InputMainXPath.java"); @@ -1238,8 +1229,7 @@ public class MainTest { } - + @Test - public void testPrintTreeCommentsOption( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16610,7 +16610,7 @@ Files.readString(Paths.get(getPath("InputMainExpectedInputJavadocComment.txt"))) @@ -1311,8 +1301,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionOption( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16620,7 +16620,7 @@ "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputMainSuppressionsStringPrinter']]", @@ -1331,7 +1320,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionAndTabWidthOption( + void printSuppressionAndTabWidthOption( @@ -16629,7 +16629,7 @@ addEndOfLine( @@ -1363,7 +1352,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionConflictingOptionsTvsC( + void printSuppressionConflictingOptionsTvsC( @@ -16638,7 +16638,7 @@ assertWithMessage("Unexpected output log") @@ -1375,7 +1364,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionConflictingOptionsTvsP( + void printSuppressionConflictingOptionsTvsP( @@ -16647,7 +16647,7 @@ -1, "-p", getPath("InputMainMycheckstyle.properties"), "-s", "2:4", getPath("")); @@ -1388,7 +1377,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionConflictingOptionsTvsF( + void printSuppressionConflictingOptionsTvsF( @@ -16656,16 +16656,16 @@ assertWithMessage("Unexpected output log") @@ -1400,7 +1389,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionConflictingOptionsTvsO( + void printSuppressionConflictingOptionsTvsO( @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); - + @@ -1414,7 +1403,7 @@ public class MainTest { } - + @Test - public void testPrintSuppressionOnMoreThanOneFile( + void printSuppressionOnMoreThanOneFile( @@ -16674,7 +16674,7 @@ assertWithMessage("Unexpected output log") @@ -1427,7 +1416,7 @@ public class MainTest { } - + @Test - public void testGenerateXpathSuppressionOptionOne( + void generateXpathSuppressionOptionOne( @@ -16683,7 +16683,7 @@ addEndOfLine( @@ -1546,7 +1535,7 @@ public class MainTest { } - + @Test - public void testGenerateXpathSuppressionOptionTwo( + void generateXpathSuppressionOptionTwo( @@ -16692,16 +16692,16 @@ addEndOfLine( @@ -1593,7 +1582,7 @@ public class MainTest { } - + @Test - public void testGenerateXpathSuppressionOptionEmptyConfig( + void generateXpathSuppressionOptionEmptyConfig( @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = ""; - + @@ -1612,8 +1601,7 @@ public class MainTest { } - + @Test - public void testGenerateXpathSuppressionOptionCustomOutput(@SysErr Capturable systemErr) - throws IOException { @@ -16720,7 +16720,7 @@ .that(systemErr.getCapturedData()) @@ -1648,7 +1636,7 @@ public class MainTest { } - + @Test - public void testGenerateXpathSuppressionOptionDefaultTabWidth( + void generateXpathSuppressionOptionDefaultTabWidth( @@ -16729,13 +16729,13 @@ addEndOfLine( @@ -1681,7 +1669,7 @@ public class MainTest { } - + @Test - public void testGenerateXpathSuppressionOptionCustomTabWidth( + void generateXpathSuppressionOptionCustomTabWidth( @SysErr Capturable systemErr, @SysOut Capturable systemOut) { final String expected = ""; - + @@ -1711,7 +1699,7 @@ public class MainTest { * @noinspectionreason RedundantThrows - false positive */ @@ -16747,7 +16747,7 @@ Files.readString( @@ -1730,8 +1718,7 @@ public class MainTest { } - + @Test - public void testConflictingOptionsTvsC( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16757,7 +16757,7 @@ .that(systemOut.getCapturedData()) @@ -1742,8 +1729,7 @@ public class MainTest { } - + @Test - public void testConflictingOptionsTvsP( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16767,7 +16767,7 @@ .that(systemOut.getCapturedData()) @@ -1754,8 +1740,7 @@ public class MainTest { } - + @Test - public void testConflictingOptionsTvsF( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16777,25 +16777,25 @@ .that(systemOut.getCapturedData()) @@ -1766,7 +1751,7 @@ public class MainTest { } - + @Test - public void testConflictingOptionsTvsS(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void conflictingOptionsTvsS(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); - + @@ -1780,7 +1765,7 @@ public class MainTest { } - + @Test - public void testConflictingOptionsTvsO(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void conflictingOptionsTvsO(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); - + @@ -1794,7 +1779,7 @@ public class MainTest { } - + @Test - public void testDebugOption(@SysErr Capturable systemErr) { + void debugOption(@SysErr Capturable systemErr) { @@ -16804,7 +16804,7 @@ .that(systemErr.getCapturedData()) @@ -1802,7 +1787,7 @@ public class MainTest { } - + @Test - public void testExcludeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void excludeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) @@ -16813,7 +16813,7 @@ assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-e", filePath); @@ -1815,7 +1800,7 @@ public class MainTest { } - + @Test - public void testExcludeOptionFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void excludeOptionFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) @@ -16822,7 +16822,7 @@ assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-e", filePath); @@ -1828,7 +1813,7 @@ public class MainTest { } - + @Test - public void testExcludeRegexpOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + void excludeRegexpOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) @@ -16831,7 +16831,7 @@ assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-x", "."); @@ -1839,8 +1824,8 @@ public class MainTest { } - + @Test - public void testExcludeRegexpOptionFile( - @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { @@ -16843,7 +16843,7 @@ @@ -1849,9 +1834,9 @@ public class MainTest { assertWithMessage("Unexpected output log").that(systemErr.getCapturedData()).isEqualTo(""); } - + - @Test @SuppressWarnings("unchecked") - public void testExcludeDirectoryNotMatch() throws Exception { @@ -16854,16 +16854,16 @@ method.setAccessible(true); @@ -1863,7 +1848,7 @@ public class MainTest { } - + @Test - public void testCustomRootModule(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void customRootModule(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { TestRootModuleChecker.reset(); - + assertMainReturnCode( @@ -1879,7 +1864,7 @@ public class MainTest { } - + @Test - public void testCustomSimpleRootModule(@SysErr Capturable systemErr) { + void customSimpleRootModule(@SysErr Capturable systemErr) { @@ -16872,7 +16872,7 @@ -2, @@ -1908,8 +1893,7 @@ public class MainTest { } - + @Test - public void testExceptionOnExecuteIgnoredModuleWithUnknownModuleName( - @SysErr Capturable systemErr) { @@ -16882,7 +16882,7 @@ "-c", @@ -1925,8 +1909,7 @@ public class MainTest { } - + @Test - public void testExceptionOnExecuteIgnoredModuleWithBadPropertyValue( - @SysErr Capturable systemErr) { @@ -16892,7 +16892,7 @@ "-c", @@ -1946,15 +1929,14 @@ public class MainTest { } - + @Test - public void testNoProblemOnExecuteIgnoredModuleWithBadPropertyValue( - @SysErr Capturable systemErr) { @@ -16901,7 +16901,7 @@ 0, "-c", getPath("InputMainConfig-TypeName-bad-value.xml"), "", getPath("InputMain.java")); assertWithMessage("Unexpected system error log").that(systemErr.getCapturedData()).isEmpty(); } - + @Test - public void testMissingFiles(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + void missingFiles(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { @@ -16910,14 +16910,14 @@ assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); @@ -1964,13 +1946,13 @@ public class MainTest { } - + @Test - public void testOutputFormatToStringLowercase() { + void outputFormatToStringLowercase() { assertWithMessage("expected xml").that(Main.OutputFormat.XML.toString()).isEqualTo("xml"); assertWithMessage("expected plain").that(Main.OutputFormat.PLAIN.toString()).isEqualTo("plain"); } - + @Test - public void testXmlOutputFormatCreateListener() throws IOException { + void xmlOutputFormatCreateListener() throws IOException { @@ -16926,7 +16926,7 @@ Main.OutputFormat.XML.createListener(out, OutputStreamOptions.CLOSE); @@ -1978,7 +1960,7 @@ public class MainTest { } - + @Test - public void testSarifOutputFormatCreateListener() throws IOException { + void sarifOutputFormatCreateListener() throws IOException { @@ -16935,7 +16935,7 @@ Main.OutputFormat.SARIF.createListener(out, OutputStreamOptions.CLOSE); @@ -1986,7 +1968,7 @@ public class MainTest { } - + @Test - public void testPlainOutputFormatCreateListener() throws IOException { + void plainOutputFormatCreateListener() throws IOException { @@ -16944,22 +16944,22 @@ Main.OutputFormat.PLAIN.createListener(out, OutputStreamOptions.CLOSE); @@ -2025,7 +2007,7 @@ public class MainTest { private boolean isClosed; - + private ShouldNotBeClosedStream() { - super(new ByteArrayOutputStream(), false, StandardCharsets.UTF_8); + super(new ByteArrayOutputStream(), false, UTF_8); } - + @Override --- a/src/test/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLoggerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLoggerTest.java @@ -31,10 +31,10 @@ import java.io.IOException; import java.io.OutputStream; import org.junit.jupiter.api.Test; - + -public class MetadataGeneratorLoggerTest { +final class MetadataGeneratorLoggerTest { - + @Test - public void testIgnoreSeverityLevel() { + void ignoreSeverityLevel() { @@ -16968,7 +16968,7 @@ new MetadataGeneratorLogger(outputStream, OutputStreamOptions.CLOSE); @@ -59,7 +59,7 @@ public class MetadataGeneratorLoggerTest { } - + @Test - public void testAddException() { + void addException() { @@ -16977,7 +16977,7 @@ new MetadataGeneratorLogger(outputStream, OutputStreamOptions.CLOSE); @@ -72,7 +72,7 @@ public class MetadataGeneratorLoggerTest { } - + @Test - public void testClose() throws IOException { + void close() throws IOException { @@ -16986,7 +16986,7 @@ final MetadataGeneratorLogger logger = @@ -83,7 +83,7 @@ public class MetadataGeneratorLoggerTest { } - + @Test - public void testCloseOutputStreamOptionNone() throws IOException { + void closeOutputStreamOptionNone() throws IOException { @@ -16995,7 +16995,7 @@ final MetadataGeneratorLogger logger = @@ -95,7 +95,7 @@ public class MetadataGeneratorLoggerTest { } - + @Test - public void testFlushStreams() throws Exception { + void flushStreams() throws Exception { @@ -17006,12 +17006,12 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java @@ -20,8 +20,10 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; -import static org.junit.jupiter.api.Assertions.assertThrows; +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; import java.io.File; @@ -17022,12 +17022,12 @@ */ -public class PackageNamesLoaderTest extends AbstractPathTestSupport { +final class PackageNamesLoaderTest extends AbstractPathTestSupport { - + @Override protected String getPackageLocation() { @@ -53,26 +55,25 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testDefault() throws CheckstyleException { + void testDefault() throws CheckstyleException { @@ -17035,17 +17035,17 @@ PackageNamesLoader.getPackageNames(Thread.currentThread().getContextClassLoader()); assertWithMessage("pkgNames.length.").that(packageNames).isEmpty(); } - + @Test - public void testNoPackages() throws Exception { + void noPackages() throws Exception { final Set actualPackageNames = - PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(Collections.emptyEnumeration())); + PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(emptyEnumeration())); - + assertWithMessage("Invalid package names length.").that(actualPackageNames).isEmpty(); } - + @Test - public void testPackagesFile() throws Exception { + void packagesFile() throws Exception { @@ -17054,12 +17054,12 @@ - Collections.singleton( - new File(getPath("InputPackageNamesLoaderFile.xml")).toURI().toURL())); + ImmutableSet.of(new File(getPath("InputPackageNamesLoaderFile.xml")).toURI().toURL())); - + final Set actualPackageNames = PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); @@ -107,10 +108,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testPackagesWithDots() throws Exception { + void packagesWithDots() throws Exception { @@ -17068,11 +17068,11 @@ - Collections.singleton( + ImmutableSet.of( new File(getPath("InputPackageNamesLoaderWithDots.xml")).toURI().toURL())); - + final Set actualPackageNames = @@ -129,10 +130,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testPackagesWithDotsEx() throws Exception { + void packagesWithDotsEx() throws Exception { @@ -17081,11 +17081,11 @@ - Collections.singleton( + ImmutableSet.of( new File(getPath("InputPackageNamesLoaderWithDotsEx.xml")).toURI().toURL())); - + final Set actualPackageNames = @@ -151,10 +152,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testPackagesWithSaxException() throws Exception { + void packagesWithSaxException() throws Exception { @@ -17094,11 +17094,11 @@ - Collections.singleton( + ImmutableSet.of( new File(getPath("InputPackageNamesLoaderNotXml.java")).toURI().toURL())); - + try { @@ -169,7 +170,7 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testPackagesWithIoException() throws Exception { + void packagesWithIoException() throws Exception { @@ -17108,15 +17108,15 @@ @@ -195,7 +196,7 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } }); - + - final Enumeration enumeration = Collections.enumeration(Collections.singleton(url)); + final Enumeration enumeration = Collections.enumeration(ImmutableSet.of(url)); - + try { PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); @@ -213,7 +214,7 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testPackagesWithIoExceptionGetResources() { + void packagesWithIoExceptionGetResources() { @@ -17125,14 +17125,14 @@ assertWithMessage("CheckstyleException is expected").fail(); @@ -229,21 +230,20 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testUnmodifiableCollection() throws Exception { + void unmodifiableCollection() throws Exception { final Set actualPackageNames = - PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(Collections.emptyEnumeration())); + PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(emptyEnumeration())); - + - assertThrows( - UnsupportedOperationException.class, - () -> actualPackageNames.add("com.puppycrawl.tools.checkstyle.checks.modifier")); @@ -17140,7 +17140,7 @@ + () -> actualPackageNames.add("com.puppycrawl.tools.checkstyle.checks.modifier")) + .isInstanceOf(UnsupportedOperationException.class); } - + @Test - public void testMapping() throws Exception { + void mapping() throws Exception { @@ -17149,12 +17149,12 @@ - Collections.singleton( - new File(getPath("InputPackageNamesLoader1.xml")).toURI().toURL())); + ImmutableSet.of(new File(getPath("InputPackageNamesLoader1.xml")).toURI().toURL())); - + final Set actualPackageNames = PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); @@ -252,11 +252,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMapping2() throws Exception { + void mapping2() throws Exception { @@ -17163,7 +17163,7 @@ - Collections.singleton( - new File(getPath("InputPackageNamesLoader2.xml")).toURI().toURL())); + ImmutableSet.of(new File(getPath("InputPackageNamesLoader2.xml")).toURI().toURL())); - + final Set actualPackageNames = PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); --- a/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java @@ -17175,7 +17175,7 @@ +import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mockStatic; - + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; @@ -17191,14 +17191,14 @@ import java.util.Map; @@ -58,13 +60,13 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; - + /** Enter a description of class PackageObjectFactoryTest.java. */ -public class PackageObjectFactoryTest { +final class PackageObjectFactoryTest { - + private final PackageObjectFactory factory = new PackageObjectFactory(BASE_PACKAGE, Thread.currentThread().getContextClassLoader()); - + @Test - public void testCtorNullLoaderException1() { + void ctorNullLoaderException1() { @@ -17207,7 +17207,7 @@ assertWithMessage("Exception is expected but got " + test).fail(); @@ -76,7 +78,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCtorNullLoaderException2() { + void ctorNullLoaderException2() { @@ -17216,7 +17216,7 @@ assertWithMessage("Exception is expected but got " + test).fail(); @@ -88,12 +90,12 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCtorNullPackageException1() { + void ctorNullPackageException1() { @@ -17231,7 +17231,7 @@ assertWithMessage("Invalid exception message") @@ -103,7 +105,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCtorNullPackageException2() { + void ctorNullPackageException2() { @@ -17240,7 +17240,7 @@ final Object test = new PackageObjectFactory((String) null, classLoader); @@ -116,14 +118,13 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCtorNullPackageException3() { + void ctorNullPackageException3() { @@ -17257,7 +17257,7 @@ assertWithMessage("Invalid exception message") @@ -133,7 +134,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testMakeObjectFromName() throws CheckstyleException { + void makeObjectFromName() throws CheckstyleException { @@ -17266,7 +17266,7 @@ assertWithMessage("Checker should not be null when creating module from name") @@ -142,7 +143,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testMakeCheckFromName() { + void makeCheckFromName() { @@ -17275,7 +17275,7 @@ factory.createModule(name); @@ -162,7 +163,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateModuleWithNonExistName() { + void createModuleWithNonExistName() { @@ -17284,7 +17284,7 @@ }; @@ -198,7 +199,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateObjectFromMap() throws Exception { + void createObjectFromMap() throws Exception { @@ -17293,7 +17293,7 @@ final String packageName = BASE_PACKAGE + ".packageobjectfactory.bar"; @@ -216,7 +217,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateStandardModuleObjectFromMap() throws Exception { + void createStandardModuleObjectFromMap() throws Exception { @@ -17302,7 +17302,7 @@ final String fullName = BASE_PACKAGE + PACKAGE_SEPARATOR + moduleName; @@ -229,7 +230,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateStandardCheckModuleObjectFromMap() throws Exception { + void createStandardCheckModuleObjectFromMap() throws Exception { @@ -17311,7 +17311,7 @@ final String fullName = @@ -250,7 +251,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateObjectFromFullModuleNamesWithAmbiguousException() { + void createObjectFromFullModuleNamesWithAmbiguousException() { @@ -17320,7 +17320,7 @@ final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); @@ -284,7 +285,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateObjectFromFullModuleNamesWithCantInstantiateException() { + void createObjectFromFullModuleNamesWithCantInstantiateException() { @@ -17329,7 +17329,7 @@ final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); @@ -329,7 +330,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateObjectFromFullModuleNamesWithExceptionByBruteForce() { + void createObjectFromFullModuleNamesWithExceptionByBruteForce() { @@ -17338,7 +17338,7 @@ final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); @@ -378,7 +379,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateObjectByBruteForce() throws Exception { + void createObjectByBruteForce() throws Exception { @@ -17347,7 +17347,7 @@ PackageObjectFactory.class.getDeclaredMethod( @@ -391,7 +392,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateCheckByBruteForce() throws Exception { + void createCheckByBruteForce() throws Exception { @@ -17356,7 +17356,7 @@ PackageObjectFactory.class.getDeclaredMethod( @@ -410,11 +411,11 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateCheckWithPartialPackageNameByBruteForce() throws Exception { + void createCheckWithPartialPackageNameByBruteForce() throws Exception { @@ -17370,7 +17370,7 @@ final AnnotationLocationCheck check = @@ -425,21 +426,21 @@ public class PackageObjectFactoryTest { } - + @Test - public void testJoinPackageNamesWithClassName() throws Exception { + void joinPackageNamesWithClassName() throws Exception { @@ -17385,7 +17385,7 @@ String.valueOf(method.invoke(PackageObjectFactory.class, className, packages)); assertWithMessage("Invalid class name").that(actual).isEqualTo("test." + className); } - + - @Test @SuppressWarnings("unchecked") - public void testNameToFullModuleNameMap() throws Exception { @@ -17396,7 +17396,7 @@ final Field field = packageObjectFactoryClass.getDeclaredField("NAME_TO_FULL_MODULE_NAME"); @@ -470,7 +471,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testConstructorFailure() { + void constructorFailure() { @@ -17405,21 +17405,21 @@ assertWithMessage("Exception is expected").fail(); @@ -487,7 +488,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testGetShortFromFullModuleNames() { + void getShortFromFullModuleNames() { final String fullName = "com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck"; - + assertWithMessage("Invalid simple check name") @@ -496,7 +497,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testGetShortFromFullModuleNamesThirdParty() { + void getShortFromFullModuleNamesThirdParty() { final String fullName = "java.util.stream.Collectors"; - + assertWithMessage("Invalid simple check name") @@ -516,11 +517,11 @@ public class PackageObjectFactoryTest { * @throws Exception when the code tested throws an exception @@ -17434,10 +17434,10 @@ + final Set packages = ImmutableSet.of(packageName); final PackageObjectFactory objectFactory = new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); - + @@ -544,9 +545,9 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateObjectWithNameContainingPackageSeparator() throws Exception { + void createObjectWithNameContainingPackageSeparator() throws Exception { @@ -17446,7 +17446,7 @@ + final Set packages = ImmutableSet.of(BASE_PACKAGE); final PackageObjectFactory objectFactory = new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); - + @@ -562,9 +563,9 @@ public class PackageObjectFactoryTest { * It ensures that ModuleReflectionUtil.getCheckstyleModules is not executed in this case. */ @@ -17458,10 +17458,10 @@ + final Set packages = ImmutableSet.of(BASE_PACKAGE); final PackageObjectFactory objectFactory = new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); - + @@ -588,9 +589,9 @@ public class PackageObjectFactoryTest { } - + @Test - public void testCreateModuleWithTryInAllRegisteredPackages() { + void createModuleWithTryInAllRegisteredPackages() { @@ -17473,7 +17473,7 @@ final CheckstyleException ex = @@ -611,7 +612,7 @@ public class PackageObjectFactoryTest { } - + @Test - public void testExceptionMessage() { + void exceptionMessage() { @@ -17485,10 +17485,10 @@ @@ -24,10 +24,10 @@ import static com.google.common.truth.Truth.assertWithMessage; import java.util.Properties; import org.junit.jupiter.api.Test; - + -public class PropertiesExpanderTest { +final class PropertiesExpanderTest { - + @Test - public void testCtorException() { + void ctorException() { @@ -17497,7 +17497,7 @@ assertWithMessage("exception expected but got " + test).fail(); @@ -39,7 +39,7 @@ public class PropertiesExpanderTest { } - + @Test - public void testDefaultProperties() { + void defaultProperties() { @@ -17509,15 +17509,15 @@ @@ -54,7 +54,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.mockito.MockedStatic; - + -public class PropertyCacheFileTest extends AbstractPathTestSupport { +final class PropertyCacheFileTest extends AbstractPathTestSupport { - + @TempDir public File temporaryFolder; - + @@ -64,7 +64,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testCtor() { + void ctor() { @@ -17526,7 +17526,7 @@ assertWithMessage("exception expected but got " + test).fail(); @@ -85,7 +85,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testInCache() throws IOException { + void inCache() throws IOException { @@ -17535,16 +17535,16 @@ final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); @@ -102,7 +102,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testResetIfFileDoesNotExist() throws IOException { + void resetIfFileDoesNotExist() throws IOException { final Configuration config = new DefaultConfiguration("myName"); final PropertyCacheFile cache = new PropertyCacheFile(config, "fileDoesNotExist.txt"); - + @@ -114,7 +114,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testPopulateDetails() throws IOException { + void populateDetails() throws IOException { @@ -17553,7 +17553,7 @@ new PropertyCacheFile(config, getPath("InputPropertyCacheFile")); @@ -136,7 +136,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testConfigHashOnReset() throws IOException { + void configHashOnReset() throws IOException { @@ -17562,7 +17562,7 @@ final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); @@ -154,7 +154,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testConfigHashRemainsOnResetExternalResources() throws IOException { + void configHashRemainsOnResetExternalResources() throws IOException { @@ -17571,7 +17571,7 @@ final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); @@ -180,7 +180,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testCacheRemainsWhenExternalResourceTheSame() throws IOException { + void cacheRemainsWhenExternalResourceTheSame() throws IOException { @@ -17580,7 +17580,7 @@ File.createTempFile("junit", null, temporaryFolder).getPath(); @@ -209,7 +209,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testExternalResourceIsSavedInCache() throws Exception { + void externalResourceIsSavedInCache() throws Exception { @@ -17588,7 +17588,7 @@ final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); @@ -223,7 +223,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { - + final MessageDigest digest = MessageDigest.getInstance("SHA-1"); final URI uri = CommonUtil.getUriByFilename(pathToResource); - final byte[] input = ByteStreams.toByteArray(new BufferedInputStream(uri.toURL().openStream())); @@ -17598,7 +17598,7 @@ oos.writeObject(input); @@ -237,7 +237,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testCacheDirectoryDoesNotExistAndShouldBeCreated() throws IOException { + void cacheDirectoryDoesNotExistAndShouldBeCreated() throws IOException { @@ -17607,7 +17607,7 @@ String.format(Locale.ENGLISH, "%s%2$stemp%2$scache.temp", temporaryFolder, File.separator); @@ -250,7 +250,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testPathToCacheContainsOnlyFileName() throws IOException { + void pathToCacheContainsOnlyFileName() throws IOException { @@ -17617,7 +17617,7 @@ @@ -263,9 +263,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { Files.delete(filePath); } - + - @Test @DisabledOnOs(OS.WINDOWS) - public void testPersistWithSymbolicLinkToDirectory() throws IOException { @@ -17629,7 +17629,7 @@ @@ -283,9 +283,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { .isTrue(); } - + - @Test @DisabledOnOs(OS.WINDOWS) - public void testSymbolicLinkResolution() throws IOException { @@ -17641,7 +17641,7 @@ @@ -303,9 +303,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { .isTrue(); } - + - @Test @DisabledOnOs(OS.WINDOWS) - public void testSymbolicLinkToNonDirectory() throws IOException { @@ -17653,7 +17653,7 @@ @@ -325,9 +325,9 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { .contains(expectedMessage); } - + - @Test @DisabledOnOs(OS.WINDOWS) - public void testMultipleSymbolicLinkResolution() throws IOException { @@ -17664,13 +17664,13 @@ Files.createSymbolicLink(firstSymbolicLink, actualDirectory); @@ -349,7 +349,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testChangeInConfig() throws Exception { + void changeInConfig() throws Exception { final DefaultConfiguration config = new DefaultConfiguration("myConfig"); config.addProperty("attr", "value"); - + @@ -401,11 +401,11 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { * @noinspectionreason ResultOfMethodCallIgnored - Setup for mockito to only mock toByteArray to * throw exception. @@ -17688,7 +17688,7 @@ final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); @@ -440,7 +440,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { } - + @Test - public void testExceptionNoSuchAlgorithmException() throws Exception { + void exceptionNoSuchAlgorithmException() throws Exception { @@ -17710,10 +17710,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; - + 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 @@ -17722,15 +17722,15 @@ import java.io.PrintWriter; -import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; - + -public class SarifLoggerTest extends AbstractModuleTestSupport { +final class SarifLoggerTest extends AbstractModuleTestSupport { - + /** * Output stream to hold the test results. The IntelliJ IDEA issues the AutoCloseableResource @@ -48,7 +48,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testEscape() { + void escape() { @@ -17739,7 +17739,7 @@ {"\\", "\\\\"}, @@ -71,7 +71,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddError() throws IOException { + void addError() throws IOException { @@ -17748,7 +17748,7 @@ final Violation violation = @@ -94,7 +94,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddErrorWithWarningLevel() throws IOException { + void addErrorWithWarningLevel() throws IOException { @@ -17757,7 +17757,7 @@ final Violation violation = @@ -117,7 +117,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddErrors() throws IOException { + void addErrors() throws IOException { @@ -17766,7 +17766,7 @@ final Violation violation = @@ -155,7 +155,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddException() throws IOException { + void addException() throws IOException { @@ -17775,7 +17775,7 @@ final Violation message = @@ -170,7 +170,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testAddExceptions() throws IOException { + void addExceptions() throws IOException { @@ -17784,7 +17784,7 @@ final Violation violation = @@ -192,7 +192,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testLineOnly() throws IOException { + void lineOnly() throws IOException { @@ -17793,7 +17793,7 @@ final Violation violation = @@ -207,7 +207,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testEmpty() throws IOException { + void empty() throws IOException { @@ -17802,7 +17802,7 @@ final Violation violation = @@ -221,7 +221,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testNullOutputStreamOptions() { + void nullOutputStreamOptions() { @@ -17811,7 +17811,7 @@ // assert required to calm down eclipse's 'The allocated object is never used' violation @@ -235,7 +235,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testCloseStream() throws IOException { + void closeStream() throws IOException { @@ -17820,7 +17820,7 @@ logger.auditFinished(null); @@ -246,7 +246,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testNoCloseStream() throws IOException { + void noCloseStream() throws IOException { @@ -17829,7 +17829,7 @@ logger.auditFinished(null); @@ -259,7 +259,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testFinishLocalSetup() throws IOException { + void finishLocalSetup() throws IOException { @@ -17838,7 +17838,7 @@ logger.auditStarted(null); @@ -268,7 +268,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { } - + @Test - public void testReadResourceWithInvalidName() { + void readResourceWithInvalidName() { @@ -17854,21 +17854,21 @@ + final String actualContent = toLfLineEnding(actualOutputStream.toString(UTF_8)); assertWithMessage("sarif content should match").that(actualContent).isEqualTo(expectedContent); } - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinterTest.java @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import java.io.File; import org.junit.jupiter.api.Test; - + -public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { +final class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { - + private static final String EOL = System.getProperty("line.separator"); - + @@ -36,14 +36,14 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -17876,7 +17876,7 @@ .that(isUtilsClassHasPrivateConstructor(SuppressionsStringPrinter.class)) .isTrue(); } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { @@ -17885,7 +17885,7 @@ + "[./IDENT[@text='InputSuppressionsStringPrinter']]" @@ -65,7 +65,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testCustomTabWidth() throws Exception { + void customTabWidth() throws Exception { @@ -17894,7 +17894,7 @@ + "[./IDENT[@text='InputSuppressionsStringPrinter']]" @@ -90,7 +90,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testCustomTabWidthEmptyResult() throws Exception { + void customTabWidthEmptyResult() throws Exception { @@ -17903,7 +17903,7 @@ final int tabWidth = 6; @@ -100,7 +100,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testInvalidLineAndColumnNumberParameter() throws Exception { + void invalidLineAndColumnNumberParameter() throws Exception { @@ -17912,7 +17912,7 @@ final int tabWidth = 2; @@ -115,7 +115,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { } - + @Test - public void testParseFileTextThrowable() throws Exception { + void parseFileTextThrowable() throws Exception { @@ -17924,10 +17924,10 @@ @@ -25,10 +25,10 @@ import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class ThreadModeSettingsTest { +final class ThreadModeSettingsTest { - + @Test - public void testProperties() { + void properties() { @@ -17936,34 +17936,34 @@ .that(config.getCheckerThreadsNumber()) @@ -39,7 +39,7 @@ public class ThreadModeSettingsTest { } - + @Test - public void testResolveCheckerInMultiThreadMode() { + void resolveCheckerInMultiThreadMode() { final ThreadModeSettings configuration = new ThreadModeSettings(2, 2); - + try { @@ -53,7 +53,7 @@ public class ThreadModeSettingsTest { } - + @Test - public void testResolveCheckerInSingleThreadMode() { + void resolveCheckerInSingleThreadMode() { final ThreadModeSettings singleThreadMode = ThreadModeSettings.SINGLE_THREAD_MODE_INSTANCE; - + final String name = singleThreadMode.resolveName(ThreadModeSettings.CHECKER_MODULE_NAME); @@ -63,7 +63,7 @@ public class ThreadModeSettingsTest { } - + @Test - public void testResolveTreeWalker() { + void resolveTreeWalker() { final ThreadModeSettings configuration = new ThreadModeSettings(2, 2); - + try { @@ -77,7 +77,7 @@ public class ThreadModeSettingsTest { } - + @Test - public void testResolveTreeWalkerInSingleThreadMode() { + void resolveTreeWalkerInSingleThreadMode() { @@ -17972,7 +17972,7 @@ assertWithMessage("Invalid name resolved: " + actual) @@ -86,7 +86,7 @@ public class ThreadModeSettingsTest { } - + @Test - public void testResolveAnyOtherModule() throws Exception { + void resolveAnyOtherModule() throws Exception { @@ -17982,7 +17982,7 @@ --- 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; - + 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; @@ -17992,7 +17992,7 @@ import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockConstruction; +import static org.mockito.Mockito.mockStatic; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -18007,7 +18007,7 @@ import java.util.Set; @@ -91,10 +94,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testProperFileExtension() throws Exception { + void properFileExtension() throws Exception { @@ -18074,7 +18074,7 @@ .when(() -> JavaParser.appendHiddenCommentNodes(any(DetailAST.class))) @@ -200,10 +202,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testImproperFileExtension() throws Exception { + void improperFileExtension() throws Exception { @@ -18087,7 +18087,7 @@ } @@ -212,7 +214,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptableTokens() throws Exception { + void acceptableTokens() throws Exception { @@ -18096,7 +18096,7 @@ try { @@ -237,7 +239,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testOnEmptyFile() throws Exception { + void onEmptyFile() throws Exception { @@ -18105,16 +18105,16 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -246,7 +248,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testWithCheckNotHavingTreeWalkerAsParent() throws Exception { + void withCheckNotHavingTreeWalkerAsParent() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(JavadocPackageCheck.class); - + try { @@ -264,7 +266,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetupChildExceptions() { + void setupChildExceptions() { @@ -18123,7 +18123,7 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -285,7 +287,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testSettersForParameters() throws Exception { + void settersForParameters() throws Exception { @@ -18132,16 +18132,16 @@ treeWalker.setTabWidth(1); @@ -298,7 +300,7 @@ 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(); - + @@ -322,7 +324,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessNonJavaFiles() throws Exception { + void processNonJavaFiles() throws Exception { @@ -18150,7 +18150,7 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -350,7 +352,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessNonJavaFilesWithoutException() throws Exception { + void processNonJavaFilesWithoutException() throws Exception { @@ -18159,7 +18159,7 @@ treeWalker.configure(new DefaultConfiguration("default config")); @@ -362,7 +364,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testWithCacheWithNoViolation() throws Exception { + void withCacheWithNoViolation() throws Exception { @@ -18168,7 +18168,7 @@ final PackageObjectFactory factory = @@ -375,7 +377,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessWithParserThrowable() throws Exception { + void processWithParserThrowable() throws Exception { @@ -18177,7 +18177,7 @@ final PackageObjectFactory factory = @@ -398,7 +400,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessWithRecognitionException() throws Exception { + void processWithRecognitionException() throws Exception { @@ -18186,16 +18186,16 @@ final PackageObjectFactory factory = @@ -421,7 +423,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testRequiredTokenIsEmptyIntArray() throws Exception { + void requiredTokenIsEmptyIntArray() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(RequiredTokenIsEmptyIntArray.class); final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); - + @@ -430,7 +432,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testBehaviourWithZeroChecks() throws Exception { + void behaviourWithZeroChecks() throws Exception { @@ -18204,7 +18204,7 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -445,7 +447,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testBehaviourWithOrdinaryAndCommentChecks() throws Exception { + void behaviourWithOrdinaryAndCommentChecks() throws Exception { @@ -18213,7 +18213,7 @@ treeWalker.configure(createModuleConfig(CommentsIndentationCheck.class)); @@ -472,7 +474,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testSetupChild() throws Exception { + void setupChild() throws Exception { @@ -18222,16 +18222,16 @@ new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); @@ -492,7 +494,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testBehaviourWithChecksAndFilters() throws Exception { + void behaviourWithChecksAndFilters() throws Exception { final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); filterConfig.addProperty("checkCPP", "false"); - + @@ -513,7 +515,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiCheckOrder() throws Exception { + void multiCheckOrder() throws Exception { @@ -18240,16 +18240,16 @@ treeWalkerConfig.addChild(createModuleConfig(WhitespaceAfterCheck.class)); @@ -527,7 +529,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiCheckOfSameTypeNoIdResultsInOrderingByHash() throws Exception { + void multiCheckOfSameTypeNoIdResultsInOrderingByHash() throws Exception { - + final DefaultConfiguration configuration1 = createModuleConfig(ParameterNameCheck.class); configuration1.addProperty("format", "^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"); @@ -557,7 +559,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testFinishLocalSetupFullyInitialized() { + void finishLocalSetupFullyInitialized() { @@ -18258,7 +18258,7 @@ treeWalker.setTabWidth(100); @@ -573,7 +575,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckInitIsCalledInTreeWalker() throws Exception { + void checkInitIsCalledInTreeWalker() throws Exception { @@ -18267,7 +18267,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -582,7 +584,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckDestroyIsCalledInTreeWalker() throws Exception { + void checkDestroyIsCalledInTreeWalker() throws Exception { @@ -18276,7 +18276,7 @@ final File file = File.createTempFile("file", ".pdf", temporaryFolder); @@ -594,7 +596,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentCheckDestroyIsCalledInTreeWalker() throws Exception { + void commentCheckDestroyIsCalledInTreeWalker() throws Exception { @@ -18285,7 +18285,7 @@ final File file = File.createTempFile("file", ".pdf", temporaryFolder); @@ -606,7 +608,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheWhenFileExternalResourceContentDoesNotChange() throws Exception { + void cacheWhenFileExternalResourceContentDoesNotChange() throws Exception { @@ -18294,7 +18294,7 @@ final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); @@ -629,7 +631,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testTreeWalkerFilterAbsolutePath() throws Exception { + void treeWalkerFilterAbsolutePath() throws Exception { @@ -18303,7 +18303,7 @@ final DefaultConfiguration checkConfig = createModuleConfig(LeftCurlyCheck.class); @@ -649,7 +651,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { } - + @Test - public void testExternalResourceFiltersWithNoExternalResource() throws Exception { + void externalResourceFiltersWithNoExternalResource() throws Exception { @@ -18316,32 +18316,32 @@ @Test - public void testOrderOfCheckExecution() throws Exception { + void orderOfCheckExecution() throws Exception { - + final DefaultConfiguration configuration1 = createModuleConfig(AaCheck.class); configuration1.addProperty("id", "2"); @@ -684,7 +686,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { treeWalkerConfig.addChild(configuration2); treeWalkerConfig.addChild(configuration1); - + - final List files = Collections.singletonList(new File(getPath("InputTreeWalker2.java"))); + final List files = ImmutableList.of(new File(getPath("InputTreeWalker2.java"))); final Checker checker = createChecker(treeWalkerConfig); - + try { --- a/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; - + /** Enter a description of class XMLLoggerTest.java. */ // -@cs[AbbreviationAsWordInName] Test should be named as its main class. -public class XMLLoggerTest extends AbstractXmlTestSupport { +final class XMLLoggerTest extends AbstractXmlTestSupport { - + /** * Output stream to hold the test results. The IntelliJ IDEA issues the AutoCloseableResource @@ -50,7 +50,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testEncode() throws IOException { + void encode() throws IOException { @@ -18350,7 +18350,7 @@ final String[][] encodings = { @@ -75,7 +75,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testIsReference() throws IOException { + void isReference() throws IOException { @@ -18359,7 +18359,7 @@ final String[] references = { @@ -97,7 +97,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testCloseStream() throws Exception { + void closeStream() throws Exception { @@ -18368,7 +18368,7 @@ logger.auditFinished(null); @@ -108,7 +108,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testNoCloseStream() throws Exception { + void noCloseStream() throws Exception { @@ -18377,7 +18377,7 @@ logger.auditFinished(null); @@ -120,7 +120,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testFileStarted() throws Exception { + void fileStarted() throws Exception { @@ -18386,7 +18386,7 @@ final AuditEvent ev = new AuditEvent(this, "Test.java"); @@ -131,7 +131,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testFileFinished() throws Exception { + void fileFinished() throws Exception { @@ -18395,7 +18395,7 @@ final AuditEvent ev = new AuditEvent(this, "Test.java"); @@ -141,7 +141,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddError() throws Exception { + void addError() throws Exception { @@ -18404,7 +18404,7 @@ final Violation violation = @@ -156,7 +156,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddErrorWithNullFileName() throws Exception { + void addErrorWithNullFileName() throws Exception { @@ -18413,7 +18413,7 @@ final Violation violation = @@ -170,7 +170,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddErrorModuleId() throws Exception { + void addErrorModuleId() throws Exception { @@ -18422,7 +18422,7 @@ final Violation violation = @@ -191,7 +191,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddErrorOnZeroColumns() throws Exception { + void addErrorOnZeroColumns() throws Exception { @@ -18431,7 +18431,7 @@ final Violation violation = @@ -206,7 +206,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddIgnored() throws Exception { + void addIgnored() throws Exception { @@ -18440,7 +18440,7 @@ final Violation violation = @@ -219,7 +219,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddException() throws Exception { + void addException() throws Exception { @@ -18449,7 +18449,7 @@ final Violation violation = @@ -232,7 +232,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddExceptionWithNullFileName() throws Exception { + void addExceptionWithNullFileName() throws Exception { @@ -18458,16 +18458,16 @@ final Violation violation = @@ -245,7 +245,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddExceptionAfterFileStarted() throws Exception { + void addExceptionAfterFileStarted() throws Exception { final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); logger.auditStarted(null); - + @@ -264,7 +264,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddExceptionBeforeFileFinished() throws Exception { + void addExceptionBeforeFileFinished() throws Exception { @@ -18476,7 +18476,7 @@ final Violation violation = @@ -279,7 +279,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAddExceptionBetweenFileStartedAndFinished() throws Exception { + void addExceptionBetweenFileStartedAndFinished() throws Exception { @@ -18485,7 +18485,7 @@ final Violation violation = @@ -296,7 +296,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testAuditFinishedWithoutFileFinished() throws Exception { + void auditFinishedWithoutFileFinished() throws Exception { @@ -18494,7 +18494,7 @@ final AuditEvent fileStartedEvent = new AuditEvent(this, "Test.java"); @@ -314,7 +314,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testNullOutputStreamOptions() { + void nullOutputStreamOptions() { @@ -18503,7 +18503,7 @@ // assert required to calm down eclipse's 'The allocated object is never used' violation @@ -328,7 +328,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { } - + @Test - public void testFinishLocalSetup() { + void finishLocalSetup() { @@ -18511,31 +18511,31 @@ logger.finishLocalSetup(); logger.auditStarted(null); @@ -338,7 +338,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { - + /** We keep this test for 100% coverage. Until #12873. */ @Test - public void testCtorWithTwoParametersCloseStreamOptions() { + void ctorWithTwoParametersCloseStreamOptions() { final XMLLogger logger = new XMLLogger(outStream, AutomaticBean.OutputStreamOptions.CLOSE); final boolean closeStream = TestUtil.getInternalState(logger, "closeStream"); - + @@ -347,7 +347,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { - + /** We keep this test for 100% coverage. Until #12873. */ @Test - public void testCtorWithTwoParametersNoneStreamOptions() { + void ctorWithTwoParametersNoneStreamOptions() { final XMLLogger logger = new XMLLogger(outStream, AutomaticBean.OutputStreamOptions.NONE); final boolean closeStream = TestUtil.getInternalState(logger, "closeStream"); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.stream.Collectors.toUnmodifiableSet; - + import com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck; import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; @@ -28,14 +29,13 @@ import java.io.IOException; @@ -18545,10 +18545,10 @@ -import java.util.stream.Collectors; import java.util.stream.Stream; import org.junit.jupiter.api.Test; - + -public class XdocsPropertyTypeTest { +final class XdocsPropertyTypeTest { - + @Test - public void testAllPropertyTypesAreUsed() throws IOException { + void allPropertyTypesAreUsed() throws IOException { @@ -18561,12 +18561,12 @@ .map(XdocsPropertyType::value) - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); - + assertWithMessage("All property types should be used") .that(propertyTypes) @@ -53,7 +53,7 @@ public class XdocsPropertyTypeTest { } - + @Test - public void testAllPropertyTypesHaveDescription() { + void allPropertyTypesHaveDescription() { @@ -18578,10 +18578,10 @@ @@ -30,10 +30,10 @@ import org.junit.jupiter.api.Test; import org.xml.sax.SAXException; import org.xml.sax.XMLReader; - + -public class XmlLoaderTest { +final class XmlLoaderTest { - + @Test - public void testParserConfiguredSuccessfully() throws Exception { + void parserConfiguredSuccessfully() throws Exception { @@ -18590,7 +18590,7 @@ assertWithMessage("Invalid entity resolver") @@ -42,14 +42,14 @@ public class XmlLoaderTest { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -18598,7 +18598,7 @@ .that(isUtilsClassHasPrivateConstructor(XmlLoader.LoadExternalDtdFeatureProvider.class)) .isTrue(); } - + @Test - public void testResolveEntityDefault() throws Exception { + void resolveEntityDefault() throws Exception { @@ -18607,7 +18607,7 @@ final DummyLoader dummyLoader = new DummyLoader(map); @@ -59,7 +59,7 @@ public class XmlLoaderTest { } - + @Test - public void testResolveEntityMap() throws Exception { + void resolveEntityMap() throws Exception { @@ -18619,10 +18619,10 @@ @@ -35,10 +35,10 @@ import java.nio.charset.StandardCharsets; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class XpathFileGeneratorAstFilterTest { +final class XpathFileGeneratorAstFilterTest { - + @Test - public void testAcceptNoToken() { + void acceptNoToken() { @@ -18631,7 +18631,7 @@ 0, 0, 0, null, null, null, null, null, XpathFileGeneratorAstFilterTest.class, null); @@ -56,7 +56,7 @@ public class XpathFileGeneratorAstFilterTest { } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -18640,7 +18640,7 @@ 3, @@ -87,7 +87,7 @@ public class XpathFileGeneratorAstFilterTest { } - + @Test - public void testNoXpathQuery() throws Exception { + void noXpathQuery() throws Exception { @@ -18649,7 +18649,7 @@ 10, @@ -116,7 +116,7 @@ public class XpathFileGeneratorAstFilterTest { } - + @Test - public void testTabWidth() throws Exception { + void tabWidth() throws Exception { @@ -18673,15 +18673,15 @@ @@ -41,7 +41,7 @@ import java.io.OutputStream; import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; - + -public class XpathFileGeneratorAuditListenerTest { +final class XpathFileGeneratorAuditListenerTest { - + /** OS specific line separator. */ private static final String EOL = System.getProperty("line.separator"); @@ -90,7 +90,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testFinishLocalSetup() { + void finishLocalSetup() { @@ -18690,7 +18690,7 @@ new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); @@ -103,7 +103,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testFileStarted() { + void fileStarted() { @@ -18699,7 +18699,7 @@ new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); @@ -115,7 +115,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testFileFinished() { + void fileFinished() { @@ -18708,7 +18708,7 @@ new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); @@ -127,7 +127,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testAddException() { + void addException() { @@ -18717,25 +18717,25 @@ new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); @@ -147,7 +147,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testCorrectOne() { + void correctOne() { final AuditEvent event = createAuditEvent("InputXpathFileGeneratorAuditListener.java", FIRST_MESSAGE); - + @@ -180,7 +180,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testCorrectTwo() { + void correctTwo() { final AuditEvent event1 = createAuditEvent("InputXpathFileGeneratorAuditListener.java", SECOND_MESSAGE); - + @@ -227,7 +227,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testOnlyOneMatching() { + void onlyOneMatching() { @@ -18744,7 +18744,7 @@ "InputXpathFileGeneratorAuditListener.java", 10, 5, MethodParamPadCheck.class); @@ -268,7 +268,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testCloseStream() { + void closeStream() { @@ -18753,7 +18753,7 @@ listener.finishLocalSetup(); @@ -279,7 +279,7 @@ public class XpathFileGeneratorAuditListenerTest { } - + @Test - public void testNoCloseStream() { + void noCloseStream() { @@ -18764,11 +18764,11 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.ant; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.jupiter.api.Assertions.assertThrows; - + import com.google.common.truth.StandardSubjectBuilder; @@ -35,7 +36,6 @@ import com.puppycrawl.tools.checkstyle.internal.testmodules.TestRootModuleChecke import java.io.File; @@ -18781,15 +18781,15 @@ @@ -52,7 +52,7 @@ import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.resources.FileResource; import org.junit.jupiter.api.Test; - + -public class CheckstyleAntTaskTest extends AbstractPathTestSupport { +final class CheckstyleAntTaskTest extends AbstractPathTestSupport { - + private static final String FLAWLESS_INPUT = "InputCheckstyleAntTaskFlawless.java"; private static final String VIOLATED_INPUT = "InputCheckstyleAntTaskError.java"; @@ -80,7 +80,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testDefaultFlawless() throws IOException { + final void defaultFlawless() throws IOException { @@ -18798,16 +18798,16 @@ antTask.setFile(new File(getPath(FLAWLESS_INPUT))); @@ -92,7 +92,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testPathsOneFile() throws IOException { + final void pathsOneFile() throws IOException { // given TestRootModuleChecker.reset(); - + @@ -118,7 +118,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testPathsFileWithLogVerification() throws IOException { + final void pathsFileWithLogVerification() throws IOException { @@ -18816,25 +18816,25 @@ final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); @@ -169,7 +169,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testPathsDirectoryWithNestedFile() throws IOException { + final void pathsDirectoryWithNestedFile() throws IOException { // given TestRootModuleChecker.reset(); - + @@ -200,7 +200,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testCustomRootModule() throws IOException { + final void customRootModule() throws IOException { TestRootModuleChecker.reset(); - + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); @@ -213,7 +213,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testFileSet() throws IOException { + final void fileSet() throws IOException { @@ -18843,7 +18843,7 @@ final FileSet examinationFileSet = new FileSet(); @@ -232,7 +232,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testNoConfigFile() throws IOException { + final void noConfigFile() throws IOException { @@ -18852,7 +18852,7 @@ antTask.setFile(new File(getPath(FLAWLESS_INPUT))); @@ -244,7 +244,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testNonExistentConfig() throws IOException { + final void nonExistentConfig() throws IOException { @@ -18861,7 +18861,7 @@ antTask.setProject(new Project()); @@ -257,7 +257,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testEmptyConfigFile() throws IOException { + final void emptyConfigFile() throws IOException { @@ -18870,7 +18870,7 @@ antTask.setProject(new Project()); @@ -270,7 +270,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testNoFile() throws IOException { + final void noFile() throws IOException { @@ -18879,7 +18879,7 @@ assertThrows(BuildException.class, antTask::execute, "BuildException is expected"); @@ -280,7 +280,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testMaxWarningExceeded() throws IOException { + final void maxWarningExceeded() throws IOException { @@ -18888,16 +18888,16 @@ antTask.setMaxWarnings(0); @@ -292,7 +292,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testMaxErrors() throws IOException { + final void maxErrors() throws IOException { TestRootModuleChecker.reset(); - + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); @@ -306,7 +306,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testFailureProperty() throws IOException { + final void failureProperty() throws IOException { @@ -18906,16 +18906,16 @@ antTask.setFile(new File(getPath(VIOLATED_INPUT))); @@ -330,7 +330,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testOverrideProperty() throws IOException { + final void overrideProperty() throws IOException { TestRootModuleChecker.reset(); - + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); @@ -347,7 +347,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testExecuteIgnoredModules() throws IOException { + final void executeIgnoredModules() throws IOException { @@ -18924,7 +18924,7 @@ antTask.setFailOnViolation(false); @@ -390,7 +390,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testConfigurationByUrl() throws IOException { + final void configurationByUrl() throws IOException { @@ -18933,7 +18933,7 @@ final URL url = new File(getPath(CONFIG_FILE)).toURI().toURL(); @@ -414,7 +414,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testConfigurationByResource() throws IOException { + final void configurationByResource() throws IOException { @@ -18942,25 +18942,25 @@ antTask.setConfig(getPath(CONFIG_FILE)); @@ -437,7 +437,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testSimultaneousConfiguration() throws IOException { + final void simultaneousConfiguration() throws IOException { final File file = new File(getPath(CONFIG_FILE)); final URL url = file.toURI().toURL(); - + @@ -453,7 +453,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testSetPropertiesFile() throws IOException { + final void setPropertiesFile() throws IOException { TestRootModuleChecker.reset(); - + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); @@ -467,7 +467,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testSetPropertiesNonExistentFile() throws IOException { + final void setPropertiesNonExistentFile() throws IOException { @@ -18969,7 +18969,7 @@ antTask.setProperties(new File(getPath(NOT_EXISTING_FILE))); @@ -479,7 +479,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testXmlOutput() throws IOException { + final void xmlOutput() throws IOException { @@ -18978,7 +18978,7 @@ antTask.setFailOnViolation(false); @@ -506,7 +506,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testSarifOutput() throws IOException { + final void sarifOutput() throws IOException { @@ -18987,7 +18987,7 @@ antTask.setFailOnViolation(false); @@ -538,7 +538,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testCreateListenerException() throws IOException { + final void createListenerException() throws IOException { @@ -18996,7 +18996,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -553,7 +553,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testCreateListenerExceptionWithXmlLogger() throws IOException { + final void createListenerExceptionWithXmlLogger() throws IOException { @@ -19005,7 +19005,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -571,7 +571,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testCreateListenerExceptionWithSarifLogger() throws IOException { + final void createListenerExceptionWithSarifLogger() throws IOException { @@ -19014,7 +19014,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -589,7 +589,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testSetInvalidType() { + void setInvalidType() { @@ -19023,7 +19023,7 @@ assertThrows( @@ -602,7 +602,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testSetFileValueByFile() throws IOException { + void setFileValueByFile() throws IOException { @@ -19032,7 +19032,7 @@ property.setFile(new File(filename)); @@ -612,7 +612,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testDefaultLoggerListener() throws IOException { + void defaultLoggerListener() throws IOException { @@ -19041,7 +19041,7 @@ assertWithMessage("Listener instance has unexpected type") @@ -621,7 +621,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testDefaultLoggerListenerWithToFile() throws IOException { + void defaultLoggerListenerWithToFile() throws IOException { @@ -19050,7 +19050,7 @@ formatter.setTofile(new File("target/")); @@ -631,7 +631,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testXmlLoggerListener() throws IOException { + void xmlLoggerListener() throws IOException { @@ -19059,7 +19059,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -643,7 +643,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testXmlLoggerListenerWithToFile() throws IOException { + void xmlLoggerListenerWithToFile() throws IOException { @@ -19068,7 +19068,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -656,7 +656,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testDefaultLoggerWithNullToFile() throws IOException { + void defaultLoggerWithNullToFile() throws IOException { @@ -19077,7 +19077,7 @@ assertWithMessage("Listener instance has unexpected type") @@ -665,7 +665,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testXmlLoggerWithNullToFile() throws IOException { + void xmlLoggerWithNullToFile() throws IOException { @@ -19086,7 +19086,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -677,7 +677,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testSarifLoggerListener() throws IOException { + void sarifLoggerListener() throws IOException { @@ -19095,7 +19095,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -689,7 +689,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testSarifLoggerListenerWithToFile() throws IOException { + void sarifLoggerListenerWithToFile() throws IOException { @@ -19104,7 +19104,7 @@ final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -702,7 +702,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testSarifLoggerWithNullToFile() throws IOException { + void sarifLoggerWithNullToFile() throws IOException { @@ -19112,34 +19112,34 @@ formatterType.setValue("sarif"); final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); @@ -715,14 +715,14 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { - + /** Testing deprecated method. */ @Test - public void testCreateClasspath() { + void createClasspath() { final CheckstyleAntTask antTask = new CheckstyleAntTask(); - + assertWithMessage("Invalid classpath").that(antTask.createClasspath().toString()).isEmpty(); } - + @Test - public void testDestroyed() throws IOException { + void destroyed() throws IOException { TestRootModuleChecker.reset(); - + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); @@ -736,7 +736,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testMaxWarnings() throws IOException { + void maxWarnings() throws IOException { TestRootModuleChecker.reset(); - + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); @@ -750,7 +750,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public final void testExecuteLogOutput() throws Exception { + final void executeLogOutput() throws Exception { @@ -19148,7 +19148,7 @@ ResourceBundle.getBundle(Definitions.CHECKSTYLE_BUNDLE, Locale.ROOT); @@ -795,7 +795,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testCheckerException() throws IOException { + void checkerException() throws IOException { @@ -19157,7 +19157,7 @@ antTask.setProject(new Project()); @@ -809,7 +809,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { } - + @Test - public void testLoggedTime() throws IOException { + void loggedTime() throws IOException { @@ -19167,30 +19167,30 @@ @@ -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 { } - + private static List readWholeFile(File outputFile) throws IOException { - return Files.readAllLines(outputFile.toPath(), StandardCharsets.UTF_8); + return Files.readAllLines(outputFile.toPath(), UTF_8); } - + 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; - + 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.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -19206,15 +19206,15 @@ @@ -37,7 +37,7 @@ import java.util.Set; import java.util.SortedSet; import org.junit.jupiter.api.Test; - + -public class AbstractCheckTest extends AbstractModuleTestSupport { +final class AbstractCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -45,7 +45,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -19223,7 +19223,7 @@ @Override @@ -70,7 +70,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptable() { + void getAcceptable() { @@ -19232,7 +19232,7 @@ @Override @@ -95,7 +95,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentNodes() { + void commentNodes() { @@ -19241,7 +19241,7 @@ @Override @@ -118,7 +118,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokenNames() { + void tokenNames() { @@ -19250,7 +19250,7 @@ @Override @@ -144,7 +144,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitToken() { + void visitToken() { @@ -19259,7 +19259,7 @@ check.visitToken(null); @@ -153,7 +153,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetLine() throws Exception { + void getLine() throws Exception { @@ -19268,7 +19268,7 @@ @Override @@ -181,7 +181,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetLineCodePoints() throws Exception { + void getLineCodePoints() throws Exception { @@ -19277,7 +19277,7 @@ @Override @@ -213,7 +213,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetTabWidth() { + void getTabWidth() { @@ -19286,7 +19286,7 @@ @Override @@ -238,7 +238,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileContents() { + void fileContents() { @@ -19295,7 +19295,7 @@ @Override @@ -268,7 +268,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -19304,16 +19304,16 @@ final int[] requiredTokens = {TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF}; @@ -302,7 +302,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClearViolations() { + void clearViolations() { final AbstractCheck check = new DummyAbstractCheck(); - + check.log(1, "key", "args"); @@ -312,11 +312,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineColumnLog() throws Exception { + void lineColumnLog() throws Exception { @@ -19322,12 +19322,12 @@ final File file = new File("fileName"); - final FileText theText = new FileText(file, Collections.singletonList("test123")); + final FileText theText = new FileText(file, ImmutableList.of("test123")); - + check.setFileContents(new FileContents(theText)); check.clearViolations(); @@ -338,11 +338,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAstLog() throws Exception { + void astLog() throws Exception { @@ -19336,12 +19336,12 @@ final File file = new File("fileName"); - final FileText theText = new FileText(file, Collections.singletonList("test123")); + final FileText theText = new FileText(file, ImmutableList.of("test123")); - + check.setFileContents(new FileContents(theText)); check.clearViolations(); @@ -362,7 +362,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheck() throws Exception { + void check() throws Exception { @@ -19360,14 +19360,14 @@ + assertThatThrownBy(() -> tokenNameSet.add("")) + .isInstanceOf(UnsupportedOperationException.class); } - + public static final class DummyAbstractCheck extends AbstractCheck { --- 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; - + import static com.google.common.truth.Truth.assertWithMessage; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.Checker; @@ -19380,15 +19380,15 @@ import java.util.SortedSet; import java.util.TreeSet; import org.junit.jupiter.api.Test; - + -public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { +final class AbstractFileSetCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,17 +41,17 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTabWidth() { + void tabWidth() { @@ -19396,7 +19396,7 @@ check.setTabWidth(12345); assertWithMessage("expected tab width").that(check.getTabWidth()).isEqualTo(12345); } - + @Test - public void testFileContents() { + void fileContents() { @@ -19409,7 +19409,7 @@ assertWithMessage("expected file contents") @@ -60,13 +60,13 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessSequential() throws Exception { + void processSequential() throws Exception { @@ -19420,26 +19420,26 @@ final SortedSet firstFileMessages = - check.process(firstFile, new FileText(firstFile, Collections.emptyList())); + check.process(firstFile, new FileText(firstFile, ImmutableList.of())); - + assertWithMessage("Invalid message") .that(firstFileMessages.first().getViolation()) @@ -86,25 +86,25 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotProcessed() throws Exception { + void notProcessed() throws Exception { final ExceptionFileSetCheck check = new ExceptionFileSetCheck(); check.setFileExtensions("java"); final File firstFile = new File("inputAbstractFileSetCheck.tmp"); - + - check.process(firstFile, new FileText(firstFile, Collections.emptyList())); + check.process(firstFile, new FileText(firstFile, ImmutableList.of())); - + final SortedSet internalMessages = check.getViolations(); assertWithMessage("Internal message should be empty").that(internalMessages).isEmpty(); } - + @Test - public void testProcessException() throws Exception { + void processException() throws Exception { @@ -19447,14 +19447,14 @@ check.configure(new DefaultConfiguration("filesetcheck")); check.setFileExtensions("tmp"); final File firstFile = new File("inputAbstractFileSetCheck.tmp"); - + - final FileText fileText = new FileText(firstFile, Collections.emptyList()); + final FileText fileText = new FileText(firstFile, ImmutableList.of()); try { check.process(firstFile, fileText); assertWithMessage("Exception is expected").fail(); @@ -118,7 +118,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { - + // again to prove only 1 violation exists final File secondFile = new File("inputAbstractFileSetCheck.tmp"); - final FileText fileText2 = new FileText(secondFile, Collections.emptyList()); @@ -19464,7 +19464,7 @@ assertWithMessage("Exception is expected").fail(); @@ -134,7 +134,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetFileExtension() { + void getFileExtension() { @@ -19472,7 +19472,7 @@ check.setFileExtensions("tmp", ".java"); final String[] expectedExtensions = {".tmp", ".java"}; @@ -146,7 +146,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { - + /** This javadoc exists only to suppress IntelliJ IDEA inspection. */ @Test - public void testSetExtensionThrowsExceptionWhenTheyAreNull() { @@ -19482,7 +19482,7 @@ check.setFileExtensions((String[]) null); @@ -159,7 +159,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineColumnLog() throws Exception { + void lineColumnLog() throws Exception { @@ -19491,7 +19491,7 @@ final File file = new File(getPath("InputAbstractFileSetLineColumn.java")); @@ -174,7 +174,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetMessageDispatcher() { + void getMessageDispatcher() { @@ -19500,7 +19500,7 @@ check.setMessageDispatcher(checker); @@ -185,7 +185,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheck() throws Exception { + void check() throws Exception { @@ -19509,7 +19509,7 @@ }; @@ -193,7 +193,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiFileFireErrors() throws Exception { + void multiFileFireErrors() throws Exception { @@ -19529,16 +19529,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporterTest.java @@ -28,7 +28,7 @@ import java.util.SortedSet; import org.junit.jupiter.api.Test; - + /** Tests to ensure that default message bundle is determined correctly. */ -public class AbstractViolationReporterTest { +final class AbstractViolationReporterTest { - + private final AbstractCheck emptyCheck = new EmptyCheck(); - + @@ -37,7 +37,7 @@ public class AbstractViolationReporterTest { } - + @Test - public void testGetMessageBundleWithPackage() throws Exception { + void getMessageBundleWithPackage() throws Exception { @@ -19547,7 +19547,7 @@ TestUtil.invokeStaticMethod( @@ -48,7 +48,7 @@ public class AbstractViolationReporterTest { } - + @Test - public void testGetMessageBundleWithoutPackage() throws Exception { + void getMessageBundleWithoutPackage() throws Exception { @@ -19556,14 +19556,14 @@ TestUtil.invokeStaticMethod( @@ -57,13 +57,13 @@ public class AbstractViolationReporterTest { } - + @Test - public void testCustomId() { + void customId() { emptyCheck.setId("MyId"); assertWithMessage("Id differs from expected").that(emptyCheck.getId()).isEqualTo("MyId"); } - + @Test - public void testSeverity() throws Exception { + void severity() throws Exception { @@ -19572,7 +19572,7 @@ emptyCheck.configure(config); @@ -75,7 +75,7 @@ public class AbstractViolationReporterTest { } - + @Test - public void testCustomMessage() throws Exception { + void customMessage() throws Exception { @@ -19581,7 +19581,7 @@ emptyCheck.configure(config); @@ -91,7 +91,7 @@ public class AbstractViolationReporterTest { } - + @Test - public void testCustomMessageWithParameters() throws Exception { + void customMessageWithParameters() throws Exception { @@ -19590,7 +19590,7 @@ emptyCheck.configure(config); @@ -107,7 +107,7 @@ public class AbstractViolationReporterTest { } - + @Test - public void testCustomMessageWithParametersNegative() throws Exception { + void customMessageWithParametersNegative() throws Exception { @@ -19600,21 +19600,21 @@ --- 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; - + import org.junit.jupiter.api.Test; - + -public class AuditEventTest { +final class AuditEventTest { - + @Test - public void test() { + void test() { final AuditEvent event = new AuditEvent(getClass()); - + assertWithMessage("invalid file name").that(event.getFileName()).isNull(); @@ -39,7 +39,7 @@ public class AuditEventTest { } - + @Test - public void testNoSource() { + void noSource() { @@ -19623,7 +19623,7 @@ IllegalArgumentException.class, @@ -49,7 +49,7 @@ public class AuditEventTest { } - + @Test - public void testFullConstructor() { + void fullConstructor() { @@ -19634,19 +19634,19 @@ +++ 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; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; - + -public class BeforeExecutionFileFilterSetTest { +final class BeforeExecutionFileFilterSetTest { - + @Test - public void testRemoveFilters() { + void removeFilters() { @@ -19655,7 +19655,7 @@ filterSet.addBeforeExecutionFileFilter(filter); @@ -39,7 +39,7 @@ public class BeforeExecutionFileFilterSetTest { } - + @Test - public void testAccept() { + void accept() { @@ -19664,7 +19664,7 @@ filter.setFileNamePattern(Pattern.compile(fileName)); @@ -52,7 +52,7 @@ public class BeforeExecutionFileFilterSetTest { } - + @Test - public void testReject() { + void reject() { @@ -19673,7 +19673,7 @@ filter.setFileNamePattern(Pattern.compile(fileName)); @@ -65,7 +65,7 @@ public class BeforeExecutionFileFilterSetTest { } - + @Test - public void testGetFilters2() { + void getFilters2() { @@ -19682,7 +19682,7 @@ assertWithMessage("size is the same") @@ -74,14 +74,14 @@ public class BeforeExecutionFileFilterSetTest { } - + @Test - public void testToString2() { + void toString2() { @@ -19690,13 +19690,13 @@ filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter()); assertWithMessage("size is the same").that(filterSet.toString()).isNotNull(); } - + @Test - public void testClear() { + void clear() { final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter()); - + @@ -102,12 +102,13 @@ public class BeforeExecutionFileFilterSetTest { done for the time being */ @@ -19711,7 +19711,7 @@ + assertThatThrownBy(() -> excFilterSet.add(filter)) + .isInstanceOf(UnsupportedOperationException.class); } - + /* @@ -115,7 +116,7 @@ public class BeforeExecutionFileFilterSetTest { useful for third party integrations. @@ -19725,54 +19725,54 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/CommentTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/CommentTest.java @@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; - + import org.junit.jupiter.api.Test; - + -public class CommentTest { +final class CommentTest { - + @Test - public void test() { + void test() { final String[] text = {"test"}; final Comment comment = new Comment(text, 1, 2, 3); - + @@ -42,7 +42,7 @@ public class CommentTest { } - + @Test - public void testIntersects() { + void intersects() { final String[] text = {"test", "test"}; final Comment comment = new Comment(text, 2, 4, 4); - + @@ -55,7 +55,7 @@ public class CommentTest { } - + @Test - public void testIntersects2() { + void intersects2() { final String[] text = {"a"}; final Comment comment = new Comment(text, 2, 2, 2); - + @@ -63,7 +63,7 @@ public class CommentTest { } - + @Test - public void testIntersects3() { + void intersects3() { final String[] text = {"test"}; final Comment comment = new Comment(text, 1, 1, 2); - + --- 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; - + 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.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import java.io.File; @@ -19782,19 +19782,19 @@ import java.util.List; import java.util.Map; import org.junit.jupiter.api.Test; - + -public class FileContentsTest { +final class FileContentsTest { - + @Test - public void testTextFileName() { + void textFileName() { final FileContents fileContents = new FileContents(new FileText(new File("filename"), Arrays.asList("123", "456"))); - + @@ -48,36 +48,35 @@ public class FileContentsTest { } - + @Test - public void testIsLineBlank() { + void isLineBlank() { @@ -19811,7 +19811,7 @@ .lineIsBlank(0)) .isTrue(); } - + @Test - public void testLineIsComment() { + void lineIsComment() { @@ -19829,7 +19829,7 @@ .lineIsComment(0)) .isTrue(); } - + @Test - public void testDeprecatedAbbreviatedMethod() { + void deprecatedAbbreviatedMethod() { @@ -19838,7 +19838,7 @@ new FileContents(new FileText(new File("filename"), Arrays.asList("123", "456"))); @@ -93,10 +92,10 @@ public class FileContentsTest { } - + @Test - public void testSinglelineCommentNotIntersect() { + void singlelineCommentNotIntersect() { @@ -19851,7 +19851,7 @@ .that(fileContents.hasIntersectionWithComment(1, 0, 1, 1)) @@ -104,10 +103,10 @@ public class FileContentsTest { } - + @Test - public void testSinglelineCommentIntersect() { + void singlelineCommentIntersect() { @@ -19864,7 +19864,7 @@ .that(fileContents.hasIntersectionWithComment(1, 5, 1, 6)) @@ -115,9 +114,9 @@ public class FileContentsTest { } - + @Test - public void testReportCppComment() { + void reportCppComment() { @@ -19873,10 +19873,10 @@ + new FileContents(new FileText(new File("filename"), ImmutableList.of(" // "))); fileContents.reportSingleLineComment(1, 2); final Map cppComments = fileContents.getSingleLineComments(); - + @@ -127,7 +126,7 @@ public class FileContentsTest { } - + @Test - public void testHasIntersectionWithSingleLineComment() { + void hasIntersectionWithSingleLineComment() { @@ -19885,7 +19885,7 @@ new FileText( @@ -141,9 +140,9 @@ public class FileContentsTest { } - + @Test - public void testReportComment() { + void reportComment() { @@ -19894,10 +19894,10 @@ + new FileContents(new FileText(new File("filename"), ImmutableList.of(" // "))); fileContents.reportBlockComment("type", 1, 2, 1, 2); final Map> comments = fileContents.getBlockComments(); - + @@ -153,10 +152,9 @@ public class FileContentsTest { } - + @Test - public void testReportBlockCommentSameLine() { + void reportBlockCommentSameLine() { @@ -19910,7 +19910,7 @@ final Map> comments = fileContents.getBlockComments(); @@ -171,7 +169,7 @@ public class FileContentsTest { } - + @Test - public void testReportBlockCommentMultiLine() { + void reportBlockCommentMultiLine() { @@ -19925,7 +19925,7 @@ - .toString()); + ImmutableList.of(new Comment(new String[] {"/*", "c", "*/"}, 0, 3, 1)).toString()); } - + @Test - public void testReportBlockCommentJavadoc() { + void reportBlockCommentJavadoc() { @@ -19934,7 +19934,7 @@ new FileText( @@ -203,7 +200,7 @@ public class FileContentsTest { } - + @Test - public void testHasIntersectionWithBlockComment() { + void hasIntersectionWithBlockComment() { @@ -19943,7 +19943,7 @@ new FileText( @@ -218,7 +215,7 @@ public class FileContentsTest { } - + @Test - public void testHasIntersectionWithBlockComment2() { + void hasIntersectionWithBlockComment2() { @@ -19952,7 +19952,7 @@ new FileText(new File("filename"), Arrays.asList(" /* */ ", " ", " "))); @@ -230,10 +227,9 @@ public class FileContentsTest { } - + @Test - public void testReportJavadocComment() { + void reportJavadocComment() { @@ -19962,10 +19962,10 @@ + new FileContents(new FileText(new File("filename"), ImmutableList.of(" /** */ "))); fileContents.reportBlockComment(1, 2, 1, 6); final TextBlock comment = fileContents.getJavadocBefore(2); - + @@ -243,10 +239,9 @@ public class FileContentsTest { } - + @Test - public void testReportJavadocComment2() { + void reportJavadocComment2() { @@ -19975,7 +19975,7 @@ + new FileContents(new FileText(new File("filename"), ImmutableList.of(" /** */ "))); fileContents.reportBlockComment(1, 2, 1, 6); final TextBlock comment = fileContents.getJavadocBefore(2); - + @@ -261,10 +256,9 @@ public class FileContentsTest { */ @Deprecated(since = "10.2") @@ -19986,7 +19986,7 @@ - new FileContents( - new FileText(new File("package-info.java"), Collections.singletonList(" // "))); + new FileContents(new FileText(new File("package-info.java"), ImmutableList.of(" // "))); - + assertWithMessage("Should return true when in package info") .that(fileContents.inPackageInfo()) @@ -277,10 +271,10 @@ public class FileContentsTest { @@ -19999,12 +19999,12 @@ new FileContents( - new FileText(new File("some-package-info.java"), Collections.singletonList(" // "))); + new FileText(new File("some-package-info.java"), ImmutableList.of(" // "))); - + assertWithMessage("Should return false when not in package info") .that(fileContents.inPackageInfo()) @@ -288,9 +282,9 @@ public class FileContentsTest { } - + @Test - public void testGetJavadocBefore() { + void getJavadocBefore() { @@ -20016,7 +20016,7 @@ TestUtil.setInternalState(fileContents, "javadocComments", javadoc); @@ -302,7 +296,7 @@ public class FileContentsTest { } - + @Test - public void testExtractBlockComment() { + void extractBlockComment() { @@ -20025,7 +20025,7 @@ new FileText( @@ -318,14 +312,14 @@ public class FileContentsTest { } - + @Test - public void testHasIntersectionEarlyOut() throws Exception { + void hasIntersectionEarlyOut() throws Exception { @@ -20039,12 +20039,12 @@ - clangComments.put(2, Collections.emptyList()); + clangComments.put(1, ImmutableList.of(textBlock)); + clangComments.put(2, ImmutableList.of()); - + assertWithMessage("Invalid results") .that( @@ -335,22 +329,22 @@ public class FileContentsTest { } - + @Test - public void testUnmodifiableGetSingleLineComment() { + void unmodifiableGetSingleLineComment() { @@ -20056,7 +20056,7 @@ - assertThrows(UnsupportedOperationException.class, () -> comments.remove(0)); + assertThatThrownBy(() -> comments.remove(0)).isInstanceOf(UnsupportedOperationException.class); } - + @Test - public void testUnmodifiableGetBlockComments() { + void unmodifiableGetBlockComments() { @@ -20074,38 +20074,38 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.File; import org.junit.jupiter.api.Test; - + -public class FileSetCheckTest extends AbstractModuleTestSupport { +final class FileSetCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class FileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTranslation() throws Exception { + void translation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFileSetIllegalTokens.java"), expected); - + @@ -44,7 +44,7 @@ public class FileSetCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessCallsFinishBeforeCallingDestroy() throws Exception { + void processCallsFinishBeforeCallingDestroy() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFileSetIllegalTokens.java"), expected); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java @@ -20,7 +20,9 @@ package com.puppycrawl.tools.checkstyle.api; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.nio.charset.StandardCharsets.ISO_8859_1; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractPathTestSupport; import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; @@ -20117,15 +20117,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class FileTextTest extends AbstractPathTestSupport { +final class FileTextTest extends AbstractPathTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +43,7 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testUnsupportedCharset() throws IOException { + void unsupportedCharset() throws IOException { @@ -20134,7 +20134,7 @@ final File file = new File("any name"); @@ -58,7 +59,7 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testFileNotFound() throws IOException { + void fileNotFound() throws IOException { @@ -20143,7 +20143,7 @@ try { @@ -73,7 +74,7 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testSupportedCharset() throws IOException { + void supportedCharset() throws IOException { @@ -20152,7 +20152,7 @@ new FileText(new File(getPath("InputFileTextImportControl.xml")), charsetName); @@ -83,7 +84,7 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testLineColumnBeforeCopyConstructor() throws IOException { + void lineColumnBeforeCopyConstructor() throws IOException { @@ -20161,7 +20161,7 @@ new FileText(new File(getPath("InputFileTextImportControl.xml")), charsetName); @@ -97,8 +98,8 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testLineColumnAfterCopyConstructor() throws IOException { - final Charset charset = StandardCharsets.ISO_8859_1; @@ -20172,7 +20172,7 @@ final FileText copy = new FileText(fileText); @@ -115,7 +116,7 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testLineColumnAtTheStartOfFile() throws IOException { + void lineColumnAtTheStartOfFile() throws IOException { @@ -20181,7 +20181,7 @@ new FileText(new File(getPath("InputFileTextImportControl.xml")), charsetName); @@ -126,15 +127,15 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testLines() throws IOException { - final List lines = Collections.singletonList("abc"); @@ -20191,12 +20191,12 @@ new FileText(new File(getPath("InputFileTextImportControl.xml")), lines); assertWithMessage("Invalid line").that(fileText.toLinesArray()).isEqualTo(new String[] {"abc"}); } - + @Test - public void testFindLineBreaks() throws Exception { + void findLineBreaks() throws Exception { final FileText fileText = new FileText(new File("fileName"), Arrays.asList("1", "2")); - + assertWithMessage("Invalid line breaks") @@ -156,8 +157,8 @@ public class FileTextTest extends AbstractPathTestSupport { * @throws Exception if there is an error. @@ -20211,7 +20211,7 @@ // produces NPE if used @@ -169,8 +170,8 @@ public class FileTextTest extends AbstractPathTestSupport { } - + @Test - public void testCharsetAfterCopyConstructor() throws IOException { - final Charset charset = StandardCharsets.ISO_8859_1; @@ -20224,19 +20224,19 @@ +++ 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; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class FilterSetTest { +final class FilterSetTest { - + @Test - public void testGetFilters() { + void getFilters() { @@ -20244,7 +20244,7 @@ filterSet.addFilter(new SeverityMatchFilter()); assertWithMessage("Invalid filter set size").that(filterSet.getFilters()).hasSize(1); } - + @Test - public void testRemoveFilters() { + void removeFilters() { @@ -20253,7 +20253,7 @@ filterSet.addFilter(filter); @@ -46,14 +46,14 @@ public class FilterSetTest { } - + @Test - public void testToString() { + void testToString() { @@ -20261,16 +20261,16 @@ filterSet.addFilter(new SeverityMatchFilter()); assertWithMessage("Invalid filter set size").that(filterSet.toString()).isNotNull(); } - + @Test - public void testClear() { + void clear() { final FilterSet filterSet = new FilterSet(); filterSet.addFilter(new SeverityMatchFilter()); - + @@ -65,21 +65,21 @@ public class FilterSetTest { } - + @Test - public void testAccept() { + void accept() { @@ -20278,7 +20278,7 @@ filterSet.addFilter(new DummyFilter(true)); assertWithMessage("invalid accept response").that(filterSet.accept(null)).isTrue(); } - + @Test - public void testNotAccept() { + void notAccept() { @@ -20286,7 +20286,7 @@ filterSet.addFilter(new DummyFilter(false)); assertWithMessage("invalid accept response").that(filterSet.accept(null)).isFalse(); } - + @Test - public void testNotAcceptEvenIfOneAccepts() { + void notAcceptEvenIfOneAccepts() { @@ -20307,7 +20307,7 @@ + assertThatThrownBy(() -> subFilterSet.add(filter)) + .isInstanceOf(UnsupportedOperationException.class); } - + /* @@ -105,7 +106,7 @@ public class FilterSetTest { be useful for third party integrations @@ -20323,15 +20323,15 @@ @@ -30,7 +30,7 @@ import java.io.File; import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; - + -public class FullIdentTest extends AbstractModuleTestSupport { +final class FullIdentTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testToString() { + void testToString() { @@ -20340,16 +20340,16 @@ ast.setColumnNo(14); @@ -60,7 +60,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testCreateFullIdentBelow() { + void createFullIdentBelow() { final DetailAST ast = new DetailAstImpl(); - + final FullIdent indent = FullIdent.createFullIdentBelow(ast); @@ -68,7 +68,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testGetDetailAst() throws Exception { + void getDetailAst() throws Exception { @@ -20358,7 +20358,7 @@ new File(getPath("InputFullIdentTestArrayType.java")).getAbsoluteFile(), @@ -83,7 +83,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testNonValidCoordinatesWithNegative() { + void nonValidCoordinatesWithNegative() { @@ -20367,7 +20367,7 @@ .that(fullIdent.toString()) @@ -91,7 +91,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testNonValidCoordinatesWithZero() { + void nonValidCoordinatesWithZero() { @@ -20376,7 +20376,7 @@ .that(fullIdent.toString()) @@ -99,7 +99,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testWithArrayCreateFullIdentWithArrayDeclare() throws Exception { + void withArrayCreateFullIdentWithArrayDeclare() throws Exception { @@ -20385,7 +20385,7 @@ new File(getPath("InputFullIdentTestArrayType.java")).getAbsoluteFile(), @@ -118,7 +118,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testFullIdentAnnotation() throws Exception { + void fullIdentAnnotation() throws Exception { @@ -20394,7 +20394,7 @@ new File(getPath("InputFullIdentAnnotation.java")).getAbsoluteFile(), @@ -146,7 +146,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testFullIdentArrayInit() throws Exception { + void fullIdentArrayInit() throws Exception { @@ -20403,7 +20403,7 @@ new File(getPath("InputFullIdentArrayInit.java")).getAbsoluteFile(), @@ -203,7 +203,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testReturnNoAnnotation() throws Exception { + void returnNoAnnotation() throws Exception { @@ -20412,7 +20412,7 @@ new File(getPath("InputFullIdentReturnNoAnnotation.java")).getAbsoluteFile(), @@ -216,7 +216,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testFullyQualifiedStringArray() throws Exception { + void fullyQualifiedStringArray() throws Exception { @@ -20421,7 +20421,7 @@ new File(getPath("InputFullIdentFullyQualifiedStringArray.java")).getAbsoluteFile(), @@ -236,7 +236,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { } - + @Test - public void testCreateFullIdentBelow2() throws Exception { + void createFullIdentBelow2() throws Exception { @@ -20433,10 +20433,10 @@ @@ -25,17 +25,17 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsCla import java.lang.reflect.Field; import org.junit.jupiter.api.Test; - + -public class JavadocTokenTypesTest { +final class JavadocTokenTypesTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -20444,7 +20444,7 @@ .that(isUtilsClassHasPrivateConstructor(JavadocTokenTypes.class)) .isTrue(); } - + @Test - public void testTokenValues() { + void tokenValues() { @@ -20453,7 +20453,7 @@ assertWithMessage(msg).that(JavadocTokenTypes.RETURN_LITERAL).isEqualTo(11); @@ -222,7 +222,7 @@ public class JavadocTokenTypesTest { } - + @Test - public void testRuleOffsetValue() throws Exception { + void ruleOffsetValue() throws Exception { @@ -20465,35 +20465,35 @@ @@ -25,16 +25,16 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class LineColumnTest { +final class LineColumnTest { - + @Test - public void testCompareToBothEqual() { + void compareToBothEqual() { final int actual = new LineColumn(0, 0).compareTo(new LineColumn(0, 0)); assertWithMessage("Invalid LineColumn comparing result").that(actual).isEqualTo(0); } - + @Test - public void testCompareToFirstLarger() { + void compareToFirstLarger() { final LineColumn lineColumn = new LineColumn(0, 0); - + final int line1column0 = new LineColumn(1, 0).compareTo(lineColumn); @@ -44,7 +44,7 @@ public class LineColumnTest { } - + @Test - public void testCompareToFirstSmaller() { + void compareToFirstSmaller() { final Comparable lineColumn = new LineColumn(0, 0); - + final int line1Column0 = lineColumn.compareTo(new LineColumn(1, 0)); @@ -54,14 +54,14 @@ public class LineColumnTest { } - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { @@ -20501,22 +20501,22 @@ EqualsVerifier.forClass(LineColumn.class).usingGetClass().report(); assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); } - + @Test - public void testGetters() { + void getters() { final LineColumn lineColumn = new LineColumn(2, 3); - + assertWithMessage("Invalid LineColumn comparison result") --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java @@ -25,20 +25,20 @@ import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.DefaultLocale; - + /** Test cases for {@link Scope} enumeration. */ -public class ScopeTest { +final class ScopeTest { - + /* Additional test for jacoco, since valueOf() * is generated by javac and jacoco reports that * valueOf() is uncovered. @@ -20527,7 +20527,7 @@ final Scope scope = Scope.valueOf("PRIVATE"); assertWithMessage("Invalid scope").that(scope).isEqualTo(Scope.PRIVATE); } - + @Test - public void testMisc() { + void misc() { @@ -20536,7 +20536,7 @@ assertWithMessage("Invalid scope toString").that(scope.toString()).isEqualTo("public"); @@ -55,7 +55,7 @@ public class ScopeTest { } - + @Test - public void testMixedCaseSpaces() { + void mixedCaseSpaces() { @@ -20544,7 +20544,7 @@ assertWithMessage("Invalid scope").that(Scope.getInstance(" PuBlic")).isEqualTo(Scope.PUBLIC); assertWithMessage("Invalid scope") @@ -74,7 +74,7 @@ public class ScopeTest { - + @DefaultLocale(language = "tr", country = "TR") @Test - public void testMixedCaseSpacesWithDifferentLocale() { @@ -20554,7 +20554,7 @@ assertWithMessage("Invalid scope") @@ -92,7 +92,7 @@ public class ScopeTest { } - + @Test - public void testIsInAnonInner() { + void isInAnonInner() { @@ -20563,7 +20563,7 @@ assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.ANONINNER)).isTrue(); @@ -102,7 +102,7 @@ public class ScopeTest { } - + @Test - public void testIsInPrivate() { + void isInPrivate() { @@ -20572,7 +20572,7 @@ assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PRIVATE)).isTrue(); @@ -112,7 +112,7 @@ public class ScopeTest { } - + @Test - public void testIsInPackage() { + void isInPackage() { @@ -20581,7 +20581,7 @@ assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PACKAGE)).isTrue(); @@ -122,7 +122,7 @@ public class ScopeTest { } - + @Test - public void testIsInProtected() { + void isInProtected() { @@ -20590,7 +20590,7 @@ assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PROTECTED)).isTrue(); @@ -132,7 +132,7 @@ public class ScopeTest { } - + @Test - public void testIsInPublic() { + void isInPublic() { @@ -20599,7 +20599,7 @@ assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PUBLIC)).isFalse(); @@ -142,7 +142,7 @@ public class ScopeTest { } - + @Test - public void testIsInNothing() { + void isInNothing() { @@ -20609,12 +20609,12 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounterTest.java @@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; - + import org.junit.jupiter.api.Test; - + -public class SeverityLevelCounterTest { +final class SeverityLevelCounterTest { - + @Test - public void testCtorException() { + void ctorException() { @@ -20623,7 +20623,7 @@ assertWithMessage("exception expected but got %s", test).fail(); @@ -39,7 +39,7 @@ public class SeverityLevelCounterTest { } - + @Test - public void testAddError() { + void addError() { @@ -20632,7 +20632,7 @@ // not counted @@ -59,7 +59,7 @@ public class SeverityLevelCounterTest { } - + @Test - public void testAddException() { + void addException() { @@ -20641,7 +20641,7 @@ assertWithMessage("Invalid severity level count").that(counter.getCount()).isEqualTo(0); @@ -68,7 +68,7 @@ public class SeverityLevelCounterTest { } - + @Test - public void testAddExceptionWarning() { + void addExceptionWarning() { @@ -20650,7 +20650,7 @@ assertWithMessage("Invalid severity level count").that(counter.getCount()).isEqualTo(0); @@ -77,7 +77,7 @@ public class SeverityLevelCounterTest { } - + @Test - public void testAuditStartedClearsState() { + void auditStartedClearsState() { @@ -20661,11 +20661,11 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java @@ -25,20 +25,20 @@ import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.DefaultLocale; - + /** Test cases for {@link SeverityLevel} enumeration. */ -public class SeverityLevelTest { +final class SeverityLevelTest { - + /* Additional test for jacoco, since valueOf() * is generated by javac and jacoco reports that * valueOf() is uncovered. @@ -20676,7 +20676,7 @@ final SeverityLevel level = SeverityLevel.valueOf("INFO"); assertWithMessage("Invalid severity level").that(level).isEqualTo(SeverityLevel.INFO); } - + @Test - public void testMisc() { + void misc() { @@ -20685,7 +20685,7 @@ .that(severityLevel) @@ -60,7 +60,7 @@ public class SeverityLevelTest { } - + @Test - public void testMixedCaseSpaces() { + void mixedCaseSpaces() { @@ -20693,7 +20693,7 @@ .that(SeverityLevel.getInstance("IgnoRe ")) .isEqualTo(SeverityLevel.IGNORE); @@ -77,7 +77,7 @@ public class SeverityLevelTest { - + @DefaultLocale(language = "tr", country = "TR") @Test - public void testMixedCaseSpacesWithDifferentLocales() { @@ -20704,11 +20704,11 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java @@ -21,20 +21,20 @@ package com.puppycrawl.tools.checkstyle.api; - + import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; +import static java.util.stream.Collectors.toUnmodifiableSet; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.utils.TokenUtil; import java.util.Arrays; @@ -20718,16 +20718,16 @@ import java.util.Set; -import java.util.stream.Collectors; import org.junit.jupiter.api.Test; - + -public class TokenTypesTest { +final class TokenTypesTest { - + @Test - public void testAllTokenTypesHasDescription() { + void allTokenTypesHasDescription() { final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes"; final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes, Locale.ROOT); - + @@ -42,27 +42,27 @@ public class TokenTypesTest { Arrays.stream(TokenUtil.getAllTokenIds()) .mapToObj(TokenUtil::getTokenName) @@ -20737,7 +20737,7 @@ final Set actual = bundle.keySet(); assertWithMessage("TokenTypes without description").that(actual).isEqualTo(expected); } - + @Test - public void testAllDescriptionsEndsWithPeriod() { + void allDescriptionsEndsWithPeriod() { @@ -20754,7 +20754,7 @@ - .isEqualTo(Collections.emptySet()); + .isEqualTo(ImmutableSet.of()); } - + @Test - public void testGetShortDescription() { + void getShortDescription() { @@ -20763,7 +20763,7 @@ .isEqualTo("The == (equal) operator."); @@ -89,7 +89,7 @@ public class TokenTypesTest { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -20775,10 +20775,10 @@ @@ -29,17 +29,17 @@ import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.DefaultLocale; - + -public class ViolationTest { +final class ViolationTest { - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { @@ -20786,51 +20786,51 @@ EqualsVerifier.forClass(Violation.class).usingGetClass().report(); assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); } - + @Test - public void testGetSeverityLevel() { + void getSeverityLevel() { final Violation violation = createSampleViolation(); - + assertWithMessage("Invalid severity level") @@ -48,14 +48,14 @@ public class ViolationTest { } - + @Test - public void testGetModuleId() { + void getModuleId() { final Violation violation = createSampleViolation(); - + assertWithMessage("Invalid module id").that(violation.getModuleId()).isEqualTo("module"); } - + @Test - public void testGetSourceName() { + void getSourceName() { final Violation violation = createSampleViolation(); - + assertWithMessage("Invalid source name") @@ -65,7 +65,7 @@ public class ViolationTest { - + @DefaultLocale("en") @Test - public void testMessageInEnglish() { + void messageInEnglish() { final Violation violation = createSampleViolation(); - + assertWithMessage("Invalid violation") @@ -75,7 +75,7 @@ public class ViolationTest { - + @DefaultLocale("fr") @Test - public void testGetKey() { + void getKey() { final Violation violation = createSampleViolation(); - + assertWithMessage("Invalid violation key") @@ -84,7 +84,7 @@ public class ViolationTest { } - + @Test - public void testTokenType() { + void tokenType() { @@ -20839,7 +20839,7 @@ 1, @@ -119,7 +119,7 @@ public class ViolationTest { } - + @Test - public void testGetColumnCharIndex() { + void getColumnCharIndex() { @@ -20848,7 +20848,7 @@ 1, @@ -140,7 +140,7 @@ public class ViolationTest { } - + @Test - public void testCompareToWithDifferentModuleId() { + void compareToWithDifferentModuleId() { @@ -20857,7 +20857,7 @@ final Violation messageNull = createSampleViolationWithId(null); @@ -155,7 +155,7 @@ public class ViolationTest { } - + @Test - public void testCompareToWithDifferentClass() { + void compareToWithDifferentClass() { @@ -20866,7 +20866,7 @@ final Violation messageNull = createSampleViolationWithClass(null); @@ -170,7 +170,7 @@ public class ViolationTest { } - + @Test - public void testCompareToWithDifferentLines() { + void compareToWithDifferentLines() { @@ -20875,7 +20875,7 @@ final Violation message2 = createSampleViolationWithLine(2); @@ -182,7 +182,7 @@ public class ViolationTest { } - + @Test - public void testCompareToWithDifferentColumns() { + void compareToWithDifferentColumns() { @@ -20885,9 +20885,9 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/InlineConfigParser.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/InlineConfigParser.java @@ -19,6 +19,8 @@ - + package com.puppycrawl.tools.checkstyle.bdd; - + +import static java.util.stream.Collectors.toUnmodifiableList; + import com.puppycrawl.tools.checkstyle.ConfigurationLoader; @@ -20899,7 +20899,7 @@ import java.util.regex.Pattern; -import java.util.stream.Collectors; import org.xml.sax.InputSource; - + public final class InlineConfigParser { @@ -241,7 +242,7 @@ public final class InlineConfigParser { return lines.stream() @@ -20908,21 +20908,21 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); } - + private static void handleXmlConfig( --- a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/ModuleInputConfiguration.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/ModuleInputConfiguration.java @@ -19,8 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.bdd; - + +import static java.util.Collections.unmodifiableMap; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; -import java.util.Collections; import java.util.HashMap; import java.util.Map; - + @@ -57,19 +58,19 @@ public final class ModuleInputConfiguration { final Map properties = new HashMap<>(); properties.putAll(defaultProperties); @@ -20930,29 +20930,29 @@ - return Collections.unmodifiableMap(properties); + return unmodifiableMap(properties); } - + public Map getDefaultProperties() { - return Collections.unmodifiableMap(defaultProperties); + return unmodifiableMap(defaultProperties); } - + public Map getNonDefaultProperties() { - return Collections.unmodifiableMap(nonDefaultProperties); + return unmodifiableMap(nonDefaultProperties); } - + public Map getModuleMessages() { - return Collections.unmodifiableMap(moduleMessages); + return unmodifiableMap(moduleMessages); } - + 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 @@ - + package com.puppycrawl.tools.checkstyle.bdd; - + +import static java.util.Collections.unmodifiableList; + import com.puppycrawl.tools.checkstyle.Checker; @@ -20967,26 +20967,26 @@ import java.util.Set; @@ -75,15 +76,15 @@ public final class TestInputConfiguration { } - + public List getChildrenModules() { - return Collections.unmodifiableList(childrenModules); + return unmodifiableList(childrenModules); } - + public List getViolations() { - return Collections.unmodifiableList(violations); + return unmodifiableList(violations); } - + public List getFilteredViolations() { - return Collections.unmodifiableList(filteredViolations); + return unmodifiableList(filteredViolations); } - + public DefaultConfiguration createConfiguration() { @@ -162,7 +163,7 @@ public final class TestInputConfiguration { } - + public List getChildrenModules() { - return Collections.unmodifiableList(childrenModules); + return unmodifiableList(childrenModules); @@ -20998,15 +20998,15 @@ @@ -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 ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { +final class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -21015,7 +21015,7 @@ assertWithMessage("Required tokens differs from expected") @@ -43,7 +43,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavaStyleOn() throws Exception { + void javaStyleOn() throws Exception { @@ -21024,7 +21024,7 @@ "14:18: " + getCheckMessage(MSG_KEY), @@ -58,7 +58,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavaStyleOff() throws Exception { + void javaStyleOff() throws Exception { @@ -21033,7 +21033,7 @@ "16:39: " + getCheckMessage(MSG_KEY), @@ -74,7 +74,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedGenerics() throws Exception { + void nestedGenerics() throws Exception { @@ -21042,7 +21042,7 @@ "23:61: " + getCheckMessage(MSG_KEY), @@ -85,7 +85,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -21054,15 +21054,15 @@ @@ -31,7 +31,7 @@ import java.util.regex.Pattern; import java.util.stream.IntStream; import org.junit.jupiter.api.Test; - + -public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSupport { +final class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSupport { - + // C0 (ASCII and derivatives) // https://en.wiktionary.org/wiki/Appendix:Control_characters#C0_.28ASCII_and_derivatives.29 @@ -63,7 +63,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -21071,7 +21071,7 @@ TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL, TokenTypes.TEXT_BLOCK_CONTENT, @@ -74,7 +74,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -21080,7 +21080,7 @@ "19:38: " + getCheckMessage(MSG_KEY), @@ -130,7 +130,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAllowEscapesForControlCharacterSet() throws Exception { + void allowEscapesForControlCharacterSet() throws Exception { @@ -21089,7 +21089,7 @@ "19:38: " + getCheckMessage(MSG_KEY), @@ -181,7 +181,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAllowByTailComment() throws Exception { + void allowByTailComment() throws Exception { @@ -21098,7 +21098,7 @@ "25:38: " + getCheckMessage(MSG_KEY), @@ -216,7 +216,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAllowAllCharactersEscaped() throws Exception { + void allowAllCharactersEscaped() throws Exception { @@ -21107,7 +21107,7 @@ "19:38: " + getCheckMessage(MSG_KEY), @@ -249,7 +249,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void allowNonPrintableEscapes() throws Exception { + void allowNonPrintableEscapes() throws Exception { @@ -21116,7 +21116,7 @@ "19:38: " + getCheckMessage(MSG_KEY), @@ -288,7 +288,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAllowByTailCommentWithEmoji() throws Exception { + void allowByTailCommentWithEmoji() throws Exception { @@ -21125,7 +21125,7 @@ "18:24: " + getCheckMessage(MSG_KEY), @@ -302,7 +302,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAvoidEscapedUnicodeCharactersTextBlocksAllowByComment() throws Exception { + void avoidEscapedUnicodeCharactersTextBlocksAllowByComment() throws Exception { @@ -21134,7 +21134,7 @@ "20:30: " + getCheckMessage(MSG_KEY), @@ -319,7 +319,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAvoidEscapedUnicodeCharactersTextBlocks() throws Exception { + void avoidEscapedUnicodeCharactersTextBlocks() throws Exception { @@ -21143,7 +21143,7 @@ "18:30: " + getCheckMessage(MSG_KEY), @@ -335,7 +335,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAvoidEscapedUnicodeCharactersEscapedS() throws Exception { + void avoidEscapedUnicodeCharactersEscapedS() throws Exception { @@ -21152,7 +21152,7 @@ "18:22: " + getCheckMessage(MSG_KEY), @@ -349,7 +349,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -21161,11 +21161,11 @@ final int[] expected = { @@ -359,7 +359,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu } - + @Test - public void testAllowEscapesForControlCharacterSetForAllCharacters() throws Exception { + void allowEscapesForControlCharacterSetForAllCharacters() throws Exception { - + final int indexOfStartLineInInputFile = 16; final String message = getCheckMessage(MSG_KEY); @@ -383,7 +383,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu @@ -21191,22 +21191,22 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class DescendantTokenCheckTest extends AbstractModuleTestSupport { +final class DescendantTokenCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,13 +36,13 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputDescendantTokenIllegalTokens.java"), expected); } - + @Test - public void testMaximumNumber() throws Exception { + void maximumNumber() throws Exception { @@ -21215,7 +21215,7 @@ }; @@ -50,7 +50,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessage() throws Exception { + void message() throws Exception { @@ -21224,7 +21224,7 @@ }; @@ -58,7 +58,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMinimumNumber() throws Exception { + void minimumNumber() throws Exception { @@ -21233,39 +21233,39 @@ }; @@ -66,19 +66,19 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMinimumDepth() throws Exception { + void minimumDepth() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputDescendantTokenIllegalTokens5.java"), expected); } - + @Test - public void testMaximumDepth() throws Exception { + void maximumDepth() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputDescendantTokenIllegalTokens6.java"), expected); } - + @Test - public void testEmptyStatements() throws Exception { + void emptyStatements() throws Exception { - + final String[] expected = { "22:7: Empty statement.", @@ -103,7 +103,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingSwitchDefault() throws Exception { + void missingSwitchDefault() throws Exception { - + final String[] expected = { "32:9: switch without \"default\" clause.", @@ -114,7 +114,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStringLiteralEquality() throws Exception { + void stringLiteralEquality() throws Exception { @@ -21274,88 +21274,88 @@ "27:20: Literal Strings should be compared using equals(), not '=='.", @@ -125,7 +125,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTokenDefault() throws Exception { + void illegalTokenDefault() throws Exception { - + final String[] expected = { "23:9: Using 'LITERAL_SWITCH' is not allowed.", @@ -136,7 +136,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTokenNative() throws Exception { + void illegalTokenNative() throws Exception { - + final String[] expected = { "32:12: Using 'LITERAL_NATIVE' is not allowed.", @@ -145,7 +145,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReturnFromCatch() throws Exception { + void returnFromCatch() throws Exception { - + final String[] expected = { "22:11: Return from catch is not allowed.", "30:11: Return from catch is not allowed.", @@ -155,7 +155,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReturnFromFinally() throws Exception { + void returnFromFinally() throws Exception { - + final String[] expected = { "22:11: Return from finally is not allowed.", "30:11: Return from finally is not allowed.", @@ -165,7 +165,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoSum() throws Exception { + void noSum() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -173,7 +173,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithSumCustomMsg() throws Exception { + void withSumCustomMsg() throws Exception { - + final String[] expected = { "37:32: this cannot be null.", @@ -186,7 +186,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithSumDefaultMsg() throws Exception { + void withSumDefaultMsg() throws Exception { - + final String[] expected = { "37:32: " + getCheckMessage(MSG_KEY_SUM_MAX, 2, 1, "EQUAL"), @@ -199,7 +199,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithSumLessThenMinDefMsg() throws Exception { + void withSumLessThenMinDefMsg() throws Exception { - + final String[] expected = { "32:44: " + getCheckMessage(MSG_KEY_SUM_MIN, 0, 3, "EQUAL"), @@ -215,7 +215,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithSumLessThenMinCustomMsg() throws Exception { + void withSumLessThenMinCustomMsg() throws Exception { - + final String[] expected = { "31:44: custom message", @@ -231,7 +231,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMaxTokenType() throws Exception { + void maxTokenType() throws Exception { @@ -21364,7 +21364,7 @@ "21:48: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "OBJBLOCK", "RCURLY"), @@ -240,7 +240,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMaxTokenTypeReverseOrder() throws Exception { + void maxTokenTypeReverseOrder() throws Exception { @@ -21373,7 +21373,7 @@ "21:49: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "OBJBLOCK", "RCURLY"), @@ -249,7 +249,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLimitedToken() throws Exception { + void limitedToken() throws Exception { @@ -21385,15 +21385,15 @@ @@ -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 FinalParametersCheckTest extends AbstractModuleTestSupport { +final class FinalParametersCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultTokens() throws Exception { + void defaultTokens() throws Exception { @@ -21402,7 +21402,7 @@ "42:26: " + getCheckMessage(MSG_KEY, "i"), @@ -51,7 +51,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCtorToken() throws Exception { + void ctorToken() throws Exception { @@ -21411,7 +21411,7 @@ "43:27: " + getCheckMessage(MSG_KEY, "i"), @@ -61,7 +61,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodToken() throws Exception { + void methodToken() throws Exception { @@ -21420,7 +21420,7 @@ "74:17: " + getCheckMessage(MSG_KEY, "s"), @@ -76,7 +76,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCatchToken() throws Exception { + void catchToken() throws Exception { @@ -21429,7 +21429,7 @@ "136:16: " + getCheckMessage(MSG_KEY, "e"), @@ -86,7 +86,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForEachClauseToken() throws Exception { + void forEachClauseToken() throws Exception { @@ -21438,7 +21438,7 @@ }; @@ -94,7 +94,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnorePrimitiveTypesParameters() throws Exception { + void ignorePrimitiveTypesParameters() throws Exception { @@ -21447,7 +21447,7 @@ "15:15: " + getCheckMessage(MSG_KEY, "s"), @@ -108,7 +108,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrimitiveTypesParameters() throws Exception { + void primitiveTypesParameters() throws Exception { @@ -21456,7 +21456,7 @@ "14:15: " + getCheckMessage(MSG_KEY, "i"), @@ -129,7 +129,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReceiverParameters() throws Exception { + void receiverParameters() throws Exception { @@ -21468,22 +21468,22 @@ @@ -40,7 +40,7 @@ import java.util.List; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { +final class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -48,13 +48,13 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewlineLfAtEndOfFile() throws Exception { + void newlineLfAtEndOfFile() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileLf.java"), expected); } - + @Test - public void testNewlineLfAtEndOfFileLfNotOverlapWithCrLf() throws Exception { + void newlineLfAtEndOfFileLfNotOverlapWithCrLf() throws Exception { @@ -21492,21 +21492,21 @@ }; @@ -62,19 +62,19 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewlineCrlfAtEndOfFile() throws Exception { + void newlineCrlfAtEndOfFile() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileCrlf3.java"), expected); } - + @Test - public void testNewlineCrAtEndOfFile() throws Exception { + void newlineCrAtEndOfFile() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileCr.java"), expected); } - + @Test - public void testAnyNewlineAtEndOfFile() throws Exception { + void anyNewlineAtEndOfFile() throws Exception { @@ -21515,7 +21515,7 @@ verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileLf2.java"), expected); @@ -82,7 +82,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoNewlineLfAtEndOfFile() throws Exception { + void noNewlineLfAtEndOfFile() throws Exception { @@ -21524,7 +21524,7 @@ }; @@ -90,7 +90,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoNewlineAtEndOfFile() throws Exception { + void noNewlineAtEndOfFile() throws Exception { @@ -21533,7 +21533,7 @@ "1: " + msgKeyNoNewlineEof, @@ -99,7 +99,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSetLineSeparatorFailure() throws Exception { + void setLineSeparatorFailure() throws Exception { @@ -21542,7 +21542,7 @@ try { @@ -116,7 +116,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyFileFile() throws Exception { + void emptyFileFile() throws Exception { @@ -21551,7 +21551,7 @@ final String[] expected = { @@ -126,7 +126,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithEmptyLineOnly() throws Exception { + void fileWithEmptyLineOnly() throws Exception { @@ -21560,7 +21560,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -134,7 +134,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithEmptyLineOnlyWithLfCrCrlf() throws Exception { + void fileWithEmptyLineOnlyWithLfCrCrlf() throws Exception { @@ -21569,7 +21569,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -142,7 +142,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongFile() throws Exception { + void wrongFile() throws Exception { @@ -21578,7 +21578,7 @@ check.configure(checkConfig); @@ -159,7 +159,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongSeparatorLength() throws Exception { + void wrongSeparatorLength() throws Exception { @@ -21587,7 +21587,7 @@ TestUtil.invokeMethod( @@ -175,7 +175,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -21599,15 +21599,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { +final class NoCodeInFileCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -21616,7 +21616,7 @@ .that(checkObj.getRequiredTokens()) @@ -43,7 +43,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -21625,7 +21625,7 @@ .that(checkObj.getAcceptableTokens()) @@ -51,7 +51,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlank() throws Exception { + void blank() throws Exception { @@ -21634,7 +21634,7 @@ "1: " + getCheckMessage(MSG_KEY_NO_CODE), @@ -60,7 +60,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineComment() throws Exception { + void singleLineComment() throws Exception { @@ -21643,7 +21643,7 @@ "1: " + getCheckMessage(MSG_KEY_NO_CODE), @@ -69,7 +69,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiLineComment() throws Exception { + void multiLineComment() throws Exception { @@ -21652,13 +21652,13 @@ }; @@ -77,12 +77,12 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileContainingCode() throws Exception { + void fileContainingCode() throws Exception { verifyWithInlineConfigParser(getPath("InputNoCodeInFile4.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testBothSingleLineAndMultiLineComment() throws Exception { + void bothSingleLineAndMultiLineComment() throws Exception { @@ -21670,7 +21670,7 @@ @@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck.MSG_IO_EXCEPTION_KEY; import static com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -21682,14 +21682,14 @@ -import java.util.Collections; import java.util.SortedSet; import org.junit.jupiter.api.Test; - + -public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { +final class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -46,7 +46,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { - + /** Tests the ordinal work of a check. Test of sub keys, repeating key pairs in wrong order */ @Test - public void testDefault() throws Exception { @@ -21699,7 +21699,7 @@ "8: " + getCheckMessage(MSG_KEY, "key1", "key2"), @@ -58,7 +58,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testKeysOnly() throws Exception { + void keysOnly() throws Exception { @@ -21708,7 +21708,7 @@ "3: " + getCheckMessage(MSG_KEY, "key1", "key2"), @@ -67,7 +67,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyKeys() throws Exception { + void emptyKeys() throws Exception { @@ -21717,16 +21717,16 @@ "3: " + getCheckMessage(MSG_KEY, "key11", "key2"), @@ -76,7 +76,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMalformedValue() throws Exception { + void malformedValue() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); final String fileName = getPath("InputOrderedProperties3MalformedValue.properties"); - + @@ -87,7 +87,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentsMultiLine() throws Exception { + void commentsMultiLine() throws Exception { @@ -21735,7 +21735,7 @@ "5: " + getCheckMessage(MSG_KEY, "aKey", "multi.line"), @@ -96,7 +96,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineNumberRepeatingPreviousKey() throws Exception { + void lineNumberRepeatingPreviousKey() throws Exception { @@ -21744,7 +21744,7 @@ "3: " + getCheckMessage(MSG_KEY, "a", "b"), @@ -106,7 +106,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldNotProcessFilesWithWrongFileExtension() throws Exception { + void shouldNotProcessFilesWithWrongFileExtension() throws Exception { @@ -21752,7 +21752,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputOrderedProperties.txt"), expected); @@ -114,13 +114,13 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { - + /** Tests IO exception, that can occur during reading of properties file. */ @Test - public void testIoException() throws Exception { @@ -21773,7 +21773,7 @@ @Test - public void testKeepForLoopIntact() throws Exception { + void keepForLoopIntact() throws Exception { - + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); final OrderedPropertiesCheck check = new OrderedPropertiesCheck(); check.configure(checkConfig); @@ -21782,19 +21782,19 @@ - final FileText fileText = new FileText(file, Collections.emptyList()); + final FileText fileText = new FileText(file, ImmutableList.of()); final SortedSet violations = check.process(file, fileText); - + assertWithMessage("Wrong violations count").that(violations).hasSize(1); } - + @Test - public void testFileExtension() { + void fileExtension() { - + final OrderedPropertiesCheck check = new OrderedPropertiesCheck(); assertWithMessage("File extension should be set") @@ -163,7 +163,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -21806,7 +21806,7 @@ @@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -21814,15 +21814,15 @@ @@ -31,7 +32,7 @@ import java.io.File; import java.util.List; import org.junit.jupiter.api.Test; - + -public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { +final class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +40,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -21831,21 +21831,21 @@ TokenTypes.CLASS_DEF, @@ -54,19 +55,19 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGood1() throws Exception { + void good1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeFilenameIllegalTokens.java"), expected); } - + @Test - public void testGood2() throws Exception { + void good2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeFilename15Extensions.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -21854,14 +21854,14 @@ final int[] expected = { @@ -82,13 +83,13 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedClass() throws Exception { + void nestedClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeFilename1.java"), expected); } - + @Test - public void testNestedClass2() throws Exception { + void nestedClass2() throws Exception { @@ -21870,21 +21870,21 @@ }; @@ -96,19 +97,19 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinePublic() throws Exception { + void finePublic() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeFilename2.java"), expected); } - + @Test - public void testPublicClassIsNotFirst() throws Exception { + void publicClassIsNotFirst() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeFilenameCheckPublic.java"), expected); } - + @Test - public void testNoPublicClasses() throws Exception { + void noPublicClasses() throws Exception { @@ -21893,14 +21893,14 @@ }; @@ -116,13 +117,13 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFineDefault() throws Exception { + void fineDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeFilename3.java"), expected); } - + @Test - public void testWrongDefault() throws Exception { + void wrongDefault() throws Exception { @@ -21909,34 +21909,34 @@ }; @@ -130,7 +131,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageAnnotation() throws Exception { + void packageAnnotation() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -138,7 +139,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOuterTypeFilenameRecords() throws Exception { + void outerTypeFilenameRecords() throws Exception { - + final String[] expected = { "10:1: " + getCheckMessage(MSG_KEY), @@ -148,7 +149,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOuterTypeFilenameRecordsMethodRecordDef() throws Exception { + void outerTypeFilenameRecordsMethodRecordDef() throws Exception { - + final String[] expected = { "10:1: " + getCheckMessage(MSG_KEY), @@ -158,7 +159,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTree2() throws Exception { + void stateIsClearedOnBeginTree2() throws Exception { @@ -21945,7 +21945,7 @@ final String file2 = getPath("InputOuterTypeFilenameBeginTree2.java"); @@ -175,12 +176,12 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTree3() throws Exception { + void stateIsClearedOnBeginTree3() throws Exception { @@ -21956,31 +21956,31 @@ - final List expectedSecondInput = List.of("9:1: " + getCheckMessage(MSG_KEY)); + final List expectedSecondInput = ImmutableList.of("9:1: " + getCheckMessage(MSG_KEY)); final File[] inputs = {new File(file1), new File(file2)}; - + verify( --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java @@ -48,7 +48,7 @@ import java.util.Optional; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; - + -public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { +final class SuppressWarningsHolderTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -56,7 +56,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @AfterEach - public void cleanUp() { + void cleanUp() { // clear cache that may have been set by tests - + new SuppressWarningsHolder().beginTree(null); @@ -67,7 +67,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testGet() { + void get() { @@ -21989,32 +21989,32 @@ assertWithMessage("Required token array differs from expected") @@ -79,14 +79,14 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testOnComplexAnnotations() throws Exception { + void onComplexAnnotations() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder.java"), expected); } - + @Test - public void testOnComplexAnnotationsNonConstant() throws Exception { + void onComplexAnnotationsNonConstant() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -94,14 +94,14 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomAnnotation() throws Exception { + void customAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder5.java"), expected); } - + @Test - public void testAll() throws Exception { + void all() throws Exception { @@ -22023,7 +22023,7 @@ + getCheckMessage( @@ -112,7 +112,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testGetDefaultAlias() { + void getDefaultAlias() { @@ -22032,7 +22032,7 @@ .isEqualTo("somename"); @@ -122,7 +122,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testSetAliasListEmpty() { + void setAliasListEmpty() { @@ -22041,7 +22041,7 @@ assertWithMessage("Empty alias list should not be set") @@ -131,7 +131,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testSetAliasListCorrect() { + void setAliasListCorrect() { @@ -22050,25 +22050,25 @@ assertWithMessage("Alias differs from expected") @@ -140,7 +140,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testSetAliasListWrong() { + void setAliasListWrong() { final SuppressWarningsHolder holder = new SuppressWarningsHolder(); - + try { @@ -154,7 +154,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressed() throws Exception { + void isSuppressed() throws Exception { populateHolder("MockEntry", 100, 100, 350, 350); final AuditEvent event = createAuditEvent("check", 100, 10); - + @@ -164,7 +164,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedByName() throws Exception { + void isSuppressedByName() throws Exception { @@ -22077,77 +22077,77 @@ final AuditEvent event = createAuditEvent("id", 110, 10); @@ -176,7 +176,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedByModuleId() throws Exception { + void isSuppressedByModuleId() throws Exception { populateHolder("check", 100, 100, 350, 350); final AuditEvent event = createAuditEvent("check", 350, 350); - + @@ -186,7 +186,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedAfterEventEnd() throws Exception { + void isSuppressedAfterEventEnd() throws Exception { populateHolder("check", 100, 100, 350, 350); final AuditEvent event = createAuditEvent("check", 350, 352); - + @@ -196,7 +196,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedAfterEventEnd2() throws Exception { + void isSuppressedAfterEventEnd2() throws Exception { populateHolder("check", 100, 100, 350, 350); final AuditEvent event = createAuditEvent("check", 400, 10); - + @@ -206,7 +206,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedAfterEventStart() throws Exception { + void isSuppressedAfterEventStart() throws Exception { populateHolder("check", 100, 100, 350, 350); final AuditEvent event = createAuditEvent("check", 100, 100); - + @@ -216,7 +216,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedAfterEventStart2() throws Exception { + void isSuppressedAfterEventStart2() throws Exception { populateHolder("check", 100, 100, 350, 350); final AuditEvent event = createAuditEvent("check", 100, 0); - + @@ -226,7 +226,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSuppressedWithAllArgument() throws Exception { + void isSuppressedWithAllArgument() throws Exception { populateHolder("all", 100, 100, 350, 350); - + final Checker source = new Checker(); @@ -254,21 +254,21 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationInTry() throws Exception { + void annotationInTry() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder2.java"), expected); } - + @Test - public void testEmptyAnnotation() throws Exception { + void emptyAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder3.java"), expected); } - + @Test - public void testGetAllAnnotationValuesWrongArg() throws ReflectiveOperationException { + void getAllAnnotationValuesWrongArg() throws ReflectiveOperationException { @@ -22156,7 +22156,7 @@ holder.getClass().getDeclaredMethod("getAllAnnotationValues", DetailAST.class); @@ -304,7 +304,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAnnotationValuesWrongArg() throws ReflectiveOperationException { + void getAnnotationValuesWrongArg() throws ReflectiveOperationException { @@ -22165,7 +22165,7 @@ holder.getClass().getDeclaredMethod("getAnnotationValues", DetailAST.class); @@ -334,7 +334,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAnnotationTargetWrongArg() throws ReflectiveOperationException { + void getAnnotationTargetWrongArg() throws ReflectiveOperationException { @@ -22174,7 +22174,7 @@ holder.getClass().getDeclaredMethod("getAnnotationTarget", DetailAST.class); @@ -368,7 +368,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testAstWithoutChildren() { + void astWithoutChildren() { @@ -22183,30 +22183,30 @@ methodDef.setType(TokenTypes.METHOD_DEF); @@ -384,22 +384,22 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationWithFullName() throws Exception { + void annotationWithFullName() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder4.java"), expected); } - + @Test - public void testSuppressWarningsAsAnnotationProperty() throws Exception { + void suppressWarningsAsAnnotationProperty() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder7.java"), expected); } - + - @Test @SuppressWarnings("unchecked") - public void testClearState() throws Exception { + @Test + void clearState() throws Exception { final SuppressWarningsHolder check = new SuppressWarningsHolder(); - + final Optional annotationDef = @@ -414,7 +414,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { .that( @@ -22219,16 +22219,16 @@ .isTrue(); @@ -445,7 +445,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressWarningsTextBlocks() throws Exception { + void suppressWarningsTextBlocks() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + final String[] expected = { @@ -465,7 +465,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testWithAndWithoutCheckSuffixDifferentCases() throws Exception { + void withAndWithoutCheckSuffixDifferentCases() throws Exception { @@ -22237,7 +22237,7 @@ "16:30: " @@ -479,7 +479,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testAliasList() throws Exception { + void aliasList() throws Exception { @@ -22246,7 +22246,7 @@ "28:17: " + getCheckMessage(ParameterNumberCheck.class, ParameterNumberCheck.MSG_KEY, 7, 8), @@ -488,7 +488,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testAliasList2() throws Exception { + void aliasList2() throws Exception { @@ -22255,7 +22255,7 @@ "16:29: " @@ -503,14 +503,14 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void testIdent() throws Exception { + void ident() throws Exception { @@ -22263,7 +22263,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputSuppressWarningsHolder1.java"), expected); } - + @Test - public void testIdent2() throws Exception { + void ident2() throws Exception { @@ -22272,27 +22272,27 @@ "42:9: " + getCheckMessage(UnusedLocalVariableCheck.class, MSG_UNUSED_LOCAL_VARIABLE, "a"), @@ -520,7 +520,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { } - + @Test - public void test3() throws Exception { + void test3() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.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 TodoCommentCheckTest extends AbstractModuleTestSupport { +final class TodoCommentCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -22301,7 +22301,7 @@ assertWithMessage("Required tokens differs from expected") @@ -43,7 +43,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -22310,7 +22310,7 @@ "164:7: " + getCheckMessage(MSG_KEY, "FIXME:"), @@ -54,7 +54,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -22319,7 +22319,7 @@ final int[] actual = check.getAcceptableTokens(); @@ -65,7 +65,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -22331,15 +22331,15 @@ @@ -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 TrailingCommentCheckTest extends AbstractModuleTestSupport { +final class TrailingCommentCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -22348,7 +22348,7 @@ TokenTypes.SINGLE_LINE_COMMENT, TokenTypes.BLOCK_COMMENT_BEGIN, @@ -46,7 +46,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -22357,7 +22357,7 @@ TokenTypes.SINGLE_LINE_COMMENT, TokenTypes.BLOCK_COMMENT_BEGIN, @@ -57,7 +57,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaults() throws Exception { + void defaults() throws Exception { @@ -22366,7 +22366,7 @@ "17:12: " + getCheckMessage(MSG_KEY), @@ -72,7 +72,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLegalComment() throws Exception { + void legalComment() throws Exception { @@ -22375,7 +22375,7 @@ "17:12: " + getCheckMessage(MSG_KEY), @@ -86,7 +86,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFormat() throws Exception { + void format() throws Exception { @@ -22384,16 +22384,16 @@ "12:12: " + getCheckMessage(MSG_KEY), @@ -111,7 +111,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLegalCommentWithNoPrecedingWhitespace() throws Exception { + void legalCommentWithNoPrecedingWhitespace() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -119,7 +119,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithEmoji() throws Exception { + void withEmoji() throws Exception { @@ -22407,7 +22407,7 @@ import static com.puppycrawl.tools.checkstyle.checks.TranslationCheck.MSG_KEY; import static com.puppycrawl.tools.checkstyle.checks.TranslationCheck.MSG_KEY_MISSING_TRANSLATION_FILE; +import static java.nio.charset.StandardCharsets.UTF_8; - + +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; @@ -22423,15 +22423,15 @@ @@ -52,7 +53,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Node; - + -public class TranslationCheckTest extends AbstractXmlTestSupport { +final class TranslationCheckTest extends AbstractXmlTestSupport { - + @TempDir public File temporaryFolder; - + @@ -62,7 +63,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testTranslation() throws Exception { + void translation() throws Exception { @@ -22440,7 +22440,7 @@ "1: " + getCheckMessage(MSG_KEY, "only.english"), @@ -79,7 +80,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testDifferentBases() throws Exception { + void differentBases() throws Exception { @@ -22449,7 +22449,7 @@ "1: " + getCheckMessage(MSG_KEY, "only.english"), @@ -98,9 +99,9 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testDifferentPaths() throws Exception { + void differentPaths() throws Exception { @@ -22470,7 +22470,7 @@ final TranslationCheck check = new TranslationCheck(); @@ -138,7 +139,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testFileExtension() throws Exception { + void fileExtension() throws Exception { @@ -22479,7 +22479,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -149,7 +150,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testLogOutput() throws Exception { + void logOutput() throws Exception { @@ -22495,12 +22495,12 @@ "InputTranslationCheckFireErrors_de.properties", - Collections.singletonList(line + secondErrorMessage))); + ImmutableList.of(line + secondErrorMessage))); - + verifyXml( getPath("ExpectedTranslationLog.xml"), @@ -189,7 +190,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testOnePropertyFileSet() throws Exception { + void onePropertyFileSet() throws Exception { @@ -22509,7 +22509,7 @@ final File[] propertyFiles = { @@ -199,7 +200,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testLogIoExceptionFileNotFound() throws Exception { + void logIoExceptionFileNotFound() throws Exception { @@ -22518,7 +22518,7 @@ // in checks running part. So I had to do it with reflection to improve coverage. @@ -231,7 +232,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testLogIoException() throws Exception { + void logIoException() throws Exception { @@ -22527,7 +22527,7 @@ // in checks running part. So I had to do it with reflection to improve coverage. @@ -263,7 +264,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testLogIllegalArgumentException() throws Exception { + void logIllegalArgumentException() throws Exception { @@ -22536,70 +22536,70 @@ final String[] expected = { @@ -277,7 +278,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testDefaultTranslationFileIsMissing() throws Exception { + void defaultTranslationFileIsMissing() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "ja,,, de, ja"); - + @@ -293,7 +294,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testTranslationFilesAreMissing() throws Exception { + void translationFilesAreMissing() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "ja, de"); - + @@ -310,7 +311,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testBaseNameWithSeparatorDefaultTranslationIsMissing() throws Exception { + void baseNameWithSeparatorDefaultTranslationIsMissing() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "fr"); - + @@ -325,7 +326,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testBaseNameWithSeparatorTranslationsAreMissing() throws Exception { + void baseNameWithSeparatorTranslationsAreMissing() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "fr, tr"); - + @@ -342,7 +343,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testIsNotMessagesBundle() throws Exception { + void isNotMessagesBundle() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "de"); - + @@ -355,7 +356,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testTranslationFileWithLanguageCountryVariantIsMissing() throws Exception { + void translationFileWithLanguageCountryVariantIsMissing() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "es, de"); - + @@ -372,7 +373,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testTranslationFileWithLanguageCountryVariantArePresent() throws Exception { + void translationFileWithLanguageCountryVariantArePresent() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); checkConfig.addProperty("requiredTranslations", "es, fr"); - + @@ -387,7 +388,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testBaseNameOption() throws Exception { + void baseNameOption() throws Exception { @@ -22608,7 +22608,7 @@ checkConfig.addProperty("baseName", "^.*Labels$"); @@ -409,7 +410,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testFileExtensions() throws Exception { + void fileExtensions() throws Exception { @@ -22617,7 +22617,7 @@ checkConfig.addProperty("fileExtensions", "properties,translation"); @@ -435,7 +436,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testEqualBaseNamesButDifferentExtensions() throws Exception { + void equalBaseNamesButDifferentExtensions() throws Exception { @@ -22626,7 +22626,7 @@ checkConfig.addProperty("fileExtensions", "properties,translations"); @@ -461,7 +462,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testEqualBaseNamesButDifferentExtensions2() throws Exception { + void equalBaseNamesButDifferentExtensions2() throws Exception { @@ -22635,7 +22635,7 @@ checkConfig.addProperty("fileExtensions", "properties, translations"); @@ -484,7 +485,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testRegexpToMatchPartOfBaseName() throws Exception { + void regexpToMatchPartOfBaseName() throws Exception { @@ -22644,7 +22644,7 @@ checkConfig.addProperty("fileExtensions", "properties,translations"); @@ -505,7 +506,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testBundlesWithSameNameButDifferentPaths() throws Exception { + void bundlesWithSameNameButDifferentPaths() throws Exception { @@ -22653,7 +22653,7 @@ checkConfig.addProperty("fileExtensions", "properties"); @@ -524,7 +525,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { } - + @Test - public void testWrongUserSpecifiedLanguageCodes() { + void wrongUserSpecifiedLanguageCodes() { @@ -22665,7 +22665,7 @@ @@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -22673,15 +22673,15 @@ @@ -33,7 +34,7 @@ import java.util.List; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class UncommentedMainCheckTest extends AbstractModuleTestSupport { +final class UncommentedMainCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +42,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaults() throws Exception { + void defaults() throws Exception { @@ -22690,7 +22690,7 @@ "26:5: " + getCheckMessage(MSG_KEY), @@ -52,7 +53,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludedClasses() throws Exception { + void excludedClasses() throws Exception { @@ -22699,7 +22699,7 @@ "35:5: " + getCheckMessage(MSG_KEY), @@ -62,7 +63,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokens() { + void tokens() { @@ -22708,14 +22708,14 @@ .that(check.getRequiredTokens()) @@ -79,13 +80,13 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDeepDepth() throws Exception { + void deepDepth() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputUncommentedMain2.java"), expected); } - + @Test - public void testVisitPackage() throws Exception { + void visitPackage() throws Exception { @@ -22724,21 +22724,21 @@ }; @@ -93,19 +94,19 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongName() throws Exception { + void wrongName() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputUncommentedMain3.java"), expected); } - + @Test - public void testWrongArrayType() throws Exception { + void wrongArrayType() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputUncommentedMain4.java"), expected); } - + @Test - public void testIllegalStateException() { + void illegalStateException() { @@ -22747,16 +22747,16 @@ ast.initialize(new CommonToken(TokenTypes.CTOR_DEF, "ctor")); @@ -120,7 +121,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecords() throws Exception { + void records() throws Exception { - + final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY), @@ -133,13 +134,13 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTree() throws Exception { + void stateIsClearedOnBeginTree() throws Exception { @@ -22769,11 +22769,11 @@ + ImmutableList.of("12:5: " + getCheckMessage(MSG_KEY), "21:24: " + getCheckMessage(MSG_KEY)); + final List expectedSecondInput = ImmutableList.of("13:13: " + getCheckMessage(MSG_KEY)); final File[] inputs = {new File(file1), new File(file2)}; - + verify( @@ -151,7 +152,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTree2() throws Exception { + void stateIsClearedOnBeginTree2() throws Exception { @@ -22787,14 +22787,14 @@ - List.of("3:5: " + getCheckMessage(MSG_KEY), "12:5: " + getCheckMessage(MSG_KEY)); + ImmutableList.of("3:5: " + getCheckMessage(MSG_KEY), "12:5: " + getCheckMessage(MSG_KEY)); final File[] inputs = {new File(file1), new File(file2)}; - + verify( --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java @@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.MSG_IO_EXCEPTION_KEY; import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -22809,10 +22809,10 @@ import java.util.Map; import java.util.SortedSet; import org.junit.jupiter.api.Test; - + -public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { +final class UniquePropertiesCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -55,14 +55,14 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { @@ -22824,7 +22824,7 @@ final LineSeparatorOption option = LineSeparatorOption.valueOf("CR"); assertWithMessage("Invalid valueOf result").that(option).isEqualTo(LineSeparatorOption.CR); } - + /** Tests the ordinal work of a check. */ @Test - public void testDefault() throws Exception { @@ -22843,7 +22843,7 @@ UniquePropertiesCheck.class.getDeclaredMethod( @@ -100,7 +100,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDuplicatedProperty() throws Exception { + void duplicatedProperty() throws Exception { @@ -22852,7 +22852,7 @@ "2: " + getCheckMessage(MSG_KEY, "key", 2), @@ -109,7 +109,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldNotProcessFilesWithWrongFileExtension() throws Exception { + void shouldNotProcessFilesWithWrongFileExtension() throws Exception { @@ -22860,7 +22860,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verify(checkConfig, getPath("InputUniqueProperties.txt"), expected); @@ -117,13 +117,13 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { - + /** Tests IO exception, that can occur during reading of properties file. */ @Test - public void testIoException() throws Exception { @@ -22877,7 +22877,7 @@ final Violation violation = violations.iterator().next(); @@ -137,7 +137,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongKeyTypeInProperties() throws Exception { + void wrongKeyTypeInProperties() throws Exception { @@ -22889,15 +22889,15 @@ @@ -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 UpperEllCheckTest extends AbstractModuleTestSupport { +final class UpperEllCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class UpperEllCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -22906,7 +22906,7 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class UpperEllCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithChecker() throws Exception { + void withChecker() throws Exception { @@ -22915,7 +22915,7 @@ }; @@ -51,7 +51,7 @@ public class UpperEllCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptableTokens() { + void acceptableTokens() { @@ -22927,15 +22927,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { +final class AnnotationLocationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -22944,15 +22944,15 @@ "AnnotationLocationCheck#getRequiredTokens should return empty array by default") @@ -45,14 +45,14 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAnnotationLocationCorrect.java"), expected); } - + @Test - public void testIncorrectOne() throws Exception { + void incorrectOne() throws Exception { @@ -22961,7 +22961,7 @@ "20:15: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation1"), @@ -82,7 +82,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectTwo() throws Exception { + void incorrectTwo() throws Exception { @@ -22970,7 +22970,7 @@ }; @@ -90,7 +90,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectAllTokensOne() throws Exception { + void incorrectAllTokensOne() throws Exception { @@ -22979,7 +22979,7 @@ "20:15: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation_13"), @@ -120,7 +120,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectAllTokensTwo() throws Exception { + void incorrectAllTokensTwo() throws Exception { @@ -22988,7 +22988,7 @@ }; @@ -128,7 +128,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -22997,14 +22997,14 @@ final int[] expected = { @@ -149,13 +149,13 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutAnnotations() throws Exception { + void withoutAnnotations() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotationLocationEmpty.java"), expected); } - + @Test - public void testWithParametersOne() throws Exception { + void withParametersOne() throws Exception { @@ -23013,7 +23013,7 @@ "33:9: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnnotation_12", 8, 4), @@ -174,7 +174,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithParametersTwo() throws Exception { + void withParametersTwo() throws Exception { @@ -23022,7 +23022,7 @@ }; @@ -182,7 +182,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithMultipleAnnotations() throws Exception { + void withMultipleAnnotations() throws Exception { @@ -23031,7 +23031,7 @@ "14:17: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation12"), @@ -193,14 +193,14 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllTokens() throws Exception { + void allTokens() throws Exception { @@ -23039,7 +23039,7 @@ verifyWithInlineConfigParser( getPath("InputAnnotationLocationWithoutAnnotations.java"), expected); } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { @@ -23048,7 +23048,7 @@ "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "AnnotationAnnotation"), @@ -211,7 +211,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClass() throws Exception { + void testClass() throws Exception { @@ -23057,7 +23057,7 @@ "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "ClassAnnotation"), @@ -224,7 +224,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { @@ -23066,7 +23066,7 @@ "19:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "EnumAnnotation"), @@ -235,7 +235,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { @@ -23075,7 +23075,7 @@ "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "InterfaceAnnotation"), @@ -246,7 +246,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackage() throws Exception { + void testPackage() throws Exception { @@ -23084,7 +23084,7 @@ "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "PackageAnnotation"), @@ -255,20 +255,20 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationInForEachLoopParameterAndVariableDef() throws Exception { + void annotationInForEachLoopParameterAndVariableDef() throws Exception { @@ -23092,14 +23092,14 @@ verifyWithInlineConfigParser( getPath("InputAnnotationLocationDeprecatedAndCustom.java"), expected); } - + @Test - public void testAnnotationMultiple() throws Exception { + void annotationMultiple() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotationLocationMultiple.java"), expected); } - + @Test - public void testAnnotationParameterized() throws Exception { + void annotationParameterized() throws Exception { @@ -23108,7 +23108,7 @@ "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), @@ -282,7 +282,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationSingleParameterless() throws Exception { + void annotationSingleParameterless() throws Exception { @@ -23117,7 +23117,7 @@ "25:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), @@ -297,7 +297,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationLocationRecordsAndCompactCtors() throws Exception { + void annotationLocationRecordsAndCompactCtors() throws Exception { @@ -23129,15 +23129,15 @@ @@ -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 AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { +final class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -23146,7 +23146,7 @@ "AnnotationOnSameLineCheck#getRequiredTokens should return empty array by default") @@ -44,7 +44,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -23155,7 +23155,7 @@ final int[] expected = { @@ -70,7 +70,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheck() throws Exception { + void check() throws Exception { @@ -23164,7 +23164,7 @@ "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), @@ -81,7 +81,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckAcceptableTokens() throws Exception { + void checkAcceptableTokens() throws Exception { @@ -23173,7 +23173,7 @@ "19:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), @@ -92,7 +92,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheck2() throws Exception { + void check2() throws Exception { @@ -23182,7 +23182,7 @@ "24:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), @@ -103,7 +103,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckOnDifferentTokens() throws Exception { + void checkOnDifferentTokens() throws Exception { @@ -23191,7 +23191,7 @@ "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Ann"), @@ -127,7 +127,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationOnSameLineRecordsAndCompactCtors() throws Exception { + void annotationOnSameLineRecordsAndCompactCtors() throws Exception { @@ -23203,10 +23203,10 @@ @@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import de.thetaphi.forbiddenapis.SuppressForbidden; import org.junit.jupiter.api.Test; - + -public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { +final class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -45,7 +45,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { @@ -23247,7 +23247,7 @@ configuration.addProperty("closingParens", " ignore "); @@ -100,7 +100,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -23255,7 +23255,7 @@ "13:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), @@ -123,7 +123,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { - + /** Test that annotation parens are always present. */ @Test - public void testParensAlways() throws Exception { @@ -23264,7 +23264,7 @@ "12:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_MISSING), "27:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_MISSING), @@ -139,7 +139,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { - + /** Test that annotation parens are never present. */ @Test - public void testParensNever() throws Exception { @@ -23274,7 +23274,7 @@ "40:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_PRESENT), @@ -152,7 +152,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStyleExpanded() throws Exception { + void styleExpanded() throws Exception { @@ -23283,7 +23283,7 @@ "21:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "EXPANDED"), @@ -170,7 +170,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStyleCompact() throws Exception { + void styleCompact() throws Exception { @@ -23292,7 +23292,7 @@ "56:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT"), @@ -183,7 +183,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStyleCompactNoArray() throws Exception { + void styleCompactNoArray() throws Exception { @@ -23301,7 +23301,7 @@ "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), @@ -200,7 +200,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaAlwaysViolations() throws Exception { + void commaAlwaysViolations() throws Exception { @@ -23310,7 +23310,7 @@ "15:30: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), @@ -221,7 +221,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaAlwaysViolationsNonCompilable() throws Exception { + void commaAlwaysViolationsNonCompilable() throws Exception { @@ -23319,25 +23319,25 @@ "15:65: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), @@ -232,7 +232,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaAlwaysNoViolations() throws Exception { + void commaAlwaysNoViolations() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -240,7 +240,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaAlwaysNoViolationsNonCompilable() throws Exception { + void commaAlwaysNoViolationsNonCompilable() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -248,7 +248,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrailingArrayIgnore() throws Exception { + void trailingArrayIgnore() throws Exception { @@ -23346,7 +23346,7 @@ "23:13: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), @@ -261,7 +261,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaNeverViolations() throws Exception { + void commaNeverViolations() throws Exception { @@ -23355,32 +23355,32 @@ "21:42: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_PRESENT), @@ -278,7 +278,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaNeverNoViolations() throws Exception { + void commaNeverNoViolations() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -286,21 +286,21 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEverythingMixed() throws Exception { + void everythingMixed() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAnnotationUseStyleEverythingMixed.java"), expected); } - + @Test - public void testAnnotationsWithoutDefaultValues() throws Exception { + void annotationsWithoutDefaultValues() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAnnotationUseStyleParams.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -23389,7 +23389,7 @@ final int[] expected = {TokenTypes.ANNOTATION}; @@ -308,7 +308,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetOption() { + void getOption() { @@ -23398,27 +23398,27 @@ check.setElementStyle("SHOULD_PRODUCE_ERROR"); @@ -323,7 +323,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStyleNotInList() throws Exception { + void styleNotInList() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAnnotationUseStyle.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { +final class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetDefaultJavadocTokens() { + void getDefaultJavadocTokens() { @@ -23427,7 +23427,7 @@ JavadocTokenTypes.JAVADOC, @@ -48,7 +48,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredJavadocTokens() { + void getRequiredJavadocTokens() { @@ -23435,95 +23435,95 @@ final int[] expected = { JavadocTokenTypes.JAVADOC, @@ -60,7 +60,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { - + /** Tests that members that are only deprecated via javadoc are flagged. */ @Test - public void testBadDeprecatedAnnotation() throws Exception { + void badDeprecatedAnnotation() throws Exception { - + final String[] expected = { "14: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), @@ -79,7 +79,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { - + /** Tests that members that are only deprecated via the annotation are flagged. */ @Test - public void testBadDeprecatedJavadoc() throws Exception { + void badDeprecatedJavadoc() throws Exception { - + final String[] expected = { "18: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), @@ -94,7 +94,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { - + /** Tests various special deprecation conditions such as duplicate or empty tags. */ @Test - public void testSpecialCaseDeprecated() throws Exception { + void specialCaseDeprecated() throws Exception { - + final String[] expected = { "12: " + getCheckMessage(MSG_KEY_JAVADOC_DUPLICATE_TAG, "@deprecated"), @@ -114,7 +114,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { - + /** Tests that good forms of deprecation are not flagged. */ @Test - public void testGoodDeprecated() throws Exception { + void goodDeprecated() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -122,7 +122,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTwoInJavadocWithoutAnnotation() throws Exception { + void twoInJavadocWithoutAnnotation() throws Exception { - + final String[] expected = { "15: " + getCheckMessage(MSG_KEY_JAVADOC_DUPLICATE_TAG, "@deprecated"), @@ -133,7 +133,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyJavadocLine() throws Exception { + void emptyJavadocLine() throws Exception { - + final String[] expected = { "18: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), @@ -143,7 +143,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfo() throws Exception { + void packageInfo() throws Exception { - + final String[] expected = { "9: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), @@ -153,7 +153,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDepPackageInfoBelowComment() throws Exception { + void depPackageInfoBelowComment() throws Exception { - + final String[] expected = { "14: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), @@ -163,7 +163,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfoBelowComment() throws Exception { + void packageInfoBelowComment() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MissingOverrideCheckTest extends AbstractModuleTestSupport { +final class MissingOverrideCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +40,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { @@ -23532,7 +23532,7 @@ @Test - public void testBadOverrideFromObject() throws Exception { + void badOverrideFromObject() throws Exception { - + final String[] expected = { "15:5: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), @@ -59,7 +59,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { @@ -23541,7 +23541,7 @@ @Test - public void testBadOverrideFromObjectJ5Compatible() throws Exception { + void badOverrideFromObjectJ5Compatible() throws Exception { - + final String[] expected = { "15:5: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), @@ -77,7 +77,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { @@ -23559,9 +23559,9 @@ @Test - public void testBadOverrideFromOtherJ5Compatible() throws Exception { + void badOverrideFromOtherJ5Compatible() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -113,7 +113,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * including the inheritDoc tag. */ @@ -23578,7 +23578,7 @@ - public void testBadAnnotationOverrideJ5Compatible() throws Exception { + void badAnnotationOverrideJ5Compatible() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputMissingOverrideBadAnnotationJava5.java"), expected); @@ -139,7 +139,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * Tests that inheritDoc misuse is properly flagged or missing Javadocs do not cause a problem. @@ -23595,18 +23595,18 @@ @Test - public void testGoodOverrideFromObject() throws Exception { + void goodOverrideFromObject() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -166,7 +166,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * including the inheritDoc tag even in Java 5 compatibility mode. */ @Test - public void testGoodOverrideFromObjectJ5Compatible() throws Exception { + void goodOverrideFromObjectJ5Compatible() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -179,7 +179,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * including the inheritDoc tag. */ @@ -23614,7 +23614,7 @@ - public void testGoodOverrideFromOther() throws Exception { + void goodOverrideFromOther() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -191,7 +191,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * compatibility mode. @@ -23622,9 +23622,9 @@ @Test - public void testGoodOverrideFromOtherJ5Compatible() throws Exception { + void goodOverrideFromOtherJ5Compatible() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -204,7 +204,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * including the inheritDoc tag. */ @@ -23632,7 +23632,7 @@ - public void testGoodAnnotationOverride() throws Exception { + void goodAnnotationOverride() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputMissingOverrideGoodOverride.java"), expected); @@ -215,14 +215,14 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { * compatibility mode. @@ -23641,10 +23641,10 @@ - public void testGoodAnnotationOverrideJ5Compatible() throws Exception { + void goodAnnotationOverrideJ5Compatible() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputMissingOverrideGoodOverrideJava5.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -23656,24 +23656,24 @@ @@ -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 PackageAnnotationCheckTest extends AbstractModuleTestSupport { +final class PackageAnnotationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { - + /** This tests a package annotation that is in the package-info.java file. */ @Test - public void testGoodPackageAnnotation() throws Exception { + void goodPackageAnnotation() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -44,7 +44,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -23682,20 +23682,20 @@ final int[] expected = {TokenTypes.PACKAGE_DEF}; @@ -52,7 +52,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoPackageAnnotation() throws Exception { + void noPackageAnnotation() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -60,7 +60,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBadPackageAnnotation() throws Exception { + void badPackageAnnotation() throws Exception { - + final String[] expected = { "10:1: " + getCheckMessage(MSG_KEY), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckTest.java @@ -23703,361 +23703,361 @@ @@ -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 SuppressWarningsCheckTest extends AbstractModuleTestSupport { +final class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings with default regex. */ @Test - public void testSingleDefault() throws Exception { + void singleDefault() throws Exception { - + final String[] expected = { "18:23: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), @@ -53,7 +53,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings all warnings disabled on everything. */ @Test - public void testSingleAll() throws Exception { + void singleAll() throws Exception { - + final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -91,7 +91,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked warning disabled on everything. */ @Test - public void testSingleNoUnchecked() throws Exception { + void singleNoUnchecked() throws Exception { - + final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -110,7 +110,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked warning disabled on certain tokens. */ @Test - public void testSingleNoUncheckedTokens() throws Exception { + void singleNoUncheckedTokens() throws Exception { - + final String[] expected = { "13:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -126,7 +126,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings un* warning disabled on everything. */ @Test - public void testSingleNoUnWildcard() throws Exception { + void singleNoUnWildcard() throws Exception { - + final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -154,7 +154,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked, unused warning disabled on everything. */ @Test - public void testSingleNoUncheckedUnused() throws Exception { + void singleNoUncheckedUnused() throws Exception { - + final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -179,7 +179,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings *, unchecked, unused warning disabled on everything. */ @Test - public void testSingleNoUncheckedUnusedAll() throws Exception { + void singleNoUncheckedUnusedAll() throws Exception { - + final String[] expected = { "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -217,7 +217,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings with default regex. */ @Test - public void testCompactDefault() throws Exception { + void compactDefault() throws Exception { - + final String[] expected = { "18:24: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), @@ -230,7 +230,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactDefaultNonConstant() throws Exception { + void compactDefaultNonConstant() throws Exception { - + final String[] expected = { "18:24: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), @@ -255,7 +255,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings all warnings disabled on everything. */ @Test - public void testCompactAll() throws Exception { + void compactAll() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -281,7 +281,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactAllNonConstant() throws Exception { + void compactAllNonConstant() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -334,7 +334,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked warning disabled on everything. */ @Test - public void testCompactNoUnchecked() throws Exception { + void compactNoUnchecked() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -349,7 +349,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked warning disabled on certain tokens. */ @Test - public void testCompactNoUncheckedTokens() throws Exception { + void compactNoUncheckedTokens() throws Exception { - + final String[] expected = { "13:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -359,7 +359,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactNoUncheckedTokensNonConstant() throws Exception { + void compactNoUncheckedTokensNonConstant() throws Exception { - + final String[] expected = { "13:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -373,7 +373,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings un* warning disabled on everything. */ @Test - public void testCompactNoUnWildcard() throws Exception { + void compactNoUnWildcard() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -392,7 +392,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactNoUnWildcardNonConstant() throws Exception { + void compactNoUnWildcardNonConstant() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -426,7 +426,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked, unused warning disabled on everything. */ @Test - public void testCompactNoUncheckedUnused() throws Exception { + void compactNoUncheckedUnused() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -444,7 +444,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactNoUncheckedUnusedNonConstant() throws Exception { + void compactNoUncheckedUnusedNonConstant() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -477,7 +477,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings *, unchecked, unused warning disabled on everything. */ @Test - public void testCompactNoUncheckedUnusedAll() throws Exception { + void compactNoUncheckedUnusedAll() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -503,7 +503,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactNoUncheckedUnusedAllNonConstant() throws Exception { + void compactNoUncheckedUnusedAllNonConstant() throws Exception { - + final String[] expected = { "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -556,7 +556,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings with default regex. */ @Test - public void testExpandedDefault() throws Exception { + void expandedDefault() throws Exception { - + final String[] expected = { "18:30: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), @@ -569,7 +569,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedDefaultNonConstant() throws Exception { + void expandedDefaultNonConstant() throws Exception { - + final String[] expected = { "18:30: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), @@ -594,7 +594,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings all warnings disabled on everything. */ @Test - public void testExpandedAll() throws Exception { + void expandedAll() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -620,7 +620,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedAllNonConstant() throws Exception { + void expandedAllNonConstant() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -673,7 +673,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked warning disabled on everything. */ @Test - public void testExpandedNoUnchecked() throws Exception { + void expandedNoUnchecked() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -687,7 +687,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedNoUncheckedNonConstant() throws Exception { + void expandedNoUncheckedNonConstant() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -711,7 +711,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked warning disabled on certain tokens. */ @Test - public void testExpandedNoUncheckedTokens() throws Exception { + void expandedNoUncheckedTokens() throws Exception { - + final String[] expected = { "13:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -721,7 +721,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedNoUncheckedTokensNonConstant() throws Exception { + void expandedNoUncheckedTokensNonConstant() throws Exception { - + final String[] expected = { "13:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -735,7 +735,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings un* warning disabled on everything. */ @Test - public void testExpandedNoUnWildcard() throws Exception { + void expandedNoUnWildcard() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -754,7 +754,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedNoUnWildcardNonConstant() throws Exception { + void expandedNoUnWildcardNonConstant() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -788,7 +788,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings unchecked, unused warning disabled on everything. */ @Test - public void testExpandedNoUncheckedUnused() throws Exception { + void expandedNoUncheckedUnused() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -806,7 +806,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedNoUncheckedUnusedNonConstant() throws Exception { + void expandedNoUncheckedUnusedNonConstant() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -839,7 +839,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { - + /** Tests SuppressWarnings *, unchecked, unused warning disabled on everything. */ @Test - public void testExpandedNoUncheckedUnusedAll() throws Exception { + void expandedNoUncheckedUnusedAll() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -865,7 +865,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExpandedNoUncheckedUnusedAllNonConstant() throws Exception { + void expandedNoUncheckedUnusedAllNonConstant() throws Exception { - + final String[] expected = { "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), @@ -917,7 +917,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUncheckedInConstant() throws Exception { + void uncheckedInConstant() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -925,7 +925,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValuePairAnnotation() throws Exception { + void valuePairAnnotation() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -933,7 +933,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWorkingProperlyOnComplexAnnotations() throws Exception { + void workingProperlyOnComplexAnnotations() throws Exception { - + final String[] expected = { "30:34: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, ""), @@ -945,7 +945,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWorkingProperlyOnComplexAnnotationsNonConstant() throws Exception { + void workingProperlyOnComplexAnnotationsNonConstant() throws Exception { - + final String[] expected = { "30:34: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, ""), @@ -959,7 +959,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressWarningsRecords() throws Exception { + void suppressWarningsRecords() throws Exception { - + final String[] expected = { "24:28: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java @@ -24065,15 +24065,15 @@ @@ -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 AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { +final class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -24082,7 +24082,7 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrictSettings() throws Exception { + void strictSettings() throws Exception { @@ -24091,16 +24091,16 @@ "47:17: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), @@ -54,7 +54,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowSwitchInCase() throws Exception { + void allowSwitchInCase() throws Exception { - + final String[] expected = { "21:9: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), @@ -65,7 +65,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -24112,10 +24112,10 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class EmptyBlockCheckTest extends AbstractModuleTestSupport { +final class EmptyBlockCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,13 +40,13 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { @@ -24127,7 +24127,7 @@ final BlockOption option = BlockOption.valueOf("TEXT"); assertWithMessage("Invalid valueOf result").that(option).isEqualTo(BlockOption.TEXT); } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -24136,7 +24136,7 @@ "40:17: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), @@ -61,7 +61,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testText() throws Exception { + void text() throws Exception { @@ -24145,7 +24145,7 @@ "40:17: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "finally"), @@ -73,7 +73,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStatement() throws Exception { + void statement() throws Exception { @@ -24154,7 +24154,7 @@ "40:17: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), @@ -88,7 +88,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void allowEmptyLoops() throws Exception { + void allowEmptyLoops() throws Exception { @@ -24163,7 +24163,7 @@ "24:34: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), @@ -99,7 +99,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void allowEmptyLoopsText() throws Exception { + void allowEmptyLoopsText() throws Exception { @@ -24172,16 +24172,16 @@ "29:34: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "if"), @@ -110,7 +110,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -129,7 +129,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyCaseWithText() throws Exception { + void allowEmptyCaseWithText() throws Exception { @@ -24190,7 +24190,7 @@ "22:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "case"), @@ -141,7 +141,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForbidCaseWithoutStmt() throws Exception { + void forbidCaseWithoutStmt() throws Exception { @@ -24199,7 +24199,7 @@ "22:13: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "case"), @@ -155,7 +155,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyDefaultWithText() throws Exception { + void allowEmptyDefaultWithText() throws Exception { @@ -24208,7 +24208,7 @@ "21:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), @@ -168,7 +168,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForbidDefaultWithoutStatement() throws Exception { + void forbidDefaultWithoutStatement() throws Exception { @@ -24217,7 +24217,7 @@ "21:13: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), @@ -184,7 +184,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyBlockWithEmoji() throws Exception { + void emptyBlockWithEmoji() throws Exception { @@ -24226,7 +24226,7 @@ "25:27: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "if"), @@ -199,14 +199,14 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationDefaultKeyword() throws Exception { + void annotationDefaultKeyword() throws Exception { @@ -24234,7 +24234,7 @@ final String path = getPath("InputEmptyBlockAnnotationDefaultKeyword.java"); verifyWithInlineConfigParser(path, expected); } - + @Test - public void testEmptyBlockSwitchExpressions() throws Exception { + void emptyBlockSwitchExpressions() throws Exception { @@ -24243,7 +24243,7 @@ }; @@ -215,7 +215,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUppercaseProperty() throws Exception { + void uppercaseProperty() throws Exception { @@ -24255,15 +24255,15 @@ @@ -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 EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { +final class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -24272,7 +24272,7 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -24281,7 +24281,7 @@ "32:83: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), @@ -52,7 +52,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithUserSetValues() throws Exception { + void withUserSetValues() throws Exception { @@ -24290,7 +24290,7 @@ "54:78: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), @@ -67,7 +67,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLinesAreProperlySplitSystemIndependently() throws Exception { + void linesAreProperlySplitSystemIndependently() throws Exception { @@ -24299,7 +24299,7 @@ "53:78: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), @@ -88,7 +88,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -24311,10 +24311,10 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class LeftCurlyCheckTest extends AbstractModuleTestSupport { +final class LeftCurlyCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,13 +42,13 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { @@ -24326,7 +24326,7 @@ final LeftCurlyOption option = LeftCurlyOption.valueOf("NL"); assertWithMessage("Invalid valueOf result").that(option).isEqualTo(LeftCurlyOption.NL); } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -24335,7 +24335,7 @@ .that(checkObj.getRequiredTokens()) @@ -56,7 +56,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -24344,7 +24344,7 @@ "19:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -68,7 +68,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNl() throws Exception { + void nl() throws Exception { @@ -24353,7 +24353,7 @@ "40:14: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 14), @@ -85,7 +85,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNlow() throws Exception { + void nlow() throws Exception { @@ -24362,7 +24362,7 @@ "19:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -104,7 +104,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault2() throws Exception { + void default2() throws Exception { @@ -24371,7 +24371,7 @@ "22:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -126,7 +126,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewline2() throws Exception { + void newline2() throws Exception { @@ -24380,7 +24380,7 @@ "26:20: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 20), @@ -141,7 +141,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault3() throws Exception { + void default3() throws Exception { @@ -24389,7 +24389,7 @@ "20:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -174,7 +174,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewline3() throws Exception { + void newline3() throws Exception { @@ -24398,7 +24398,7 @@ "96:19: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 19), @@ -187,7 +187,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingBraces() throws Exception { + void missingBraces() throws Exception { @@ -24407,7 +24407,7 @@ "20:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -201,7 +201,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultWithAnnotations() throws Exception { + void defaultWithAnnotations() throws Exception { @@ -24416,7 +24416,7 @@ "27:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -215,7 +215,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNlWithAnnotations() throws Exception { + void nlWithAnnotations() throws Exception { @@ -24425,7 +24425,7 @@ "51:41: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 41), @@ -226,7 +226,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNlowWithAnnotations() throws Exception { + void nlowWithAnnotations() throws Exception { @@ -24434,7 +24434,7 @@ "27:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -239,7 +239,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineBreakAfter() throws Exception { + void lineBreakAfter() throws Exception { @@ -24443,7 +24443,7 @@ "25:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -262,7 +262,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreEnumsOptionTrue() throws Exception { + void ignoreEnumsOptionTrue() throws Exception { @@ -24452,7 +24452,7 @@ }; @@ -271,7 +271,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreEnumsOptionFalse() throws Exception { + void ignoreEnumsOptionFalse() throws Exception { @@ -24461,7 +24461,7 @@ "21:44: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 44), @@ -281,7 +281,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultLambda() throws Exception { + void defaultLambda() throws Exception { @@ -24470,7 +24470,7 @@ "24:32: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 32), @@ -291,7 +291,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewLineOptionWithLambda() throws Exception { + void newLineOptionWithLambda() throws Exception { @@ -24479,7 +24479,7 @@ "24:32: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 32), @@ -301,7 +301,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEolSwitch() throws Exception { + void eolSwitch() throws Exception { @@ -24488,7 +24488,7 @@ "26:13: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 13), @@ -313,7 +313,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNlSwitch() throws Exception { + void nlSwitch() throws Exception { @@ -24497,7 +24497,7 @@ "56:14: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 14), @@ -322,7 +322,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNlowSwitch() throws Exception { + void nlowSwitch() throws Exception { @@ -24506,7 +24506,7 @@ }; @@ -330,7 +330,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLeftCurlySwitchExpressions() throws Exception { + void leftCurlySwitchExpressions() throws Exception { @@ -24515,16 +24515,16 @@ "22:17: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 17), @@ -348,7 +348,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLeftCurlySwitchExpressionsNewLine() throws Exception { + void leftCurlySwitchExpressionsNewLine() throws Exception { - + final String[] expected = { "17:57: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 57), @@ -361,7 +361,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -24533,14 +24533,14 @@ final int[] expected = { @@ -394,13 +394,13 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFirstLine() throws Exception { + void firstLine() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLeftCurlyTestFirstLine.java"), expected); } - + @Test - public void testCoverageIncrease() throws Exception { + void coverageIncrease() throws Exception { @@ -24549,7 +24549,7 @@ "30:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -416,7 +416,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLeftCurlyRecordsAndCompactCtors() throws Exception { + void leftCurlyRecordsAndCompactCtors() throws Exception { @@ -24558,7 +24558,7 @@ "24:9: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 9), @@ -430,7 +430,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLeftCurlyWithEmoji() throws Exception { + void leftCurlyWithEmoji() throws Exception { @@ -24567,7 +24567,7 @@ "37:9: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 9), @@ -448,7 +448,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLeftCurlyWithEmojiNewLine() throws Exception { + void leftCurlyWithEmojiNewLine() throws Exception { @@ -24576,16 +24576,16 @@ "20:27: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 27), @@ -468,7 +468,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -487,7 +487,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -24594,7 +24594,7 @@ "20:16: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 16), @@ -496,7 +496,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForEnumConstantDef() throws Exception { + void forEnumConstantDef() throws Exception { @@ -24603,7 +24603,7 @@ "19:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), @@ -505,7 +505,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void commentBeforeLeftCurly() throws Exception { + void commentBeforeLeftCurly() throws Exception { @@ -24612,7 +24612,7 @@ }; @@ -513,7 +513,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void commentBeforeLeftCurly2() throws Exception { + void commentBeforeLeftCurly2() throws Exception { @@ -24624,15 +24624,15 @@ @@ -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 NeedBracesCheckTest extends AbstractModuleTestSupport { +final class NeedBracesCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -24641,7 +24641,7 @@ "42:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), @@ -63,7 +63,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testItWithAllowsOn() throws Exception { + void itWithAllowsOn() throws Exception { @@ -24650,7 +24650,7 @@ "47:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), @@ -88,7 +88,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineStatements() throws Exception { + void singleLineStatements() throws Exception { @@ -24659,7 +24659,7 @@ "38:43: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), @@ -106,7 +106,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineLambda() throws Exception { + void singleLineLambda() throws Exception { @@ -24668,7 +24668,7 @@ "19:22: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), @@ -117,7 +117,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoNotAllowSingleLineLambda() throws Exception { + void doNotAllowSingleLineLambda() throws Exception { @@ -24677,7 +24677,7 @@ "15:29: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), @@ -131,7 +131,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineCaseDefault() throws Exception { + void singleLineCaseDefault() throws Exception { @@ -24686,7 +24686,7 @@ "84:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), @@ -143,14 +143,14 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineCaseDefault2() throws Exception { + void singleLineCaseDefault2() throws Exception { @@ -24694,7 +24694,7 @@ verifyWithInlineConfigParser( getPath("InputNeedBracesTestSingleLineCaseDefault2.java"), expected); } - + @Test - public void testSingleLineCaseDefaultNoSingleLine() throws Exception { + void singleLineCaseDefaultNoSingleLine() throws Exception { @@ -24703,14 +24703,14 @@ "19:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), @@ -164,13 +164,13 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCycles() throws Exception { + void cycles() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNeedBracesTestCycles.java"), expected); } - + @Test - public void testConditions() throws Exception { + void conditions() throws Exception { @@ -24719,7 +24719,7 @@ "53:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), @@ -180,7 +180,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyLoopBodyTrue() throws Exception { + void allowEmptyLoopBodyTrue() throws Exception { @@ -24728,7 +24728,7 @@ }; @@ -188,7 +188,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyLoopBodyFalse() throws Exception { + void allowEmptyLoopBodyFalse() throws Exception { @@ -24737,7 +24737,7 @@ "23:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), @@ -212,14 +212,14 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptySingleLineDefaultStmt() throws Exception { + void emptySingleLineDefaultStmt() throws Exception { @@ -24745,7 +24745,7 @@ verifyWithInlineConfigParser( getPath("InputNeedBracesEmptySingleLineDefaultStmt.java"), expected); } - + @Test - public void testNeedBracesSwitchExpressionNoSingleLine() throws Exception { + void needBracesSwitchExpressionNoSingleLine() throws Exception { @@ -24754,7 +24754,7 @@ "18:47: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), @@ -243,7 +243,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNeedBracesSwitchExpression() throws Exception { + void needBracesSwitchExpression() throws Exception { @@ -24766,10 +24766,10 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class RightCurlyCheckTest extends AbstractModuleTestSupport { +final class RightCurlyCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,13 +41,13 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { @@ -24781,7 +24781,7 @@ final RightCurlyOption option = RightCurlyOption.valueOf("ALONE"); assertWithMessage("Invalid valueOf result").that(option).isEqualTo(RightCurlyOption.ALONE); } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -24790,7 +24790,7 @@ "28:17: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 17), @@ -59,7 +59,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSame() throws Exception { + void same() throws Exception { @@ -24799,21 +24799,21 @@ "29:17: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 17), @@ -74,19 +74,19 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSameOmitOneLiners() throws Exception { + void sameOmitOneLiners() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRightCurlyTestSameOmitOneLiners.java"), expected); } - + @Test - public void testSameDoesNotComplainForNonMultilineConstructs() throws Exception { + void sameDoesNotComplainForNonMultilineConstructs() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRightCurlyTestSame.java"), expected); } - + @Test - public void testAlone() throws Exception { + void alone() throws Exception { @@ -24822,7 +24822,7 @@ "94:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), @@ -103,7 +103,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewLine() throws Exception { + void newLine() throws Exception { @@ -24831,7 +24831,7 @@ "111:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -126,7 +126,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldStartLine2() throws Exception { + void shouldStartLine2() throws Exception { @@ -24840,7 +24840,7 @@ "111:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -144,7 +144,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForceLineBreakBefore() throws Exception { + void forceLineBreakBefore() throws Exception { @@ -24849,7 +24849,7 @@ "41:17: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 17), @@ -156,20 +156,20 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForceLineBreakBefore2() throws Exception { + void forceLineBreakBefore2() throws Exception { @@ -24857,14 +24857,14 @@ verifyWithInlineConfigParser( getPath("InputRightCurlyTestForceLineBreakBefore2.java"), expected); } - + @Test - public void testNullPointerException() throws Exception { + void nullPointerException() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRightCurlyTestNullPointerException.java"), expected); } - + @Test - public void testWithAnnotations() throws Exception { + void withAnnotations() throws Exception { @@ -24873,7 +24873,7 @@ "21:65: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 65), @@ -246,7 +246,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAloneOrSingleLine() throws Exception { + void aloneOrSingleLine() throws Exception { @@ -24882,7 +24882,7 @@ "84:42: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 42), @@ -293,7 +293,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCatchWithoutFinally() throws Exception { + void catchWithoutFinally() throws Exception { @@ -24891,7 +24891,7 @@ }; @@ -301,7 +301,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineClass() throws Exception { + void singleLineClass() throws Exception { @@ -24900,16 +24900,16 @@ }; @@ -309,7 +309,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -328,7 +328,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlySameAndLiteralDo() throws Exception { + void rightCurlySameAndLiteralDo() throws Exception { @@ -24918,7 +24918,7 @@ "75:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), @@ -338,7 +338,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResourceSame() throws Exception { + void tryWithResourceSame() throws Exception { @@ -24927,7 +24927,7 @@ "33:67: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 67), @@ -349,7 +349,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResourceAlone() throws Exception { + void tryWithResourceAlone() throws Exception { @@ -24936,7 +24936,7 @@ "33:67: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 67), @@ -364,7 +364,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResourceAloneSingle() throws Exception { + void tryWithResourceAloneSingle() throws Exception { @@ -24945,7 +24945,7 @@ "36:64: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 64), @@ -376,7 +376,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBracePolicyAloneAndSinglelineIfBlocks() throws Exception { + void bracePolicyAloneAndSinglelineIfBlocks() throws Exception { @@ -24954,14 +24954,14 @@ "15:45: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 45), @@ -386,26 +386,26 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyIsAloneLambda() throws Exception { + void rightCurlyIsAloneLambda() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRightCurlyTestIsAloneLambda.java"), expected); } - + @Test - public void testRightCurlyIsAloneOrSinglelineLambda() throws Exception { + void rightCurlyIsAloneOrSinglelineLambda() throws Exception { @@ -24969,14 +24969,14 @@ verifyWithInlineConfigParser( getPath("InputRightCurlyTestIsAloneOrSinglelineLambda.java"), expected); } - + @Test - public void testRightCurlyIsSameLambda() throws Exception { + void rightCurlyIsSameLambda() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRightCurlyTestIsSameLambda.java"), expected); } - + @Test - public void testOptionAlone() throws Exception { + void optionAlone() throws Exception { @@ -24985,7 +24985,7 @@ "17:21: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 21), @@ -433,7 +433,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOptionAloneOrSingleLine() throws Exception { + void optionAloneOrSingleLine() throws Exception { @@ -24994,7 +24994,7 @@ "30:37: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 37), @@ -450,7 +450,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlocksEndingWithSemiOptionSame() throws Exception { + void blocksEndingWithSemiOptionSame() throws Exception { @@ -25003,7 +25003,7 @@ "21:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -471,7 +471,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlocksEndingWithSemiOptionAlone() throws Exception { + void blocksEndingWithSemiOptionAlone() throws Exception { @@ -25012,7 +25012,7 @@ "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -499,7 +499,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlocksEndingWithSemiOptionAloneOrSingleLine() throws Exception { + void blocksEndingWithSemiOptionAloneOrSingleLine() throws Exception { @@ -25021,7 +25021,7 @@ "21:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -520,7 +520,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewTokensAlone() throws Exception { + void newTokensAlone() throws Exception { @@ -25030,7 +25030,7 @@ "16:20: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 20), @@ -530,7 +530,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewTokensAloneOrSingleLine() throws Exception { + void newTokensAloneOrSingleLine() throws Exception { @@ -25039,7 +25039,7 @@ }; @@ -539,7 +539,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewTokensSame() throws Exception { + void newTokensSame() throws Exception { @@ -25048,7 +25048,7 @@ }; @@ -547,7 +547,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyDoubleBrace() throws Exception { + void rightCurlyDoubleBrace() throws Exception { @@ -25057,14 +25057,14 @@ "14:2: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 2), @@ -556,13 +556,13 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyEmptyOnSingleLine() throws Exception { + void rightCurlyEmptyOnSingleLine() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRightCurlyTestEmptyOnSingleLine.java"), expected); } - + @Test - public void testRightCurlyEndOfFile() throws Exception { + void rightCurlyEndOfFile() throws Exception { @@ -25073,7 +25073,7 @@ "16:3: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 3), @@ -571,7 +571,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyRecordsAndCompactCtors() throws Exception { + void rightCurlyRecordsAndCompactCtors() throws Exception { @@ -25082,7 +25082,7 @@ "23:11: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 11), @@ -585,7 +585,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyWithEmoji() throws Exception { + void rightCurlyWithEmoji() throws Exception { @@ -25091,7 +25091,7 @@ "28:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), @@ -598,7 +598,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyWithEmojiAloneOrSingleLine() throws Exception { + void rightCurlyWithEmojiAloneOrSingleLine() throws Exception { @@ -25100,7 +25100,7 @@ "30:43: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 43), @@ -611,7 +611,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUppercaseOptionProperty() throws Exception { + void uppercaseOptionProperty() throws Exception { @@ -25109,7 +25109,7 @@ "21:35: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 35), @@ -621,7 +621,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyWithIfElseAlone() throws Exception { + void rightCurlyWithIfElseAlone() throws Exception { @@ -25118,7 +25118,7 @@ "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), @@ -630,7 +630,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCase() throws Exception { + void switchCase() throws Exception { @@ -25127,7 +25127,7 @@ "27:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), @@ -644,7 +644,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCase2() throws Exception { + void switchCase2() throws Exception { @@ -25136,7 +25136,7 @@ "27:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), @@ -654,7 +654,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCase3() throws Exception { + void switchCase3() throws Exception { @@ -25145,7 +25145,7 @@ "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), @@ -677,7 +677,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCase4() throws Exception { + void switchCase4() throws Exception { @@ -25154,7 +25154,7 @@ "19:36: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 36), @@ -693,7 +693,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCase5() throws Exception { + void switchCase5() throws Exception { @@ -25163,7 +25163,7 @@ "19:36: " + getCheckMessage(MSG_KEY_LINE_BREAK_BEFORE, "}", 36), @@ -710,7 +710,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchExpression() throws Exception { + void switchExpression() throws Exception { @@ -25172,7 +25172,7 @@ "56:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -721,7 +721,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchExpression2() throws Exception { + void switchExpression2() throws Exception { @@ -25181,7 +25181,7 @@ "54:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), @@ -733,14 +733,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchExpression3() throws Exception { + void switchExpression3() throws Exception { @@ -25189,7 +25189,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputRightCurlyTestSwitchExpression3.java"), expected); } - + @Test - public void testSwitchExpression4() throws Exception { + void switchExpression4() throws Exception { @@ -25198,7 +25198,7 @@ }; @@ -749,14 +749,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchExpression5() throws Exception { + void switchExpression5() throws Exception { @@ -25206,7 +25206,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputRightCurlyTestSwitchExpression5.java"), expected); } - + @Test - public void testSwitchWithComment() throws Exception { + void switchWithComment() throws Exception { @@ -25215,7 +25215,7 @@ "23:61: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 61), @@ -770,14 +770,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchExpression6() throws Exception { + void switchExpression6() throws Exception { @@ -25223,7 +25223,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputRightCurlyTestSwitchExpression6.java"), expected); } - + @Test - public void testSwitchExpression7() throws Exception { + void switchExpression7() throws Exception { @@ -25235,15 +25235,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCh import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { +final class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25252,7 +25252,7 @@ "43:9: " + getCheckMessage(MSG_KEY), @@ -44,7 +44,7 @@ public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25261,7 +25261,7 @@ assertWithMessage("Invalid default tokens").that(check.getDefaultTokens()).isNotNull(); @@ -52,7 +52,7 @@ public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAlwaysDemandTrailingComma() throws Exception { + void alwaysDemandTrailingComma() throws Exception { @@ -25273,15 +25273,15 @@ @@ -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 AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestSupport { +final class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestS } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25290,7 +25290,7 @@ "19:40: " + getCheckMessage(MSG_KEY), @@ -54,7 +54,7 @@ public class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestS } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25302,15 +25302,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineCondition import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport { +final class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25319,7 +25319,7 @@ "35:20: " + getCheckMessage(MSG_KEY), @@ -43,7 +43,7 @@ public class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25331,24 +25331,24 @@ @@ -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 AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModuleTestSupport { +final class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModule } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "12:9: " + getCheckMessage(MSG_CTOR), @@ -47,7 +47,7 @@ public class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModule } - + @Test - public void testTokens() { + void tokens() { @@ -25360,15 +25360,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { +final class CovariantEqualsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25377,7 +25377,7 @@ "36:20: " + getCheckMessage(MSG_KEY), @@ -46,7 +46,7 @@ public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCovariantEqualsRecords() throws Exception { + void covariantEqualsRecords() throws Exception { @@ -25386,7 +25386,7 @@ }; @@ -55,7 +55,7 @@ public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25398,42 +25398,42 @@ @@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.util.SortedSet; import org.junit.jupiter.api.Test; - + -public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { +final class DeclarationOrderCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +41,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "16:5: " + getCheckMessage(MSG_ACCESS), @@ -70,7 +70,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOnlyConstructors() throws Exception { + void onlyConstructors() throws Exception { - + final String[] expected = { "53:9: " + getCheckMessage(MSG_STATIC), @@ -85,7 +85,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOnlyModifiers() throws Exception { + void onlyModifiers() throws Exception { - + final String[] expected = { "16:5: " + getCheckMessage(MSG_ACCESS), @@ -112,7 +112,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25442,7 +25442,7 @@ .that(check.getAcceptableTokens()) @@ -126,7 +126,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testParents() { + void parents() { @@ -25451,7 +25451,7 @@ final DetailAstImpl method = new DetailAstImpl(); @@ -150,7 +150,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImproperToken() { + void improperToken() { @@ -25460,7 +25460,7 @@ final DetailAstImpl array = new DetailAstImpl(); @@ -166,7 +166,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForwardReference() throws Exception { + void forwardReference() throws Exception { @@ -25469,7 +25469,7 @@ "21:5: " + getCheckMessage(MSG_ACCESS), @@ -182,7 +182,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDeclarationOrderRecordsAndCompactCtors() throws Exception { + void declarationOrderRecordsAndCompactCtors() throws Exception { @@ -25478,7 +25478,7 @@ "24:9: " + getCheckMessage(MSG_STATIC), @@ -195,7 +195,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDeclarationOrderInterfaceMemberScopeIsPublic() throws Exception { + void declarationOrderInterfaceMemberScopeIsPublic() throws Exception { @@ -25487,7 +25487,7 @@ }; @@ -204,7 +204,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVariableAccess() throws Exception { + void variableAccess() throws Exception { @@ -25496,7 +25496,7 @@ }; @@ -212,7 +212,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAvoidDuplicatesForStaticFinalFields() throws Exception { + void avoidDuplicatesForStaticFinalFields() throws Exception { @@ -25505,7 +25505,7 @@ }; @@ -221,7 +221,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -25517,15 +25517,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { +final class DefaultComesLastCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSkipIfLastAndSharedWithCase() throws Exception { + void skipIfLastAndSharedWithCase() throws Exception { @@ -25534,7 +25534,7 @@ "31:13: " + getCheckMessage(MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE), @@ -52,7 +52,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25543,7 +25543,7 @@ "38:24: " + getCheckMessage(MSG_KEY), @@ -73,14 +73,14 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultMethodsInJava8() throws Exception { + void defaultMethodsInJava8() throws Exception { @@ -25551,7 +25551,7 @@ verifyWithInlineConfigParser( getPath("InputDefaultComesLastDefaultMethodsInInterface.java"), expected); } - + @Test - public void testDefaultComesLastSwitchExpressions() throws Exception { + void defaultComesLastSwitchExpressions() throws Exception { @@ -25560,16 +25560,16 @@ "32:13: " + getCheckMessage(MSG_KEY), @@ -91,7 +91,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultComesLastSwitchExpressionsSkipIfLast() throws Exception { + void defaultComesLastSwitchExpressionsSkipIfLast() throws Exception { - + final String[] expected = { "33:13: " + getCheckMessage(MSG_KEY), "48:13: " + getCheckMessage(MSG_KEY), @@ -101,7 +101,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25578,7 +25578,7 @@ .that(check.getAcceptableTokens()) @@ -115,7 +115,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultMethodsInJava8Interface2() throws Exception { + void defaultMethodsInJava8Interface2() throws Exception { @@ -25590,15 +25590,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck. import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyStatementCheckTest extends AbstractModuleTestSupport { +final class EmptyStatementCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class EmptyStatementCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyStatements() throws Exception { + void emptyStatements() throws Exception { @@ -25607,7 +25607,7 @@ "23:7: " + getCheckMessage(MSG_KEY), @@ -57,7 +57,7 @@ public class EmptyStatementCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25619,96 +25619,96 @@ @@ -26,7 +26,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { +final class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsWithDefault() throws Exception { + void equalsWithDefault() throws Exception { - + final String[] expected = { "44:27: " + getCheckMessage(MSG_EQUALS_IGNORE_CASE_AVOID_NULL), @@ -97,7 +97,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsWithoutEqualsIgnoreCase() throws Exception { + void equalsWithoutEqualsIgnoreCase() throws Exception { - + final String[] expected = { "245:21: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -148,7 +148,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsOnTheSameLine() throws Exception { + void equalsOnTheSameLine() throws Exception { - + final String[] expected = { "14:28: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -158,7 +158,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsNested() throws Exception { + void equalsNested() throws Exception { - + final String[] expected = { "25:34: " + getCheckMessage(MSG_EQUALS_IGNORE_CASE_AVOID_NULL), @@ -174,7 +174,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsSuperClass() throws Exception { + void equalsSuperClass() throws Exception { - + final String[] expected = { "23:35: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -183,7 +183,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputEqualsAvoidNullEnhancedInstanceof() throws Exception { + void inputEqualsAvoidNullEnhancedInstanceof() throws Exception { - + final String[] expected = { "15:45: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -198,7 +198,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMisc() throws Exception { + void misc() throws Exception { - + final String[] expected = { "20:17: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -207,7 +207,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsAndCompactCtors() throws Exception { + void recordsAndCompactCtors() throws Exception { - + final String[] expected = { "15:23: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -221,7 +221,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsAvoidNullTextBlocks() throws Exception { + void equalsAvoidNullTextBlocks() throws Exception { - + final String[] expected = { "13:24: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), @@ -235,7 +235,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25717,7 +25717,7 @@ .that(check.getAcceptableTokens()) @@ -249,7 +249,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualAvoidNull() throws Exception { + void equalAvoidNull() throws Exception { @@ -25729,7 +25729,7 @@ @@ -23,17 +23,17 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.MSG_KEY_EQUALS; import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.MSG_KEY_HASHCODE; - + +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -25740,15 +25740,15 @@ -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + -public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { +final class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +41,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSemantic() throws Exception { + void semantic() throws Exception { @@ -25757,7 +25757,7 @@ }; @@ -49,7 +49,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoEquals() throws Exception { + void noEquals() throws Exception { @@ -25766,19 +25766,19 @@ }; @@ -57,19 +57,19 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBooleanMethods() throws Exception { + void booleanMethods() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputEqualsHashCode.java"), expected); } - + @Test - public void testMultipleInputs() throws Exception { + void multipleInputs() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(EqualsHashCodeCheck.class); - + final List expectedFirstInputErrors = - Collections.singletonList("10:5: " + getCheckMessage(MSG_KEY_EQUALS)); + ImmutableList.of("10:5: " + getCheckMessage(MSG_KEY_EQUALS)); @@ -25786,11 +25786,11 @@ - Collections.singletonList("96:13: " + getCheckMessage(MSG_KEY_HASHCODE)); + ImmutableList.of("96:13: " + getCheckMessage(MSG_KEY_HASHCODE)); final List expectedThirdInputErrors = Arrays.asList(CommonUtil.EMPTY_STRING_ARRAY); - + final String firstInput = getPath("InputEqualsHashCodeNoEquals.java"); @@ -90,7 +90,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsParameter() throws Exception { + void equalsParameter() throws Exception { @@ -25799,7 +25799,7 @@ "24:9: " + getCheckMessage(MSG_KEY_HASHCODE), @@ -106,7 +106,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25811,15 +25811,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializati import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { +final class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25828,7 +25828,7 @@ "12:20: " + getCheckMessage(MSG_KEY, "bar", "null"), @@ -62,7 +62,7 @@ public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25837,7 +25837,7 @@ .that(check.getAcceptableTokens()) @@ -76,7 +76,7 @@ public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOnlyObjectReferences() throws Exception { + void onlyObjectReferences() throws Exception { @@ -25849,15 +25849,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class FallThroughCheckTest extends AbstractModuleTestSupport { +final class FallThroughCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -25866,14 +25866,14 @@ "46:13: " + getCheckMessage(MSG_FALL_THROUGH), @@ -65,13 +65,13 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResources() throws Exception { + void tryWithResources() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getNonCompilablePath("InputFallThrough.java"), expected); } - + @Test - public void testTryCatchInSwitch() throws Exception { + void tryCatchInSwitch() throws Exception { @@ -25882,7 +25882,7 @@ }; @@ -79,7 +79,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStringSwitch() throws Exception { + void stringSwitch() throws Exception { @@ -25891,7 +25891,7 @@ }; @@ -87,7 +87,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCharacterSwitch() throws Exception { + void characterSwitch() throws Exception { @@ -25900,7 +25900,7 @@ "30:13: " + getCheckMessage(MSG_FALL_THROUGH), @@ -100,7 +100,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLastCaseGroup() throws Exception { + void lastCaseGroup() throws Exception { @@ -25909,25 +25909,25 @@ "46:13: " + getCheckMessage(MSG_FALL_THROUGH), @@ -126,7 +126,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOwnPattern() throws Exception { + void ownPattern() throws Exception { - + final String[] expected = { "22:13: " + getCheckMessage(MSG_FALL_THROUGH), @@ -170,7 +170,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOwnPatternTryWithResources() throws Exception { + void ownPatternTryWithResources() throws Exception { - + final String[] expected = { "54:9: " + getCheckMessage(MSG_FALL_THROUGH), @@ -183,7 +183,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithEmoji() throws Exception { + void withEmoji() throws Exception { @@ -25936,7 +25936,7 @@ "25:17: " + getCheckMessage(MSG_FALL_THROUGH), @@ -194,7 +194,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -25945,7 +25945,7 @@ .that(check.getAcceptableTokens()) @@ -208,7 +208,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFallThroughNoElse() throws Exception { + void fallThroughNoElse() throws Exception { @@ -25954,7 +25954,7 @@ "43:13: " + getCheckMessage(MSG_FALL_THROUGH), @@ -224,7 +224,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testYield() throws Exception { + void yield() throws Exception { @@ -25963,7 +25963,7 @@ }; @@ -232,7 +232,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLastCase() throws Exception { + void lastCase() throws Exception { @@ -25972,7 +25972,7 @@ "83:11: " + getCheckMessage(MSG_FALL_THROUGH_LAST), @@ -242,7 +242,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIfElse() throws Exception { + void ifElse() throws Exception { @@ -25981,7 +25981,7 @@ }; @@ -250,7 +250,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFallThrough() throws Exception { + void fallThrough() throws Exception { @@ -25990,14 +25990,14 @@ "27:13: " + getCheckMessage(MSG_FALL_THROUGH), @@ -264,13 +264,13 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFallThroughNonCompilable4() throws Exception { + void fallThroughNonCompilable4() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getNonCompilablePath("InputFallThrough4.java"), expected); } - + @Test - public void testFallThroughComment() throws Exception { + void fallThroughComment() throws Exception { @@ -26006,7 +26006,7 @@ }; @@ -279,14 +279,14 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFallThroughComment2() throws Exception { + void fallThroughComment2() throws Exception { @@ -26014,7 +26014,7 @@ verifyWithInlineConfigParser( getPath("InputFallThroughFallThroughLotsOfComment2.java"), expected); } - + @Test - public void testFallThrough7() throws Exception { + void fallThrough7() throws Exception { @@ -26023,7 +26023,7 @@ "36:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), @@ -299,7 +299,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLastLine() throws Exception { + void lastLine() throws Exception { @@ -26032,7 +26032,7 @@ // until https://github.com/checkstyle/checkstyle/issues/13553 @@ -312,7 +312,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLastLine2() throws Exception { + void lastLine2() throws Exception { @@ -26041,7 +26041,7 @@ "22:13: " + getCheckMessage(MSG_FALL_THROUGH_LAST), @@ -321,7 +321,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReliefCommentBetweenMultipleComment() throws Exception { + void reliefCommentBetweenMultipleComment() throws Exception { @@ -26053,24 +26053,24 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { +final class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariableOne() throws Exception { + void inputFinalLocalVariableOne() throws Exception { - + final String[] expected = { "17:13: " + getCheckMessage(MSG_KEY, "i"), @@ -59,7 +59,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariableTwo() throws Exception { + void inputFinalLocalVariableTwo() throws Exception { @@ -26079,7 +26079,7 @@ "25:17: " + getCheckMessage(MSG_KEY, "j"), @@ -69,7 +69,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariableThree() throws Exception { + void inputFinalLocalVariableThree() throws Exception { @@ -26088,7 +26088,7 @@ "20:21: " + getCheckMessage(MSG_KEY, "x"), @@ -86,7 +86,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariableFour() throws Exception { + void inputFinalLocalVariableFour() throws Exception { @@ -26097,7 +26097,7 @@ "28:17: " + getCheckMessage(MSG_KEY, "shouldBeFinal"), @@ -98,7 +98,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalLocalVariableFive() throws Exception { + void finalLocalVariableFive() throws Exception { @@ -26106,7 +26106,7 @@ "26:17: " + getCheckMessage(MSG_KEY, "shouldBeFinal"), @@ -110,7 +110,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsInput() throws Exception { + void recordsInput() throws Exception { @@ -26115,68 +26115,68 @@ }; @@ -119,7 +119,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariable2One() throws Exception { + void inputFinalLocalVariable2One() throws Exception { - + final String[] expected = { "52:28: " + getCheckMessage(MSG_KEY, "aArg"), @@ -128,7 +128,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariable2Two() throws Exception { + void inputFinalLocalVariable2Two() throws Exception { - + final String[] excepted = { "78:36: " + getCheckMessage(MSG_KEY, "_o"), "83:37: " + getCheckMessage(MSG_KEY, "_o1"), @@ -137,7 +137,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariable2Three() throws Exception { + void inputFinalLocalVariable2Three() throws Exception { - + final String[] excepted = {}; - + @@ -145,7 +145,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariable2Four() throws Exception { + void inputFinalLocalVariable2Four() throws Exception { - + final String[] excepted = {}; - + @@ -153,7 +153,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputFinalLocalVariable2Five() throws Exception { + void inputFinalLocalVariable2Five() throws Exception { - + final String[] excepted = {}; - + @@ -161,21 +161,21 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNativeMethods() throws Exception { + void nativeMethods() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFinalLocalVariableNativeMethods.java"), expected); } - + @Test - public void testFalsePositive() throws Exception { + void falsePositive() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFinalLocalVariableFalsePositive.java"), expected); } - + @Test - public void testEnhancedForLoopVariableTrue() throws Exception { + void enhancedForLoopVariableTrue() throws Exception { @@ -26185,7 +26185,7 @@ "23:13: " + getCheckMessage(MSG_KEY, "x"), @@ -190,7 +190,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnhancedForLoopVariableFalse() throws Exception { + void enhancedForLoopVariableFalse() throws Exception { @@ -26194,7 +26194,7 @@ "29:66: " + getCheckMessage(MSG_KEY, "snippets"), @@ -202,7 +202,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambda() throws Exception { + void lambda() throws Exception { @@ -26203,34 +26203,34 @@ }; @@ -210,7 +210,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVariableNameShadowing() throws Exception { + void variableNameShadowing() throws Exception { - + final String[] expected = { "12:28: " + getCheckMessage(MSG_KEY, "text"), "25:13: " + getCheckMessage(MSG_KEY, "x"), @@ -219,7 +219,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImproperToken() { + void improperToken() { final FinalLocalVariableCheck check = new FinalLocalVariableCheck(); - + final DetailAstImpl lambdaAst = new DetailAstImpl(); @@ -234,7 +234,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVariableWhichIsAssignedMultipleTimes() throws Exception { + void variableWhichIsAssignedMultipleTimes() throws Exception { - + final String[] expected = { "57:13: " + getCheckMessage(MSG_KEY, "i"), @@ -249,7 +249,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVariableIsAssignedInsideAndOutsideSwitchBlock() throws Exception { + void variableIsAssignedInsideAndOutsideSwitchBlock() throws Exception { @@ -26239,7 +26239,7 @@ }; @@ -258,7 +258,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalLocalVariableFalsePositives() throws Exception { + void finalLocalVariableFalsePositives() throws Exception { @@ -26248,7 +26248,7 @@ }; @@ -266,27 +266,27 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleAndNestedConditions() throws Exception { + void multipleAndNestedConditions() throws Exception { @@ -26256,14 +26256,14 @@ verifyWithInlineConfigParser( getPath("InputFinalLocalVariableMultipleAndNestedConditions.java"), expected); } - + @Test - public void testMultiTypeCatch() throws Exception { + void multiTypeCatch() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFinalLocalVariableMultiCatch.java"), expected); } - + @Test - public void testLeavingSlistToken() throws Exception { + void leavingSlistToken() throws Exception { @@ -26271,7 +26271,7 @@ verifyWithInlineConfigParser( getPath("InputFinalLocalVariableLeavingSlistToken.java"), expected); } - + @Test - public void testBreakOrReturn() throws Exception { + void breakOrReturn() throws Exception { @@ -26280,7 +26280,7 @@ }; @@ -294,7 +294,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnonymousClass() throws Exception { + void anonymousClass() throws Exception { @@ -26289,7 +26289,7 @@ }; @@ -302,14 +302,14 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReceiverParameter() throws Exception { + void receiverParameter() throws Exception { @@ -26297,7 +26297,7 @@ verifyWithInlineConfigParser( getPath("InputFinalLocalVariableReceiverParameter.java"), expected); } - + @Test - public void testFinalLocalVariableSwitchExpressions() throws Exception { + void finalLocalVariableSwitchExpressions() throws Exception { @@ -26306,7 +26306,7 @@ "53:19: " + getCheckMessage(MSG_KEY, "e"), @@ -321,7 +321,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalLocalVariableSwitchAssignment() throws Exception { + void finalLocalVariableSwitchAssignment() throws Exception { @@ -26315,14 +26315,14 @@ "44:13: " + getCheckMessage(MSG_KEY, "b"), @@ -334,13 +334,13 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalLocalVariableSwitchStatement() throws Exception { + void finalLocalVariableSwitchStatement() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFinalLocalVariableSwitchStatement.java"), expected); } - + @Test - public void testConstructor() throws Exception { + void constructor() throws Exception { @@ -26331,7 +26331,7 @@ "18:44: " + getCheckMessage(MSG_KEY, "a"), @@ -352,7 +352,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -26343,15 +26343,15 @@ @@ -34,7 +34,7 @@ import java.util.Optional; import java.util.function.Predicate; import org.junit.jupiter.api.Test; - + -public class HiddenFieldCheckTest extends AbstractModuleTestSupport { +final class HiddenFieldCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticVisibilityFromLambdas() throws Exception { + void staticVisibilityFromLambdas() throws Exception { @@ -26360,7 +26360,7 @@ "63:31: " + getCheckMessage(MSG_KEY, "languageCode"), @@ -65,7 +65,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticVisibilityFromAnonymousClasses() throws Exception { + void staticVisibilityFromAnonymousClasses() throws Exception { @@ -26369,7 +26369,7 @@ "28:42: " + getCheckMessage(MSG_KEY, "other"), @@ -77,7 +77,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoParameters() throws Exception { + void noParameters() throws Exception { @@ -26378,7 +26378,7 @@ "39:13: " + getCheckMessage(MSG_KEY, "hidden"), @@ -102,7 +102,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -26386,7 +26386,7 @@ "30:13: " + getCheckMessage(MSG_KEY, "hidden"), "33:34: " + getCheckMessage(MSG_KEY, "hidden"), @@ -145,7 +145,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { - + /** Tests ignoreFormat property. */ @Test - public void testIgnoreFormat() throws Exception { @@ -26395,7 +26395,7 @@ checkConfig.addProperty("ignoreFormat", "^i.*$"); assertWithMessage("Ignore format should not be null") @@ -186,7 +186,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { - + /** Tests ignoreSetter property. */ @Test - public void testIgnoreSetter() throws Exception { @@ -26404,7 +26404,7 @@ "30:13: " + getCheckMessage(MSG_KEY, "hidden"), "33:34: " + getCheckMessage(MSG_KEY, "hidden"), @@ -225,7 +225,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { - + /** Tests ignoreSetter and setterCanReturnItsClass properties. */ @Test - public void testIgnoreChainSetter() throws Exception { @@ -26413,7 +26413,7 @@ "30:13: " + getCheckMessage(MSG_KEY, "hidden"), "33:34: " + getCheckMessage(MSG_KEY, "hidden"), @@ -262,7 +262,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { - + /** Tests ignoreConstructorParameter property. */ @Test - public void testIgnoreConstructorParameter() throws Exception { @@ -26422,7 +26422,7 @@ "29:13: " + getCheckMessage(MSG_KEY, "hidden"), "38:13: " + getCheckMessage(MSG_KEY, "hidden"), @@ -302,7 +302,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { - + /** Test against a class with field declarations in different order. */ @Test - public void testReordered() throws Exception { @@ -26432,50 +26432,50 @@ "33:40: " + getCheckMessage(MSG_KEY, "hidden"), @@ -329,7 +329,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreAbstractMethods() throws Exception { + void ignoreAbstractMethods() throws Exception { - + final String[] expected = { "30:13: " + getCheckMessage(MSG_KEY, "hidden"), @@ -371,13 +371,13 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReceiverParameter() throws Exception { + void receiverParameter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputHiddenFieldReceiver.java"), expected); } - + @Test - public void testHiddenFieldEnhancedInstanceof() throws Exception { + void hiddenFieldEnhancedInstanceof() throws Exception { - + final String[] expected = { "26:39: " + getCheckMessage(MSG_KEY, "price"), @@ -388,7 +388,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHiddenFieldSwitchExpression() throws Exception { + void hiddenFieldSwitchExpression() throws Exception { - + final String[] expected = { "28:13: " + getCheckMessage(MSG_KEY, "x"), @@ -411,7 +411,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHiddenFieldRecords() throws Exception { + void hiddenFieldRecords() throws Exception { - + final String[] expected = { "23:17: " + getCheckMessage(MSG_KEY, "myHiddenInt"), @@ -428,7 +428,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHiddenFieldLambdasInNestedScope() throws Exception { + void hiddenFieldLambdasInNestedScope() throws Exception { @@ -26484,29 +26484,29 @@ }; @@ -436,7 +436,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassNestedInRecord() throws Exception { + void classNestedInRecord() throws Exception { - + final String[] expected = { "23:26: " + getCheckMessage(MSG_KEY, "a"), @@ -446,7 +446,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHiddenFieldInnerRecordsImplicitlyStatic() throws Exception { + void hiddenFieldInnerRecordsImplicitlyStatic() throws Exception { - + final String[] expected = { "35:30: " + getCheckMessage(MSG_KEY, "pointer"), @@ -457,7 +457,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHiddenFieldRecordsImplicitlyStaticClassComparison() throws Exception { + void hiddenFieldRecordsImplicitlyStaticClassComparison() throws Exception { - + final String[] expected = { "49:27: " + getCheckMessage(MSG_KEY, "x"), @@ -475,7 +475,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { @@ -26526,30 +26526,30 @@ + 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 import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class IllegalCatchCheckTest extends AbstractModuleTestSupport { +final class IllegalCatchCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "14:11: " + getCheckMessage(MSG_KEY, "RuntimeException"), @@ -48,7 +48,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClassNames() throws Exception { + void illegalClassNames() throws Exception { @@ -26558,7 +26558,7 @@ "15:11: " + getCheckMessage(MSG_KEY, "Throwable"), @@ -60,7 +60,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClassNamesBad() throws Exception { + void illegalClassNamesBad() throws Exception { @@ -26567,7 +26567,7 @@ "15:11: " + getCheckMessage(MSG_KEY, "Exception"), @@ -71,7 +71,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleTypes() throws Exception { + void multipleTypes() throws Exception { @@ -26576,7 +26576,7 @@ "15:11: " + getCheckMessage(MSG_KEY, "SQLException"), @@ -90,7 +90,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -26588,22 +26588,22 @@ @@ -37,7 +37,7 @@ import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; - + -public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { +final class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -45,13 +45,13 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputIllegalInstantiationSemantic.java"), expected); } - + @Test - public void testClasses() throws Exception { + void classes() throws Exception { @@ -26612,7 +26612,7 @@ "29:21: " + getCheckMessage(MSG_KEY, "java.lang.Boolean"), @@ -68,20 +68,20 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSameClassNameAsJavaLang() throws Exception { + void sameClassNameAsJavaLang() throws Exception { @@ -26620,14 +26620,14 @@ verifyWithInlineConfigParser( getPath("InputIllegalInstantiationSameClassNameJavaLang.java"), expected); } - + @Test - public void testJava8() throws Exception { + void java8() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputIllegalInstantiation.java"), expected); } - + @Test - public void testNoPackage() throws Exception { + void noPackage() throws Exception { @@ -26636,7 +26636,7 @@ }; @@ -89,7 +89,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavaLangPackage() throws Exception { + void javaLangPackage() throws Exception { @@ -26645,7 +26645,7 @@ "21:20: " + getCheckMessage(MSG_KEY, "java.lang.String"), @@ -99,27 +99,27 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongPackage() throws Exception { + void wrongPackage() throws Exception { @@ -26653,14 +26653,14 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputIllegalInstantiationLang2.java"), expected); } - + @Test - public void testJavaLangPackage3() throws Exception { + void javaLangPackage3() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputIllegalInstantiationLang3.java"), expected); } - + @Test - public void testNameSimilarToStandardClass() throws Exception { + void nameSimilarToStandardClass() throws Exception { @@ -26668,7 +26668,7 @@ verifyWithInlineConfigParser( getPath("InputIllegalInstantiationNameSimilarToStandardClasses.java"), expected); } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -26677,12 +26677,12 @@ .that(check.getAcceptableTokens()) @@ -133,7 +133,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImproperToken() { + void improperToken() { final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); - + final DetailAstImpl lambdaAst = new DetailAstImpl(); @@ -153,9 +153,9 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { * @@ -26725,7 +26725,7 @@ + imports -> ((Collection) imports).isEmpty())) .isTrue(); } - + @@ -205,9 +208,9 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { * * @throws Exception when code tested throws exception @@ -26748,7 +26748,7 @@ instantiations -> ((Collection) instantiations).isEmpty())) .isTrue(); } - + @Test - public void testStateIsClearedOnBeginTreePackageName() throws Exception { + void stateIsClearedOnBeginTreePackageName() throws Exception { @@ -26760,24 +26760,24 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { +final class IllegalThrowsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "19:51: " + getCheckMessage(MSG_KEY, "RuntimeException"), @@ -46,7 +46,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClassNames() throws Exception { + void illegalClassNames() throws Exception { @@ -26785,16 +26785,16 @@ final String[] expected = { "15:33: " + getCheckMessage(MSG_KEY, "NullPointerException"), @@ -58,7 +58,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { - + /** Test to validate the IllegalThrowsCheck with ignoredMethodNames attribute. */ @Test - public void testIgnoreMethodNames() throws Exception { + void ignoreMethodNames() throws Exception { - + final String[] expected = { "19:51: " + getCheckMessage(MSG_KEY, "RuntimeException"), @@ -70,7 +70,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { - + /** Test to validate the IllegalThrowsCheck with both the attributes specified. */ @Test - public void testIllegalClassNamesWithIgnoreMethodNames() throws Exception { @@ -26803,26 +26803,26 @@ "14:33: " + getCheckMessage(MSG_KEY, "NullPointerException"), "27:35: " + getCheckMessage(MSG_KEY, "Throwable"), @@ -81,7 +81,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { - + /** Test to validate the IllegalThrowsCheck with ignoreOverriddenMethods property. */ @Test - public void testIgnoreOverriddenMethods() throws Exception { + void ignoreOverriddenMethods() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -91,7 +91,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { - + /** Test to validate the IllegalThrowsCheck without ignoreOverriddenMethods property. */ @Test - public void testNotIgnoreOverriddenMethods() throws Exception { + void notIgnoreOverriddenMethods() throws Exception { - + final String[] expected = { "17:36: " + getCheckMessage(MSG_KEY, "RuntimeException"), @@ -103,7 +103,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -26833,24 +26833,24 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckTest.java @@ -20,14 +20,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; - + import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.MSG_KEY; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; -import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; - + -public class IllegalTokenCheckTest extends AbstractModuleTestSupport { +final class IllegalTokenCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckWithDefaultSettings() throws Exception { + void checkWithDefaultSettings() throws Exception { @@ -26859,7 +26859,7 @@ "38:25: " + getCheckMessage(MSG_KEY, "anotherLabel:"), @@ -44,7 +44,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPreviouslyIllegalTokens() throws Exception { + void previouslyIllegalTokens() throws Exception { @@ -26868,7 +26868,7 @@ "21:18: " + getCheckMessage(MSG_KEY, "--"), @@ -54,7 +54,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNative() throws Exception { + void testNative() throws Exception { @@ -26877,11 +26877,11 @@ }; @@ -62,10 +62,10 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentContentToken() throws Exception { + void commentContentToken() throws Exception { - + final String path = getPath("InputIllegalTokens4.java"); - final String lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); + final String lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); @@ -26890,53 +26890,53 @@ + getCheckMessage( @@ -99,7 +99,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlockCommentBeginToken() throws Exception { + void blockCommentBeginToken() throws Exception { - + final String[] expected = { "1:1: " + getCheckMessage(MSG_KEY, "/*"), "10:1: " + getCheckMessage(MSG_KEY, "/*"), @@ -108,7 +108,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlockCommentEndToken() throws Exception { + void blockCommentEndToken() throws Exception { - + final String[] expected = { "6:1: " + getCheckMessage(MSG_KEY, "*/"), "12:2: " + getCheckMessage(MSG_KEY, "*/"), @@ -117,7 +117,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleLineCommentToken() throws Exception { + void singleLineCommentToken() throws Exception { - + final String[] expected = { "38:27: " + getCheckMessage(MSG_KEY, "//"), "42:26: " + getCheckMessage(MSG_KEY, "//"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckTest.java @@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.checks.coding; - + import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.MSG_KEY; +import static java.util.regex.Pattern.CASE_INSENSITIVE; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.TokenTypes; @@ -31,7 +32,7 @@ import java.util.List; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; - + -public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { +final class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +40,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCaseSensitive() throws Exception { + void caseSensitive() throws Exception { @@ -26945,7 +26945,7 @@ }; @@ -47,7 +48,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCaseInSensitive() throws Exception { + void caseInSensitive() throws Exception { @@ -26954,43 +26954,43 @@ "35:32: " + getCheckMessage(MSG_KEY, "a href"), @@ -56,7 +57,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomMessage() throws Exception { + void customMessage() throws Exception { - + final String[] expected = { "34:28: " + "My custom message", @@ -65,7 +66,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNullCustomMessage() throws Exception { + void nullCustomMessage() throws Exception { - + final String[] expected = { "34:28: " + getCheckMessage(MSG_KEY, "a href"), @@ -74,7 +75,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTokenTextTextBlocks() throws Exception { + void illegalTokenTextTextBlocks() throws Exception { - + final String[] expected = { "16:28: " + getCheckMessage(MSG_KEY, "a href"), @@ -88,7 +89,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTokenTextTextBlocksQuotes() throws Exception { + void illegalTokenTextTextBlocksQuotes() throws Exception { - + final String[] expected = { "16:28: " + getCheckMessage(MSG_KEY, "\""), @@ -104,7 +105,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -26999,25 +26999,25 @@ .that(check.getAcceptableTokens()) @@ -121,7 +122,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentToken() throws Exception { + void commentToken() 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 { } - + @Test - public void testOrderOfProperties() { + void orderOfProperties() { @@ -27031,7 +27031,7 @@ + assertWithMessage("should match").that(actual.flags()).isEqualTo(CASE_INSENSITIVE); assertWithMessage("should match").that(actual.pattern()).isEqualTo("test"); } - + @Test - public void testAcceptableTokensMakeSense() { + void acceptableTokensMakeSense() { @@ -27040,11 +27040,11 @@ "Total number of TokenTypes has changed, acceptable tokens in" @@ -192,7 +193,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultFormat() throws Exception { + void defaultFormat() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputIllegalTokenTextDefaultFormat.java"), expected); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckTest.java @@ -27052,15 +27052,15 @@ @@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.File; import org.junit.jupiter.api.Test; - + -public class IllegalTypeCheckTest extends AbstractModuleTestSupport { +final class IllegalTypeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidateAbstractClassNamesSetToTrue() throws Exception { + void validateAbstractClassNamesSetToTrue() throws Exception { @@ -27069,16 +27069,16 @@ "44:5: " + getCheckMessage(MSG_KEY, "AbstractClass"), @@ -52,7 +52,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidateAbstractClassNamesSetToFalse() throws Exception { + void validateAbstractClassNamesSetToFalse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -60,7 +60,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaults() throws Exception { + void defaults() throws Exception { @@ -27087,16 +27087,16 @@ "35:13: " + getCheckMessage(MSG_KEY, "TreeSet"), @@ -72,7 +72,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultsEmptyStringMemberModifiers() throws Exception { + void defaultsEmptyStringMemberModifiers() throws Exception { - + final String[] expected = { "34:13: " + getCheckMessage(MSG_KEY, "java.util.TreeSet"), @@ -86,7 +86,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreMethodNames() throws Exception { + void ignoreMethodNames() throws Exception { @@ -27105,25 +27105,25 @@ "26:13: " @@ -104,7 +104,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFormat() throws Exception { + void format() throws Exception { - + final String[] expected = { "34:13: " + getCheckMessage(MSG_KEY, "java.util.TreeSet"), @@ -117,7 +117,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLegalAbstractClassNames() throws Exception { + void legalAbstractClassNames() throws Exception { - + final String[] expected = { "26:13: " @@ -136,7 +136,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSameFileNameFalsePositive() throws Exception { + void sameFileNameFalsePositive() throws Exception { @@ -27132,7 +27132,7 @@ "43:5: " + getCheckMessage(MSG_KEY, "java.util.List"), @@ -147,7 +147,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSameFileNameGeneral() throws Exception { + void sameFileNameGeneral() throws Exception { @@ -27141,7 +27141,7 @@ "29:43: " + getCheckMessage(MSG_KEY, "InputIllegalTypeGregCal"), @@ -162,7 +162,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayTypes() throws Exception { + void arrayTypes() throws Exception { @@ -27150,7 +27150,7 @@ "22:12: " + getCheckMessage(MSG_KEY, "Boolean[][]"), @@ -175,7 +175,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPlainAndArrayTypes() throws Exception { + void plainAndArrayTypes() throws Exception { @@ -27159,7 +27159,7 @@ "24:12: " + getCheckMessage(MSG_KEY, "Boolean[][]"), @@ -187,7 +187,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGenerics() throws Exception { + void generics() throws Exception { @@ -27168,7 +27168,7 @@ "29:31: " + getCheckMessage(MSG_KEY, "Boolean"), @@ -211,7 +211,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExtendsImplements() throws Exception { + void extendsImplements() throws Exception { @@ -27177,25 +27177,25 @@ "25:14: " + getCheckMessage(MSG_KEY, "Boolean"), @@ -227,7 +227,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStarImports() throws Exception { + void starImports() throws Exception { - + final String[] expected = { "24:5: " + getCheckMessage(MSG_KEY, "List"), @@ -237,7 +237,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticImports() throws Exception { + void staticImports() throws Exception { - + final String[] expected = { "26:6: " + getCheckMessage(MSG_KEY, "SomeStaticClass"), @@ -248,7 +248,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMemberModifiers() throws Exception { + void memberModifiers() throws Exception { @@ -27204,16 +27204,16 @@ "25:13: " + getCheckMessage(MSG_KEY, "java.util.AbstractList"), @@ -263,7 +263,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageClassName() throws Exception { + void packageClassName() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -271,7 +271,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClearDataBetweenFiles() throws Exception { + void clearDataBetweenFiles() throws Exception { @@ -27222,7 +27222,7 @@ checkConfig.addProperty("illegalClassNames", "java.util.TreeSet"); @@ -290,7 +290,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTypeEnhancedInstanceof() throws Exception { + void illegalTypeEnhancedInstanceof() throws Exception { @@ -27231,7 +27231,7 @@ "31:28: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), @@ -304,7 +304,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTypeRecordsAndCompactCtors() throws Exception { + void illegalTypeRecordsAndCompactCtors() throws Exception { @@ -27240,16 +27240,16 @@ "31:52: " + getCheckMessage(MSG_KEY, "Cloneable"), @@ -320,7 +320,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTypeNewArrayStructure() throws Exception { + void illegalTypeNewArrayStructure() throws Exception { - + final String[] expected = { "26:13: " + getCheckMessage(MSG_KEY, "HashMap"), @@ -330,7 +330,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentsDefault() throws Exception { + void recordComponentsDefault() throws Exception { @@ -27258,7 +27258,7 @@ "53:23: " + getCheckMessage(MSG_KEY, "HashSet"), @@ -341,7 +341,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentsFinal() throws Exception { + void recordComponentsFinal() throws Exception { @@ -27267,7 +27267,7 @@ "53:23: " + getCheckMessage(MSG_KEY, "HashSet"), @@ -352,7 +352,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentsPrivateFinal() throws Exception { + void recordComponentsPrivateFinal() throws Exception { @@ -27276,23 +27276,23 @@ "53:23: " + getCheckMessage(MSG_KEY, "HashSet"), @@ -364,7 +364,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentsPublicProtectedStatic() throws Exception { + void recordComponentsPublicProtectedStatic() throws Exception { final String[] expected = {"45:9: " + getCheckMessage(MSG_KEY, "HashSet")}; - + verifyWithInlineConfigParser( @@ -374,13 +374,13 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrailingWhitespaceInConfig() throws Exception { + void trailingWhitespaceInConfig() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputIllegalTypeWhitespaceInConfig.java"), expected); } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -27301,12 +27301,12 @@ .that(check.getAcceptableTokens()) @@ -394,7 +394,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImproperToken() { + void improperToken() { final IllegalTypeCheck check = new IllegalTypeCheck(); - + final DetailAstImpl classDefAst = new DetailAstImpl(); @@ -414,7 +414,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { * beneficial. @@ -27319,7 +27319,7 @@ enumAst.setType(TokenTypes.ENUM_DEF); @@ -430,7 +430,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalTypeAbstractClassNameFormat() throws Exception { + void illegalTypeAbstractClassNameFormat() throws Exception { @@ -27331,15 +27331,15 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { +final class InnerAssignmentCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -27348,7 +27348,7 @@ "22:19: " + getCheckMessage(MSG_KEY), @@ -46,7 +46,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethod() throws Exception { + void method() throws Exception { @@ -27357,7 +27357,7 @@ }; @@ -54,7 +54,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDemoBug1195047Comment3() throws Exception { + void demoBug1195047Comment3() throws Exception { @@ -27366,14 +27366,14 @@ "19:24: " + getCheckMessage(MSG_KEY), @@ -74,13 +74,13 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaExpression() throws Exception { + void lambdaExpression() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputInnerAssignmentLambdaExpressions.java"), expected); } - + @Test - public void testInnerAssignmentNotInLoopContext() throws Exception { + void innerAssignmentNotInLoopContext() throws Exception { @@ -27382,7 +27382,7 @@ }; @@ -88,7 +88,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -27394,22 +27394,22 @@ @@ -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 MagicNumberCheckTest extends AbstractModuleTestSupport { +final class MagicNumberCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,13 +33,13 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLocalVariables() throws Exception { + void localVariables() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMagicNumberLocalVariables.java"), expected); } - + @Test - public void testLocalVariables2() throws Exception { + void localVariables2() throws Exception { @@ -27418,7 +27418,7 @@ }; @@ -47,7 +47,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault1() throws Exception { + void default1() throws Exception { @@ -27427,7 +27427,7 @@ "55:32: " + getCheckMessage(MSG_KEY, "1.5_0"), @@ -75,7 +75,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault2() throws Exception { + void default2() throws Exception { @@ -27436,7 +27436,7 @@ "28:30: " + getCheckMessage(MSG_KEY, "+3"), @@ -92,7 +92,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault3() throws Exception { + void default3() throws Exception { @@ -27445,7 +27445,7 @@ "25:16: " + getCheckMessage(MSG_KEY, "42"), @@ -114,7 +114,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreSome1() throws Exception { + void ignoreSome1() throws Exception { @@ -27454,7 +27454,7 @@ "42:35: " + getCheckMessage(MSG_KEY, "2"), @@ -136,7 +136,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreSome2() throws Exception { + void ignoreSome2() throws Exception { @@ -27463,7 +27463,7 @@ "30:29: " + getCheckMessage(MSG_KEY, "-2"), @@ -156,7 +156,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreSome3() throws Exception { + void ignoreSome3() throws Exception { @@ -27472,7 +27472,7 @@ "26:16: " + getCheckMessage(MSG_KEY, "42"), @@ -174,7 +174,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreNone1() throws Exception { + void ignoreNone1() throws Exception { @@ -27481,7 +27481,7 @@ "42:25: " + getCheckMessage(MSG_KEY, "2"), @@ -223,7 +223,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreNone2() throws Exception { + void ignoreNone2() throws Exception { @@ -27490,7 +27490,7 @@ "26:30: " + getCheckMessage(MSG_KEY, "+3"), @@ -244,7 +244,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreNone3() throws Exception { + void ignoreNone3() throws Exception { @@ -27499,7 +27499,7 @@ "25:16: " + getCheckMessage(MSG_KEY, "42"), @@ -262,7 +262,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIntegersOnly1() throws Exception { + void integersOnly1() throws Exception { @@ -27508,7 +27508,7 @@ "57:27: " + getCheckMessage(MSG_KEY, "3"), @@ -288,7 +288,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIntegersOnly2() throws Exception { + void integersOnly2() throws Exception { @@ -27517,7 +27517,7 @@ "28:30: " + getCheckMessage(MSG_KEY, "+3"), @@ -303,7 +303,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIntegersOnly3() throws Exception { + void integersOnly3() throws Exception { @@ -27526,7 +27526,7 @@ "25:16: " + getCheckMessage(MSG_KEY, "42"), @@ -321,7 +321,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreNegativeOctalHex1() throws Exception { + void ignoreNegativeOctalHex1() throws Exception { @@ -27535,7 +27535,7 @@ "57:27: " + getCheckMessage(MSG_KEY, "3"), @@ -347,7 +347,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreNegativeOctalHex2() throws Exception { + void ignoreNegativeOctalHex2() throws Exception { @@ -27544,7 +27544,7 @@ "28:30: " + getCheckMessage(MSG_KEY, "+3"), @@ -357,7 +357,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreNegativeOctalHex3() throws Exception { + void ignoreNegativeOctalHex3() throws Exception { @@ -27553,7 +27553,7 @@ "25:16: " + getCheckMessage(MSG_KEY, "42"), @@ -375,7 +375,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreHashCodeMethod() throws Exception { + void ignoreHashCodeMethod() throws Exception { @@ -27562,7 +27562,7 @@ "56:32: " + getCheckMessage(MSG_KEY, "1.5_0"), @@ -403,7 +403,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreHashCodeMethod2() throws Exception { + void ignoreHashCodeMethod2() throws Exception { @@ -27571,7 +27571,7 @@ "27:30: " + getCheckMessage(MSG_KEY, "+3"), @@ -420,7 +420,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreHashCodeMethod3() throws Exception { + void ignoreHashCodeMethod3() throws Exception { @@ -27580,7 +27580,7 @@ "30:16: " + getCheckMessage(MSG_KEY, "13"), @@ -437,7 +437,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreFieldDeclaration1() throws Exception { + void ignoreFieldDeclaration1() throws Exception { @@ -27589,7 +27589,7 @@ "56:32: " + getCheckMessage(MSG_KEY, "1.5_0"), @@ -464,7 +464,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreFieldDeclaration2() throws Exception { + void ignoreFieldDeclaration2() throws Exception { @@ -27598,7 +27598,7 @@ }; @@ -472,7 +472,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreFieldDeclaration3() throws Exception { + void ignoreFieldDeclaration3() throws Exception { @@ -27607,7 +27607,7 @@ "25:16: " + getCheckMessage(MSG_KEY, "42"), @@ -490,7 +490,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWaiverParentToken() throws Exception { + void waiverParentToken() throws Exception { @@ -27616,7 +27616,7 @@ "56:32: " + getCheckMessage(MSG_KEY, "1.5_0"), @@ -518,7 +518,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWaiverParentToken2() throws Exception { + void waiverParentToken2() throws Exception { @@ -27625,7 +27625,7 @@ "28:30: " + getCheckMessage(MSG_KEY, "+3"), @@ -540,7 +540,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWaiverParentToken3() throws Exception { + void waiverParentToken3() throws Exception { @@ -27634,7 +27634,7 @@ "25:16: " + getCheckMessage(MSG_KEY, "42"), @@ -563,7 +563,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMagicNumberRecordsDefault() throws Exception { + void magicNumberRecordsDefault() throws Exception { @@ -27643,7 +27643,7 @@ "21:36: " + getCheckMessage(MSG_KEY, "7"), @@ -576,7 +576,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMagicNumberIgnoreFieldDeclarationRecords() throws Exception { + void magicNumberIgnoreFieldDeclarationRecords() throws Exception { @@ -27652,7 +27652,7 @@ "25:29: " + getCheckMessage(MSG_KEY, "8"), @@ -588,7 +588,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreInAnnotationElementDefault() throws Exception { + void ignoreInAnnotationElementDefault() throws Exception { @@ -27661,7 +27661,7 @@ }; @@ -596,7 +596,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMagicNumber() throws Exception { + void magicNumber() throws Exception { @@ -27670,7 +27670,7 @@ "39:32: " + getCheckMessage(MSG_KEY, "1.5_0"), @@ -635,7 +635,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMagicNumber2() throws Exception { + void magicNumber2() throws Exception { @@ -27679,7 +27679,7 @@ "27:20: " + getCheckMessage(MSG_KEY, "5.5"), @@ -659,7 +659,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMagicNumber3() throws Exception { + void magicNumber3() throws Exception { @@ -27691,36 +27691,36 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MatchXpathCheckTest extends AbstractModuleTestSupport { +final class MatchXpathCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,25 +38,25 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckWithEmptyQuery() throws Exception { + void checkWithEmptyQuery() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMatchXpath.java"), expected); } - + @Test - public void testNoStackoverflowError() throws Exception { + void noStackoverflowError() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMatchXpathNoStackoverflowError.java"), expected); } - + @Test - public void testCheckWithImplicitEmptyQuery() throws Exception { + void checkWithImplicitEmptyQuery() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMatchXpath2.java"), expected); } - + @Test - public void testCheckWithMatchingMethodNames() throws Exception { + void checkWithMatchingMethodNames() throws Exception { @@ -27729,14 +27729,14 @@ "13:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), @@ -65,13 +65,13 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckWithNoMatchingMethodName() throws Exception { + void checkWithNoMatchingMethodName() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMatchXpath4.java"), expected); } - + @Test - public void testCheckWithSingleLineCommentsStartsWithSpace() throws Exception { + void checkWithSingleLineCommentsStartsWithSpace() throws Exception { @@ -27745,7 +27745,7 @@ "14:27: " + getCheckMessage(MatchXpathCheck.MSG_KEY), @@ -80,7 +80,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckWithBlockComments() throws Exception { + void checkWithBlockComments() throws Exception { @@ -27754,7 +27754,7 @@ "14:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), @@ -89,7 +89,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckWithMultilineComments() throws Exception { + void checkWithMultilineComments() throws Exception { @@ -27763,7 +27763,7 @@ "20:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), @@ -98,7 +98,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckWithDoubleBraceInitialization() throws Exception { + void checkWithDoubleBraceInitialization() throws Exception { @@ -27772,7 +27772,7 @@ }; @@ -106,7 +106,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImitateIllegalThrowsCheck() throws Exception { + void imitateIllegalThrowsCheck() throws Exception { @@ -27781,7 +27781,7 @@ "15:25: Illegal throws statement", @@ -116,7 +116,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImitateExecutableStatementCountCheck() throws Exception { + void imitateExecutableStatementCountCheck() throws Exception { @@ -27790,7 +27790,7 @@ }; @@ -124,7 +124,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForbidPrintStackTrace() throws Exception { + void forbidPrintStackTrace() throws Exception { @@ -27799,7 +27799,7 @@ }; @@ -132,7 +132,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForbidParameterizedConstructor() throws Exception { + void forbidParameterizedConstructor() throws Exception { @@ -27808,7 +27808,7 @@ "15:5: Parameterized constructors are not allowed", @@ -142,7 +142,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAvoidInstanceCreationWithoutVar() throws Exception { + void avoidInstanceCreationWithoutVar() throws Exception { @@ -27817,46 +27817,46 @@ }; @@ -151,7 +151,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidQuery() { + void invalidQuery() { final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); - + try { @@ -163,7 +163,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEvaluationException() { + void evaluationException() { final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); matchXpathCheck.setQuery("count(*) div 0"); - + @@ -182,25 +182,25 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetDefaultTokens() { + void getDefaultTokens() { final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); assertWithMessage("Expected empty array").that(matchXpathCheck.getDefaultTokens()).isEmpty(); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); assertWithMessage("Expected empty array").that(matchXpathCheck.getAcceptableTokens()).isEmpty(); } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); assertWithMessage("Expected empty array").that(matchXpathCheck.getRequiredTokens()).isEmpty(); } - + @Test - public void testMatchXpathWithFailedEvaluation() { + void matchXpathWithFailedEvaluation() { @@ -27868,24 +27868,24 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.MSG import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MissingCtorCheckTest extends AbstractModuleTestSupport { +final class MissingCtorCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class MissingCtorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingSwitchDefault() throws Exception { + void missingSwitchDefault() throws Exception { - + final String[] expected = { "9:1: " + getCheckMessage(MSG_KEY), @@ -43,7 +43,7 @@ public class MissingCtorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -27894,11 +27894,11 @@ .that(check.getAcceptableTokens()) @@ -57,7 +57,7 @@ public class MissingCtorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingCtorClassOnOneLine() throws Exception { + void missingCtorClassOnOneLine() throws Exception { - + final String[] expected = { "9:1: " + getCheckMessage(MSG_KEY), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java @@ -27906,15 +27906,15 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { +final class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingSwitchDefault() throws Exception { + void missingSwitchDefault() throws Exception { @@ -27923,7 +27923,7 @@ "35:17: " + getCheckMessage(MSG_KEY, "default"), @@ -45,7 +45,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -27932,7 +27932,7 @@ .that(check.getAcceptableTokens()) @@ -59,7 +59,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingSwitchDefaultSwitchExpressions() throws Exception { + void missingSwitchDefaultSwitchExpressions() throws Exception { @@ -27941,7 +27941,7 @@ }; @@ -68,14 +68,14 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNullCaseLabel() throws Exception { + void nullCaseLabel() throws Exception { @@ -27949,7 +27949,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputMissingSwitchDefaultCheckNullCaseLabel.java"), expected); } - + @Test - public void testMissingSwitchDefaultSwitchExpressionsTwo() throws Exception { + void missingSwitchDefaultSwitchExpressionsTwo() throws Exception { @@ -27958,7 +27958,7 @@ "26:9: " + getCheckMessage(MSG_KEY, "default"), @@ -85,7 +85,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingSwitchDefaultSwitchExpressionsThree() throws Exception { + void missingSwitchDefaultSwitchExpressionsThree() throws Exception { @@ -27967,7 +27967,7 @@ getNonCompilablePath("InputMissingSwitchDefaultCheckSwitchExpressionsThree.java"), @@ -93,7 +93,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingSwitchDefaultCaseLabelElements() throws Exception { + void missingSwitchDefaultCaseLabelElements() throws Exception { @@ -27979,15 +27979,15 @@ @@ -35,7 +35,7 @@ import java.util.Optional; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport { +final class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -43,7 +43,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testModifiedControlVariable() throws Exception { + void modifiedControlVariable() throws Exception { @@ -27996,34 +27996,34 @@ "20:15: " + getCheckMessage(MSG_KEY, "i"), @@ -60,7 +60,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testEnhancedForLoopVariableTrue() throws Exception { + void enhancedForLoopVariableTrue() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( @@ -68,7 +68,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testEnhancedForLoopVariableFalse() throws Exception { + void enhancedForLoopVariableFalse() throws Exception { - + final String[] expected = { "16:18: " + getCheckMessage(MSG_KEY, "line"), @@ -78,7 +78,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testEnhancedForLoopVariable2() throws Exception { + void enhancedForLoopVariable2() throws Exception { - + final String[] expected = { "21:18: " + getCheckMessage(MSG_KEY, "i"), @@ -88,7 +88,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28032,16 +28032,16 @@ .that(check.getAcceptableTokens()) @@ -102,7 +102,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testImproperToken() { + void improperToken() { final ModifiedControlVariableCheck check = new ModifiedControlVariableCheck(); - + final DetailAstImpl classDefAst = new DetailAstImpl(); @@ -124,7 +124,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testVariousAssignments() throws Exception { + void variousAssignments() throws Exception { @@ -28050,7 +28050,7 @@ "15:15: " + getCheckMessage(MSG_KEY, "k"), @@ -154,7 +154,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport } - + @Test - public void testRecordDecompositionInEnhancedForLoop() throws Exception { + void recordDecompositionInEnhancedForLoop() throws Exception { @@ -28083,60 +28083,60 @@ @@ -31,7 +31,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { +final class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { - + final String[] expected = { "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), @@ -51,7 +51,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testItIgnoreEmpty() throws Exception { + void itIgnoreEmpty() throws Exception { - + final String[] expected = { "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), @@ -62,7 +62,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleInputs() throws Exception { + void multipleInputs() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(MultipleStringLiteralsCheck.class); checkConfig.addProperty("allowedDuplicates", "2"); - + @@ -84,7 +84,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testItIgnoreEmptyAndComspace() throws Exception { + void itIgnoreEmptyAndComspace() throws Exception { - + final String[] expected = { "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), @@ -94,7 +94,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testItWithoutIgnoringAnnotations() throws Exception { + void itWithoutIgnoringAnnotations() throws Exception { - + final String[] expected = { "28:23: " + getCheckMessage(MSG_KEY, "\"unchecked\"", 4), @@ -104,7 +104,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28145,7 +28145,7 @@ .that(check.getAcceptableTokens()) @@ -118,7 +118,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { @@ -28154,7 +28154,7 @@ "16:17: " + getCheckMessage(MSG_KEY, "\"DoubleString\"", 2), @@ -129,7 +129,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnores() throws Exception { + void ignores() throws Exception { @@ -28163,11 +28163,11 @@ }; @@ -138,7 +138,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleStringLiteralsTextBlocks() throws Exception { + void multipleStringLiteralsTextBlocks() throws Exception { - + final String[] expected = { "14:22: " + getCheckMessage(MSG_KEY, "\"string\"", 3), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckTest.java @@ -28175,24 +28175,24 @@ @@ -26,7 +26,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDecl import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSupport { +final class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSup } - + @Test - public void testIt() throws Exception { + void it() throws Exception { - + final String[] expected = { "11:5: " + getCheckMessage(MSG_MULTIPLE_COMMA), @@ -52,7 +52,7 @@ public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSup } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28201,11 +28201,11 @@ .that(check.getAcceptableTokens()) @@ -66,7 +66,7 @@ public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSup } - + @Test - public void test() throws Exception { + void test() throws Exception { - + final String[] expected = { "11:5: " + getCheckMessage(MSG_MULTIPLE), "14:5: " + getCheckMessage(MSG_MULTIPLE), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java @@ -28213,10 +28213,10 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class NestedForDepthCheckTest extends AbstractModuleTestSupport { +final class NestedForDepthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +41,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { @@ -28225,7 +28225,7 @@ @Test - public void testNestedTooDeep() throws Exception { + void nestedTooDeep() throws Exception { - + final String[] expected = { "32:11: " + getCheckMessage(MSG_KEY, 3, 2), @@ -60,7 +60,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { @@ -28234,12 +28234,12 @@ @Test - public void testNestedOk() throws Exception { + void nestedOk() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -68,7 +68,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28248,7 +28248,7 @@ .that(check.getAcceptableTokens()) @@ -82,7 +82,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedDefault() throws Exception { + void nestedDefault() throws Exception { @@ -28260,33 +28260,33 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { +final class NestedIfDepthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "26:17: " + getCheckMessage(MSG_KEY, 2, 1), @@ -48,7 +48,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomizedDepth() throws Exception { + void customizedDepth() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -56,7 +56,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28298,33 +28298,33 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck. import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { +final class NestedTryDepthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "29:17: " + getCheckMessage(MSG_KEY, 2, 1), @@ -45,7 +45,7 @@ public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomizedDepth() throws Exception { + void customizedDepth() throws Exception { - + final String[] expected = { "41:21: " + getCheckMessage(MSG_KEY, 3, 2), @@ -55,7 +55,7 @@ public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28336,15 +28336,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingComma import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { +final class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { - + @Override public String getPackageLocation() { @@ -33,7 +33,7 @@ public class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -28353,7 +28353,7 @@ "25:32: " + getCheckMessage(MSG_KEY), @@ -47,7 +47,7 @@ public class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28365,15 +28365,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.MSG_KEY import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoCloneCheckTest extends AbstractModuleTestSupport { +final class NoCloneCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NoCloneCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHasClone() throws Exception { + void hasClone() throws Exception { @@ -28382,7 +28382,7 @@ "34:5: " + getCheckMessage(MSG_KEY), @@ -47,7 +47,7 @@ public class NoCloneCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28394,15 +28394,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NoEnumTrailingCommaC import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { +final class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultOne() throws Exception { + void defaultOne() throws Exception { @@ -28411,7 +28411,7 @@ "28:12: " + getCheckMessage(MSG_KEY), @@ -48,7 +48,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultTwo() throws Exception { + void defaultTwo() throws Exception { @@ -28420,7 +28420,7 @@ "24:14: " + getCheckMessage(MSG_KEY), @@ -64,7 +64,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultThree() throws Exception { + void defaultThree() throws Exception { @@ -28429,7 +28429,7 @@ "33:10: " + getCheckMessage(MSG_KEY), @@ -76,7 +76,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28440,25 +28440,25 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** NoFinalizerCheck test. */ -public class NoFinalizerCheckTest extends AbstractModuleTestSupport { +final class NoFinalizerCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class NoFinalizerCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final NoFinalizerCheck noFinalizerCheck = new NoFinalizerCheck(); final int[] expected = {TokenTypes.METHOD_DEF}; - + @@ -46,7 +46,7 @@ public class NoFinalizerCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHasFinalizer() throws Exception { + void hasFinalizer() throws Exception { @@ -28467,14 +28467,14 @@ }; @@ -54,13 +54,13 @@ public class NoFinalizerCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHasNoFinalizer() throws Exception { + void hasNoFinalizer() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNoFinalizerFallThrough.java"), expected); } - + @Test - public void testHasNoFinalizerTryWithResource() throws Exception { + void hasNoFinalizerTryWithResource() throws Exception { @@ -28486,22 +28486,22 @@ @@ -22,13 +22,14 @@ package com.puppycrawl.tools.checkstyle.checks.coding; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.util.List; import org.junit.jupiter.api.Test; - + -public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { +final class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +37,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiCaseClass() throws Exception { + void multiCaseClass() throws Exception { @@ -28510,7 +28510,7 @@ "93:21: " + getCheckMessage(MSG_KEY), @@ -51,7 +52,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28519,7 +28519,7 @@ .that(check.getAcceptableTokens()) @@ -65,7 +66,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithMultilineStatements() throws Exception { + void withMultilineStatements() throws Exception { @@ -28528,7 +28528,7 @@ "66:17: " + getCheckMessage(MSG_KEY), @@ -81,7 +82,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void oneStatementNonCompilableInputTest() throws Exception { + void oneStatementNonCompilableInputTest() throws Exception { @@ -28537,7 +28537,7 @@ "44:54: " + getCheckMessage(MSG_KEY), @@ -95,7 +96,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testResourceReferenceVariableIgnored() throws Exception { + void resourceReferenceVariableIgnored() throws Exception { @@ -28546,7 +28546,7 @@ "36:43: " + getCheckMessage(MSG_KEY), @@ -108,14 +109,14 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testResourcesIgnored() throws Exception { + void resourcesIgnored() throws Exception { @@ -28554,16 +28554,16 @@ verifyWithInlineConfigParser( getPath("InputOneStatementPerLineTryWithResourcesIgnore.java"), expected); } - + @Test - public void testAllTheCodeInSingleLine() throws Exception { + void allTheCodeInSingleLine() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(OneStatementPerLineCheck.class); - + final String[] expected = { @@ -132,22 +133,22 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTreeForLastStatementEnd() throws Exception { + void stateIsClearedOnBeginTreeForLastStatementEnd() throws Exception { @@ -28575,7 +28575,7 @@ verifyWithInlineConfigParser( inputWithWarnings, inputWithoutWarnings, expectedFirstInput, expectedSecondInput); } - + @Test - public void testStateIsClearedOnBeginTreeForLastVariableStatement() throws Exception { + void stateIsClearedOnBeginTreeForLastVariableStatement() throws Exception { @@ -28593,42 +28593,42 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTestSupport { +final class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "32:5: " + getCheckMessage(MSG_KEY, 21), @@ -46,7 +46,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } - + @Test - public void testOverloadMethodsDeclarationOrderRecords() throws Exception { + void overloadMethodsDeclarationOrderRecords() throws Exception { - + final String[] expected = { "21:9: " + getCheckMessage(MSG_KEY, 15), @@ -58,7 +58,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } - + @Test - public void testOverloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { + void overloadMethodsDeclarationOrderPrivateAndStaticMethods() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -67,7 +67,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28640,96 +28640,96 @@ @@ -31,7 +31,7 @@ import de.thetaphi.forbiddenapis.SuppressForbidden; import java.io.File; import org.junit.jupiter.api.Test; - + -public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { +final class PackageDeclarationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultNoPackage() throws Exception { + void defaultNoPackage() throws Exception { - + final String[] expected = { "8:1: " + getCheckMessage(MSG_KEY_MISSING), @@ -49,7 +49,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultWithPackage() throws Exception { + void defaultWithPackage() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -57,7 +57,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOnFileWithCommentOnly() throws Exception { + void onFileWithCommentOnly() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -65,7 +65,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileForDiffDirectoryMismatch() throws Exception { + void fileForDiffDirectoryMismatch() throws Exception { - + final String[] expected = { "8:1: " + getCheckMessage(MSG_KEY_MISMATCH), @@ -76,7 +76,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileForDirectoryMismatchAtParent() throws Exception { + void fileForDirectoryMismatchAtParent() throws Exception { - + final String[] expected = { "8:1: " + getCheckMessage(MSG_KEY_MISMATCH), @@ -87,7 +87,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileForDirectoryMismatchAtSubpackage() throws Exception { + void fileForDirectoryMismatchAtSubpackage() throws Exception { - + final String[] expected = { "8:1: " + getCheckMessage(MSG_KEY_MISMATCH), @@ -98,7 +98,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileIgnoreDiffDirectoryMismatch() throws Exception { + void fileIgnoreDiffDirectoryMismatch() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -106,7 +106,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileIgnoreDirectoryMismatchAtParent() throws Exception { + void fileIgnoreDirectoryMismatchAtParent() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -114,7 +114,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileIgnoreDirectoryMismatchAtSubpackage() throws Exception { + void fileIgnoreDirectoryMismatchAtSubpackage() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -122,7 +122,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoPackage() throws Exception { + void noPackage() throws Exception { @@ -28737,17 +28737,17 @@ "9:1: " + getCheckMessage(MSG_KEY_MISSING), }; @@ -133,7 +133,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { - + @SuppressForbidden @Test - public void testEmptyFile() throws Exception { + void emptyFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(PackageDeclarationCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -141,7 +141,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28756,7 +28756,7 @@ .that(check.getAcceptableTokens()) @@ -155,7 +155,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBeginTreeClear() throws Exception { + void beginTreeClear() throws Exception { @@ -28768,15 +28768,15 @@ @@ -34,7 +34,7 @@ import java.util.Optional; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { +final class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -28785,14 +28785,14 @@ "18:15: " + getCheckMessage(MSG_KEY, "field"), @@ -61,13 +61,13 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReceiverParameter() throws Exception { + void receiverParameter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterAssignmentReceiver.java"), expected); } - + @Test - public void testEnhancedSwitch() throws Exception { + void enhancedSwitch() throws Exception { @@ -28801,7 +28801,7 @@ }; @@ -76,7 +76,7 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28834,15 +28834,15 @@ @@ -39,7 +39,7 @@ import java.util.SortedSet; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class RequireThisCheckTest extends AbstractModuleTestSupport { +final class RequireThisCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -47,7 +47,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -28851,7 +28851,7 @@ "26:9: " + getCheckMessage(MSG_METHOD, "method1", ""), @@ -73,7 +73,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodsOnly() throws Exception { + void methodsOnly() throws Exception { @@ -28860,7 +28860,7 @@ "124:9: " + getCheckMessage(MSG_METHOD, "instanceMethod", ""), @@ -85,7 +85,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFieldsOnly() throws Exception { + void fieldsOnly() throws Exception { @@ -28869,7 +28869,7 @@ "39:9: " + getCheckMessage(MSG_VARIABLE, "i", ""), @@ -107,7 +107,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFieldsInExpressions() throws Exception { + void fieldsInExpressions() throws Exception { @@ -28878,14 +28878,14 @@ "19:28: " + getCheckMessage(MSG_VARIABLE, "length", ""), @@ -133,13 +133,13 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGenerics() throws Exception { + void generics() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThis15Extensions.java"), expected); } - + @Test - public void testGithubIssue41() throws Exception { + void githubIssue41() throws Exception { @@ -28894,7 +28894,7 @@ "17:16: " + getCheckMessage(MSG_METHOD, "other", ""), @@ -148,7 +148,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -28903,7 +28903,7 @@ .that(check.getAcceptableTokens()) @@ -162,7 +162,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithAnonymousClass() throws Exception { + void withAnonymousClass() throws Exception { @@ -28912,16 +28912,16 @@ "33:24: " + getCheckMessage(MSG_VARIABLE, "bar", "InputRequireThisAnonymousEmpty."), @@ -172,7 +172,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultSwitch() { + void defaultSwitch() { final RequireThisCheck check = new RequireThisCheck(); - + final DetailAstImpl ast = new DetailAstImpl(); @@ -185,7 +185,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidateOnlyOverlappingFalse() throws Exception { + void validateOnlyOverlappingFalse() throws Exception { @@ -28930,7 +28930,7 @@ "30:9: " + getCheckMessage(MSG_VARIABLE, "fieldFinal1", ""), @@ -238,7 +238,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidateOnlyOverlappingFalseLeaves() throws Exception { + void validateOnlyOverlappingFalseLeaves() throws Exception { @@ -28939,7 +28939,7 @@ "36:16: " + getCheckMessage(MSG_VARIABLE, "_a", ""), @@ -248,7 +248,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidateOnlyOverlappingTrue() throws Exception { + void validateOnlyOverlappingTrue() throws Exception { @@ -28948,7 +28948,7 @@ "52:9: " + getCheckMessage(MSG_VARIABLE, "field1", ""), @@ -268,32 +268,32 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidateOnlyOverlappingTrue2() throws Exception { + void validateOnlyOverlappingTrue2() throws Exception { @@ -28956,28 +28956,28 @@ verifyWithInlineConfigParser( getPath("InputRequireThisValidateOnlyOverlappingTrue2.java"), expected); } - + @Test - public void testReceiverParameter() throws Exception { + void receiverParameter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisReceiver.java"), expected); } - + @Test - public void testBraceAlone() throws Exception { + void braceAlone() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisBraceAlone.java"), expected); } - + @Test - public void testStatic() throws Exception { + void testStatic() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisStatic.java"), expected); } - + @Test - public void testMethodReferences() throws Exception { + void methodReferences() throws Exception { @@ -28986,7 +28986,7 @@ }; @@ -301,7 +301,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowLocalVars() throws Exception { + void allowLocalVars() throws Exception { @@ -28995,7 +28995,7 @@ "26:9: " + getCheckMessage(MSG_VARIABLE, "s1", ""), @@ -314,7 +314,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowLambdaParameters() throws Exception { + void allowLambdaParameters() throws Exception { @@ -29004,14 +29004,14 @@ "46:21: " + getCheckMessage(MSG_VARIABLE, "z", ""), @@ -326,13 +326,13 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResources() throws Exception { + void tryWithResources() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisTryWithResources.java"), expected); } - + @Test - public void testTryWithResourcesOnlyOverlappingFalse() throws Exception { + void tryWithResourcesOnlyOverlappingFalse() throws Exception { @@ -29020,7 +29020,7 @@ "57:13: " + getCheckMessage(MSG_VARIABLE, "fldCharset", ""), @@ -350,7 +350,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCatchVariables() throws Exception { + void catchVariables() throws Exception { @@ -29029,21 +29029,21 @@ }; @@ -358,19 +358,19 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumConstant() throws Exception { + void enumConstant() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisEnumConstant.java"), expected); } - + @Test - public void testAnnotationInterface() throws Exception { + void annotationInterface() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisAnnotationInterface.java"), expected); } - + @Test - public void testFor() throws Exception { + void testFor() throws Exception { @@ -29052,7 +29052,7 @@ "30:34: " + getCheckMessage(MSG_VARIABLE, "name", ""), @@ -379,7 +379,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalInstanceVariable() throws Exception { + void finalInstanceVariable() throws Exception { @@ -29061,14 +29061,14 @@ "19:9: " + getCheckMessage(MSG_VARIABLE, "z", ""), @@ -388,13 +388,13 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRequireThisCaseGroup.java"), expected); } - + @Test - public void testExtendedMethod() throws Exception { + void extendedMethod() throws Exception { @@ -29077,7 +29077,7 @@ }; @@ -402,7 +402,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsAndCompactCtors() throws Exception { + void recordsAndCompactCtors() throws Exception { @@ -29086,7 +29086,7 @@ "19:13: " + getCheckMessage(MSG_METHOD, "method2", ""), @@ -418,14 +418,14 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordCompactCtors() throws Exception { + void recordCompactCtors() throws Exception { @@ -29094,7 +29094,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputRequireThisRecordCompactCtors.java"), expected); } - + @Test - public void testRecordsAsTopLevel() throws Exception { + void recordsAsTopLevel() throws Exception { @@ -29103,7 +29103,7 @@ "18:9: " + getCheckMessage(MSG_METHOD, "method2", ""), @@ -440,7 +440,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsDefault() throws Exception { + void recordsDefault() throws Exception { @@ -29112,7 +29112,7 @@ }; @@ -449,14 +449,14 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsWithCheckFields() throws Exception { + void recordsWithCheckFields() throws Exception { @@ -29120,7 +29120,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputRequireThisRecordsWithCheckFields.java"), expected); } - + @Test - public void testRecordsWithCheckFieldsOverlap() throws Exception { + void recordsWithCheckFieldsOverlap() throws Exception { @@ -29129,7 +29129,7 @@ "39:20: " + getCheckMessage(MSG_VARIABLE, "a", ""), @@ -467,7 +467,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLocalClassesInsideLambdas() throws Exception { + void localClassesInsideLambdas() throws Exception { @@ -29144,7 +29144,7 @@ + void unusedMethodCatch() throws Exception { final DetailAstImpl ident = new DetailAstImpl(); ident.setText("testName"); - + @@ -503,7 +503,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws an exception. */ @@ -29153,7 +29153,7 @@ + void unusedMethodFor() throws Exception { final DetailAstImpl ident = new DetailAstImpl(); ident.setText("testName"); - + @@ -524,7 +524,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { * @throws Exception when code tested throws exception */ @@ -29180,15 +29180,15 @@ @@ -37,7 +37,7 @@ import java.util.Optional; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class ReturnCountCheckTest extends AbstractModuleTestSupport { +final class ReturnCountCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -45,7 +45,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -29197,7 +29197,7 @@ "40:5: " + getCheckMessage(MSG_KEY_VOID, 2, 1), @@ -56,7 +56,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFormat() throws Exception { + void format() throws Exception { @@ -29206,7 +29206,7 @@ "28:5: " + getCheckMessage(MSG_KEY_VOID, 7, 1), @@ -68,7 +68,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodsAndLambdas() throws Exception { + void methodsAndLambdas() throws Exception { @@ -29215,7 +29215,7 @@ "37:49: " + getCheckMessage(MSG_KEY, 2, 1), @@ -80,7 +80,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdasOnly() throws Exception { + void lambdasOnly() throws Exception { @@ -29224,7 +29224,7 @@ }; @@ -88,7 +88,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodsOnly() throws Exception { + void methodsOnly() throws Exception { @@ -29233,23 +29233,23 @@ "42:5: " + getCheckMessage(MSG_KEY, 4, 2), @@ -99,13 +99,13 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithReturnOnlyAsTokens() throws Exception { + void withReturnOnlyAsTokens() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputReturnCountLambda4.java"), expected); } - + @Test - public void testImproperToken() { + void improperToken() { final ReturnCountCheck check = new ReturnCountCheck(); - + final DetailAstImpl classDefAst = new DetailAstImpl(); @@ -127,7 +127,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMaxForVoid() throws Exception { + void maxForVoid() throws Exception { @@ -29300,15 +29300,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpre import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSupport { +final class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSuppor } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -29317,7 +29317,7 @@ "43:36: " + getCheckMessage(MSG_KEY), @@ -53,7 +53,7 @@ public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSuppor } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29329,15 +29329,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanRetur import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { +final class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -29346,7 +29346,7 @@ }; @@ -41,7 +41,7 @@ public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29358,15 +29358,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualit import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { +final class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -29375,7 +29375,7 @@ "22:20: " + getCheckMessage(MSG_KEY, "=="), @@ -43,7 +43,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStringLiteralEqualityTextBlocks() throws Exception { + void stringLiteralEqualityTextBlocks() throws Exception { @@ -29384,7 +29384,7 @@ "22:21: " + getCheckMessage(MSG_KEY, "=="), @@ -55,7 +55,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testConcatenatedStringLiterals() throws Exception { + void concatenatedStringLiterals() throws Exception { @@ -29393,7 +29393,7 @@ "17:24: " + getCheckMessage(MSG_KEY, "=="), @@ -74,7 +74,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testConcatenatedTextBlocks() throws Exception { + void concatenatedTextBlocks() throws Exception { @@ -29402,7 +29402,7 @@ "21:23: " + getCheckMessage(MSG_KEY, "=="), @@ -91,7 +91,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -29411,7 +29411,7 @@ }; @@ -99,7 +99,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29423,15 +29423,15 @@ @@ -34,7 +34,7 @@ import java.util.Optional; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class SuperCloneCheckTest extends AbstractModuleTestSupport { +final class SuperCloneCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -29440,7 +29440,7 @@ "41:19: " + getCheckMessage(MSG_KEY, "clone", "super.clone"), @@ -52,7 +52,7 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnotherInputFile() throws Exception { + void anotherInputFile() throws Exception { @@ -29449,14 +29449,14 @@ "48:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"), @@ -61,13 +61,13 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodReference() throws Exception { + void methodReference() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputSuperCloneMethodReference.java"), expected); } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29489,15 +29489,15 @@ @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck.M import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SuperFinalizeCheckTest extends AbstractModuleTestSupport { +final class SuperFinalizeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class SuperFinalizeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -29506,7 +29506,7 @@ "41:17: " + getCheckMessage(MSG_KEY, "finalize", "super.finalize"), @@ -42,7 +42,7 @@ public class SuperFinalizeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodReference() throws Exception { + void methodReference() throws Exception { @@ -29517,25 +29517,25 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckTest.java @@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Test fixture for the UnnecessaryParenthesesCheck. */ -public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { +final class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +41,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "18:22: " + getCheckMessage(MSG_ASSIGN), @@ -97,7 +97,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test15Extensions() throws Exception { + void test15Extensions() throws Exception { @@ -29544,7 +29544,7 @@ "28:51: " + getCheckMessage(MSG_LITERAL, "1"), @@ -107,7 +107,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdas() throws Exception { + void lambdas() throws Exception { @@ -29553,7 +29553,7 @@ "18:35: " + getCheckMessage(MSG_LAMBDA), @@ -122,7 +122,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReturn() throws Exception { + void testReturn() throws Exception { @@ -29562,7 +29562,7 @@ "22:16: " + getCheckMessage(MSG_RETURN), @@ -135,7 +135,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnnecessaryParenthesesSwitchExpression() throws Exception { + void unnecessaryParenthesesSwitchExpression() throws Exception { @@ -29571,7 +29571,7 @@ "24:13: " + getCheckMessage(MSG_LITERAL, 2), @@ -154,7 +154,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnnecessaryParenthesesTextBlocks() throws Exception { + void unnecessaryParenthesesTextBlocks() throws Exception { @@ -29580,7 +29580,7 @@ "19:34: " + getCheckMessage(MSG_STRING, "\"that\""), @@ -170,14 +170,14 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnnecessaryParenthesesPatterns() throws Exception { + void unnecessaryParenthesesPatterns() throws Exception { @@ -29588,7 +29588,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputUnnecessaryParenthesesCheckPatterns.java"), expected); } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29597,16 +29597,16 @@ .that(check.getAcceptableTokens()) @@ -191,7 +191,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIfStatement() throws Exception { + void ifStatement() throws Exception { - + final String[] expected = { "20:20: " + getCheckMessage(MSG_EXPR), @@ -225,7 +225,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIfStatement2() throws Exception { + void ifStatement2() throws Exception { @@ -29615,7 +29615,7 @@ "39:17: " + getCheckMessage(MSG_EXPR), @@ -241,7 +241,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIdentifier() throws Exception { + void identifier() throws Exception { @@ -29624,7 +29624,7 @@ "31:18: " + getCheckMessage(MSG_ASSIGN), @@ -259,7 +259,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOperator1() throws Exception { + void operator1() throws Exception { @@ -29633,7 +29633,7 @@ "22:17: " + getCheckMessage(MSG_EXPR), @@ -293,7 +293,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOperator2() throws Exception { + void operator2() throws Exception { @@ -29642,7 +29642,7 @@ "67:17: " + getCheckMessage(MSG_EXPR), @@ -311,7 +311,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOperator3() throws Exception { + void operator3() throws Exception { @@ -29654,33 +29654,33 @@ @@ -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 UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest +final class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest extends AbstractModuleTestSupport { - + @Override @@ -37,7 +37,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "28:2: " + getCheckMessage(MSG_SEMI), @@ -51,7 +51,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest } - + @Test - public void testUnnecessarySemicolonAfterOuterTypeDeclarationRecords() throws Exception { + void unnecessarySemicolonAfterOuterTypeDeclarationRecords() throws Exception { - + final String[] expected = { "17:2: " + getCheckMessage(MSG_SEMI), "23:2: " + getCheckMessage(MSG_SEMI), @@ -63,7 +63,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest } - + @Test - public void testTokens() { + void tokens() { @@ -29692,33 +29692,33 @@ @@ -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 UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest +final class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest extends AbstractModuleTestSupport { - + @Override @@ -37,7 +37,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "13:5: " + getCheckMessage(MSG_SEMI), @@ -61,7 +61,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest } - + @Test - public void testUnnecessarySemicolonAfterTypeMemberDeclarationRecords() throws Exception { + void unnecessarySemicolonAfterTypeMemberDeclarationRecords() throws Exception { - + final String[] expected = { "14:5: " + getCheckMessage(MSG_SEMI), @@ -79,7 +79,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest } - + @Test - public void testTokens() { + void tokens() { @@ -29727,36 +29727,36 @@ final int[] expected = { @@ -109,7 +109,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest } - + @Test - public void testIsSemicolonWithNullAst() throws Exception { + void isSemicolonWithNullAst() throws Exception { final String[] expected = {"24:32: " + getCheckMessage(MSG_SEMI)}; - + verifyWithInlineConfigParser( --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + /** Test fixture for the UnnecessarySemicolonInEnumerationCheck. */ -public class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTestSupport { +final class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTe } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "30:12: " + getCheckMessage(MSG_SEMI), @@ -55,7 +55,7 @@ public class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTe } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -29768,24 +29768,24 @@ @@ -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 UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractModuleTestSupport { +final class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractMod } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "17:42: " + getCheckMessage(MSG_SEMI), "18:72: " + getCheckMessage(MSG_SEMI), @@ -46,7 +46,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractMod } - + @Test - public void testNoBraceAfterAllowed() throws Exception { + void noBraceAfterAllowed() throws Exception { @@ -29794,7 +29794,7 @@ "19:13: " + getCheckMessage(MSG_SEMI), @@ -58,7 +58,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractMod } - + @Test - public void testTokensAreCorrect() { + void tokensAreCorrect() { @@ -29806,15 +29806,15 @@ @@ -36,7 +36,7 @@ import java.util.Optional; import java.util.function.Predicate; import org.junit.jupiter.api.Test; - + -public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { +final class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -44,7 +44,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -29823,7 +29823,7 @@ final int[] expected = { @@ -73,7 +73,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -29832,7 +29832,7 @@ final int[] expected = { @@ -102,7 +102,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVariable() throws Exception { + void unusedLocalVariable() throws Exception { @@ -29841,7 +29841,7 @@ "28:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "b"), @@ -122,7 +122,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVar2() throws Exception { + void unusedLocalVar2() throws Exception { @@ -29850,7 +29850,7 @@ "19:14: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "j"), @@ -138,7 +138,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarInAnonInnerClasses() throws Exception { + void unusedLocalVarInAnonInnerClasses() throws Exception { @@ -29859,7 +29859,7 @@ "15:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "b"), @@ -155,7 +155,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarGenericAnonInnerClasses() throws Exception { + void unusedLocalVarGenericAnonInnerClasses() throws Exception { @@ -29868,7 +29868,7 @@ "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "obj"), @@ -171,7 +171,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarDepthOfClasses() throws Exception { + void unusedLocalVarDepthOfClasses() throws Exception { @@ -29877,7 +29877,7 @@ "49:21: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), @@ -182,7 +182,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarNestedClasses() throws Exception { + void unusedLocalVarNestedClasses() throws Exception { @@ -29886,7 +29886,7 @@ "23:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "S"), @@ -196,7 +196,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarNestedClasses2() throws Exception { + void unusedLocalVarNestedClasses2() throws Exception { @@ -29895,7 +29895,7 @@ "30:51: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "obj"), @@ -208,7 +208,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarNestedClasses3() throws Exception { + void unusedLocalVarNestedClasses3() throws Exception { @@ -29904,16 +29904,16 @@ "54:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "o"), @@ -220,7 +220,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarTestWarningSeverity() throws Exception { + void unusedLocalVarTestWarningSeverity() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -228,7 +228,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarEnum() throws Exception { + void unusedLocalVarEnum() throws Exception { @@ -29922,7 +29922,7 @@ "50:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), @@ -240,7 +240,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarRecords() throws Exception { + void unusedLocalVarRecords() throws Exception { @@ -29931,7 +29931,7 @@ "25:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var1"), @@ -252,7 +252,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVarWithoutPackageStatement() throws Exception { + void unusedLocalVarWithoutPackageStatement() throws Exception { @@ -29940,7 +29940,7 @@ "24:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var2"), @@ -263,14 +263,14 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedLocalVariableTernaryAndExpressions() throws Exception { + void unusedLocalVariableTernaryAndExpressions() throws Exception { @@ -29948,7 +29948,7 @@ verifyWithInlineConfigParser( getPath("InputUnusedLocalVariableTernaryAndExpressions.java"), expected); } - + @Test - public void testClearStateVariables() throws Exception { + void clearStateVariables() throws Exception { @@ -29966,7 +29966,7 @@ TestUtil.isStatefulFieldClearedDuringBeginTree( @@ -294,7 +294,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClearStateClasses() throws Exception { + void clearStateClasses() throws Exception { @@ -29984,7 +29984,7 @@ TestUtil.isStatefulFieldClearedDuringBeginTree( @@ -337,7 +337,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClearStateAnonInnerClass() throws Exception { + void clearStateAnonInnerClass() throws Exception { @@ -30002,7 +30002,7 @@ anonInnerAstToTypeDesc -> { @@ -370,7 +370,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClearStatePackageDef() throws Exception { + void clearStatePackageDef() throws Exception { @@ -30023,15 +30023,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTestSupport { +final class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testGeneralLogic() throws Exception { + void generalLogic() throws Exception { @@ -30040,7 +30040,7 @@ "50:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), @@ -79,7 +79,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testGeneralLogic2() throws Exception { + void generalLogic2() throws Exception { @@ -30049,7 +30049,7 @@ "29:9: " + getCheckMessage(MSG_KEY, "allInvariants", 2, 1), @@ -89,7 +89,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testIfStatements() throws Exception { + void ifStatements() throws Exception { @@ -30058,7 +30058,7 @@ "28:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), @@ -105,7 +105,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testDistance() throws Exception { + void distance() throws Exception { @@ -30067,7 +30067,7 @@ "231:9: " + getCheckMessage(MSG_KEY, "t", 5, 3), @@ -121,7 +121,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testVariableRegExp() throws Exception { + void variableRegExp() throws Exception { @@ -30076,7 +30076,7 @@ "56:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), @@ -154,7 +154,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testValidateBetweenScopesOption() throws Exception { + void validateBetweenScopesOption() throws Exception { @@ -30085,7 +30085,7 @@ "50:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), @@ -186,7 +186,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testIgnoreFinalOption() throws Exception { + void ignoreFinalOption() throws Exception { @@ -30094,7 +30094,7 @@ "50:9: " + getCheckMessage(MSG_KEY_EXT, "temp", 2, 1), @@ -228,7 +228,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testTokensNotNull() { + void tokensNotNull() { @@ -30103,7 +30103,7 @@ .that(check.getAcceptableTokens()) @@ -242,7 +242,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { @@ -30112,16 +30112,16 @@ "231:9: " + getCheckMessage(MSG_KEY_EXT, "t", 5, 3), @@ -258,7 +258,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testDefaultConfiguration2() throws Exception { + void defaultConfiguration2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -266,7 +266,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testAnonymousClass() throws Exception { + void anonymousClass() throws Exception { @@ -30130,25 +30130,25 @@ }; @@ -276,7 +276,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 } - + @Test - public void testVariableDeclarationUsageDistanceSwitchExpressions() throws Exception { + void variableDeclarationUsageDistanceSwitchExpressions() throws Exception { - + final int maxDistance = 1; final String[] expected = { @@ -303,7 +303,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testVariableDeclarationUsageDistanceSwitchExpressions2() throws Exception { + void variableDeclarationUsageDistanceSwitchExpressions2() throws Exception { @@ -30157,7 +30157,7 @@ "16:9: " + getCheckMessage(MSG_KEY, "i", 2, maxDistance), @@ -314,7 +314,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testGeneralClass3() throws Exception { + void generalClass3() throws Exception { @@ -30166,7 +30166,7 @@ }; @@ -324,7 +324,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testGeneralClass4() throws Exception { + void generalClass4() throws Exception { @@ -30175,7 +30175,7 @@ }; @@ -334,7 +334,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testVariableDeclarationUsageDistanceTryResources() throws Exception { + void variableDeclarationUsageDistanceTryResources() throws Exception { @@ -30184,15 +30184,15 @@ "20:9: " + getCheckMessage(MSG_KEY, "b", 2, 1), @@ -345,14 +345,14 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testVariableDeclarationUsageDistance4() throws Exception { + void variableDeclarationUsageDistance4() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputVariableDeclarationUsageDistance3.java"), expected); } - + @Test - public void testVariableDeclarationUsageDistanceScope2() throws Exception { + void variableDeclarationUsageDistanceScope2() throws Exception { @@ -30201,7 +30201,7 @@ }; @@ -362,7 +362,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes } - + @Test - public void testVariableDeclarationUsageDistance1() throws Exception { + void variableDeclarationUsageDistance1() throws Exception { @@ -30213,15 +30213,15 @@ @@ -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 DesignForExtensionCheckTest extends AbstractModuleTestSupport { +final class DesignForExtensionCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30230,7 +30230,7 @@ assertWithMessage("Default required tokens are invalid") @@ -44,7 +44,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -30239,7 +30239,7 @@ "104:9: " + getCheckMessage(MSG_KEY, "anotherNonFinalClass", "someMethod"), @@ -53,7 +53,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -30248,7 +30248,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -62,7 +62,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOverridableMethods() throws Exception { + void overridableMethods() throws Exception { @@ -30257,7 +30257,7 @@ "38:9: " + getCheckMessage(MSG_KEY, "A", "foo8"), @@ -89,7 +89,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoredAnnotationsOption() throws Exception { + void ignoredAnnotationsOption() throws Exception { @@ -30266,7 +30266,7 @@ "149:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtensionIgnoredAnnotations", "foo21"), @@ -102,14 +102,14 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreAnnotationsOptionWithMultipleAnnotations() throws Exception { + void ignoreAnnotationsOptionWithMultipleAnnotations() throws Exception { @@ -30274,7 +30274,7 @@ verifyWithInlineConfigParser( getPath("InputDesignForExtensionMultipleAnnotations.java"), expected); } - + @Test - public void testNativeMethods() throws Exception { + void nativeMethods() throws Exception { @@ -30283,16 +30283,16 @@ "32:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtensionNativeMethods", "foo6"), @@ -118,7 +118,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDesignForExtensionRecords() throws Exception { + void designForExtensionRecords() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -127,7 +127,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRequiredJavadocPhrase() throws Exception { + void requiredJavadocPhrase() throws Exception { @@ -30301,7 +30301,7 @@ "41:5: " + getCheckMessage(MSG_KEY, className, "foo5"), @@ -140,7 +140,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRequiredJavadocPhraseMultiLine() throws Exception { + void requiredJavadocPhraseMultiLine() throws Exception { @@ -30310,7 +30310,7 @@ "23:5: " + getCheckMessage(MSG_KEY, className, "foo2"), @@ -150,7 +150,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { @@ -30322,15 +30322,15 @@ @@ -32,7 +32,7 @@ import java.io.File; import java.util.Optional; import org.junit.jupiter.api.Test; - + -public class FinalClassCheckTest extends AbstractModuleTestSupport { +final class FinalClassCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +40,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30339,7 +30339,7 @@ TokenTypes.ANNOTATION_DEF, @@ -58,7 +58,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClass() throws Exception { + void finalClass() throws Exception { @@ -30348,7 +30348,7 @@ "19:4: " + getCheckMessage(MSG_KEY, "test4"), @@ -72,7 +72,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassWithPrivateCtorAndNestedExtendingSubclass() throws Exception { + void classWithPrivateCtorAndNestedExtendingSubclass() throws Exception { @@ -30357,7 +30357,7 @@ "18:9: " + getCheckMessage(MSG_KEY, "ExtendB"), @@ -85,7 +85,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassWithPrivateCtorAndNestedExtendingSubclassWithoutPackage() throws Exception { + void classWithPrivateCtorAndNestedExtendingSubclassWithoutPackage() throws Exception { @@ -30366,16 +30366,16 @@ "14:5: " + getCheckMessage(MSG_KEY, "C"), @@ -98,7 +98,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassConstructorInRecord() throws Exception { + void finalClassConstructorInRecord() throws Exception { - + final String[] expected = { "27:9: " + getCheckMessage(MSG_KEY, "F"), @@ -109,7 +109,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImproperToken() { + void improperToken() { @@ -30384,7 +30384,7 @@ final int unsupportedTokenByCheck = TokenTypes.COMPILATION_UNIT; @@ -125,7 +125,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -30393,7 +30393,7 @@ TokenTypes.ANNOTATION_DEF, @@ -143,7 +143,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassInnerAndNestedClasses() throws Exception { + void finalClassInnerAndNestedClasses() throws Exception { @@ -30402,16 +30402,16 @@ "19:5: " + getCheckMessage(MSG_KEY, "SameName"), @@ -155,7 +155,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassStaticNestedClasses() throws Exception { + void finalClassStaticNestedClasses() throws Exception { - + final String[] expected = { "14:17: " + getCheckMessage(MSG_KEY, "C"), @@ -171,7 +171,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassEnum() throws Exception { + void finalClassEnum() throws Exception { @@ -30420,7 +30420,7 @@ }; @@ -179,7 +179,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassAnnotation() throws Exception { + void finalClassAnnotation() throws Exception { @@ -30429,7 +30429,7 @@ }; @@ -187,7 +187,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassInterface() throws Exception { + void finalClassInterface() throws Exception { @@ -30438,7 +30438,7 @@ }; @@ -195,7 +195,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassAnonymousInnerClass() throws Exception { + void finalClassAnonymousInnerClass() throws Exception { @@ -30447,7 +30447,7 @@ "27:9: " + getCheckMessage(MSG_KEY, "m"), @@ -210,7 +210,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassNestedInInterface() throws Exception { + void finalClassNestedInInterface() throws Exception { @@ -30456,7 +30456,7 @@ "28:13: " + getCheckMessage(MSG_KEY, "m"), @@ -221,7 +221,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassNestedInEnum() throws Exception { + void finalClassNestedInEnum() throws Exception { @@ -30465,7 +30465,7 @@ }; @@ -230,7 +230,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalClassNestedInRecord() throws Exception { + void finalClassNestedInRecord() throws Exception { @@ -30491,7 +30491,7 @@ packageName -> ((String) packageName).isEmpty())) .isTrue(); } - + @Test - public void testPrivateClassWithDefaultCtor() throws Exception { + void privateClassWithDefaultCtor() throws Exception { @@ -30500,7 +30500,7 @@ "19:1: " + getCheckMessage(MSG_KEY, "Some"), @@ -286,7 +286,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrivateClassWithDefaultCtor2() throws Exception { + void privateClassWithDefaultCtor2() throws Exception { @@ -30509,7 +30509,7 @@ "34:5: " + getCheckMessage(MSG_KEY, "Check"), @@ -297,7 +297,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrivateClassWithDefaultCtor3() throws Exception { + void privateClassWithDefaultCtor3() throws Exception { @@ -30521,15 +30521,15 @@ @@ -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 HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupport { +final class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30538,7 +30538,7 @@ assertWithMessage("Default required tokens are invalid") @@ -44,7 +44,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp } - + @Test - public void testUtilClass() throws Exception { + void utilClass() throws Exception { @@ -30547,7 +30547,7 @@ }; @@ -53,7 +53,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp } - + @Test - public void testUtilClassPublicCtor() throws Exception { + void utilClassPublicCtor() throws Exception { @@ -30556,14 +30556,14 @@ }; @@ -61,69 +61,69 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp } - + @Test - public void testUtilClassPrivateCtor() throws Exception { + void utilClassPrivateCtor() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputHideUtilityClassConstructorPrivate.java"), expected); } - + /** Non-static methods - always OK. */ @Test - public void testNonUtilClass() throws Exception { @@ -30572,7 +30572,7 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorDesignForExtension.java"), expected); } - + @Test - public void testDerivedNonUtilClass() throws Exception { + void derivedNonUtilClass() throws Exception { @@ -30580,7 +30580,7 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorNonUtilityClass.java"), expected); } - + @Test - public void testOnlyNonStaticFieldNonUtilClass() throws Exception { + void onlyNonStaticFieldNonUtilClass() throws Exception { @@ -30588,7 +30588,7 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorRegression.java"), expected); } - + @Test - public void testEmptyAbstractClass() throws Exception { + void emptyAbstractClass() throws Exception { @@ -30596,7 +30596,7 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorAbstractSerializable.java"), expected); } - + @Test - public void testEmptyAbstractClass2() throws Exception { + void emptyAbstractClass2() throws Exception { @@ -30604,7 +30604,7 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorAbstract.java"), expected); } - + @Test - public void testEmptyClassWithOnlyPrivateFields() throws Exception { + void emptyClassWithOnlyPrivateFields() throws Exception { @@ -30612,7 +30612,7 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorSerializable.java"), expected); } - + @Test - public void testClassWithStaticInnerClass() throws Exception { + void classWithStaticInnerClass() throws Exception { @@ -30620,14 +30620,14 @@ verifyWithInlineConfigParser( getPath("InputHideUtilityClassConstructorSerializableInnerStatic.java"), expected); } - + @Test - public void testProtectedCtor() throws Exception { + void protectedCtor() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputHideUtilityClassConstructor.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -30639,15 +30639,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.File; import org.junit.jupiter.api.Test; - + -public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { +final class InnerTypeLastCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30656,7 +30656,7 @@ TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.RECORD_DEF, @@ -48,7 +48,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMembersBeforeInner() throws Exception { + void membersBeforeInner() throws Exception { @@ -30665,21 +30665,21 @@ "71:9: " + getCheckMessage(MSG_KEY), @@ -60,19 +60,19 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIfRootClassChecked() throws Exception { + void ifRootClassChecked() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputInnerTypeLastClassRootClass.java"), expected); } - + @Test - public void testIfRootClassChecked2() throws Exception { + void ifRootClassChecked2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputInnerTypeLastClassRootClass2.java"), expected); } - + @Test - public void testIfRootClassChecked3() throws Exception { + void ifRootClassChecked3() throws Exception { @@ -30688,7 +30688,7 @@ verify( @@ -86,7 +86,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerTypeBeforeCtor() throws Exception { + void innerTypeBeforeCtor() throws Exception { @@ -30697,16 +30697,16 @@ "22:5: " + getCheckMessage(MSG_KEY), @@ -96,7 +96,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerTypeLastRecords() throws Exception { + void innerTypeLastRecords() throws Exception { - + final String[] expected = { "17:9: " + getCheckMessage(MSG_KEY), @@ -111,7 +111,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerTypeLastCstyleArray() throws Exception { + void innerTypeLastCstyleArray() throws Exception { @@ -30715,7 +30715,7 @@ "12:5: " + getCheckMessage(MSG_KEY), @@ -122,7 +122,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -30727,15 +30727,15 @@ @@ -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 InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { +final class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -30744,7 +30744,7 @@ }; @@ -42,7 +42,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowMarker() throws Exception { + void allowMarker() throws Exception { @@ -30753,7 +30753,7 @@ }; @@ -50,7 +50,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -30762,7 +30762,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -59,7 +59,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30774,33 +30774,33 @@ @@ -34,7 +34,7 @@ import java.util.List; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class MutableExceptionCheckTest extends AbstractModuleTestSupport { +final class MutableExceptionCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassExtendsGenericClass() throws Exception { + void classExtendsGenericClass() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -51,7 +51,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "14:9: " + getCheckMessage(MSG_KEY, "errorCode"), @@ -63,7 +63,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleInputs() throws Exception { + void multipleInputs() throws Exception { @@ -30809,7 +30809,7 @@ final String filePath2 = getPath("InputMutableExceptionMultipleInputs.java"); @@ -87,7 +87,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFormat() throws Exception { + void format() throws Exception { @@ -30818,16 +30818,16 @@ }; @@ -96,7 +96,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNested() throws Exception { + void nested() throws Exception { - + final String[] expected = { "15:9: " + getCheckMessage(MSG_KEY, "code"), @@ -106,7 +106,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -30836,7 +30836,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -115,7 +115,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30845,7 +30845,7 @@ assertWithMessage("Default required tokens are invalid") @@ -124,7 +124,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongTokenType() { + void wrongTokenType() { @@ -30857,15 +30857,15 @@ @@ -32,7 +32,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { +final class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +40,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -30874,7 +30874,7 @@ assertWithMessage("Required tokens are invalid.") @@ -49,7 +49,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClearState() throws Exception { + void clearState() throws Exception { @@ -30883,7 +30883,7 @@ final String secondInputFilePath = getPath("InputOneTopLevelClassInterface2.java"); @@ -75,7 +75,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptableTokens() { + void acceptableTokens() { @@ -30892,35 +30892,35 @@ assertWithMessage("Default required tokens are invalid") @@ -84,31 +84,31 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithOneTopLevelClass() throws Exception { + void fileWithOneTopLevelClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOneTopLevelClass.java"), expected); } - + @Test - public void testFileWithOneTopLevelInterface() throws Exception { + void fileWithOneTopLevelInterface() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOneTopLevelClassInterface.java"), expected); } - + @Test - public void testFileWithOneTopLevelEnum() throws Exception { + void fileWithOneTopLevelEnum() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOneTopLevelClassEnum.java"), expected); } - + @Test - public void testFileWithOneTopLevelAnnotation() throws Exception { + void fileWithOneTopLevelAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOneTopLevelClassAnnotation.java"), expected); } - + @Test - public void testFileWithNoPublicTopLevelClass() throws Exception { + void fileWithNoPublicTopLevelClass() throws Exception { @@ -30929,7 +30929,7 @@ }; @@ -116,7 +116,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithThreeTopLevelInterface() throws Exception { + void fileWithThreeTopLevelInterface() throws Exception { @@ -30938,7 +30938,7 @@ "17:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassInterface3inner2"), @@ -125,7 +125,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithThreeTopLevelEnum() throws Exception { + void fileWithThreeTopLevelEnum() throws Exception { @@ -30947,7 +30947,7 @@ "17:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassEnum2inner2"), @@ -134,7 +134,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithThreeTopLevelAnnotation() throws Exception { + void fileWithThreeTopLevelAnnotation() throws Exception { @@ -30956,7 +30956,7 @@ "20:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassAnnotation2B"), @@ -143,7 +143,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithFewTopLevelClasses() throws Exception { + void fileWithFewTopLevelClasses() throws Exception { @@ -30965,7 +30965,7 @@ "35:1: " + getCheckMessage(MSG_KEY, "InnerClone"), @@ -157,7 +157,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithSecondEnumTopLevelClass() throws Exception { + void fileWithSecondEnumTopLevelClass() throws Exception { @@ -30974,14 +30974,14 @@ "26:1: " + getCheckMessage(MSG_KEY, "InputDeclarationOrderAnnotation2"), @@ -166,13 +166,13 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfoWithNoTypesDeclared() throws Exception { + void packageInfoWithNoTypesDeclared() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getNonCompilablePath("package-info.java"), expected); } - + @Test - public void testFileWithMultipleSameLine() throws Exception { + void fileWithMultipleSameLine() throws Exception { @@ -30990,7 +30990,7 @@ }; @@ -180,7 +180,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileWithIndentation() throws Exception { + void fileWithIndentation() throws Exception { @@ -30999,7 +30999,7 @@ "17:5: " + getCheckMessage(MSG_KEY, "ViolatingIndentedClass2"), @@ -190,7 +190,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOneTopLevelClassRecords() throws Exception { + void oneTopLevelClassRecords() throws Exception { @@ -31008,7 +31008,7 @@ "17:1: " + getCheckMessage(MSG_KEY, "TestRecord2"), @@ -200,7 +200,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOneTopLevelClassEmpty() throws Exception { + void oneTopLevelClassEmpty() throws Exception { @@ -31020,33 +31020,33 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class ThrowsCountCheckTest extends AbstractModuleTestSupport { +final class ThrowsCountCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "25:20: " + getCheckMessage(MSG_KEY, 5, 4), @@ -49,7 +49,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMax() throws Exception { + void max() throws Exception { - + final String[] expected = { "35:20: " + getCheckMessage(MSG_KEY, 6, 5), @@ -59,7 +59,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -31055,7 +31055,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -68,7 +68,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -31064,7 +31064,7 @@ assertWithMessage("Default required tokens are invalid") @@ -77,7 +77,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongTokenType() { + void wrongTokenType() { @@ -31073,7 +31073,7 @@ ast.initialize(new CommonToken(TokenTypes.CLASS_DEF, "class")); @@ -92,7 +92,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotIgnorePrivateMethod() throws Exception { + void notIgnorePrivateMethod() throws Exception { @@ -31082,7 +31082,7 @@ "30:20: " + getCheckMessage(MSG_KEY, 5, 4), @@ -104,7 +104,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodWithAnnotation() throws Exception { + void methodWithAnnotation() throws Exception { @@ -31091,7 +31091,7 @@ }; @@ -112,7 +112,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOverriding() throws Exception { + void overriding() throws Exception { @@ -31103,15 +31103,15 @@ @@ -33,7 +33,7 @@ import java.io.File; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { +final class VisibilityModifierCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +41,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -31120,7 +31120,7 @@ TokenTypes.VARIABLE_DEF, TokenTypes.IMPORT, @@ -52,7 +52,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInner() throws Exception { + void inner() throws Exception { @@ -31129,7 +31129,7 @@ "50:27: " + getCheckMessage(MSG_KEY, "protectedVariable"), @@ -66,7 +66,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreAccess() throws Exception { + void ignoreAccess() throws Exception { @@ -31138,7 +31138,7 @@ "94:20: " + getCheckMessage(MSG_KEY, "someValue"), @@ -75,7 +75,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSimple() throws Exception { + void simple() throws Exception { @@ -31147,7 +31147,7 @@ "59:23: " + getCheckMessage(MSG_KEY, "sTest1"), @@ -88,7 +88,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrictJavadoc() throws Exception { + void strictJavadoc() throws Exception { @@ -31156,7 +31156,7 @@ "50:19: " + getCheckMessage(MSG_KEY, "mDeer"), @@ -98,7 +98,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowPublicFinalFieldsInImmutableClass() throws Exception { + void allowPublicFinalFieldsInImmutableClass() throws Exception { @@ -31165,7 +31165,7 @@ "34:39: " + getCheckMessage(MSG_KEY, "excludes"), @@ -112,7 +112,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowPublicFinalFieldsInImmutableClassWithNonCanonicalClasses() throws Exception { + void allowPublicFinalFieldsInImmutableClassWithNonCanonicalClasses() throws Exception { @@ -31174,7 +31174,7 @@ "29:39: " + getCheckMessage(MSG_KEY, "excludes"), @@ -130,7 +130,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDisAllowPublicFinalAndImmutableFieldsInImmutableClass() throws Exception { + void disAllowPublicFinalAndImmutableFieldsInImmutableClass() throws Exception { @@ -31183,7 +31183,7 @@ "33:39: " + getCheckMessage(MSG_KEY, "includes"), @@ -152,7 +152,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowPublicFinalFieldsInNonFinalClass() throws Exception { + void allowPublicFinalFieldsInNonFinalClass() throws Exception { @@ -31192,7 +31192,7 @@ "57:24: " + getCheckMessage(MSG_KEY, "bValue"), @@ -162,7 +162,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUserSpecifiedImmutableClassesList() throws Exception { + void userSpecifiedImmutableClassesList() throws Exception { @@ -31201,7 +31201,7 @@ "47:35: " + getCheckMessage(MSG_KEY, "uri"), @@ -177,7 +177,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImmutableSpecifiedSameTypeName() throws Exception { + void immutableSpecifiedSameTypeName() throws Exception { @@ -31210,7 +31210,7 @@ "26:36: " + getCheckMessage(MSG_KEY, "address"), @@ -188,7 +188,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImmutableValueSameTypeName() throws Exception { + void immutableValueSameTypeName() throws Exception { @@ -31219,7 +31219,7 @@ "29:59: " + getCheckMessage(MSG_KEY, "calendar2"), @@ -199,21 +199,21 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImmutableStarImportFalseNegative() throws Exception { + void immutableStarImportFalseNegative() throws Exception { @@ -31227,7 +31227,7 @@ verifyWithInlineConfigParser( getPath("InputVisibilityModifierImmutableStarImport.java"), expected); } - + @Test - public void testImmutableStarImportNoWarn() throws Exception { + void immutableStarImportNoWarn() throws Exception { @@ -31235,7 +31235,7 @@ verifyWithInlineConfigParser( getPath("InputVisibilityModifierImmutableStarImport2.java"), expected); } - + @Test - public void testDefaultAnnotationPatterns() throws Exception { + void defaultAnnotationPatterns() throws Exception { @@ -31244,7 +31244,7 @@ "64:12: " + getCheckMessage(MSG_KEY, "customAnnotatedPackage"), @@ -226,7 +226,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomAnnotationPatterns() throws Exception { + void customAnnotationPatterns() throws Exception { @@ -31253,7 +31253,7 @@ "40:28: " + getCheckMessage(MSG_KEY, "fqPublicJUnitRule"), @@ -246,7 +246,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreAnnotationNoPattern() throws Exception { + void ignoreAnnotationNoPattern() throws Exception { @@ -31262,7 +31262,7 @@ "39:28: " + getCheckMessage(MSG_KEY, "fqPublicJUnitRule"), @@ -269,7 +269,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreAnnotationSameName() throws Exception { + void ignoreAnnotationSameName() throws Exception { @@ -31271,7 +31271,7 @@ "36:28: " + getCheckMessage(MSG_KEY, "publicJUnitClassRule"), @@ -279,7 +279,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -31280,7 +31280,7 @@ TokenTypes.VARIABLE_DEF, TokenTypes.IMPORT, @@ -290,7 +290,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPublicImmutableFieldsNotAllowed() throws Exception { + void publicImmutableFieldsNotAllowed() throws Exception { @@ -31289,7 +31289,7 @@ "32:39: " + getCheckMessage(MSG_KEY, "includes"), @@ -302,7 +302,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPublicFinalFieldsNotAllowed() throws Exception { + void publicFinalFieldsNotAllowed() throws Exception { @@ -31298,7 +31298,7 @@ "32:39: " + getCheckMessage(MSG_KEY, "includes"), @@ -315,14 +315,14 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPublicFinalFieldsAllowed() throws Exception { + void publicFinalFieldsAllowed() throws Exception { @@ -31306,7 +31306,7 @@ verifyWithInlineConfigParser( getPath("InputVisibilityModifiersPublicImmutable3.java"), expected); } - + @Test - public void testPublicFinalFieldInEnum() throws Exception { + void publicFinalFieldInEnum() throws Exception { @@ -31315,7 +31315,7 @@ }; @@ -330,7 +330,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongTokenType() { + void wrongTokenType() { @@ -31324,7 +31324,7 @@ ast.initialize(new CommonToken(TokenTypes.CLASS_DEF, "class")); @@ -345,7 +345,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNullModifiers() throws Exception { + void nullModifiers() throws Exception { @@ -31333,7 +31333,7 @@ }; @@ -353,7 +353,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisibilityModifiersOfGenericFields() throws Exception { + void visibilityModifiersOfGenericFields() throws Exception { @@ -31351,7 +31351,7 @@ new File(getPath("InputVisibilityModifierIsStarImport.java")), @@ -402,7 +402,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageClassName() throws Exception { + void packageClassName() throws Exception { @@ -31363,15 +31363,15 @@ @@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.mockito.MockedConstruction; - + -public class HeaderCheckTest extends AbstractModuleTestSupport { +final class HeaderCheckTest extends AbstractModuleTestSupport { - + @TempDir public File temporaryFolder; - + @@ -50,7 +50,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticHeader() throws Exception { + void staticHeader() throws Exception { @@ -31380,25 +31380,25 @@ checkConfig.addProperty("ignoreLines", ""); @@ -61,7 +61,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoHeader() throws Exception { + void noHeader() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); - + createChecker(checkConfig); @@ -70,7 +70,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceHeader() throws Exception { + void whitespaceHeader() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("header", "\n \n"); - + @@ -80,7 +80,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonExistentHeaderFile() throws Exception { + void nonExistentHeaderFile() throws Exception { @@ -31407,7 +31407,7 @@ final CheckstyleException ex = @@ -106,7 +106,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidCharset() throws Exception { + void invalidCharset() throws Exception { @@ -31416,7 +31416,7 @@ checkConfig.addProperty("charset", "XSO-8859-1"); @@ -133,7 +133,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyFilename() { + void emptyFilename() { @@ -31425,7 +31425,7 @@ final CheckstyleException ex = @@ -161,7 +161,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNullFilename() { + void nullFilename() { @@ -31434,7 +31434,7 @@ final CheckstyleException ex = @@ -180,7 +180,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatch() throws Exception { + void notMatch() throws Exception { @@ -31443,7 +31443,7 @@ checkConfig.addProperty("ignoreLines", ""); @@ -195,7 +195,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnore() throws Exception { + void ignore() throws Exception { @@ -31452,7 +31452,7 @@ checkConfig.addProperty("ignoreLines", "2"); @@ -204,7 +204,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSetHeaderTwice() { + void setHeaderTwice() { @@ -31461,34 +31461,34 @@ final IllegalArgumentException ex = @@ -220,7 +220,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIoExceptionWhenLoadingHeaderFile() throws Exception { + void ioExceptionWhenLoadingHeaderFile() throws Exception { final HeaderCheck check = new HeaderCheck(); check.setHeaderFile(new URI("test://bad")); - + @@ -236,7 +236,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheHeaderFile() throws Exception { + void cacheHeaderFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); - + @@ -254,7 +254,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheHeaderWithoutFile() throws Exception { + void cacheHeaderWithoutFile() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); checkConfig.addProperty("header", "Test"); - + @@ -270,7 +270,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreLinesSorted() throws Exception { + void ignoreLinesSorted() throws Exception { @@ -31497,7 +31497,7 @@ checkConfig.addProperty("ignoreLines", "4,2,3"); @@ -279,7 +279,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLoadHeaderFileTwice() { + void loadHeaderFileTwice() { @@ -31506,7 +31506,7 @@ final ReflectiveOperationException ex = @@ -294,21 +294,21 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHeaderIsValidWithBlankLines() throws Exception { + void headerIsValidWithBlankLines() throws Exception { @@ -31514,7 +31514,7 @@ checkConfig.addProperty("headerFile", getPath("InputHeaderjava.blank-lines.header")); verify(checkConfig, getPath("InputHeaderBlankLines.java")); } - + @Test - public void testHeaderIsValidWithBlankLinesBlockStyle() throws Exception { + void headerIsValidWithBlankLinesBlockStyle() throws Exception { @@ -31522,7 +31522,7 @@ checkConfig.addProperty("headerFile", getPath("InputHeaderjava.blank-lines2.header")); verify(checkConfig, getPath("InputHeaderBlankLines2.java")); } - + @Test - public void testExternalResource() throws Exception { + void externalResource() throws Exception { @@ -31531,7 +31531,7 @@ check.setHeaderFile(uri); @@ -320,7 +320,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIoExceptionWhenLoadingHeader() { + void ioExceptionWhenLoadingHeader() { @@ -31542,15 +31542,15 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckTest.java @@ -34,7 +34,7 @@ import java.util.regex.Pattern; import org.junit.jupiter.api.Test; - + /** Unit test for RegexpHeaderCheck. */ -public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { +final class RegexpHeaderCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -43,7 +43,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { - + /** Test of setHeader method, of class RegexpHeaderCheck. */ @Test - public void testSetHeaderNull() { @@ -31559,7 +31559,7 @@ final RegexpHeaderCheck instance = new RegexpHeaderCheck(); // recreate for each test because multiple invocations fail @@ -58,7 +58,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { - + /** Test of setHeader method, of class RegexpHeaderCheck. */ @Test - public void testSetHeaderEmpty() { @@ -31568,7 +31568,7 @@ final RegexpHeaderCheck instance = new RegexpHeaderCheck(); // check empty string passes @@ -73,7 +73,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { - + /** Test of setHeader method, of class RegexpHeaderCheck. */ @Test - public void testSetHeaderSimple() { @@ -31577,7 +31577,7 @@ // check valid header passes final String header = "abc.*"; @@ -87,7 +87,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { - + /** Test of setHeader method, of class RegexpHeaderCheck. */ @Test - public void testSetHeader() { @@ -31587,7 +31587,7 @@ try { @@ -107,7 +107,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { @@ -31596,7 +31596,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -115,7 +115,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyFilename() throws Exception { + void emptyFilename() throws Exception { @@ -31605,7 +31605,7 @@ try { @@ -132,7 +132,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeader() throws Exception { + void regexpHeader() throws Exception { @@ -31614,7 +31614,7 @@ final String[] expected = { @@ -142,7 +142,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingRegexpHeader() throws Exception { + void nonMatchingRegexpHeader() throws Exception { @@ -31623,7 +31623,7 @@ checkConfig.addProperty("multiLines", "1"); @@ -153,7 +153,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderUrl() throws Exception { + void regexpHeaderUrl() throws Exception { @@ -31632,7 +31632,7 @@ final String[] expected = { @@ -163,7 +163,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineRegexpHeader() throws Exception { + void inlineRegexpHeader() throws Exception { @@ -31641,7 +31641,7 @@ final String[] expected = { @@ -173,7 +173,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFailureForMultilineRegexp() throws Exception { + void failureForMultilineRegexp() throws Exception { @@ -31650,7 +31650,7 @@ try { @@ -191,7 +191,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineRegexpHeaderConsecutiveNewlines() throws Exception { + void inlineRegexpHeaderConsecutiveNewlines() throws Exception { @@ -31659,7 +31659,7 @@ final String[] expected = { @@ -201,7 +201,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineRegexpHeaderConsecutiveNewlinesThroughConfigFile() throws Exception { + void inlineRegexpHeaderConsecutiveNewlinesThroughConfigFile() throws Exception { @@ -31668,7 +31668,7 @@ final String[] expected = { @@ -211,7 +211,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderIgnore() throws Exception { + void regexpHeaderIgnore() throws Exception { @@ -31677,7 +31677,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -219,7 +219,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti1() throws Exception { + void regexpHeaderMulti1() throws Exception { @@ -31686,7 +31686,7 @@ checkConfig.addProperty("multiLines", "3, 6"); @@ -228,7 +228,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti2() throws Exception { + void regexpHeaderMulti2() throws Exception { @@ -31695,7 +31695,7 @@ checkConfig.addProperty("multiLines", "3, 6"); @@ -237,7 +237,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti3() throws Exception { + void regexpHeaderMulti3() throws Exception { @@ -31704,7 +31704,7 @@ checkConfig.addProperty("multiLines", "3, 7"); @@ -246,7 +246,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti4() throws Exception { + void regexpHeaderMulti4() throws Exception { @@ -31713,7 +31713,7 @@ checkConfig.addProperty("multiLines", "3, 5, 6, 7"); @@ -255,7 +255,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti5() throws Exception { + void regexpHeaderMulti5() throws Exception { @@ -31722,7 +31722,7 @@ checkConfig.addProperty("multiLines", "3"); @@ -266,7 +266,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti6() throws Exception { + void regexpHeaderMulti6() throws Exception { @@ -31731,7 +31731,7 @@ checkConfig.addProperty("multiLines", "8974382"); @@ -275,7 +275,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderSmallHeader() throws Exception { + void regexpHeaderSmallHeader() throws Exception { @@ -31740,7 +31740,7 @@ checkConfig.addProperty("multiLines", "3, 6"); @@ -284,7 +284,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyMultiline() throws Exception { + void emptyMultiline() throws Exception { @@ -31749,7 +31749,7 @@ checkConfig.addProperty("multiLines", ""); @@ -295,7 +295,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegexpHeaderMulti52() throws Exception { + void regexpHeaderMulti52() throws Exception { @@ -31758,7 +31758,7 @@ final String[] expected = { @@ -305,7 +305,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreLinesSorted() throws Exception { + void ignoreLinesSorted() throws Exception { @@ -31767,7 +31767,7 @@ checkConfig.addProperty("multiLines", "7,5,3"); @@ -314,7 +314,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHeaderWithInvalidRegexp() throws Exception { + void headerWithInvalidRegexp() throws Exception { @@ -31776,7 +31776,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -330,7 +330,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoWarningIfSingleLinedLeft() throws Exception { + void noWarningIfSingleLinedLeft() throws Exception { @@ -31785,7 +31785,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -338,7 +338,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoHeaderMissingErrorInCaseHeaderSizeEqualToFileSize() throws Exception { + void noHeaderMissingErrorInCaseHeaderSizeEqualToFileSize() throws Exception { @@ -31794,7 +31794,7 @@ checkConfig.addProperty("multiLines", "1"); @@ -349,7 +349,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCharsetProperty1() throws Exception { + void charsetProperty1() throws Exception { @@ -31803,7 +31803,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -358,7 +358,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCharsetProperty2() throws Exception { + void charsetProperty2() throws Exception { @@ -31812,7 +31812,7 @@ checkConfig.addProperty("headerFile", getPath("InputRegexpHeader7.header")); @@ -371,7 +371,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCharsetProperty3() throws Exception { + void charsetProperty3() throws Exception { @@ -31822,12 +31822,12 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResultTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResultTest.java @@ -23,14 +23,14 @@ import static com.google.common.truth.Truth.assertWithMessage; - + import org.junit.jupiter.api.Test; - + -public class AccessResultTest { +final class AccessResultTest { - + /* Additional test for jacoco, since valueOf() * is generated by javac and jacoco reports that * valueOf() is uncovered. @@ -31852,15 +31852,15 @@ @@ -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 AvoidStarImportCheckTest extends AbstractModuleTestSupport { +final class AvoidStarImportCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultOperation() throws Exception { + void defaultOperation() throws Exception { @@ -31869,7 +31869,7 @@ "13:17: " + getCheckMessage(MSG_KEY, "java.lang.*"), @@ -47,7 +47,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludes() throws Exception { + void excludes() throws Exception { @@ -31878,7 +31878,7 @@ "31:27: " + getCheckMessage(MSG_KEY, "java.io.File.*"), @@ -56,7 +56,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowClassImports() throws Exception { + void allowClassImports() throws Exception { @@ -31887,7 +31887,7 @@ "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -67,7 +67,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowStaticMemberImports() throws Exception { + void allowStaticMemberImports() throws Exception { @@ -31896,7 +31896,7 @@ "12:15: " + getCheckMessage(MSG_KEY, "java.io.*"), @@ -77,7 +77,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -31905,7 +31905,7 @@ final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; @@ -85,7 +85,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -31917,15 +31917,15 @@ @@ -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 AvoidStaticImportCheckTest extends AbstractModuleTestSupport { +final class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -31934,7 +31934,7 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultOperation() throws Exception { + void defaultOperation() throws Exception { @@ -31943,7 +31943,7 @@ "26:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -67,7 +67,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStarExcludes() throws Exception { + void starExcludes() throws Exception { @@ -31952,7 +31952,7 @@ "26:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -88,7 +88,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMemberExcludes() throws Exception { + void memberExcludes() throws Exception { @@ -31961,7 +31961,7 @@ "26:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), @@ -110,7 +110,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBogusMemberExcludes() throws Exception { + void bogusMemberExcludes() throws Exception { @@ -31970,7 +31970,7 @@ "26:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), @@ -134,7 +134,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerClassMemberExcludesStar() throws Exception { + void innerClassMemberExcludesStar() throws Exception { @@ -31979,7 +31979,7 @@ final String[] expected = { @@ -154,7 +154,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -31989,12 +31989,12 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ClassImportRuleTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ClassImportRuleTest.java @@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; - + import org.junit.jupiter.api.Test; - + -public class ClassImportRuleTest { +final class ClassImportRuleTest { - + @Test - public void testClassImportRule() { + void classImportRule() { @@ -32003,7 +32003,7 @@ assertWithMessage("Invalid access result") @@ -50,7 +50,7 @@ public class ClassImportRuleTest { } - + @Test - public void testClassImportRuleRegexpSimple() { + void classImportRuleRegexpSimple() { @@ -32012,7 +32012,7 @@ assertWithMessage("Invalid access result") @@ -74,7 +74,7 @@ public class ClassImportRuleTest { } - + @Test - public void testClassImportRuleRegexp() { + void classImportRuleRegexp() { @@ -32024,15 +32024,15 @@ @@ -38,7 +38,7 @@ import java.io.File; import java.lang.reflect.Method; import org.junit.jupiter.api.Test; - + -public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { +final class CustomImportOrderCheckTest extends AbstractModuleTestSupport { - + /** Shortcuts to make code more compact. */ private static final String STATIC = CustomImportOrderCheck.STATIC_RULE_GROUP; @@ -54,7 +54,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -32041,7 +32041,7 @@ TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, TokenTypes.PACKAGE_DEF, @@ -65,7 +65,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustom() throws Exception { + void custom() throws Exception { @@ -32059,7 +32059,7 @@ "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), @@ -109,7 +109,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticStandardThirdListCustomRules() throws Exception { + void staticStandardThirdListCustomRules() throws Exception { @@ -32068,16 +32068,16 @@ "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), @@ -128,7 +128,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticStandardThirdListCustomRulesWhitespace() throws Exception { + void staticStandardThirdListCustomRulesWhitespace() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -136,7 +136,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderSingleLineList() throws Exception { + void inputCustomImportOrderSingleLineList() throws Exception { @@ -32085,7 +32085,7 @@ "14:112: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), "15:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.google.common.annotations.Beta"), @@ -148,7 +148,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { - + /** Checks different combinations for same_package group. */ @Test - public void testNonSpecifiedImports() throws Exception { @@ -32095,7 +32095,7 @@ "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), @@ -166,7 +166,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOrderRuleEmpty() throws Exception { + void orderRuleEmpty() throws Exception { @@ -32104,7 +32104,7 @@ }; @@ -175,7 +175,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOrderRuleWithOneGroup() throws Exception { + void orderRuleWithOneGroup() throws Exception { @@ -32113,7 +32113,7 @@ "19:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.List"), @@ -207,7 +207,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticSamePackage() throws Exception { + void staticSamePackage() throws Exception { @@ -32122,7 +32122,7 @@ "18:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), @@ -226,7 +226,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutLineSeparator() throws Exception { + void withoutLineSeparator() throws Exception { @@ -32131,7 +32131,7 @@ "18:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), @@ -245,7 +245,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutLineSeparator2() throws Exception { + void withoutLineSeparator2() throws Exception { @@ -32140,15 +32140,15 @@ + getCheckMessage( @@ -261,14 +261,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoValid() throws Exception { + void noValid() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputCustomImportOrderNoValid.java"), expected); } - + @Test - public void testPossibleIndexOutOfBoundsException() throws Exception { + void possibleIndexOutOfBoundsException() throws Exception { @@ -32157,25 +32157,25 @@ }; @@ -278,7 +278,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultPackage2() throws Exception { + void defaultPackage2() throws Exception { - + final String[] expected = { "19:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), @@ -301,7 +301,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutThirdPartyPackage() throws Exception { + void withoutThirdPartyPackage() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -309,7 +309,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThirdPartyAndSpecialImports() throws Exception { + void thirdPartyAndSpecialImports() throws Exception { @@ -32184,7 +32184,7 @@ + getCheckMessage(MSG_ORDER, THIRD, SPECIAL, "com.google.common.collect.HashMultimap"), @@ -320,7 +320,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCompareImports() throws Exception { + void compareImports() throws Exception { @@ -32193,7 +32193,7 @@ }; @@ -329,7 +329,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFindBetterPatternMatch() throws Exception { + void findBetterPatternMatch() throws Exception { @@ -32202,7 +32202,7 @@ }; @@ -339,7 +339,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBeginTreeClear() throws Exception { + void beginTreeClear() throws Exception { @@ -32211,7 +32211,7 @@ checkConfig.addProperty("separateLineBetweenGroups", "false"); @@ -355,7 +355,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportsContainingJava() throws Exception { + void importsContainingJava() throws Exception { @@ -32220,7 +32220,7 @@ }; @@ -365,7 +365,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -32238,7 +32238,7 @@ final Method method = clazz.getDeclaredMethod("getFullImportIdent", DetailAST.class); @@ -390,7 +390,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepth2() throws Exception { + void samePackageDepth2() throws Exception { @@ -32247,7 +32247,7 @@ "21:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.List"), @@ -410,7 +410,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepth3() throws Exception { + void samePackageDepth3() throws Exception { @@ -32256,7 +32256,7 @@ "24:1: " @@ -425,7 +425,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepth4() throws Exception { + void samePackageDepth4() throws Exception { @@ -32265,60 +32265,60 @@ + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.locks.LockSupport"), @@ -436,7 +436,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepthLongerThenActualPackage() throws Exception { + void samePackageDepthLongerThenActualPackage() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -444,7 +444,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepthNegative() throws Exception { + void samePackageDepthNegative() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -469,7 +469,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepthZero() throws Exception { + void samePackageDepthZero() throws Exception { try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -492,7 +492,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnsupportedRule() throws Exception { + void unsupportedRule() throws Exception { try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -514,7 +514,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSamePackageDepthNotInt() throws Exception { + void samePackageDepthNotInt() throws Exception { try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -536,14 +536,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoImports() throws Exception { + void noImports() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputCustomImportOrder_NoImports.java"), expected); } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { @@ -32327,7 +32327,7 @@ "32:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.*"), @@ -553,7 +553,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRulesWithOverlappingPatterns() throws Exception { + void rulesWithOverlappingPatterns() throws Exception { @@ -32336,7 +32336,7 @@ + getCheckMessage( @@ -596,28 +596,28 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiplePatternMatchesSecondPatternIsLonger() throws Exception { + void multiplePatternMatchesSecondPatternIsLonger() throws Exception { @@ -32344,7 +32344,7 @@ verifyWithInlineConfigParser( getPath("InputCustomImportOrder_MultiplePatternMatches.java"), expected); } - + @Test - public void testMultiplePatternMatchesFirstPatternHasLaterPosition() throws Exception { + void multiplePatternMatchesFirstPatternHasLaterPosition() throws Exception { @@ -32352,7 +32352,7 @@ verifyWithInlineConfigParser( getPath("InputCustomImportOrder_MultiplePatternMatches2.java"), expected); } - + @Test - public void testMultiplePatternMatchesFirstPatternHasEarlierPosition() throws Exception { + void multiplePatternMatchesFirstPatternHasEarlierPosition() throws Exception { @@ -32360,7 +32360,7 @@ verifyWithInlineConfigParser( getPath("InputCustomImportOrder_MultiplePatternMatches3.java"), expected); } - + @Test - public void testMultiplePatternMultipleImportFirstPatternHasLaterPosition() throws Exception { + void multiplePatternMultipleImportFirstPatternHasLaterPosition() throws Exception { @@ -32369,7 +32369,7 @@ }; @@ -626,7 +626,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoPackage() throws Exception { + void noPackage() throws Exception { @@ -32378,7 +32378,7 @@ "19:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.HashMap"), @@ -638,7 +638,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoPackage2() throws Exception { + void noPackage2() throws Exception { @@ -32387,7 +32387,7 @@ "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Arrays"), @@ -651,7 +651,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoPackage3() throws Exception { + void noPackage3() throws Exception { @@ -32396,7 +32396,7 @@ "25:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "org.apache.*"), @@ -662,7 +662,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderSingleLine() throws Exception { + void inputCustomImportOrderSingleLine() throws Exception { @@ -32405,7 +32405,7 @@ "15:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.google.common.annotations.Beta"), @@ -673,7 +673,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderSingleLine2() throws Exception { + void inputCustomImportOrderSingleLine2() throws Exception { @@ -32414,7 +32414,7 @@ }; @@ -682,7 +682,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderThirdPartyAndSpecial2() throws Exception { + void inputCustomImportOrderThirdPartyAndSpecial2() throws Exception { @@ -32423,7 +32423,7 @@ "24:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.awt.Button"), @@ -701,7 +701,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderMultipleViolationsSameLine() throws Exception { + void inputCustomImportOrderMultipleViolationsSameLine() throws Exception { @@ -32432,7 +32432,7 @@ "18:1: " @@ -715,7 +715,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderSpanMultipleLines() throws Exception { + void inputCustomImportOrderSpanMultipleLines() throws Exception { @@ -32441,7 +32441,7 @@ "45:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.HashSet"), @@ -728,7 +728,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderEclipseDefaultPositive() throws Exception { + void inputCustomImportOrderEclipseDefaultPositive() throws Exception { @@ -32450,7 +32450,7 @@ "23:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "java.awt.Dialog"), @@ -744,7 +744,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputCustomImportOrderSpecialImportsRegExp() throws Exception { + void inputCustomImportOrderSpecialImportsRegExp() throws Exception { @@ -32462,24 +32462,24 @@ @@ -24,7 +24,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class FileImportControlTest { +final class FileImportControlTest { - + private final PkgImportControl root = new PkgImportControl("com.kazgroup.courtlink", false, MismatchStrategy.DISALLOWED); @@ -33,7 +33,7 @@ public class FileImportControlTest { private final FileImportControl fileRegexpNode = new FileImportControl(root, ".*Other.*", true); - + @BeforeEach - public void setUp() { + void setUp() { root.addChild(fileNode); root.addChild(fileRegexpNode); - + @@ -43,7 +43,7 @@ public class FileImportControlTest { } - + @Test - public void testLocateFinest() { + void locateFinest() { @@ -32491,15 +32491,15 @@ @@ -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 IllegalImportCheckTest extends AbstractModuleTestSupport { +final class IllegalImportCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -32508,7 +32508,7 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithSupplied() throws Exception { + void withSupplied() throws Exception { @@ -32517,14 +32517,14 @@ "26:1: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), @@ -53,13 +53,13 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithDefault() throws Exception { + void withDefault() throws Exception { final String[] expected = {}; verifyWithInlineConfigParser(getPath("InputIllegalImportDefault2.java"), expected); } - + @Test - public void testCustomSunPackageWithRegexp() throws Exception { + void customSunPackageWithRegexp() throws Exception { @@ -32533,7 +32533,7 @@ }; @@ -67,7 +67,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -32542,7 +32542,7 @@ final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; @@ -76,7 +76,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClasses() throws Exception { + void illegalClasses() throws Exception { @@ -32551,7 +32551,7 @@ "18:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), @@ -86,7 +86,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClassesStarImport() throws Exception { + void illegalClassesStarImport() throws Exception { @@ -32560,7 +32560,7 @@ "18:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), @@ -96,7 +96,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalPackagesRegularExpression() throws Exception { + void illegalPackagesRegularExpression() throws Exception { @@ -32569,7 +32569,7 @@ "16:1: " + getCheckMessage(MSG_KEY, "java.util.List"), @@ -110,7 +110,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClassesRegularExpression() throws Exception { + void illegalClassesRegularExpression() throws Exception { @@ -32578,7 +32578,7 @@ "16:1: " + getCheckMessage(MSG_KEY, "java.util.List"), @@ -120,7 +120,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalPackagesAndClassesRegularExpression() throws Exception { + void illegalPackagesAndClassesRegularExpression() throws Exception { @@ -32590,15 +32590,15 @@ @@ -39,7 +39,7 @@ import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - + -public class ImportControlCheckTest extends AbstractModuleTestSupport { +final class ImportControlCheckTest extends AbstractModuleTestSupport { - + @TempDir public File temporaryFolder; - + @@ -49,7 +49,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -32607,15 +32607,15 @@ TokenTypes.PACKAGE_DEF, TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, @@ -60,14 +60,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOne() throws Exception { + void one() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl.java"), expected); } - + @Test - public void testTwo() throws Exception { + void two() throws Exception { @@ -32624,35 +32624,35 @@ "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), @@ -78,31 +78,31 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrong() throws Exception { + void wrong() throws Exception { final String[] expected = {"9:1: " + getCheckMessage(MSG_UNKNOWN_PKG)}; verifyWithInlineConfigParser(getPath("InputImportControl3.java"), expected); } - + @Test - public void testMissing() throws Exception { + void missing() throws Exception { final String[] expected = {"9:1: " + getCheckMessage(MSG_MISSING_FILE)}; verifyWithInlineConfigParser(getPath("InputImportControl4.java"), expected); } - + @Test - public void testEmpty() throws Exception { + void empty() throws Exception { final String[] expected = {"9:1: " + getCheckMessage(MSG_MISSING_FILE)}; verifyWithInlineConfigParser(getPath("InputImportControl5.java"), expected); } - + @Test - public void testNull() throws Exception { + void testNull() throws Exception { final String[] expected = {"9:1: " + getCheckMessage(MSG_MISSING_FILE)}; verifyWithInlineConfigParser(getPath("InputImportControl6.java"), expected); } - + @Test - public void testUnknown() throws Exception { + void unknown() throws Exception { @@ -32661,7 +32661,7 @@ verifyWithInlineConfigParser(getPath("InputImportControl7.java"), expected); @@ -118,7 +118,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBroken() throws Exception { + void broken() throws Exception { @@ -32670,15 +32670,15 @@ verifyWithInlineConfigParser(getPath("InputImportControl8.java"), expected); @@ -134,14 +134,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOneRegExp() throws Exception { + void oneRegExp() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl9.java"), expected); } - + @Test - public void testTwoRegExp() throws Exception { + void twoRegExp() throws Exception { @@ -32687,15 +32687,15 @@ "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), @@ -152,14 +152,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotRegExpNoMatch() throws Exception { + void notRegExpNoMatch() throws Exception { - + verifyWithInlineConfigParser( getPath("InputImportControl11.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testBlacklist() throws Exception { + void blacklist() throws Exception { @@ -32704,7 +32704,7 @@ "12:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.Date"), @@ -171,7 +171,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrategyOnMismatchOne() throws Exception { + void strategyOnMismatchOne() throws Exception { @@ -32713,7 +32713,7 @@ "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), @@ -182,7 +182,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrategyOnMismatchTwo() throws Exception { + void strategyOnMismatchTwo() throws Exception { @@ -32722,7 +32722,7 @@ "14:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Button.ABORT"), @@ -192,7 +192,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrategyOnMismatchThree() throws Exception { + void strategyOnMismatchThree() throws Exception { @@ -32731,7 +32731,7 @@ }; @@ -201,7 +201,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrategyOnMismatchFour() throws Exception { + void strategyOnMismatchFour() throws Exception { @@ -32740,40 +32740,40 @@ "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), @@ -211,7 +211,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutRegexAndWithStrategyOnMismatch() throws Exception { + void withoutRegexAndWithStrategyOnMismatch() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -219,28 +219,28 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPkgRegExpInParent() throws Exception { + void pkgRegExpInParent() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl16.java"), expected); } - + @Test - public void testPkgRegExpInChild() throws Exception { + void pkgRegExpInChild() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl162.java"), expected); } - + @Test - public void testPkgRegExpInBoth() throws Exception { + void pkgRegExpInBoth() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl163.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -32782,15 +32782,15 @@ final int[] expected = { @@ -251,14 +251,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testResource() throws Exception { + void resource() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl17.java"), expected); } - + @Test - public void testResourceUnableToLoad() throws Exception { + void resourceUnableToLoad() throws Exception { @@ -32799,65 +32799,65 @@ verifyWithInlineConfigParser(getPath("InputImportControl18.java"), expected); @@ -274,14 +274,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUrlInFileProperty() throws Exception { + void urlInFileProperty() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl19.java"), expected); } - + @Test - public void testUrlInFilePropertyUnableToLoad() throws Exception { + void urlInFilePropertyUnableToLoad() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -298,7 +298,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCacheWhenFileExternalResourceContentDoesNotChange() throws Exception { + void cacheWhenFileExternalResourceContentDoesNotChange() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportControlCheck.class); checkConfig.addProperty("file", getPath("InputImportControlOneRegExp.xml")); - + @@ -322,35 +322,35 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPathRegexMatches() throws Exception { + void pathRegexMatches() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl21.java"), expected); } - + @Test - public void testPathRegexMatchesPartially() throws Exception { + void pathRegexMatchesPartially() throws Exception { final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; - + verifyWithInlineConfigParser(getPath("InputImportControl22.java"), expected); } - + @Test - public void testPathRegexDoesntMatch() throws Exception { + void pathRegexDoesntMatch() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputImportControl23.java"), expected); } - + @Test - public void testPathRegexDoesntMatchPartially() throws Exception { + void pathRegexDoesntMatchPartially() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputImportControl24.java"), expected); } - + @Test - public void testDisallowClassOfAllowPackage() throws Exception { + void disallowClassOfAllowPackage() throws Exception { @@ -32866,7 +32866,7 @@ }; @@ -360,7 +360,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileName() throws Exception { + void fileName() throws Exception { @@ -32875,7 +32875,7 @@ }; @@ -369,7 +369,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithRegex() throws Exception { + void withRegex() throws Exception { @@ -32884,7 +32884,7 @@ }; @@ -378,7 +378,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileNameNoExtension() throws Exception { + void fileNameNoExtension() throws Exception { @@ -32893,7 +32893,7 @@ }; @@ -387,7 +387,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBeginTreeCurrentImportControl() throws Exception { + void beginTreeCurrentImportControl() throws Exception { @@ -32902,7 +32902,7 @@ final List expectedFirstInput = @@ -399,7 +399,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportControlFileName() throws Exception { + void importControlFileName() throws Exception { @@ -32911,15 +32911,15 @@ }; @@ -408,14 +408,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportControlFileName2() throws Exception { + void importControlFileName2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputImportControlTestRegexpInFile2.java"), expected); } - + @Test - public void testImportControlTestException() { + void importControlTestException() { @@ -32931,15 +32931,15 @@ @@ -40,7 +40,7 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.AttributesImpl; - + -public class ImportControlLoaderTest { +final class ImportControlLoaderTest { - + private static String getPath(String filename) { return "src/test/resources/com/puppycrawl/tools/" @@ -49,14 +49,14 @@ public class ImportControlLoaderTest { } - + @Test - public void testLoad() throws CheckstyleException { + void load() throws CheckstyleException { @@ -32947,7 +32947,7 @@ ImportControlLoader.load(new File(getPath("InputImportControlLoaderComplete.xml")).toURI()); assertWithMessage("Import root should not be null").that(root).isNotNull(); } - + @Test - public void testWrongFormatUri() throws Exception { + void wrongFormatUri() throws Exception { @@ -32956,7 +32956,7 @@ assertWithMessage("exception expected").fail(); @@ -73,7 +73,7 @@ public class ImportControlLoaderTest { } - + @Test - public void testExtraElementInConfig() throws Exception { + void extraElementInConfig() throws Exception { @@ -32964,7 +32964,7 @@ ImportControlLoader.load( new File(getPath("InputImportControlLoaderWithNewElement.xml")).toURI()); @@ -82,7 +82,7 @@ public class ImportControlLoaderTest { - + @Test // UT uses Reflection to avoid removing null-validation from static method - public void testSafeGetThrowsException() { @@ -32983,7 +32983,7 @@ final Class clazz = ImportControlLoader.class; @@ -135,7 +135,7 @@ public class ImportControlLoaderTest { } - + @Test - public void testInputStreamFailsOnRead() throws Exception { + void inputStreamFailsOnRead() throws Exception { @@ -32995,23 +32995,23 @@ @@ -38,7 +38,7 @@ import java.util.Optional; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class ImportOrderCheckTest extends AbstractModuleTestSupport { +final class ImportOrderCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -46,14 +46,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVeryPreciseGrouping() throws Exception { + void veryPreciseGrouping() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getNonCompilablePath("InputImportOrder6.java"), expected); } - + @Test - public void testGetTokens() { + void getTokens() { @@ -33027,7 +33027,7 @@ final ImportOrderOption option = ImportOrderOption.valueOf("TOP"); assertWithMessage("Invalid valueOf result").that(option).isEqualTo(ImportOrderOption.TOP); } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -33036,24 +33036,24 @@ "25:1: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), @@ -92,7 +92,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongSequenceInNonStaticImports() throws Exception { + void wrongSequenceInNonStaticImports() throws Exception { - + final String[] expected = { "19:1: " + getCheckMessage(MSG_ORDERING, "java.util.HashMap"), @@ -103,14 +103,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultilineImport() throws Exception { + void multilineImport() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getNonCompilablePath("InputImportOrderMultiline.java"), expected); } - + @Test - public void testGroups() throws Exception { + void groups() throws Exception { @@ -33062,7 +33062,7 @@ "29:1: " + getCheckMessage(MSG_ORDERING, "java.io.IOException"), @@ -123,7 +123,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGroupsRegexp() throws Exception { + void groupsRegexp() throws Exception { @@ -33071,7 +33071,7 @@ "34:1: " @@ -134,7 +134,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSeparated() throws Exception { + void separated() throws Exception { @@ -33080,7 +33080,7 @@ "27:1: " + getCheckMessage(MSG_SEPARATION, "java.io.File"), @@ -145,7 +145,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticImportSeparated() throws Exception { + void staticImportSeparated() throws Exception { @@ -33089,25 +33089,25 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.junit.Assert.assertEquals"), @@ -155,7 +155,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoGapBetweenStaticImports() throws Exception { + void noGapBetweenStaticImports() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -163,7 +163,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSortStaticImportsAlphabeticallyFalse() throws Exception { + void sortStaticImportsAlphabeticallyFalse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -171,7 +171,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSortStaticImportsAlphabeticallyTrue() throws Exception { + void sortStaticImportsAlphabeticallyTrue() throws Exception { @@ -33116,42 +33116,42 @@ + getCheckMessage(MSG_ORDERING, "javax.xml.transform.TransformerFactory.newInstance"), @@ -184,14 +184,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCaseInsensitive() throws Exception { + void caseInsensitive() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputImportOrderCaseInsensitive.java"), expected); } - + @Test - public void testContainerCaseInsensitive() throws Exception { + void containerCaseInsensitive() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -199,7 +199,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSimilarGroupPattern() throws Exception { + void similarGroupPattern() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -207,7 +207,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -226,7 +226,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTop() throws Exception { + void top() throws Exception { @@ -33160,7 +33160,7 @@ "28:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.IOException"), @@ -239,7 +239,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAbove() throws Exception { + void above() throws Exception { @@ -33169,7 +33169,7 @@ "24:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), @@ -252,7 +252,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInFlow() throws Exception { + void inFlow() throws Exception { @@ -33178,7 +33178,7 @@ "25:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.JComponent"), @@ -268,7 +268,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnder() throws Exception { + void under() throws Exception { @@ -33187,7 +33187,7 @@ "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), @@ -281,7 +281,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBottom() throws Exception { + void bottom() throws Exception { @@ -33196,16 +33196,16 @@ "27:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.JComponent"), @@ -296,7 +296,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetGroupNumber() throws Exception { + void getGroupNumber() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -304,7 +304,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHonorsTokenProperty() throws Exception { + void honorsTokenProperty() throws Exception { @@ -33214,7 +33214,7 @@ "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), @@ -315,7 +315,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWildcard() throws Exception { + void wildcard() throws Exception { @@ -33223,7 +33223,7 @@ }; @@ -324,7 +324,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWildcardUnspecified() throws Exception { + void wildcardUnspecified() throws Exception { @@ -33232,7 +33232,7 @@ }; @@ -333,14 +333,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoFailureForRedundantImports() throws Exception { + void noFailureForRedundantImports() throws Exception { @@ -33240,7 +33240,7 @@ verifyWithInlineConfigParser( getPath("InputImportOrder_NoFailureForRedundantImports.java"), expected); } - + @Test - public void testStaticGroupsAlphabeticalOrder() throws Exception { + void staticGroupsAlphabeticalOrder() throws Exception { @@ -33249,7 +33249,7 @@ "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), @@ -350,7 +350,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsOrder() throws Exception { + void staticGroupsOrder() throws Exception { @@ -33258,7 +33258,7 @@ "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), @@ -359,7 +359,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsAlphabeticalOrderBottom() throws Exception { + void staticGroupsAlphabeticalOrderBottom() throws Exception { @@ -33267,7 +33267,7 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), @@ -368,7 +368,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsAlphabeticalOrderBottomNegative() throws Exception { + void staticGroupsAlphabeticalOrderBottomNegative() throws Exception { @@ -33294,7 +33294,7 @@ }; @@ -401,7 +401,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsOrderBottom() throws Exception { + void staticGroupsOrderBottom() throws Exception { @@ -33303,21 +33303,21 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), @@ -410,19 +410,19 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportReception() throws Exception { + void importReception() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputImportOrderRepetition.java"), expected); } - + @Test - public void testStaticImportReceptionTop() throws Exception { + void staticImportReceptionTop() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputImportOrderStaticRepetition1.java"), expected); } - + @Test - public void testStaticImportReception() throws Exception { + void staticImportReception() throws Exception { @@ -33326,7 +33326,7 @@ "23:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), @@ -431,7 +431,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsOrderAbove() throws Exception { + void staticGroupsOrderAbove() throws Exception { @@ -33335,7 +33335,7 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), @@ -442,7 +442,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticOnDemandGroupsOrder() throws Exception { + void staticOnDemandGroupsOrder() throws Exception { @@ -33344,7 +33344,7 @@ "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), @@ -453,7 +453,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticOnDemandGroupsAlphabeticalOrder() throws Exception { + void staticOnDemandGroupsAlphabeticalOrder() throws Exception { @@ -33353,7 +33353,7 @@ "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), @@ -464,7 +464,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticOnDemandGroupsOrderBottom() throws Exception { + void staticOnDemandGroupsOrderBottom() throws Exception { @@ -33362,7 +33362,7 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), @@ -474,7 +474,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticOnDemandGroupsAlphabeticalOrderBottom() throws Exception { + void staticOnDemandGroupsAlphabeticalOrderBottom() throws Exception { @@ -33371,7 +33371,7 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), @@ -484,7 +484,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticOnDemandGroupsOrderAbove() throws Exception { + void staticOnDemandGroupsOrderAbove() throws Exception { @@ -33380,16 +33380,16 @@ "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), @@ -496,7 +496,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGroupWithSlashes() throws Exception { + void groupWithSlashes() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); checkConfig.addProperty("groups", "/^javax"); - + @@ -518,7 +518,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGroupWithDot() throws Exception { + void groupWithDot() throws Exception { @@ -33398,7 +33398,7 @@ "23:1: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), @@ -527,7 +527,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiplePatternMatches() throws Exception { + void multiplePatternMatches() throws Exception { @@ -33416,16 +33416,16 @@ final DetailAstImpl astIdent = mockAST(TokenTypes.IDENT, "myTestImport", 0, 0); @@ -584,7 +584,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEclipseDefaultPositive() throws Exception { + void eclipseDefaultPositive() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -592,14 +592,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticImportEclipseRepetition() throws Exception { + void staticImportEclipseRepetition() throws Exception { @@ -33433,7 +33433,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputImportOrderEclipseStaticRepetition.java"), expected); } - + @Test - public void testEclipseDefaultNegative() throws Exception { + void eclipseDefaultNegative() throws Exception { @@ -33442,7 +33442,7 @@ "33:1: " + getCheckMessage(MSG_ORDERING, "org.junit.Test"), @@ -610,14 +610,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUseContainerOrderingForStaticTrue() throws Exception { + void useContainerOrderingForStaticTrue() throws Exception { @@ -33450,7 +33450,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputImportOrderEclipseStatic1.java"), expected); } - + @Test - public void testUseContainerOrderingForStaticFalse() throws Exception { + void useContainerOrderingForStaticFalse() throws Exception { @@ -33459,7 +33459,7 @@ + getCheckMessage(MSG_ORDERING, "io.netty.handler.codec.http.HttpHeaders.Names.addDate"), @@ -627,7 +627,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUseContainerOrderingForStaticTrueCaseSensitive() throws Exception { + void useContainerOrderingForStaticTrueCaseSensitive() throws Exception { @@ -33468,7 +33468,7 @@ + getCheckMessage(MSG_ORDERING, "io.netty.handler.codec.http.HttpHeaders.Names.DATE"), @@ -637,7 +637,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUseContainerOrderingForStatic() throws Exception { + void useContainerOrderingForStatic() throws Exception { @@ -33477,7 +33477,7 @@ "23:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.Codec.HTTP.HttpHeaders.TKN.same"), @@ -647,7 +647,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportGroupsRedundantSeparatedInternally() throws Exception { + void importGroupsRedundantSeparatedInternally() throws Exception { @@ -33486,43 +33486,43 @@ }; @@ -656,7 +656,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsAbove() throws Exception { + void staticGroupsAbove() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -664,7 +664,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsBottom() throws Exception { + void staticGroupsBottom() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -672,7 +672,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsBottomSeparated() throws Exception { + void staticGroupsBottomSeparated() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -680,7 +680,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsInflow() throws Exception { + void staticGroupsInflow() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -688,7 +688,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsNegative() throws Exception { + void staticGroupsNegative() throws Exception { @@ -33531,34 +33531,34 @@ "23:1: " + getCheckMessage(MSG_ORDERING, "org.infinispan.test.TestingUtil.extract"), @@ -699,7 +699,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsTop() throws Exception { + void staticGroupsTop() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -707,7 +707,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsTopSeparated() throws Exception { + void staticGroupsTopSeparated() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -715,7 +715,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticGroupsUnordered() throws Exception { + void staticGroupsUnordered() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -723,7 +723,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOption() throws Exception { + void trimOption() throws Exception { @@ -33588,15 +33588,15 @@ @@ -24,7 +24,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class PkgImportControlTest { +final class PkgImportControlTest { - + private final PkgImportControl icRoot = new PkgImportControl("com.kazgroup.courtlink", false, MismatchStrategy.DISALLOWED); @@ -44,7 +44,7 @@ public class PkgImportControlTest { new PkgImportControl(icRootRegexpParent, "bo+t", true, MismatchStrategy.DELEGATE_TO_PARENT); - + @BeforeEach - public void setUp() { + void setUp() { @@ -33605,7 +33605,7 @@ icRoot.addImportRule(new PkgImportRule(false, false, "org.hibernate", false, false)); @@ -66,14 +66,14 @@ public class PkgImportControlTest { } - + @Test - public void testDotMetaCharacter() { + void dotMetaCharacter() { @@ -33613,7 +33613,7 @@ .that(icUncommon.locateFinest("com-kazgroup.courtlink.uncommon.regexp", "MyClass")) .isNull(); } - + @Test - public void testLocateFinest() { + void locateFinest() { @@ -33622,7 +33622,7 @@ .isEqualTo(icRoot); @@ -84,7 +84,7 @@ public class PkgImportControlTest { } - + @Test - public void testEnsureTrailingDot() { + void ensureTrailingDot() { @@ -33631,7 +33631,7 @@ .isNull(); @@ -94,7 +94,7 @@ public class PkgImportControlTest { } - + @Test - public void testCheckAccess() { + void checkAccess() { @@ -33640,7 +33640,7 @@ icCommon.checkAccess( @@ -125,14 +125,14 @@ public class PkgImportControlTest { } - + @Test - public void testUnknownPkg() { + void unknownPkg() { @@ -33648,7 +33648,7 @@ .that(icRoot.locateFinest("net.another", "MyClass")) .isNull(); } - + @Test - public void testRegExpChildLocateFinest() { + void regExpChildLocateFinest() { @@ -33657,7 +33657,7 @@ .isEqualTo(icRootRegexpChild); @@ -145,7 +145,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpChildCheckAccess() { + void regExpChildCheckAccess() { @@ -33666,7 +33666,7 @@ icCommonRegexpChild.checkAccess( @@ -204,14 +204,14 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpChildUnknownPkg() { + void regExpChildUnknownPkg() { @@ -33674,7 +33674,7 @@ .that(icRootRegexpChild.locateFinest("net.another", "MyClass")) .isNull(); } - + @Test - public void testRegExpParentInRootIsConsidered() { + void regExpParentInRootIsConsidered() { @@ -33683,7 +33683,7 @@ .isNull(); @@ -230,7 +230,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpParentInSubpackageIsConsidered() { + void regExpParentInSubpackageIsConsidered() { @@ -33692,7 +33692,7 @@ .isEqualTo(icBootRegexpParen); @@ -240,7 +240,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpParentEnsureTrailingDot() { + void regExpParentEnsureTrailingDot() { @@ -33701,7 +33701,7 @@ .isNull(); @@ -250,7 +250,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpParentAlternationInParentIsHandledCorrectly() { + void regExpParentAlternationInParentIsHandledCorrectly() { @@ -33710,7 +33710,7 @@ new PkgImportControl("com\\.foo|com\\.bar", true, MismatchStrategy.DISALLOWED); @@ -272,7 +272,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpParentAlternationInParentIfUserCaresForIt() { + void regExpParentAlternationInParentIfUserCaresForIt() { @@ -33719,7 +33719,7 @@ new PkgImportControl("(com\\.foo|com\\.bar)", true, MismatchStrategy.DISALLOWED); @@ -294,7 +294,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpParentAlternationInSubpackageIsHandledCorrectly() { + void regExpParentAlternationInSubpackageIsHandledCorrectly() { @@ -33728,7 +33728,7 @@ // the regular expression has to be adjusted to (foo|bar) @@ -313,7 +313,7 @@ public class PkgImportControlTest { } - + @Test - public void testRegExpParentUnknownPkg() { + void regExpParentUnknownPkg() { @@ -33738,12 +33738,12 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportRuleTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportRuleTest.java @@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; - + import org.junit.jupiter.api.Test; - + -public class PkgImportRuleTest { +final class PkgImportRuleTest { - + @Test - public void testPkgImportRule() { + void pkgImportRule() { @@ -33752,7 +33752,7 @@ assertWithMessage("Invalid access result") @@ -50,7 +50,7 @@ public class PkgImportRuleTest { } - + @Test - public void testPkgImportRuleExactMatch() { + void pkgImportRuleExactMatch() { @@ -33761,7 +33761,7 @@ assertWithMessage("Invalid access result") @@ -71,7 +71,7 @@ public class PkgImportRuleTest { } - + @Test - public void testPkgImportRuleRegexpSimple() { + void pkgImportRuleRegexpSimple() { @@ -33770,7 +33770,7 @@ assertWithMessage("Invalid access result") @@ -95,7 +95,7 @@ public class PkgImportRuleTest { } - + @Test - public void testPkgImportRuleExactMatchRegexpSimple() { + void pkgImportRuleExactMatchRegexpSimple() { @@ -33779,7 +33779,7 @@ assertWithMessage("Invalid access result") @@ -116,7 +116,7 @@ public class PkgImportRuleTest { } - + @Test - public void testPkgImportRuleRegexp() { + void pkgImportRuleRegexp() { @@ -33788,7 +33788,7 @@ assertWithMessage("Invalid access result") @@ -152,7 +152,7 @@ public class PkgImportRuleTest { } - + @Test - public void testPkgImportRuleNoRegexp() { + void pkgImportRuleNoRegexp() { @@ -33797,7 +33797,7 @@ assertWithMessage("Invalid access result") @@ -185,7 +185,7 @@ public class PkgImportRuleTest { } - + @Test - public void testPkgImportRuleExactMatchRegexp() { + void pkgImportRuleExactMatchRegexp() { @@ -33809,15 +33809,15 @@ @@ -34,7 +34,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class RedundantImportCheckTest extends AbstractModuleTestSupport { +final class RedundantImportCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -33826,7 +33826,7 @@ TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, TokenTypes.PACKAGE_DEF, @@ -53,7 +53,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTree1() throws Exception { + void stateIsClearedOnBeginTree1() throws Exception { @@ -33835,7 +33835,7 @@ final String inputWithoutWarnings = getPath("InputRedundantImportWithoutWarnings.java"); @@ -73,7 +73,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithChecker() throws Exception { + void withChecker() throws Exception { @@ -33844,7 +33844,7 @@ + getCheckMessage( @@ -92,7 +92,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnnamedPackage() throws Exception { + void unnamedPackage() throws Exception { @@ -33853,7 +33853,7 @@ "12:1: " + getCheckMessage(MSG_LANG, "java.lang.String"), @@ -102,7 +102,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -33862,7 +33862,7 @@ final int[] expected = { @@ -113,7 +113,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBeginTreePackage() throws Exception { + void beginTreePackage() throws Exception { @@ -33874,7 +33874,7 @@ @@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.checks.imports; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck.MSG_KEY; - + +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -33882,15 +33882,15 @@ @@ -32,7 +33,7 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; - + -public class UnusedImportsCheckTest extends AbstractModuleTestSupport { +final class UnusedImportsCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +41,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testReferencedStateIsCleared() throws Exception { + void referencedStateIsCleared() throws Exception { @@ -33899,7 +33899,7 @@ final String inputWithWarnings = getPath("InputUnusedImportsCheckClearState.java"); @@ -72,7 +73,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutProcessJavadoc() throws Exception { + void withoutProcessJavadoc() throws Exception { @@ -33908,7 +33908,7 @@ + getCheckMessage(MSG_KEY, "com.google.errorprone.annotations." + "concurrent.GuardedBy"), @@ -106,7 +107,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessJavadoc() throws Exception { + void processJavadoc() throws Exception { @@ -33917,14 +33917,14 @@ + getCheckMessage(MSG_KEY, "com.google.errorprone.annotations." + "concurrent.GuardedBy"), @@ -125,27 +126,27 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProcessJavadocWithLinkTag() throws Exception { + void processJavadocWithLinkTag() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputUnusedImportsWithValueTag.java"), expected); } - + @Test - public void testProcessJavadocWithBlockTagContainingMethodParameters() throws Exception { + void processJavadocWithBlockTagContainingMethodParameters() throws Exception { @@ -33932,7 +33932,7 @@ verifyWithInlineConfigParser( getPath("InputUnusedImportsWithBlockMethodParameters.java"), expected); } - + @Test - public void testAnnotations() throws Exception { + void annotations() throws Exception { @@ -33940,7 +33940,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputUnusedImportsAnnotations.java"), expected); } - + @Test - public void testArrayRef() throws Exception { + void arrayRef() throws Exception { @@ -33949,14 +33949,14 @@ }; @@ -153,20 +154,20 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBug() throws Exception { + void bug() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputUnusedImportsBug.java"), expected); } - + @Test - public void testNewlinesInsideTags() throws Exception { + void newlinesInsideTags() throws Exception { @@ -33964,7 +33964,7 @@ verifyWithInlineConfigParser( getPath("InputUnusedImportsWithNewlinesInsideTags.java"), expected); } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -33973,7 +33973,7 @@ final int[] expected = { @@ -194,7 +195,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -33982,7 +33982,7 @@ final int[] expected = { @@ -222,7 +223,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFileInUnnamedPackage() throws Exception { + void fileInUnnamedPackage() throws Exception { @@ -33991,7 +33991,7 @@ "13:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), @@ -232,7 +233,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportsFromJavaLang() throws Exception { + void importsFromJavaLang() throws Exception { @@ -34000,7 +34000,7 @@ "11:8: " + getCheckMessage(MSG_KEY, "java.lang.Math"), @@ -250,7 +251,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportsJavadocQualifiedName() throws Exception { + void importsJavadocQualifiedName() throws Exception { @@ -34009,7 +34009,7 @@ }; @@ -258,7 +259,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleWordPackage() throws Exception { + void singleWordPackage() throws Exception { @@ -34018,7 +34018,7 @@ }; @@ -267,7 +268,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsAndCompactCtors() throws Exception { + void recordsAndCompactCtors() throws Exception { @@ -34027,7 +34027,7 @@ "20:8: " + getCheckMessage(MSG_KEY, "javax.swing.JToggleButton"), @@ -277,7 +278,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testShadowedImports() throws Exception { + void shadowedImports() throws Exception { @@ -34036,7 +34036,7 @@ "13:8: " + getCheckMessage(MSG_KEY, "java.util.Set"), @@ -291,7 +292,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnusedImports3() throws Exception { + void unusedImports3() throws Exception { @@ -34045,7 +34045,7 @@ "13:8: " + getCheckMessage(MSG_KEY, "java.awt.event.KeyEvent"), @@ -300,14 +301,15 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTreeCollect() throws Exception { + void stateIsClearedOnBeginTreeCollect() throws Exception { @@ -34067,15 +34067,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { +final class CommentsIndentationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlockOne() throws Exception { + void commentIsAtTheEndOfBlockOne() throws Exception { @@ -34084,7 +34084,7 @@ "40:6: " + getCheckMessage(MSG_KEY_SINGLE, 42, 5, 4), @@ -54,7 +54,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlockTwo() throws Exception { + void commentIsAtTheEndOfBlockTwo() throws Exception { @@ -34093,7 +34093,7 @@ "45:27: " + getCheckMessage(MSG_KEY_SINGLE, 38, 26, 8), @@ -68,7 +68,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlockThree() throws Exception { + void commentIsAtTheEndOfBlockThree() throws Exception { @@ -34102,7 +34102,7 @@ "35:13: " + getCheckMessage(MSG_KEY_SINGLE, 32, 12, 8), @@ -84,7 +84,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlockFour() throws Exception { + void commentIsAtTheEndOfBlockFour() throws Exception { @@ -34111,7 +34111,7 @@ "28:1: " + getCheckMessage(MSG_KEY_SINGLE, 29, 0, 4), @@ -100,7 +100,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlockFive() throws Exception { + void commentIsAtTheEndOfBlockFive() throws Exception { @@ -34120,7 +34120,7 @@ "77:11: " + getCheckMessage(MSG_KEY_BLOCK, 73, 10, 8), @@ -114,7 +114,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsAtTheEndOfBlockSix() throws Exception { + void commentIsAtTheEndOfBlockSix() throws Exception { @@ -34129,7 +34129,7 @@ "33:1: " + getCheckMessage(MSG_KEY_SINGLE, 30, 0, 8), @@ -132,7 +132,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsInsideSwitchBlockOne() throws Exception { + void commentIsInsideSwitchBlockOne() throws Exception { @@ -34138,7 +34138,7 @@ "33:20: " + getCheckMessage(MSG_KEY_SINGLE, "32, 34", 19, "16, 12"), @@ -148,7 +148,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsInsideSwitchBlockTwo() throws Exception { + void commentIsInsideSwitchBlockTwo() throws Exception { @@ -34147,7 +34147,7 @@ "43:16: " + getCheckMessage(MSG_KEY_SINGLE, "42, 44", 15, "17, 12"), @@ -161,7 +161,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsInsideSwitchBlockThree() throws Exception { + void commentIsInsideSwitchBlockThree() throws Exception { @@ -34156,7 +34156,7 @@ "45:5: " + getCheckMessage(MSG_KEY_SINGLE, "44, 46", 4, "12, 12"), @@ -175,7 +175,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsInsideSwitchBlockFour() throws Exception { + void commentIsInsideSwitchBlockFour() throws Exception { @@ -34165,7 +34165,7 @@ "34:12: " + getCheckMessage(MSG_KEY_BLOCK, "33, 37", 11, "16, 12"), @@ -187,7 +187,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIsInsideEmptyBlock() throws Exception { + void commentIsInsideEmptyBlock() throws Exception { @@ -34174,7 +34174,7 @@ "17:24: " + getCheckMessage(MSG_KEY_BLOCK, 19, 23, 31), @@ -202,7 +202,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSurroundingCodeOne() throws Exception { + void surroundingCodeOne() throws Exception { @@ -34183,7 +34183,7 @@ "31:17: " + getCheckMessage(MSG_KEY_BLOCK, 32, 16, 12), @@ -218,7 +218,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSurroundingCodeTwo() throws Exception { + void surroundingCodeTwo() throws Exception { @@ -34192,7 +34192,7 @@ "42:13: " + getCheckMessage(MSG_KEY_BLOCK, 43, 12, 8), @@ -230,14 +230,14 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoNpeWhenBlockCommentEndsClassFile() throws Exception { + void noNpeWhenBlockCommentEndsClassFile() throws Exception { @@ -34200,7 +34200,7 @@ final String testInputFile = "InputCommentsIndentationNoNpe.java"; verifyWithInlineConfigParser(getPath(testInputFile), expected); } - + @Test - public void testCheckOnlySingleLineComments() throws Exception { + void checkOnlySingleLineComments() throws Exception { @@ -34209,7 +34209,7 @@ "57:28: " + getCheckMessage(MSG_KEY_SINGLE, 60, 27, 36), @@ -250,7 +250,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckOnlyBlockCommentsOne() throws Exception { + void checkOnlyBlockCommentsOne() throws Exception { @@ -34218,7 +34218,7 @@ "32:17: " + getCheckMessage(MSG_KEY_BLOCK, 34, 16, 12), @@ -262,7 +262,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckOnlyBlockCommentsTwo() throws Exception { + void checkOnlyBlockCommentsTwo() throws Exception { @@ -34227,7 +34227,7 @@ "46:5: " + getCheckMessage(MSG_KEY_BLOCK, 47, 4, 8), @@ -273,7 +273,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitToken() { + void visitToken() { @@ -34236,7 +34236,7 @@ methodDef.setType(TokenTypes.METHOD_DEF); @@ -290,7 +290,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadoc() throws Exception { + void javadoc() throws Exception { @@ -34245,7 +34245,7 @@ "16:1: " + getCheckMessage(MSG_KEY_BLOCK, 17, 0, 4), @@ -302,7 +302,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiblockStructuresOne() throws Exception { + void multiblockStructuresOne() throws Exception { @@ -34254,7 +34254,7 @@ "25:17: " + getCheckMessage(MSG_KEY_SINGLE, "24, 26", 16, "12, 8"), @@ -325,7 +325,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultiblockStructuresTwo() throws Exception { + void multiblockStructuresTwo() throws Exception { @@ -34263,7 +34263,7 @@ "26:17: " + getCheckMessage(MSG_KEY_SINGLE, "25, 27", 16, "12, 8"), @@ -336,7 +336,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentsAfterAnnotation() throws Exception { + void commentsAfterAnnotation() throws Exception { @@ -34272,7 +34272,7 @@ "25:9: " + getCheckMessage(MSG_KEY_SINGLE, 26, 8, 4), @@ -349,7 +349,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentsInSameMethodCallWithSameIndent() throws Exception { + void commentsInSameMethodCallWithSameIndent() throws Exception { @@ -34281,7 +34281,7 @@ "30:11: " + getCheckMessage(MSG_KEY_SINGLE, 31, 10, 4), @@ -359,7 +359,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentIndentationWithEmoji() throws Exception { + void commentIndentationWithEmoji() throws Exception { @@ -34290,7 +34290,7 @@ "25:13: " + getCheckMessage(MSG_KEY_SINGLE, 24, 12, 8), @@ -376,7 +376,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentsBlockCommentBeforePackage() throws Exception { + void commentsBlockCommentBeforePackage() throws Exception { @@ -34299,7 +34299,7 @@ }; @@ -385,7 +385,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentsAfterRecordsAndCompactCtors() throws Exception { + void commentsAfterRecordsAndCompactCtors() throws Exception { @@ -34308,7 +34308,7 @@ "28:1: " + getCheckMessage(MSG_KEY_SINGLE, 29, 0, 4), @@ -398,7 +398,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentsAtTheEndOfMethodCall() throws Exception { + void commentsAtTheEndOfMethodCall() throws Exception { @@ -34318,9 +34318,9 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java @@ -19,11 +19,13 @@ - + package com.puppycrawl.tools.checkstyle.checks.indentation; - + +import static com.google.common.base.Preconditions.checkState; import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_CHILD_ERROR; @@ -34328,7 +34328,7 @@ import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_ERROR; import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_ERROR_MULTI; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.Checker; @@ -34,7 +36,6 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; @@ -34341,11 +34341,11 @@ import java.util.ArrayList; @@ -46,7 +47,7 @@ import java.util.regex.Pattern; import org.junit.jupiter.api.Test; - + /** Unit test for IndentationCheck. */ -public class IndentationCheckTest extends AbstractModuleTestSupport { +final class IndentationCheckTest extends AbstractModuleTestSupport { - + private static final Pattern LINE_WITH_COMMENT_REGEX = Pattern.compile( @@ -57,8 +58,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { @@ -34361,7 +34361,7 @@ @@ -66,26 +66,24 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { final IndentComment warn = new IndentComment(match, lineNumber); final int actualIndent = getLineStart(line, tabWidth); - + - if (actualIndent != warn.getIndent()) { - throw new IllegalStateException( - String.format( @@ -34383,7 +34383,7 @@ + lineNumber, + warn.getIndent(), + actualIndent)); - + - if (!isCommentConsistent(warn)) { - throw new IllegalStateException( - String.format( @@ -34399,12 +34399,12 @@ + "File \"%1$s\" has inconsistent comment on line %2$d", + aFileName, + lineNumber)); - + if (warn.isWarning()) { result.add(warn); @@ -169,7 +167,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -34413,7 +34413,7 @@ final HandlerFactory handlerFactory = new HandlerFactory(); @@ -182,7 +180,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -34422,16 +34422,16 @@ final HandlerFactory handlerFactory = new HandlerFactory(); @@ -195,7 +193,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThrowsIndentProperty() { + void throwsIndentProperty() { final IndentationCheck indentationCheck = new IndentationCheck(); - + indentationCheck.setThrowsIndent(1); @@ -206,7 +204,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrictCondition() throws Exception { + void strictCondition() throws Exception { @@ -34440,7 +34440,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -225,7 +223,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void forbidOldStyle() throws Exception { + void forbidOldStyle() throws Exception { @@ -34449,7 +34449,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -243,7 +241,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testZeroCaseLevel() throws Exception { + void zeroCaseLevel() throws Exception { @@ -34458,7 +34458,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -258,7 +256,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAndroidStyle() throws Exception { + void androidStyle() throws Exception { @@ -34467,637 +34467,637 @@ checkConfig.addProperty("basicOffset", "4"); @@ -283,7 +281,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodCallLineWrap() throws Exception { + void methodCallLineWrap() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -303,7 +301,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDifficultAnnotations() throws Exception { + void difficultAnnotations() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -329,7 +327,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationClosingParenthesisEndsInSameIndentationAsOpening() throws Exception { + void annotationClosingParenthesisEndsInSameIndentationAsOpening() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "4"); @@ -352,7 +350,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnonClassesFromGuava() throws Exception { + void anonClassesFromGuava() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -368,7 +366,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotations() throws Exception { + void annotations() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -384,7 +382,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCorrectIfAndParameters() throws Exception { + void correctIfAndParameters() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -407,7 +405,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnonymousClasses() throws Exception { + void anonymousClasses() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -423,7 +421,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrays() throws Exception { + void arrays() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -439,7 +437,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLabels() throws Exception { + void labels() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -455,7 +453,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassesAndMethods() throws Exception { + void classesAndMethods() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -471,7 +469,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCtorCall() throws Exception { + void ctorCall() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "2"); @@ -504,7 +502,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMembers() throws Exception { + void members() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -524,7 +522,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationArrayInit() throws Exception { + void annotationArrayInit() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "6"); @@ -560,7 +558,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationArrayInitTwo() throws Exception { + void annotationArrayInitTwo() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "0"); @@ -588,7 +586,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationArrayInitWithEmoji() throws Exception { + void annotationArrayInitWithEmoji() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "0"); @@ -626,7 +624,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOddAnnotations() throws Exception { + void oddAnnotations() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "3"); @@ -648,7 +646,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationOddStyles() throws Exception { + void annotationOddStyles() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("tabWidth", "8"); @@ -661,7 +659,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testZeroAnnotationArrayInit() throws Exception { + void zeroAnnotationArrayInit() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "0"); @@ -683,7 +681,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationArrayInitGoodCase() throws Exception { + void annotationArrayInitGoodCase() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -700,7 +698,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationArrayInitGoodCaseTwo() throws Exception { + void annotationArrayInitGoodCaseTwo() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -717,7 +715,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidLabel() throws Exception { + void invalidLabel() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -740,7 +738,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidLabelWithWhileLoop() throws Exception { + void invalidLabelWithWhileLoop() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -760,7 +758,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidLabel() throws Exception { + void validLabel() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -776,7 +774,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidIfWithChecker() throws Exception { + void validIfWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -795,7 +793,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidDotWithChecker() throws Exception { + void validDotWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -812,7 +810,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidMethodWithChecker() throws Exception { + void validMethodWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -832,7 +830,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidMethodWithChecker() throws Exception { + void invalidMethodWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -885,7 +883,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAlternativeGoogleStyleSwitchCaseAndEnums() throws Exception { + void alternativeGoogleStyleSwitchCaseAndEnums() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -908,7 +906,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidSwitchWithChecker() throws Exception { + void invalidSwitchWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -955,7 +953,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIfElseWithNoCurly() throws Exception { + void ifElseWithNoCurly() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -979,7 +977,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhileWithNoCurly() throws Exception { + void whileWithNoCurly() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1002,7 +1000,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForWithNoCurly() throws Exception { + void forWithNoCurly() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1026,7 +1024,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoWhileWithoutCurly() throws Exception { + void doWhileWithoutCurly() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1047,7 +1045,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidSwitchWithChecker() throws Exception { + void validSwitchWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1064,7 +1062,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewKeyword() throws Exception { + void newKeyword() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "4"); @@ -1077,7 +1075,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewKeyword2() throws Exception { + void newKeyword2() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "4"); @@ -1090,7 +1088,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidNewKeywordWithForceStrictCondition() throws Exception { + void validNewKeywordWithForceStrictCondition() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "4"); @@ -1103,7 +1101,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidNewKeywordWithForceStrictCondition() throws Exception { + void invalidNewKeywordWithForceStrictCondition() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "4"); @@ -1131,7 +1129,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidArrayInitDefaultIndentWithChecker() throws Exception { + void validArrayInitDefaultIndentWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1148,7 +1146,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidArrayInitWithChecker() throws Exception { + void validArrayInitWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "8"); @@ -1165,7 +1163,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidArrayInitTwoDimensional() throws Exception { + void validArrayInitTwoDimensional() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -1182,7 +1180,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidArrayInitTwoDimensional() throws Exception { + void invalidArrayInitTwoDimensional() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -1212,7 +1210,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidArrayInit() throws Exception { + void validArrayInit() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -1229,7 +1227,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidArrayInitWithChecker() throws Exception { + void invalidArrayInitWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1291,7 +1289,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayInitWithEmoji() throws Exception { + void arrayInitWithEmoji() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -1315,7 +1313,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testChainedMethodCalling() throws Exception { + void chainedMethodCalling() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -1337,7 +1335,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidArrayInitWithTrueStrictCondition() throws Exception { + void invalidArrayInitWithTrueStrictCondition() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1399,7 +1397,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidTryWithChecker() throws Exception { + void validTryWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1416,7 +1414,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidTryWithChecker() throws Exception { + void invalidTryWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1462,7 +1460,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidClassDefWithChecker() throws Exception { + void invalidClassDefWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1514,7 +1512,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidBlockWithChecker() throws Exception { + void invalidBlockWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1578,7 +1576,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidIfWithChecker() throws Exception { + void invalidIfWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1670,7 +1668,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidWhileWithChecker() throws Exception { + void invalidWhileWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1716,7 +1714,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidInvalidAnonymousClass() throws Exception { + void invalidInvalidAnonymousClass() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1733,7 +1731,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidForWithChecker() throws Exception { + void invalidForWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1781,7 +1779,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidForWithChecker() throws Exception { + void validForWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1798,7 +1796,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidDoWhileWithChecker() throws Exception { + void validDoWhileWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1815,7 +1813,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidDoWhileWithChecker() throws Exception { + void invalidDoWhileWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1850,7 +1848,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidBlockWithChecker() throws Exception { + void validBlockWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1867,7 +1865,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidWhileWithChecker() throws Exception { + void validWhileWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1884,7 +1882,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidClassDefWithChecker() throws Exception { + void validClassDefWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1904,7 +1902,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidInterfaceDefWithChecker() throws Exception { + void validInterfaceDefWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1921,7 +1919,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidCommaWithChecker() throws Exception { + void validCommaWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1938,7 +1936,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTabs() throws Exception { + void tabs() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1956,7 +1954,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationLevel() throws Exception { + void indentationLevel() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1974,7 +1972,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThrowsIndentationLevel() throws Exception { + void throwsIndentationLevel() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -1990,7 +1988,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThrowsIndentationLevel2() throws Exception { + void throwsIndentationLevel2() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("basicOffset", "1"); @@ -2017,7 +2015,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCaseLevel() throws Exception { + void caseLevel() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2035,7 +2033,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBraceAdjustment() throws Exception { + void braceAdjustment() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2057,7 +2055,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidAssignWithChecker() throws Exception { + void invalidAssignWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2078,7 +2076,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidImportIndent() throws Exception { + void invalidImportIndent() throws Exception { @@ -35106,43 +35106,43 @@ checkConfig.addProperty("tabWidth", "4"); @@ -2090,7 +2088,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testValidAssignWithChecker() throws Exception { + void validAssignWithChecker() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2106,7 +2104,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test15Extensions() throws Exception { + void test15Extensions() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2122,7 +2120,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryResources() throws Exception { + void tryResources() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2138,7 +2136,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCustom() throws Exception { + void switchCustom() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "4"); @@ -2154,7 +2152,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSynchronizedStatement() throws Exception { + void synchronizedStatement() throws Exception { @@ -35151,7 +35151,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2172,7 +2170,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSynchronizedMethod() throws Exception { + void synchronizedMethod() throws Exception { @@ -35160,7 +35160,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2187,7 +2185,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnonymousClassInMethod() throws Exception { + void anonymousClassInMethod() throws Exception { @@ -35169,7 +35169,7 @@ checkConfig.addProperty("basicOffset", "2"); @@ -2208,7 +2206,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnonymousClassInMethodWithCurlyOnNewLine() throws Exception { + void anonymousClassInMethodWithCurlyOnNewLine() throws Exception { @@ -35178,7 +35178,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2233,7 +2231,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationDefinition() throws Exception { + void annotationDefinition() throws Exception { @@ -35187,7 +35187,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -2241,7 +2239,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageDeclaration() throws Exception { + void packageDeclaration() throws Exception { @@ -35196,7 +35196,7 @@ final String[] expected = { @@ -2251,7 +2249,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageDeclaration2() throws Exception { + void packageDeclaration2() throws Exception { @@ -35205,7 +35205,7 @@ final String[] expected = { @@ -2261,7 +2259,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageDeclaration3() throws Exception { + void packageDeclaration3() throws Exception { @@ -35214,7 +35214,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -2269,7 +2267,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageDeclaration4() throws Exception { + void packageDeclaration4() throws Exception { @@ -35223,7 +35223,7 @@ final String[] expected = { @@ -2280,7 +2278,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambda1() throws Exception { + void lambda1() throws Exception { @@ -35232,7 +35232,7 @@ checkConfig.addProperty("basicOffset", "2"); @@ -2300,7 +2298,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambda2() throws Exception { + void lambda2() throws Exception { @@ -35241,7 +35241,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2310,7 +2308,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambda3() throws Exception { + void lambda3() throws Exception { @@ -35250,7 +35250,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2327,7 +2325,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambda4() throws Exception { + void lambda4() throws Exception { @@ -35259,7 +35259,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2337,7 +2335,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambda5() throws Exception { + void lambda5() throws Exception { @@ -35268,7 +35268,7 @@ checkConfig.addProperty("basicOffset", "3"); @@ -2348,7 +2346,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaFalseForceStrictCondition() throws Exception { + void lambdaFalseForceStrictCondition() throws Exception { @@ -35277,7 +35277,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2367,7 +2365,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaTrueForceStrictCondition() throws Exception { + void lambdaTrueForceStrictCondition() throws Exception { @@ -35286,7 +35286,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2396,7 +2394,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaOddConditions() throws Exception { + void lambdaOddConditions() throws Exception { @@ -35295,7 +35295,7 @@ checkConfig.addProperty("basicOffset", "3"); @@ -2409,7 +2407,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSeparatedStatements() throws Exception { + void separatedStatements() throws Exception { @@ -35304,7 +35304,7 @@ final String fileName = getPath("InputIndentationSeparatedStatements.java"); @@ -2418,7 +2416,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSeparatedLineWithJustSpaces() throws Exception { + void separatedLineWithJustSpaces() throws Exception { @@ -35313,7 +35313,7 @@ final String fileName = getPath("InputIndentationSeparatedStatementWithSpaces.java"); @@ -2427,7 +2425,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTwoStatementsPerLine() throws Exception { + void twoStatementsPerLine() throws Exception { @@ -35322,7 +35322,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2437,7 +2435,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodChaining() throws Exception { + void methodChaining() throws Exception { @@ -35331,7 +35331,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2447,7 +2445,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleAnnotationsWithWrappedLines() throws Exception { + void multipleAnnotationsWithWrappedLines() throws Exception { @@ -35340,7 +35340,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2459,7 +2457,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodPrecedeByAnnotationsWithParameterOnSeparateLine() throws Exception { + void methodPrecedeByAnnotationsWithParameterOnSeparateLine() throws Exception { @@ -35349,7 +35349,7 @@ checkConfig.addProperty("basicOffset", "2"); @@ -2475,7 +2473,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationIncorrect() throws Exception { + void annotationIncorrect() throws Exception { @@ -35358,7 +35358,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2491,7 +2489,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputAnnotationScopeIndentationCheck() throws Exception { + void inputAnnotationScopeIndentationCheck() throws Exception { @@ -35367,7 +35367,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2505,7 +2503,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInputAnnotationDefIndentationCheck() throws Exception { + void inputAnnotationDefIndentationCheck() throws Exception { @@ -35376,7 +35376,7 @@ checkConfig.addProperty("arrayInitIndent", "4"); @@ -2550,7 +2548,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryResourcesStrict() throws Exception { + void tryResourcesStrict() throws Exception { @@ -35385,7 +35385,7 @@ checkConfig.addProperty("forceStrictCondition", "true"); @@ -2585,7 +2583,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryResourcesNotStrict() throws Exception { + void tryResourcesNotStrict() throws Exception { @@ -35403,7 +35403,7 @@ getCheckMessage(MSG_ERROR, arguments), @@ -2651,7 +2649,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyArray() throws Exception { + void emptyArray() throws Exception { @@ -35412,7 +35412,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -2659,7 +2657,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewHandler() throws Exception { + void newHandler() throws Exception { @@ -35421,7 +35421,7 @@ final String[] expected = { @@ -2673,7 +2671,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryHandler() throws Exception { + void tryHandler() throws Exception { @@ -35430,7 +35430,7 @@ checkConfig.addProperty("braceAdjustment", "0"); @@ -2684,7 +2682,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryHandler2() throws Exception { + void tryHandler2() throws Exception { @@ -35439,16 +35439,16 @@ checkConfig.addProperty("braceAdjustment", "0"); @@ -2698,7 +2696,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testChainedMethodWithBracketOnNewLine() throws Exception { + void chainedMethodWithBracketOnNewLine() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); - + checkConfig.addProperty("arrayInitIndent", "2"); @@ -2722,7 +2720,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationSwitchExpression() throws Exception { + void indentationSwitchExpression() throws Exception { @@ -35457,7 +35457,7 @@ final String[] expected = { @@ -2746,7 +2744,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationYieldStatement() throws Exception { + void indentationYieldStatement() throws Exception { @@ -35466,7 +35466,7 @@ final String[] expected = { @@ -2762,7 +2760,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationSwitchExpressionCorrect() throws Exception { + void indentationSwitchExpressionCorrect() throws Exception { @@ -35475,7 +35475,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -2773,7 +2771,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationSwitchExpressionDeclaration() throws Exception { + void indentationSwitchExpressionDeclaration() throws Exception { @@ -35484,7 +35484,7 @@ checkConfig.addProperty("caseIndent", "4"); @@ -2795,7 +2793,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationSwitchExpressionDeclarationLeftCurlyNewLine() throws Exception { + void indentationSwitchExpressionDeclarationLeftCurlyNewLine() throws Exception { @@ -35493,7 +35493,7 @@ final String[] expected = { @@ -2811,7 +2809,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationRecords() throws Exception { + void indentationRecords() throws Exception { @@ -35502,7 +35502,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2828,7 +2826,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationRecordsAndCompactCtors() throws Exception { + void indentationRecordsAndCompactCtors() throws Exception { @@ -35511,7 +35511,7 @@ final String[] expected = { @@ -2845,7 +2843,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationSwitchExpressionNewLine() throws Exception { + void indentationSwitchExpressionNewLine() throws Exception { @@ -35520,7 +35520,7 @@ final String[] expected = { @@ -2860,7 +2858,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationMethodParenthesisOnNewLine() throws Exception { + void indentationMethodParenthesisOnNewLine() throws Exception { @@ -35529,7 +35529,7 @@ final String[] expected = { @@ -2872,7 +2870,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationMethodParenthesisOnNewLine1() throws Exception { + void indentationMethodParenthesisOnNewLine1() throws Exception { @@ -35538,7 +35538,7 @@ final String[] expected = { @@ -2885,7 +2883,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationLineWrappedRecordDeclaration() throws Exception { + void indentationLineWrappedRecordDeclaration() throws Exception { @@ -35547,7 +35547,7 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2924,7 +2922,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationAnnotationFieldDefinition() throws Exception { + void indentationAnnotationFieldDefinition() throws Exception { @@ -35556,22 +35556,22 @@ checkConfig.addProperty("basicOffset", "4"); @@ -2944,7 +2942,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationLongConcatenatedString() throws Exception { + void indentationLongConcatenatedString() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); checkConfig.addProperty("tabWidth", "4"); - + @@ -2954,7 +2952,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIndentationLineBreakVariableDeclaration() throws Exception { + void indentationLineBreakVariableDeclaration() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); 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 @@ -35580,18 +35580,18 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.MSG_SUMMARY_FIRST_SENTENCE; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.assertj.core.api.Assertions.assertThatCode; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -44,7 +44,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.io.TempDir; - + @ExtendWith(SystemErrGuard.class) -public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { +final class AbstractJavadocCheckTest extends AbstractModuleTestSupport { - + @TempDir public File temporaryFolder; - + @@ -63,12 +63,12 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { * @param systemErr wrapper for {@code System.err} */ @@ -35600,7 +35600,7 @@ + void setUp(@SysErr Capturable systemErr) { systemErr.captureMuted(); } - + @Test - public void testJavadocTagsWithoutArgs() throws Exception { + void javadocTagsWithoutArgs() throws Exception { @@ -35609,7 +35609,7 @@ + getCheckMessage( @@ -109,7 +109,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNumberFormatException() throws Exception { + void numberFormatException() throws Exception { @@ -35618,14 +35618,14 @@ + getCheckMessage( @@ -123,13 +123,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomTag() throws Exception { + void customTag() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocCustomTag.java"), expected); } - + @Test - public void testParsingErrors(@SysErr Capturable systemErr) throws Exception { + void parsingErrors(@SysErr Capturable systemErr) throws Exception { @@ -35634,21 +35634,21 @@ "16: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), @@ -139,19 +139,19 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithMultipleChecksOne() throws Exception { + void withMultipleChecksOne() throws Exception { verifyWithInlineConfigParser( getPath("InputAbstractJavadocCorrectParagraphOne.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testWithMultipleChecksTwo() throws Exception { + void withMultipleChecksTwo() throws Exception { verifyWithInlineConfigParser( getPath("InputAbstractJavadocCorrectParagraphTwo.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testAntlrError(@SysErr Capturable systemErr) throws Exception { + void antlrError(@SysErr Capturable systemErr) throws Exception { @@ -35657,7 +35657,7 @@ + getCheckMessage( @@ -163,8 +163,8 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckReuseAfterParseErrorWithFollowingAntlrErrorInTwoFiles( - @SysErr Capturable systemErr) throws Exception { @@ -35668,7 +35668,7 @@ "16: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"), @@ -184,7 +184,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckReuseAfterParseErrorWithFollowingAntlrErrorInSingleFile() throws Exception { + void checkReuseAfterParseErrorWithFollowingAntlrErrorInSingleFile() throws Exception { @@ -35677,7 +35677,7 @@ "16: " @@ -196,7 +196,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCache() throws Exception { + void cache() throws Exception { @@ -35686,7 +35686,7 @@ }; @@ -207,7 +207,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionOne() throws Exception { + void positionOne() throws Exception { @@ -35695,7 +35695,7 @@ verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionOne.java"), expected); @@ -219,7 +219,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionTwo() throws Exception { + void positionTwo() throws Exception { @@ -35704,7 +35704,7 @@ verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionTwo.java"), expected); @@ -231,7 +231,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionThree() throws Exception { + void positionThree() throws Exception { @@ -35713,7 +35713,7 @@ verifyWithInlineConfigParser(getPath("InputAbstractJavadocPositionThree.java"), expected); @@ -243,7 +243,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionWithSinglelineCommentsOne() throws Exception { + void positionWithSinglelineCommentsOne() throws Exception { @@ -35722,7 +35722,7 @@ verifyWithInlineConfigParser( @@ -256,7 +256,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionWithSinglelineCommentsTwo() throws Exception { + void positionWithSinglelineCommentsTwo() throws Exception { @@ -35731,7 +35731,7 @@ verifyWithInlineConfigParser( @@ -269,7 +269,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionWithSinglelineCommentsThree() throws Exception { + void positionWithSinglelineCommentsThree() throws Exception { @@ -35740,7 +35740,7 @@ verifyWithInlineConfigParser( @@ -282,7 +282,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPositionOnlyComments() throws Exception { + void positionOnlyComments() throws Exception { @@ -35749,7 +35749,7 @@ verifyWithInlineConfigParser( @@ -293,7 +293,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokens() { + void tokens() { @@ -35758,7 +35758,7 @@ new AbstractJavadocCheck() { @@ -329,7 +329,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokensFail() { + void tokensFail() { @@ -35772,7 +35772,7 @@ - assertDoesNotThrow(check::init); + assertThatCode(check::init).doesNotThrowAnyException(); } - + @Test - public void testAcceptableTokensFail() throws Exception { + void acceptableTokensFail() throws Exception { @@ -35781,14 +35781,14 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -374,13 +374,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptableTokensPass() throws Exception { + void acceptableTokensPass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAbstractJavadocTokensPass.java"), expected); } - + @Test - public void testRequiredTokenIsNotInDefaultTokens() throws Exception { + void requiredTokenIsNotInDefaultTokens() throws Exception { @@ -35797,7 +35797,7 @@ final String pathToEmptyFile = File.createTempFile("empty", ".java", temporaryFolder).getPath(); @@ -402,7 +402,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitLeaveTokenOne() throws Exception { + void visitLeaveTokenOne() throws Exception { @@ -35806,7 +35806,7 @@ verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenOne.java"), expected); @@ -415,7 +415,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitLeaveTokenTwo() throws Exception { + void visitLeaveTokenTwo() throws Exception { @@ -35815,7 +35815,7 @@ verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenTwo.java"), expected); @@ -428,7 +428,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitLeaveTokenThree() throws Exception { + void visitLeaveTokenThree() throws Exception { @@ -35824,7 +35824,7 @@ verifyWithInlineConfigParser(getPath("InputAbstractJavadocLeaveTokenThree.java"), expected); @@ -441,7 +441,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoWsBeforeDescriptionInJavadocTags() throws Exception { + void noWsBeforeDescriptionInJavadocTags() throws Exception { @@ -35833,7 +35833,7 @@ + getCheckMessage( @@ -491,7 +491,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongSingletonTagInJavadoc() throws Exception { + void wrongSingletonTagInJavadoc() throws Exception { @@ -35842,7 +35842,7 @@ "17: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "keygen"), @@ -504,7 +504,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonTightHtmlTagIntolerantCheckOne() throws Exception { + void nonTightHtmlTagIntolerantCheckOne() throws Exception { @@ -35851,7 +35851,7 @@ "19: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), @@ -518,7 +518,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonTightHtmlTagIntolerantCheckTwo() throws Exception { + void nonTightHtmlTagIntolerantCheckTwo() throws Exception { @@ -35860,7 +35860,7 @@ "19: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), @@ -530,21 +530,21 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonTightHtmlTagIntolerantCheckReportingNoViolationOne() throws Exception { + void nonTightHtmlTagIntolerantCheckReportingNoViolationOne() throws Exception { @@ -35868,7 +35868,7 @@ verifyWithInlineConfigParser( getPath("InputAbstractJavadocNonTightHtmlTagsNoViolationOne.java"), expected); } - + @Test - public void testNonTightHtmlTagIntolerantCheckReportingNoViolationTwo() throws Exception { + void nonTightHtmlTagIntolerantCheckReportingNoViolationTwo() throws Exception { @@ -35876,7 +35876,7 @@ verifyWithInlineConfigParser( getPath("InputAbstractJavadocNonTightHtmlTagsNoViolationTwo.java"), expected); } - + @Test - public void testNonTightHtmlTagIntolerantCheckVisitCountOne() throws Exception { + void nonTightHtmlTagIntolerantCheckVisitCountOne() throws Exception { @@ -35885,7 +35885,7 @@ "20: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), @@ -560,7 +560,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonTightHtmlTagIntolerantCheckVisitCountTwo() throws Exception { + void nonTightHtmlTagIntolerantCheckVisitCountTwo() throws Exception { @@ -35894,7 +35894,7 @@ "20: " + getCheckMessage(MSG_UNCLOSED_HTML_TAG, "p"), @@ -577,7 +577,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitCountForCheckAcceptingJavadocWithNonTightHtml() throws Exception { + void visitCountForCheckAcceptingJavadocWithNonTightHtml() throws Exception { @@ -35903,7 +35903,7 @@ "12:4: " + getCheckMessage(NonTightHtmlTagCheck.MSG_KEY, "P_TAG_START"), @@ -619,7 +619,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitCountForCheckAcceptingJavadocWithNonTightHtml3() throws Exception { + void visitCountForCheckAcceptingJavadocWithNonTightHtml3() throws Exception { @@ -35915,15 +35915,15 @@ @@ -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 AtclauseOrderCheckTest extends AbstractModuleTestSupport { +final class AtclauseOrderCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -35932,7 +35932,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -44,7 +44,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -35941,39 +35941,39 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -53,35 +53,35 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCorrect1() throws Exception { + void correct1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAtclauseOrderCorrect1.java"), expected); } - + @Test - public void testCorrect2() throws Exception { + void correct2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAtclauseOrderCorrect2.java"), expected); } - + @Test - public void testCorrect3() throws Exception { + void correct3() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAtclauseOrderCorrect3.java"), expected); } - + @Test - public void testCorrect4() throws Exception { + void correct4() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAtclauseOrderCorrect4.java"), expected); } - + @Test - public void testIncorrect1() throws Exception { + void incorrect1() throws Exception { @@ -35982,7 +35982,7 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -105,7 +105,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrect2() throws Exception { + void incorrect2() throws Exception { @@ -35991,7 +35991,7 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -129,7 +129,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrect3() throws Exception { + void incorrect3() throws Exception { @@ -36000,7 +36000,7 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -147,7 +147,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrect4() throws Exception { + void incorrect4() throws Exception { @@ -36009,15 +36009,15 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -172,14 +172,14 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectCustom1() throws Exception { + void incorrectCustom1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAtclauseOrderIncorrectCustom1.java"), expected); } - + @Test - public void testIncorrectCustom2() throws Exception { + void incorrectCustom2() throws Exception { @@ -36026,7 +36026,7 @@ + " @deprecated, @see, @serial, @serialField, @serialData, @author]"; @@ -190,7 +190,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectCustom3() throws Exception { + void incorrectCustom3() throws Exception { @@ -36035,7 +36035,7 @@ + " @deprecated, @see, @serial, @serialField, @serialData, @author]"; @@ -201,7 +201,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectCustom4() throws Exception { + void incorrectCustom4() throws Exception { @@ -36044,15 +36044,15 @@ + " @deprecated, @see, @serial, @serialField, @serialData, @author]"; @@ -212,14 +212,14 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfo() throws Exception { + void packageInfo() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("package-info.java"), expected); } - + @Test - public void testAtclauseOrderRecords() throws Exception { + void atclauseOrderRecords() throws Exception { @@ -36061,7 +36061,7 @@ + " @see, @since, @serial, @serialField, @serialData, @deprecated]"; @@ -238,7 +238,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodReturningArrayType() throws Exception { + void methodReturningArrayType() throws Exception { @@ -36070,43 +36070,43 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -252,7 +252,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAtclauseOrderLotsOfRecords1() throws Exception { + void atclauseOrderLotsOfRecords1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -260,7 +260,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAtclauseOrderLotsOfRecords2() throws Exception { + void atclauseOrderLotsOfRecords2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -268,7 +268,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAtclauseOrderLotsOfRecords3() throws Exception { + void atclauseOrderLotsOfRecords3() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -276,7 +276,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAtclauseOrderLotsOfRecords4() throws Exception { + void atclauseOrderLotsOfRecords4() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -284,7 +284,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAtclause() throws Exception { + void atclause() throws Exception { @@ -36115,7 +36115,7 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -317,7 +317,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNewArrayDeclaratorStructure() throws Exception { + void newArrayDeclaratorStructure() throws Exception { @@ -36124,7 +36124,7 @@ + " @since, @serial, @serialField, @serialData, @deprecated]"; @@ -335,7 +335,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrim() throws Exception { + void trim() throws Exception { @@ -36136,15 +36136,15 @@ @@ -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 InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { +final class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -36153,7 +36153,7 @@ }; @@ -45,7 +45,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -36162,7 +36162,7 @@ }; @@ -56,7 +56,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -36171,7 +36171,7 @@ "10:1: " + getCheckMessage(MSG_KEY), @@ -89,7 +89,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfo() throws Exception { + void packageInfo() throws Exception { @@ -36180,7 +36180,7 @@ }; @@ -97,7 +97,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfoComment() throws Exception { + void packageInfoComment() throws Exception { @@ -36192,15 +36192,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport { +final class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -36209,12 +36209,12 @@ JavadocTokenTypes.TEXT, @@ -46,7 +46,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocBlockTagLocationCorrect.java"), expected); @@ -61,7 +61,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport * @throws Exception if exception occurs during verification process. @@ -36223,11 +36223,11 @@ - public void testMultilineCodeBlock() throws Exception { + void multilineCodeBlock() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -69,7 +69,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport } - + @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { @@ -36236,7 +36236,7 @@ "16: " + getCheckMessage(MSG_BLOCK_TAG_LOCATION, "since"), @@ -83,7 +83,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport } - + @Test - public void testCustomTags() throws Exception { + void customTags() throws Exception { @@ -36248,15 +36248,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { +final class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -36265,7 +36265,7 @@ assertWithMessage("Acceptable tokens are invalid") @@ -45,7 +45,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetDefaultTokens() { + void getDefaultTokens() { @@ -36274,7 +36274,7 @@ assertWithMessage("Default tokens are invalid") @@ -54,7 +54,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -36283,7 +36283,7 @@ "21:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_SECOND_LINE), @@ -63,7 +63,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFirstLine() throws Exception { + void firstLine() throws Exception { @@ -36292,7 +36292,7 @@ "21:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), @@ -72,7 +72,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackage() throws Exception { + void testPackage() throws Exception { @@ -36301,7 +36301,7 @@ }; @@ -80,7 +80,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterface() throws Exception { + void testInterface() throws Exception { @@ -36310,7 +36310,7 @@ }; @@ -88,14 +88,14 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOptionalSpacesAndAsterisks() throws Exception { + void optionalSpacesAndAsterisks() throws Exception { @@ -36318,7 +36318,7 @@ verifyWithInlineConfigParser( getPath("InputJavadocContentLocationTrailingSpace.java"), expected); } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -36327,7 +36327,7 @@ "21:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), @@ -105,7 +105,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault2() throws Exception { + void default2() throws Exception { @@ -36339,38 +36339,38 @@ @@ -34,7 +34,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import org.junit.jupiter.api.Test; - + -public class JavadocMethodCheckTest extends AbstractModuleTestSupport { +final class JavadocMethodCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final JavadocMethodCheck javadocMethodCheck = new JavadocMethodCheck(); - + final int[] actual = javadocMethodCheck.getAcceptableTokens(); @@ -61,19 +61,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void extendAnnotationTest() throws Exception { + void extendAnnotationTest() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodExtendAnnotation.java"), expected); } - + @Test - public void allowedAnnotationsTest() throws Exception { + void allowedAnnotationsTest() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodAllowedAnnotations.java"), expected); } - + @Test - public void testThrowsDetection() throws Exception { + void throwsDetection() throws Exception { @@ -36379,7 +36379,7 @@ "37:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "UnsupportedOperationException"), @@ -94,7 +94,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExtraThrows() throws Exception { + void extraThrows() throws Exception { @@ -36388,7 +36388,7 @@ "70:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), @@ -107,7 +107,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreThrows() throws Exception { + void ignoreThrows() throws Exception { @@ -36397,7 +36397,7 @@ "43:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalStateException"), @@ -119,7 +119,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTags() throws Exception { + void tags() throws Exception { @@ -36406,7 +36406,7 @@ "37: " + getCheckMessage(MSG_RETURN_EXPECTED), @@ -148,7 +148,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrictJavadoc() throws Exception { + void strictJavadoc() throws Exception { @@ -36415,14 +36415,14 @@ "82:22: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), @@ -160,14 +160,14 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoJavadoc() throws Exception { + void noJavadoc() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodPublicOnly1.java"), expected); } - + // pre 1.4 relaxed mode is roughly equivalent with check=protected @Test - public void testRelaxedJavadoc() throws Exception { @@ -36432,21 +36432,21 @@ "92:37: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), @@ -176,19 +176,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeInnerInterfacesPublic() throws Exception { + void scopeInnerInterfacesPublic() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodScopeInnerInterfaces.java"), expected); } - + @Test - public void testScopeAnonInnerPrivate() throws Exception { + void scopeAnonInnerPrivate() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodScopeAnonInner.java"), expected); } - + @Test - public void testScopes() throws Exception { + void scopes() throws Exception { @@ -36455,7 +36455,7 @@ "29: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), @@ -199,7 +199,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes2() throws Exception { + void scopes2() throws Exception { @@ -36464,7 +36464,7 @@ "29: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), @@ -209,7 +209,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope() throws Exception { + void excludeScope() throws Exception { @@ -36473,7 +36473,7 @@ "31: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), @@ -220,21 +220,21 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowMissingJavadocTags() throws Exception { + void allowMissingJavadocTags() throws Exception { @@ -36481,7 +36481,7 @@ verifyWithInlineConfigParser( getPath("InputJavadocMethodMissingJavadocNoMissingTags.java"), expected); } - + @Test - public void testSurroundingAccessModifier() throws Exception { + void surroundingAccessModifier() throws Exception { @@ -36489,7 +36489,7 @@ verifyWithInlineConfigParser( getPath("InputJavadocMethodSurroundingAccessModifier.java"), expected); } - + @Test - public void testDoAllowMissingJavadocTagsByDefault() throws Exception { + void doAllowMissingJavadocTagsByDefault() throws Exception { @@ -36498,14 +36498,14 @@ "34:26: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "number"), @@ -247,13 +247,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSetterGetter() throws Exception { + void setterGetter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodSetterGetter.java"), expected); } - + @Test - public void testTypeParamsTags() throws Exception { + void typeParamsTags() throws Exception { @@ -36514,7 +36514,7 @@ "40:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), @@ -264,7 +264,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowUndocumentedParamsTags() throws Exception { + void allowUndocumentedParamsTags() throws Exception { @@ -36523,28 +36523,28 @@ "34:6: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unexpectedParam2"), @@ -279,25 +279,25 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test11684081() throws Exception { + void test11684081() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethod_01.java"), expected); } - + @Test - public void test11684082() throws Exception { + void test11684082() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethod_02.java"), expected); } - + @Test - public void test11684083() throws Exception { + void test11684083() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethod_03.java"), expected); } - + @Test - public void testGenerics() throws Exception { + void generics() throws Exception { @@ -36553,14 +36553,14 @@ "46:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), @@ -308,13 +308,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1379666() throws Exception { + void test1379666() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethod_1379666.java"), expected); } - + @Test - public void testInheritDoc() throws Exception { + void inheritDoc() throws Exception { @@ -36569,7 +36569,7 @@ "23:5: " + getCheckMessage(MSG_INVALID_INHERIT_DOC), @@ -327,7 +327,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowToSkipOverridden() throws Exception { + void allowToSkipOverridden() throws Exception { @@ -36578,21 +36578,21 @@ "30:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), @@ -336,19 +336,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJava8ReceiverParameter() throws Exception { + void java8ReceiverParameter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodReceiverParameter.java"), expected); } - + @Test - public void testJavadocInMethod() throws Exception { + void javadocInMethod() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocMethodJavadocInMethod.java"), expected); } - + @Test - public void testConstructor() throws Exception { + void constructor() throws Exception { @@ -36601,7 +36601,7 @@ "24:50: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "p1"), @@ -357,7 +357,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocMethodRecordsAndCompactCtors() throws Exception { + void javadocMethodRecordsAndCompactCtors() throws Exception { @@ -36610,7 +36610,7 @@ "43:27: " @@ -375,7 +375,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -36619,7 +36619,7 @@ }; @@ -385,7 +385,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokenToString() throws Exception { + void tokenToString() throws Exception { @@ -36628,14 +36628,14 @@ "com.puppycrawl.tools.checkstyle.checks.javadoc." + "JavadocMethodCheck$Token"); @@ -399,20 +399,20 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithoutLogErrors() throws Exception { + void withoutLogErrors() throws Exception { verifyWithInlineConfigParser( getPath("InputJavadocMethodLoadErrors.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testCompilationUnit() throws Exception { + void compilationUnit() throws Exception { @@ -36643,7 +36643,7 @@ getNonCompilablePath("InputJavadocMethodCompilationUnit.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testDefaultAccessModifier() throws Exception { + void defaultAccessModifier() throws Exception { @@ -36652,7 +36652,7 @@ "26:43: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "b"), @@ -421,7 +421,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAccessModifierEnum() throws Exception { + void accessModifierEnum() throws Exception { @@ -36661,7 +36661,7 @@ }; @@ -429,7 +429,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomMessages() throws Exception { + void customMessages() throws Exception { @@ -36670,7 +36670,7 @@ final String msgExpectedTagCustom = "Expected @param tag for 'a' :)"; @@ -443,7 +443,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1() throws Exception { + void test1() throws Exception { @@ -36679,7 +36679,7 @@ }; @@ -451,7 +451,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test2() throws Exception { + void test2() throws Exception { @@ -36688,7 +36688,7 @@ "19:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), @@ -460,7 +460,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test3() throws Exception { + void test3() throws Exception { @@ -36700,15 +36700,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSupport { +final class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSu } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -36717,7 +36717,7 @@ JavadocTokenTypes.NEWLINE, @@ -46,14 +46,14 @@ public class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSu } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { @@ -36725,7 +36725,7 @@ verifyWithInlineConfigParser( getPath("InputJavadocMissingLeadingAsteriskCorrect.java"), expected); } - + @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { @@ -36737,15 +36737,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModuleTestSupport { +final class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -36754,7 +36754,7 @@ final int[] expected = { @@ -48,7 +48,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu } - + @Test - public void testGetRequiredJavadocTokens() { + void getRequiredJavadocTokens() { @@ -36763,25 +36763,25 @@ final int[] expected = { @@ -60,7 +60,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu } - + @Test - public void testValid() throws Exception { + void valid() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -68,7 +68,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu } - + @Test - public void testValidWithTabCharacter() throws Exception { + void validWithTabCharacter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -76,7 +76,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu } - + @Test - public void testInvalid() throws Exception { + void invalid() throws Exception { @@ -36793,10 +36793,10 @@ @@ -24,10 +24,10 @@ import static com.google.common.truth.Truth.assertWithMessage; import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; import org.junit.jupiter.api.Test; - + -public class JavadocNodeImplTest { +final class JavadocNodeImplTest { - + @Test - public void testToString() { + void testToString() { @@ -36805,19 +36805,19 @@ javadocNode.setLineNumber(1); @@ -43,7 +43,7 @@ public class JavadocNodeImplTest { } - + @Test - public void testGetColumnNumber() { + void getColumnNumber() { final JavadocNodeImpl javadocNode = new JavadocNodeImpl(); javadocNode.setColumnNumber(1); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java @@ -23,15 +23,15 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.MSG_LEGACY_PACKAGE_HTML; import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.MSG_PACKAGE_INFO; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -36826,15 +36826,15 @@ import java.io.File; -import java.util.Collections; import org.junit.jupiter.api.Test; - + -public class JavadocPackageCheckTest extends AbstractModuleTestSupport { +final class JavadocPackageCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissing() throws Exception { + void missing() throws Exception { @@ -36843,7 +36843,7 @@ }; @@ -47,7 +47,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingWithAllowLegacy() throws Exception { + void missingWithAllowLegacy() throws Exception { @@ -36852,7 +36852,7 @@ }; @@ -55,7 +55,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithMultipleFiles() throws Exception { + void withMultipleFiles() throws Exception { @@ -36861,7 +36861,7 @@ }; @@ -66,7 +66,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBoth() throws Exception { + void both() throws Exception { @@ -36870,7 +36870,7 @@ }; @@ -75,7 +75,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtmlDisallowed() throws Exception { + void htmlDisallowed() throws Exception { @@ -36879,7 +36879,7 @@ }; @@ -84,7 +84,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtmlAllowed() throws Exception { + void htmlAllowed() throws Exception { @@ -36888,7 +36888,7 @@ getPath("pkghtml" + File.separator + "InputJavadocPackageHtmlIgnored2.java"), @@ -93,7 +93,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { @@ -36910,14 +36910,14 @@ try { @@ -121,13 +121,13 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonJava() throws Exception { + void nonJava() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocPackageNotJava.txt"), expected); } - + @Test - public void testWithFileWithoutParent() throws Exception { + void withFileWithoutParent() throws Exception { @@ -36929,15 +36929,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { +final class JavadocParagraphCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -36946,15 +36946,15 @@ assertWithMessage("Default required tokens are invalid") @@ -47,14 +47,14 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocParagraphCorrect.java"), expected); } - + @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { @@ -36963,7 +36963,7 @@ "13: " + getCheckMessage(MSG_LINE_BEFORE), @@ -97,7 +97,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowNewlineParagraph() throws Exception { + void allowNewlineParagraph() throws Exception { @@ -36972,7 +36972,7 @@ "14: " + getCheckMessage(MSG_LINE_BEFORE), @@ -123,7 +123,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocParagraph() throws Exception { + void javadocParagraph() throws Exception { @@ -36984,24 +36984,24 @@ @@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.File; import org.junit.jupiter.api.Test; - + -public class JavadocStyleCheckTest extends AbstractModuleTestSupport { +final class JavadocStyleCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +40,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final JavadocStyleCheck javadocStyleCheck = new JavadocStyleCheck(); - + final int[] actual = javadocStyleCheck.getAcceptableTokens(); @@ -63,7 +63,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleDefaultSettingsOne() throws Exception { + void javadocStyleDefaultSettingsOne() throws Exception { @@ -37010,7 +37010,7 @@ "50: " + getCheckMessage(MSG_NO_PERIOD), @@ -84,7 +84,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleDefaultSettingsTwo() throws Exception { + void javadocStyleDefaultSettingsTwo() throws Exception { @@ -37019,7 +37019,7 @@ "72:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
"), @@ -96,7 +96,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleDefaultSettingsThree() throws Exception { + void javadocStyleDefaultSettingsThree() throws Exception { @@ -37028,7 +37028,7 @@ }; @@ -105,7 +105,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleDefaultSettingsFour() throws Exception { + void javadocStyleDefaultSettingsFour() throws Exception { @@ -37037,7 +37037,7 @@ "42: " + getCheckMessage(MSG_NO_PERIOD), @@ -121,7 +121,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceOne() throws Exception { + void javadocStyleFirstSentenceOne() throws Exception { @@ -37046,7 +37046,7 @@ "50: " + getCheckMessage(MSG_NO_PERIOD), @@ -134,7 +134,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceTwo() throws Exception { + void javadocStyleFirstSentenceTwo() throws Exception { @@ -37055,15 +37055,15 @@ }; @@ -143,14 +143,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceThree() throws Exception { + void javadocStyleFirstSentenceThree() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleFirstSentenceThree.java"), expected); } - + @Test - public void testJavadocStyleFirstSentenceFour() throws Exception { + void javadocStyleFirstSentenceFour() throws Exception { @@ -37072,7 +37072,7 @@ "51: " + getCheckMessage(MSG_NO_PERIOD), @@ -164,7 +164,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceFormatOne() throws Exception { + void javadocStyleFirstSentenceFormatOne() throws Exception { @@ -37081,7 +37081,7 @@ "35: " + getCheckMessage(MSG_NO_PERIOD), @@ -179,7 +179,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceFormatTwo() throws Exception { + void javadocStyleFirstSentenceFormatTwo() throws Exception { @@ -37090,16 +37090,16 @@ }; @@ -188,7 +188,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceFormatThree() throws Exception { + void javadocStyleFirstSentenceFormatThree() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -196,7 +196,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleFirstSentenceFormatFour() throws Exception { + void javadocStyleFirstSentenceFormatFour() throws Exception { @@ -37108,7 +37108,7 @@ "51: " + getCheckMessage(MSG_NO_PERIOD), @@ -211,7 +211,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtml1() throws Exception { + void html1() throws Exception { @@ -37117,7 +37117,7 @@ "62:7: " + getCheckMessage(MSG_EXTRA_HTML, ""), @@ -228,7 +228,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtml2() throws Exception { + void html2() throws Exception { @@ -37126,7 +37126,7 @@ }; @@ -237,7 +237,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtml3() throws Exception { + void html3() throws Exception { @@ -37135,7 +37135,7 @@ }; @@ -246,7 +246,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtml4() throws Exception { + void html4() throws Exception { @@ -37144,31 +37144,31 @@ "47:11: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), @@ -256,28 +256,28 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtmlComment() throws Exception { + void htmlComment() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleHtmlComment.java"), expected); } - + @Test - public void testOnInputWithNoJavadoc1() throws Exception { + void onInputWithNoJavadoc1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleNoJavadoc1.java"), expected); } - + @Test - public void testOnInputWithNoJavadoc2() throws Exception { + void onInputWithNoJavadoc2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleNoJavadoc2.java"), expected); } - + @Test - public void testScopePublic1() throws Exception { + void scopePublic1() throws Exception { @@ -37177,7 +37177,7 @@ "79:31: " + getCheckMessage(MSG_EXTRA_HTML, ""), @@ -288,7 +288,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePublic2() throws Exception { + void scopePublic2() throws Exception { @@ -37186,7 +37186,7 @@ "102: " + getCheckMessage(MSG_EMPTY), @@ -299,7 +299,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePublic3() throws Exception { + void scopePublic3() throws Exception { @@ -37195,7 +37195,7 @@ }; @@ -308,7 +308,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePublic4() throws Exception { + void scopePublic4() throws Exception { @@ -37204,7 +37204,7 @@ "56: " + getCheckMessage(MSG_NO_PERIOD), @@ -319,7 +319,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeProtected1() throws Exception { + void scopeProtected1() throws Exception { @@ -37213,7 +37213,7 @@ "68:23: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), @@ -332,7 +332,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeProtected2() throws Exception { + void scopeProtected2() throws Exception { @@ -37222,7 +37222,7 @@ "87: " + getCheckMessage(MSG_EMPTY), @@ -344,7 +344,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeProtected3() throws Exception { + void scopeProtected3() throws Exception { @@ -37231,7 +37231,7 @@ }; @@ -353,7 +353,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeProtected4() throws Exception { + void scopeProtected4() throws Exception { @@ -37240,7 +37240,7 @@ "56: " + getCheckMessage(MSG_NO_PERIOD), @@ -364,7 +364,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePackage1() throws Exception { + void scopePackage1() throws Exception { @@ -37249,7 +37249,7 @@ "68:24: " + getCheckMessage(MSG_UNCLOSED_HTML, ""), @@ -379,7 +379,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePackage2() throws Exception { + void scopePackage2() throws Exception { @@ -37258,7 +37258,7 @@ "87: " + getCheckMessage(MSG_EMPTY), @@ -392,7 +392,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePackage3() throws Exception { + void scopePackage3() throws Exception { @@ -37267,7 +37267,7 @@ }; @@ -401,7 +401,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopePackage4() throws Exception { + void scopePackage4() throws Exception { @@ -37276,15 +37276,15 @@ "56: " + getCheckMessage(MSG_NO_PERIOD), @@ -414,14 +414,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyJavadoc1() throws Exception { + void emptyJavadoc1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleEmptyJavadoc1.java"), expected); } - + @Test - public void testEmptyJavadoc2() throws Exception { + void emptyJavadoc2() throws Exception { @@ -37293,23 +37293,23 @@ "79: " + getCheckMessage(MSG_EMPTY), @@ -434,21 +434,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyJavadoc3() throws Exception { + void emptyJavadoc3() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleEmptyJavadoc3.java"), expected); } - + @Test - public void testEmptyJavadoc4() throws Exception { + void emptyJavadoc4() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleEmptyJavadoc4.java"), expected); } - + @Test - public void testExcludeScope1() throws Exception { + void excludeScope1() throws Exception { @@ -37318,7 +37318,7 @@ "50: " + getCheckMessage(MSG_NO_PERIOD), @@ -465,7 +465,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope2() throws Exception { + void excludeScope2() throws Exception { @@ -37327,15 +37327,15 @@ "75: " + getCheckMessage(MSG_NO_PERIOD), @@ -475,14 +475,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope3() throws Exception { + void excludeScope3() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleExcludeScope3.java"), expected); } - + @Test - public void testExcludeScope4() throws Exception { + void excludeScope4() throws Exception { @@ -37344,7 +37344,7 @@ "42: " + getCheckMessage(MSG_NO_PERIOD), @@ -495,7 +495,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void packageInfoInheritDoc() throws Exception { + void packageInfoInheritDoc() throws Exception { @@ -37353,7 +37353,7 @@ }; @@ -507,7 +507,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void packageInfoInvalid() throws Exception { + void packageInfoInvalid() throws Exception { @@ -37362,25 +37362,25 @@ }; @@ -519,7 +519,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void packageInfoAnnotation() throws Exception { + void packageInfoAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -528,7 +528,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void packageInfoMissing() throws Exception { + void packageInfoMissing() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -536,7 +536,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void packageInfoMissingPeriod() throws Exception { + void packageInfoMissingPeriod() throws Exception { @@ -37389,24 +37389,24 @@ }; @@ -546,14 +546,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNothing() throws Exception { + void nothing() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleNothing.java"), expected); } - + @Test - public void packageInfoValid() throws Exception { + void packageInfoValid() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -562,7 +562,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRestrictedTokenSet1() throws Exception { + void restrictedTokenSet1() throws Exception { @@ -37415,23 +37415,23 @@ }; @@ -571,21 +571,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRestrictedTokenSet2() throws Exception { + void restrictedTokenSet2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleRestrictedTokenSet2.java"), expected); } - + @Test - public void testRestrictedTokenSet3() throws Exception { + void restrictedTokenSet3() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleRestrictedTokenSet3.java"), expected); } - + @Test - public void testRestrictedTokenSet4() throws Exception { + void restrictedTokenSet4() throws Exception { @@ -37440,7 +37440,7 @@ }; @@ -594,7 +594,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleRecordsAndCompactCtors() throws Exception { + void javadocStyleRecordsAndCompactCtors() throws Exception { @@ -37449,7 +37449,7 @@ "45: " + getCheckMessage(MSG_NO_PERIOD), @@ -614,7 +614,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtmlTagToString() { + void htmlTagToString() { @@ -37458,15 +37458,15 @@ .that(tag.toString()) @@ -624,14 +624,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNeverEndingXmlCommentInsideJavadoc() throws Exception { + void neverEndingXmlCommentInsideJavadoc() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputJavadocStyleNeverEndingXmlComment.java"), expected); } - + @Test - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { @@ -37475,7 +37475,7 @@ }; @@ -641,7 +641,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumCtorScopeIsPrivate() throws Exception { + void enumCtorScopeIsPrivate() throws Exception { @@ -37484,16 +37484,16 @@ "25: " + getCheckMessage(MSG_EMPTY), @@ -652,7 +652,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLowerCasePropertyForTag() throws Exception { + void lowerCasePropertyForTag() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -660,7 +660,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocTag() throws Exception { + void javadocTag() throws Exception { @@ -37502,7 +37502,7 @@ }; @@ -669,7 +669,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocTag2() throws Exception { + void javadocTag2() throws Exception { @@ -37511,7 +37511,7 @@ "18:16: " @@ -682,7 +682,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocTag3() throws Exception { + void javadocTag3() throws Exception { @@ -37520,7 +37520,7 @@ }; @@ -691,7 +691,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleCheck3() throws Exception { + void javadocStyleCheck3() throws Exception { @@ -37529,7 +37529,7 @@ }; @@ -700,7 +700,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocStyleCheck4() throws Exception { + void javadocStyleCheck4() throws Exception { @@ -37541,15 +37541,15 @@ @@ -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 JavadocTagContinuationIndentationCheckTest extends AbstractModuleTestSupport { +final class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -37558,7 +37558,7 @@ final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; @@ -45,14 +45,14 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testFp() throws Exception { + void fp() throws Exception { @@ -37566,7 +37566,7 @@ verifyWithInlineConfigParser( getPath("InputJavadocTagContinuationIndentationGuavaFalsePositive.java"), expected); } - + @Test - public void testCheck() throws Exception { + void check() throws Exception { @@ -37575,7 +37575,7 @@ "117: " + getCheckMessage(MSG_KEY, 4), @@ -73,7 +73,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testCheckWithOffset3() throws Exception { + void checkWithOffset3() throws Exception { @@ -37584,7 +37584,7 @@ }; @@ -82,7 +82,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testCheckWithDescription() throws Exception { + void checkWithDescription() throws Exception { @@ -37593,7 +37593,7 @@ "17: " + getCheckMessage(MSG_KEY, 4), @@ -96,7 +96,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testBlockTag() throws Exception { + void blockTag() throws Exception { @@ -37602,7 +37602,7 @@ "32: " + getCheckMessage(MSG_KEY, 4), @@ -128,7 +128,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testContinuationIndentation() throws Exception { + void continuationIndentation() throws Exception { @@ -37611,7 +37611,7 @@ }; @@ -136,7 +136,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe } - + @Test - public void testJavadocTagContinuationIndentationCheck1() throws Exception { + void javadocTagContinuationIndentationCheck1() throws Exception { @@ -37623,10 +37623,10 @@ @@ -26,14 +26,14 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.lang.reflect.Method; import org.junit.jupiter.api.Test; - + -public class JavadocTagInfoTest { +final class JavadocTagInfoTest { - + /* Additional test for jacoco, since valueOf() * is generated by javac and jacoco reports that * valueOf() is uncovered. @@ -37657,16 +37657,16 @@ }; @@ -62,7 +62,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testAuthor() { + void author() { final DetailAstImpl ast = new DetailAstImpl(); - + final int[] validTypes = { @@ -86,7 +86,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testOthers() throws ReflectiveOperationException { + void others() throws ReflectiveOperationException { @@ -37675,7 +37675,7 @@ JavadocTagInfo.DOC_ROOT, @@ -137,7 +137,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testDeprecated() throws ReflectiveOperationException { + void deprecated() throws ReflectiveOperationException { @@ -37684,7 +37684,7 @@ astParent.setType(TokenTypes.LITERAL_CATCH); @@ -176,7 +176,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testSerial() throws ReflectiveOperationException { + void serial() throws ReflectiveOperationException { @@ -37693,43 +37693,43 @@ astParent.setType(TokenTypes.LITERAL_CATCH); @@ -207,7 +207,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testException() { + void exception() { final DetailAstImpl ast = new DetailAstImpl(); - + final int[] validTypes = { @@ -227,7 +227,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testThrows() { + void testThrows() { final DetailAstImpl ast = new DetailAstImpl(); - + final int[] validTypes = { @@ -247,7 +247,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testVersions() { + void versions() { final DetailAstImpl ast = new DetailAstImpl(); - + final int[] validTypes = { @@ -271,7 +271,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testParam() { + void param() { final DetailAstImpl ast = new DetailAstImpl(); - + final int[] validTypes = { @@ -291,7 +291,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testReturn() { + void testReturn() { @@ -37738,7 +37738,7 @@ astChild.setType(TokenTypes.TYPE); @@ -322,7 +322,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testSerialField() { + void serialField() { @@ -37747,7 +37747,7 @@ astChild.setType(TokenTypes.TYPE); @@ -359,7 +359,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testSerialData() { + void serialData() { @@ -37756,7 +37756,7 @@ final DetailAstImpl astChild = new DetailAstImpl(); @@ -389,7 +389,7 @@ public class JavadocTagInfoTest { } - + @Test - public void testCoverage() { + void coverage() { @@ -37768,10 +37768,10 @@ @@ -25,14 +25,14 @@ import static com.google.common.truth.Truth.assertWithMessage; import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; import org.junit.jupiter.api.Test; - + -public class JavadocTagTest { +final class JavadocTagTest { - + /* Additional test for jacoco, since valueOf() * is generated by javac and jacoco reports that * valueOf() is uncovered. @@ -37793,16 +37793,16 @@ JavadocUtil.JavadocTagType.BLOCK, @@ -55,7 +55,7 @@ public class JavadocTagTest { } - + @Test - public void testToString() { + void testToString() { final JavadocTag javadocTag = new JavadocTag(0, 1, "author", "firstArg"); - + final String result = javadocTag.toString(); @@ -66,7 +66,7 @@ public class JavadocTagTest { } - + @Test - public void testJavadocTagReferenceImports() { + void javadocTagReferenceImports() { @@ -37811,7 +37811,7 @@ assertThat(new JavadocTag(0, 0, "value", null).canReferenceImports()).isTrue(); @@ -76,7 +76,7 @@ public class JavadocTagTest { } - + @Test - public void testJavadocTagReferenceImportsInvalid() { + void javadocTagReferenceImportsInvalid() { @@ -37823,15 +37823,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class JavadocTypeCheckTest extends AbstractModuleTestSupport { +final class JavadocTypeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -37840,58 +37840,58 @@ .that(javadocTypeCheck.getRequiredTokens()) @@ -46,7 +46,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final JavadocTypeCheck javadocTypeCheck = new JavadocTypeCheck(); - + final int[] actual = javadocTypeCheck.getAcceptableTokens(); @@ -62,43 +62,43 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTags() throws Exception { + void tags() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeTags.java"), expected); } - + @Test - public void testInner() throws Exception { + void inner() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeInner.java"), expected); } - + @Test - public void testStrict() throws Exception { + void strict() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypePublicOnly.java"), expected); } - + @Test - public void testProtected() throws Exception { + void testProtected() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypePublicOnly1.java"), expected); } - + @Test - public void testPublic() throws Exception { + void testPublic() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeScopeInnerInterfaces.java"), expected); } - + @Test - public void testProtest() throws Exception { + void protest() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeScopeInnerInterfaces1.java"), expected); } - + @Test - public void testPkg() throws Exception { + void pkg() throws Exception { @@ -37900,14 +37900,14 @@ }; @@ -106,13 +106,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEclipse() throws Exception { + void eclipse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeScopeInnerClasses1.java"), expected); } - + @Test - public void testAuthorRequired() throws Exception { + void authorRequired() throws Exception { @@ -37916,7 +37916,7 @@ }; @@ -120,7 +120,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAuthorRegularEx() throws Exception { + void authorRegularEx() throws Exception { @@ -37925,7 +37925,7 @@ "67:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), @@ -130,7 +130,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAuthorRegularExError() throws Exception { + void authorRegularExError() throws Exception { @@ -37934,7 +37934,7 @@ "31:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), @@ -146,7 +146,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVersionRequired() throws Exception { + void versionRequired() throws Exception { @@ -37943,7 +37943,7 @@ }; @@ -154,7 +154,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVersionRegularEx() throws Exception { + void versionRegularEx() throws Exception { @@ -37952,7 +37952,7 @@ "67:1: " + getCheckMessage(MSG_MISSING_TAG, "@version"), @@ -164,7 +164,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVersionRegularExError() throws Exception { + void versionRegularExError() throws Exception { @@ -37961,7 +37961,7 @@ "31:1: " + getCheckMessage(MSG_MISSING_TAG, "@version"), @@ -183,7 +183,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes() throws Exception { + void scopes() throws Exception { @@ -37970,14 +37970,14 @@ "137:5: " + getCheckMessage(MSG_MISSING_TAG, "@param "), @@ -192,13 +192,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLimitViolationsBySpecifyingTokens() throws Exception { + void limitViolationsBySpecifyingTokens() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeNoJavadocOnInterface.java"), expected); } - + @Test - public void testScopes2() throws Exception { + void scopes2() throws Exception { @@ -37986,7 +37986,7 @@ }; @@ -206,7 +206,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope() throws Exception { + void excludeScope() throws Exception { @@ -37995,7 +37995,7 @@ }; @@ -214,7 +214,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTypeParameters() throws Exception { + void typeParameters() throws Exception { @@ -38004,7 +38004,7 @@ "25:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), @@ -226,7 +226,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowMissingTypeParameters() throws Exception { + void allowMissingTypeParameters() throws Exception { @@ -38013,7 +38013,7 @@ "58:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), @@ -236,7 +236,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDontAllowUnusedParameterTag() throws Exception { + void dontAllowUnusedParameterTag() throws Exception { @@ -38022,7 +38022,7 @@ "21:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), @@ -246,7 +246,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBadTag() throws Exception { + void badTag() throws Exception { @@ -38031,46 +38031,46 @@ }; @@ -254,33 +254,33 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBadTagSuppress() throws Exception { + void badTagSuppress() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeBadTag_1.java"), expected); } - + @Test - public void testAllowedAnnotationsDefault() throws Exception { + void allowedAnnotationsDefault() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations.java"), expected); } - + @Test - public void testAllowedAnnotationsWithFullyQualifiedName() throws Exception { + void allowedAnnotationsWithFullyQualifiedName() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations_1.java"), expected); } - + @Test - public void testAllowedAnnotationsAllowed() throws Exception { + void allowedAnnotationsAllowed() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations_2.java"), expected); } - + @Test - public void testAllowedAnnotationsNotAllowed() throws Exception { + void allowedAnnotationsNotAllowed() throws Exception { - + final String[] expected = { "38:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), @@ -289,7 +289,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocTypeRecords() throws Exception { + void javadocTypeRecords() throws Exception { @@ -38079,34 +38079,34 @@ "33:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), @@ -301,7 +301,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocTypeRecordComponents() throws Exception { + void javadocTypeRecordComponents() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -310,7 +310,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 { } - + @Test - public void testJavadocTypeInterfaceMemberScopeIsPublic() throws Exception { + void javadocTypeInterfaceMemberScopeIsPublic() throws Exception { - + final String[] expected = { "19:5: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), @@ -342,7 +342,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -38115,14 +38115,14 @@ }; @@ -350,13 +350,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAuthorFormat() throws Exception { + void authorFormat() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocType1.java"), expected); } - + @Test - public void testAuthorFormat2() throws Exception { + void authorFormat2() throws Exception { @@ -38131,7 +38131,7 @@ }; @@ -364,7 +364,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocType() throws Exception { + void javadocType() throws Exception { @@ -38140,7 +38140,7 @@ }; @@ -372,7 +372,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocType2() throws Exception { + void javadocType2() throws Exception { @@ -38152,15 +38152,15 @@ @@ -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 JavadocVariableCheckTest extends AbstractModuleTestSupport { +final class JavadocVariableCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -38169,16 +38169,16 @@ final int[] expected = { @@ -45,7 +45,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final JavadocVariableCheck javadocVariableCheck = new JavadocVariableCheck(); - + final int[] actual = javadocVariableCheck.getAcceptableTokens(); @@ -57,7 +57,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -38187,7 +38187,7 @@ "311:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -68,7 +68,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnother() throws Exception { + void another() throws Exception { @@ -38196,14 +38196,14 @@ "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -78,13 +78,13 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnother2() throws Exception { + void another2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavadocVariableInner2.java"), expected); } - + @Test - public void testAnother3() throws Exception { + void another3() throws Exception { @@ -38212,7 +38212,7 @@ "22:13: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -98,7 +98,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnother4() throws Exception { + void another4() throws Exception { @@ -38221,7 +38221,7 @@ }; @@ -106,7 +106,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes() throws Exception { + void scopes() throws Exception { @@ -38230,7 +38230,7 @@ "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -150,7 +150,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes2() throws Exception { + void scopes2() throws Exception { @@ -38239,7 +38239,7 @@ "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -161,7 +161,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope() throws Exception { + void excludeScope() throws Exception { @@ -38248,7 +38248,7 @@ "18:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -201,7 +201,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoredVariableNames() throws Exception { + void ignoredVariableNames() throws Exception { @@ -38257,7 +38257,7 @@ "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -244,7 +244,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoNotIgnoreAnythingWhenIgnoreNamePatternIsEmpty() throws Exception { + void doNotIgnoreAnythingWhenIgnoreNamePatternIsEmpty() throws Exception { @@ -38266,7 +38266,7 @@ "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -288,7 +288,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaLocalVariablesDoNotNeedJavadoc() throws Exception { + void lambdaLocalVariablesDoNotNeedJavadoc() throws Exception { @@ -38275,7 +38275,7 @@ }; @@ -297,7 +297,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { @@ -38287,24 +38287,24 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.io.File; import org.junit.jupiter.api.Test; - + -public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { +final class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final MissingJavadocMethodCheck missingJavadocMethodCheck = new MissingJavadocMethodCheck(); - + final int[] actual = missingJavadocMethodCheck.getAcceptableTokens(); @@ -53,7 +53,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -38313,7 +38313,7 @@ final int[] expected = CommonUtil.EMPTY_INT_ARRAY; @@ -61,7 +61,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void extendAnnotationTest() throws Exception { + void extendAnnotationTest() throws Exception { @@ -38322,7 +38322,7 @@ }; @@ -70,7 +70,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void newTest() throws Exception { + void newTest() throws Exception { @@ -38331,7 +38331,7 @@ }; @@ -78,7 +78,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void allowedAnnotationsTest() throws Exception { + void allowedAnnotationsTest() throws Exception { @@ -38340,7 +38340,7 @@ }; @@ -87,7 +87,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTags() throws Exception { + void tags() throws Exception { @@ -38349,7 +38349,7 @@ "337:9: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -98,7 +98,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrictJavadoc() throws Exception { + void strictJavadoc() throws Exception { @@ -38358,14 +38358,14 @@ "30:13: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -117,14 +117,14 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoJavadoc() throws Exception { + void noJavadoc() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMissingJavadocMethodPublicOnly2.java"), expected); } - + // pre 1.4 relaxed mode is roughly equivalent with check=protected @Test - public void testRelaxedJavadoc() throws Exception { @@ -38375,7 +38375,7 @@ "69:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -135,7 +135,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeInnerInterfacesPublic() throws Exception { + void scopeInnerInterfacesPublic() throws Exception { @@ -38384,7 +38384,7 @@ "53:9: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -145,7 +145,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { @@ -38393,7 +38393,7 @@ "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -155,7 +155,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumCtorScopeIsPrivate() throws Exception { + void enumCtorScopeIsPrivate() throws Exception { @@ -38402,14 +38402,14 @@ }; @@ -164,13 +164,13 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopeAnonInnerPrivate() throws Exception { + void scopeAnonInnerPrivate() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMissingJavadocMethodScopeAnonInner.java"), expected); } - + @Test - public void testScopeAnonInnerAnonInner() throws Exception { + void scopeAnonInnerAnonInner() throws Exception { @@ -38418,7 +38418,7 @@ "47:13: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -181,7 +181,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes() throws Exception { + void scopes() throws Exception { @@ -38427,7 +38427,7 @@ "27:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -225,7 +225,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes2() throws Exception { + void scopes2() throws Exception { @@ -38436,7 +38436,7 @@ "27:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -236,7 +236,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope() throws Exception { + void excludeScope() throws Exception { @@ -38445,7 +38445,7 @@ "29:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -268,14 +268,14 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoAllowMissingJavadocTagsByDefault() throws Exception { + void doAllowMissingJavadocTagsByDefault() throws Exception { @@ -38453,7 +38453,7 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocMethodMissingJavadocTags.java"), expected); } - + @Test - public void testSetterGetterOff() throws Exception { + void setterGetterOff() throws Exception { @@ -38462,7 +38462,7 @@ "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -299,7 +299,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSetterGetterOnCheck() throws Exception { + void setterGetterOnCheck() throws Exception { @@ -38471,21 +38471,21 @@ "35:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -320,26 +320,26 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test11684081() throws Exception { + void test11684081() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMissingJavadocMethod_01.java"), expected); } - + @Test - public void test11684082() throws Exception { + void test11684082() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMissingJavadocMethod_02.java"), expected); } - + @Test - public void testSkipCertainMethods() throws Exception { + void skipCertainMethods() throws Exception { @@ -38493,7 +38493,7 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocMethodIgnoreNameRegex.java"), expected); } - + @Test - public void testNotSkipAnythingWhenSkipRegexDoesNotMatch() throws Exception { + void notSkipAnythingWhenSkipRegexDoesNotMatch() throws Exception { @@ -38502,7 +38502,7 @@ "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -350,21 +350,21 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowToSkipOverridden() throws Exception { + void allowToSkipOverridden() throws Exception { @@ -38510,7 +38510,7 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocMethodsNotSkipWritten.java"), expected); } - + @Test - public void testJava8ReceiverParameter() throws Exception { + void java8ReceiverParameter() throws Exception { @@ -38518,7 +38518,7 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocMethodReceiverParameter.java"), expected); } - + @Test - public void testJavadocInMethod() throws Exception { + void javadocInMethod() throws Exception { @@ -38527,7 +38527,7 @@ "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -376,7 +376,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testConstructor() throws Exception { + void constructor() throws Exception { @@ -38536,7 +38536,7 @@ }; @@ -384,14 +384,14 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotPublicInterfaceMethods() throws Exception { + void notPublicInterfaceMethods() throws Exception { @@ -38544,7 +38544,7 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocMethodInterfacePrivateMethod.java"), expected); } - + @Test - public void testPublicMethods() throws Exception { + void publicMethods() throws Exception { @@ -38553,7 +38553,7 @@ "24:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -403,7 +403,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingJavadocMethodRecordsAndCompactCtors() throws Exception { + void missingJavadocMethodRecordsAndCompactCtors() throws Exception { @@ -38562,16 +38562,16 @@ "27:9: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -417,7 +417,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingJavadocMethodRecordsAndCompactCtorsMinLineCount() throws Exception { + void missingJavadocMethodRecordsAndCompactCtorsMinLineCount() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -427,7 +427,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMinLineCount() throws Exception { + void minLineCount() throws Exception { @@ -38580,7 +38580,7 @@ }; @@ -435,7 +435,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationField() throws Exception { + void annotationField() throws Exception { @@ -38589,7 +38589,7 @@ "27:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -446,7 +446,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIsGetterMethod() throws Exception { + void isGetterMethod() throws Exception { @@ -38598,7 +38598,7 @@ final DetailAST getterMethod = notGetterMethod.getNextSibling().getNextSibling(); @@ -460,7 +460,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIsSetterMethod() throws Exception { + void isSetterMethod() throws Exception { @@ -38607,7 +38607,7 @@ final DetailAST setterMethod = @@ -476,7 +476,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSetterGetterOn() throws Exception { + void setterGetterOn() throws Exception { @@ -38616,7 +38616,7 @@ "24:5: " + getCheckMessage(MissingJavadocMethodCheck.class, MSG_JAVADOC_MISSING), @@ -486,7 +486,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { } - + @Test - public void missingJavadoc() throws Exception { + void missingJavadoc() throws Exception { @@ -38628,43 +38628,43 @@ @@ -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 MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { +final class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,31 +35,31 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageJavadocPresent() throws Exception { + void packageJavadocPresent() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("package-info.java"), expected); } - + @Test - public void testPackageSingleLineJavadocPresent() throws Exception { + void packageSingleLineJavadocPresent() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("singleline/package-info.java"), expected); } - + @Test - public void testPackageJavadocPresentWithAnnotation() throws Exception { + void packageJavadocPresentWithAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("annotation/package-info.java"), expected); } - + @Test - public void testPackageJavadocPresentWithBlankLines() throws Exception { + void packageJavadocPresentWithBlankLines() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("blank/package-info.java"), expected); } - + @Test - public void testPackageJavadocMissing() throws Exception { + void packageJavadocMissing() throws Exception { @@ -38673,7 +38673,7 @@ }; @@ -67,7 +67,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlockCommentInsteadOfJavadoc() throws Exception { + void blockCommentInsteadOfJavadoc() throws Exception { @@ -38682,7 +38682,7 @@ }; @@ -75,7 +75,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSinglelineCommentInsteadOfJavadoc() throws Exception { + void singlelineCommentInsteadOfJavadoc() throws Exception { @@ -38691,7 +38691,7 @@ }; @@ -83,7 +83,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSinglelineCommentInsteadOfJavadoc2() throws Exception { + void singlelineCommentInsteadOfJavadoc2() throws Exception { @@ -38700,7 +38700,7 @@ }; @@ -91,7 +91,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageJavadocMissingWithAnnotation() throws Exception { + void packageJavadocMissingWithAnnotation() throws Exception { @@ -38709,7 +38709,7 @@ }; @@ -99,7 +99,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageJavadocMissingWithAnnotationAndBlockComment() throws Exception { + void packageJavadocMissingWithAnnotationAndBlockComment() throws Exception { @@ -38718,7 +38718,7 @@ }; @@ -108,7 +108,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageJavadocMissingDetachedJavadoc() throws Exception { + void packageJavadocMissingDetachedJavadoc() throws Exception { @@ -38727,14 +38727,14 @@ }; @@ -116,13 +116,13 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageJavadocPresentWithHeader() throws Exception { + void packageJavadocPresentWithHeader() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("header/package-info.java"), expected); } - + @Test - public void testPackageJavadocMissingWithBlankLines() throws Exception { + void packageJavadocMissingWithBlankLines() throws Exception { @@ -38743,7 +38743,7 @@ }; @@ -130,14 +130,14 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotPackageInfo() throws Exception { + void notPackageInfo() throws Exception { @@ -38751,7 +38751,7 @@ verifyFilterWithInlineConfigParser( getPath("InputMissingJavadocPackageNotPackageInfo-package-info.java"), expected); } - + @Test - public void testTokensAreCorrect() { + void tokensAreCorrect() { @@ -38763,15 +38763,15 @@ @@ -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 MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { +final class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -38780,16 +38780,16 @@ "MissingJavadocTypeCheck#getRequiredTokens should return empty array by default") @@ -44,7 +44,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final MissingJavadocTypeCheck missingJavadocTypeCheck = new MissingJavadocTypeCheck(); - + final int[] actual = missingJavadocTypeCheck.getAcceptableTokens(); @@ -60,7 +60,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTagsOne() throws Exception { + void tagsOne() throws Exception { @@ -38798,7 +38798,7 @@ "44:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -70,7 +70,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTagsTwo() throws Exception { + void tagsTwo() throws Exception { @@ -38807,7 +38807,7 @@ }; @@ -78,7 +78,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTagsThree() throws Exception { + void tagsThree() throws Exception { @@ -38816,7 +38816,7 @@ }; @@ -86,7 +86,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTagsFour() throws Exception { + void tagsFour() throws Exception { @@ -38825,7 +38825,7 @@ }; @@ -94,7 +94,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInner() throws Exception { + void inner() throws Exception { @@ -38834,7 +38834,7 @@ "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -104,7 +104,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStrict() throws Exception { + void strict() throws Exception { @@ -38843,7 +38843,7 @@ "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -115,7 +115,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProtected() throws Exception { + void testProtected() throws Exception { @@ -38852,7 +38852,7 @@ }; @@ -123,7 +123,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPublic() throws Exception { + void testPublic() throws Exception { @@ -38861,7 +38861,7 @@ "44:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -133,7 +133,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProtest() throws Exception { + void protest() throws Exception { @@ -38870,7 +38870,7 @@ "35:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -145,7 +145,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPkg() throws Exception { + void pkg() throws Exception { @@ -38879,7 +38879,7 @@ "24:9: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -156,7 +156,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEclipse() throws Exception { + void eclipse() throws Exception { @@ -38888,7 +38888,7 @@ }; @@ -165,7 +165,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopesOne() throws Exception { + void scopesOne() throws Exception { @@ -38897,7 +38897,7 @@ "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -176,7 +176,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopesTwo() throws Exception { + void scopesTwo() throws Exception { @@ -38906,7 +38906,7 @@ "15:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -190,7 +190,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLimitViolationsBySpecifyingTokens() throws Exception { + void limitViolationsBySpecifyingTokens() throws Exception { @@ -38915,7 +38915,7 @@ }; @@ -199,7 +199,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testScopes2() throws Exception { + void scopes2() throws Exception { @@ -38924,7 +38924,7 @@ "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -208,7 +208,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludeScope() throws Exception { + void excludeScope() throws Exception { @@ -38933,7 +38933,7 @@ "49:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -223,14 +223,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDontAllowUnusedParameterTag() throws Exception { + void dontAllowUnusedParameterTag() throws Exception { @@ -38941,16 +38941,16 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocTypeUnusedParamInJavadocForClass.java"), expected); } - + @Test - public void testSkipAnnotationsDefault() throws Exception { + void skipAnnotationsDefault() throws Exception { - + final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -241,7 +241,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSkipAnnotationsWithFullyQualifiedName() throws Exception { + void skipAnnotationsWithFullyQualifiedName() throws Exception { @@ -38959,42 +38959,42 @@ "17:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -251,14 +251,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSkipAnnotationsAllowed() throws Exception { + void skipAnnotationsAllowed() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMissingJavadocTypeSkipAnnotations3.java"), expected); } - + @Test - public void testSkipAnnotationsNotAllowed() throws Exception { + void skipAnnotationsNotAllowed() throws Exception { - + final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -269,7 +269,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingJavadocTypeCheckRecords() throws Exception { + void missingJavadocTypeCheckRecords() throws Exception { - + final String[] expected = { "14:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -285,7 +285,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { - + final String[] expected = { "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -297,7 +297,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testQualifiedAnnotation1() throws Exception { + void qualifiedAnnotation1() throws Exception { @@ -39003,7 +39003,7 @@ "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -308,7 +308,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testQualifiedAnnotation2() throws Exception { + void qualifiedAnnotation2() throws Exception { @@ -39012,7 +39012,7 @@ "23:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -318,7 +318,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testQualifiedAnnotation3() throws Exception { + void qualifiedAnnotation3() throws Exception { @@ -39021,7 +39021,7 @@ "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -328,7 +328,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testQualifiedAnnotation4() throws Exception { + void qualifiedAnnotation4() throws Exception { @@ -39030,7 +39030,7 @@ "21:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -338,14 +338,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testQualifiedAnnotation5() throws Exception { + void qualifiedAnnotation5() throws Exception { @@ -39038,7 +39038,7 @@ verifyWithInlineConfigParser( getPath("InputMissingJavadocTypeQualifiedAnnotation5.java"), expected); } - + @Test - public void testMultipleQualifiedAnnotation() throws Exception { + void multipleQualifiedAnnotation() throws Exception { @@ -39047,7 +39047,7 @@ "38:5: " + getCheckMessage(MSG_JAVADOC_MISSING), @@ -355,7 +355,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testQualifiedAnnotationWithParameters() throws Exception { + void qualifiedAnnotationWithParameters() throws Exception { @@ -39059,15 +39059,15 @@ @@ -31,7 +31,7 @@ import de.thetaphi.forbiddenapis.SuppressForbidden; import java.nio.charset.CodingErrorAction; import org.junit.jupiter.api.Test; - + -public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupport { +final class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -39076,7 +39076,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -48,7 +48,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -39085,7 +39085,7 @@ assertWithMessage("Default required tokens are invalid") @@ -57,7 +57,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp } - + @Test - public void testCheckOne() throws Exception { + void checkOne() throws Exception { @@ -39094,7 +39094,7 @@ "37: " + getCheckMessage(MSG_KEY), @@ -82,7 +82,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp } - + @Test - public void testCheckTwo() throws Exception { + void checkTwo() throws Exception { @@ -39115,15 +39115,15 @@ @@ -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 RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModuleTestSupport { +final class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModule } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -39132,16 +39132,16 @@ final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; @@ -46,7 +46,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModule } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { createModuleConfig(RequireEmptyLineBeforeBlockTagGroupCheck.class); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -55,7 +55,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModule } - + @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { @@ -39153,15 +39153,15 @@ @@ -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 SingleLineJavadocCheckTest extends AbstractModuleTestSupport { +final class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptableTokens() { + void acceptableTokens() { @@ -39170,7 +39170,7 @@ assertWithMessage("Default acceptable tokens are invalid") @@ -43,7 +43,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -39179,7 +39179,7 @@ assertWithMessage("Default required tokens are invalid") @@ -52,7 +52,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void simpleTest() throws Exception { + void simpleTest() throws Exception { @@ -39188,7 +39188,7 @@ "38: " + getCheckMessage(MSG_KEY), @@ -64,7 +64,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoredTags() throws Exception { + void ignoredTags() throws Exception { @@ -39200,15 +39200,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { +final class SummaryJavadocCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -39217,15 +39217,15 @@ assertWithMessage("Default required tokens are invalid") @@ -47,14 +47,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCorrect() throws Exception { + void correct() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSummaryJavadocCorrect.java"), expected); } - + @Test - public void testInlineCorrect() throws Exception { + void inlineCorrect() throws Exception { @@ -39234,7 +39234,7 @@ }; @@ -63,7 +63,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrect() throws Exception { + void incorrect() throws Exception { @@ -39243,7 +39243,7 @@ "42: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), @@ -85,7 +85,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineForbidden() throws Exception { + void inlineForbidden() throws Exception { @@ -39252,7 +39252,7 @@ "31: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), @@ -103,7 +103,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPeriod() throws Exception { + void period() throws Exception { @@ -39261,15 +39261,15 @@ "19: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), @@ -114,14 +114,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoPeriod() throws Exception { + void noPeriod() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSummaryJavadocNoPeriod.java"), expected); } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { @@ -39278,7 +39278,7 @@ "41: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), @@ -142,7 +142,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectUsageOfSummaryTag() throws Exception { + void incorrectUsageOfSummaryTag() throws Exception { @@ -39287,7 +39287,7 @@ "41: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), @@ -159,7 +159,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineDefaultConfiguration() throws Exception { + void inlineDefaultConfiguration() throws Exception { @@ -39296,7 +39296,7 @@ "26: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), @@ -181,7 +181,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineReturn() throws Exception { + void inlineReturn() throws Exception { @@ -39305,7 +39305,7 @@ }; @@ -190,7 +190,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineReturn2() throws Exception { + void inlineReturn2() throws Exception { @@ -39314,7 +39314,7 @@ }; @@ -199,7 +199,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInlineReturnForbidden() throws Exception { + void inlineReturnForbidden() throws Exception { @@ -39323,7 +39323,7 @@ "21: " + getCheckMessage(MSG_SUMMARY_JAVADOC), @@ -211,7 +211,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPeriodAtEnd() throws Exception { + void periodAtEnd() throws Exception { @@ -39332,7 +39332,7 @@ "26: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), @@ -224,7 +224,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHtmlFormatSummary() throws Exception { + void htmlFormatSummary() throws Exception { @@ -39341,7 +39341,7 @@ "36: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), @@ -235,7 +235,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfo() throws Exception { + void packageInfo() throws Exception { @@ -39350,7 +39350,7 @@ }; @@ -244,7 +244,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageInfoWithAnnotation() throws Exception { + void packageInfoWithAnnotation() throws Exception { @@ -39359,7 +39359,7 @@ }; @@ -253,7 +253,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForbidden() throws Exception { + void forbidden() throws Exception { @@ -39368,15 +39368,15 @@ }; @@ -263,14 +263,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyPeriod() throws Exception { + void emptyPeriod() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSummaryJavadocEmptyPeriod.java"), expected); } - + @Test - public void testForbidden3() throws Exception { + void forbidden3() throws Exception { @@ -39385,24 +39385,24 @@ }; @@ -280,7 +280,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForbidden2() throws Exception { + void forbidden2() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -288,14 +288,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSummaryJavaDoc() throws Exception { + void summaryJavaDoc() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSummaryJavadoc1.java"), expected); } - + @Test - public void testSummaryJavaDoc2() throws Exception { + void summaryJavaDoc2() throws Exception { @@ -39411,7 +39411,7 @@ }; @@ -304,7 +304,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInheritDoc() throws Exception { + void inheritDoc() throws Exception { @@ -39425,7 +39425,7 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_TAG_FORMAT; import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_WRITE_TAG; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.Checker; @@ -31,14 +32,13 @@ import java.io.ByteArrayInputStream; @@ -39437,23 +39437,23 @@ import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; - + /** Unit test for WriteTagCheck. */ -public class WriteTagCheckTest extends AbstractModuleTestSupport { +final class WriteTagCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -46,13 +46,13 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultSettings() throws Exception { + void defaultSettings() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputWriteTagDefault.java"), expected); } - + @Test - public void testTag() throws Exception { + void tag() throws Exception { @@ -39462,7 +39462,7 @@ }; @@ -60,7 +60,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingFormat() throws Exception { + void missingFormat() throws Exception { @@ -39471,7 +39471,7 @@ }; @@ -68,7 +68,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTagIncomplete() throws Exception { + void tagIncomplete() throws Exception { @@ -39480,7 +39480,7 @@ }; @@ -76,7 +76,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoubleTag() throws Exception { + void doubleTag() throws Exception { @@ -39489,7 +39489,7 @@ "19: " + getCheckMessage(MSG_WRITE_TAG, "@doubletag", "second text"), @@ -85,7 +85,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyTag() throws Exception { + void emptyTag() throws Exception { @@ -39498,7 +39498,7 @@ }; @@ -93,7 +93,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMissingTag() throws Exception { + void missingTag() throws Exception { @@ -39507,7 +39507,7 @@ }; @@ -101,7 +101,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethod() throws Exception { + void method() throws Exception { @@ -39516,7 +39516,7 @@ "36: " + getCheckMessage(MSG_WRITE_TAG, "@todo", "Add a comment"), @@ -110,7 +110,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSeverity() throws Exception { + void severity() throws Exception { @@ -39525,21 +39525,21 @@ }; @@ -118,19 +118,19 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreMissing() throws Exception { + void ignoreMissing() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(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); } - + @Test - public void testRegularExError() throws Exception { + void regularExError() throws Exception { @@ -39548,7 +39548,7 @@ }; @@ -138,7 +138,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumsAndAnnotations() throws Exception { + void enumsAndAnnotations() throws Exception { @@ -39557,7 +39557,7 @@ "21: " @@ -152,7 +152,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoJavadocs() throws Exception { + void noJavadocs() throws Exception { @@ -39566,7 +39566,7 @@ }; @@ -160,7 +160,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWriteTagRecordsAndCompactCtors() throws Exception { + void writeTagRecordsAndCompactCtors() throws Exception { @@ -39574,7 +39574,7 @@ "15: " + getCheckMessage(MSG_MISSING_TAG, "@incomplete"), "19: " + getCheckMessage(MSG_TAG_FORMAT, "@incomplete", "\\S"), @@ -196,8 +196,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { - + // process each of the lines try (ByteArrayInputStream localStream = new ByteArrayInputStream(getStream().toByteArray()); - LineNumberReader lnr = @@ -39588,10 +39588,10 @@ @@ -25,17 +25,17 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import java.util.List; import org.junit.jupiter.api.Test; - + -public class BlockTagUtilTest { +final class BlockTagUtilTest { - + @Test - public void testHasPrivateConstructor() throws Exception { + void hasPrivateConstructor() throws Exception { @@ -39599,7 +39599,7 @@ .that(TestUtil.isUtilsClassHasPrivateConstructor(BlockTagUtil.class)) .isTrue(); } - + @Test - public void testExtractBlockTags() { + void extractBlockTags() { @@ -39608,7 +39608,7 @@ }; @@ -57,7 +57,7 @@ public class BlockTagUtilTest { } - + @Test - public void testVersionStringFormat() { + void versionStringFormat() { @@ -39617,22 +39617,22 @@ }; @@ -68,7 +68,7 @@ public class BlockTagUtilTest { } - + @Test - public void testOddVersionString() { + void oddVersionString() { final String[] text = {"/**", " * Foo", " * @version 1.0 */"}; - + final List tags = BlockTagUtil.extractBlockTags(text); --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java @@ -25,17 +25,17 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import java.util.List; import org.junit.jupiter.api.Test; - + -public class InlineTagUtilTest { +final class InlineTagUtilTest { - + @Test - public void testHasPrivateConstructor() throws Exception { + void hasPrivateConstructor() throws Exception { @@ -39640,7 +39640,7 @@ .that(TestUtil.isUtilsClassHasPrivateConstructor(InlineTagUtil.class)) .isTrue(); } - + @Test - public void testExtractInlineTags() { + void testExtractInlineTags() { @@ -39649,25 +39649,25 @@ " * {@link List }, {@link List link text }", @@ -54,7 +54,7 @@ public class InlineTagUtilTest { } - + @Test - public void testMultiLineLinkTag() { + void multiLineLinkTag() { final String[] text = {"/**", " * {@link foo", " * bar baz}", " */"}; - + final List tags = InlineTagUtil.extractInlineTags(text); @@ -64,7 +64,7 @@ public class InlineTagUtilTest { } - + @Test - public void testCollapseWhitespace() { + void collapseWhitespace() { final String[] text = {"/**", " * {@code foo\t\t bar baz\t }", " */"}; - + final List tags = InlineTagUtil.extractInlineTags(text); @@ -74,7 +74,7 @@ public class InlineTagUtilTest { } - + @Test - public void extractInlineTags() { + void extractInlineTags() { @@ -39676,7 +39676,7 @@ }; @@ -88,7 +88,7 @@ public class InlineTagUtilTest { } - + @Test - public void testBadInputExtractInlineTagsLineFeed() { + void badInputExtractInlineTagsLineFeed() { @@ -39685,7 +39685,7 @@ assertWithMessage("IllegalArgumentException expected").fail(); @@ -98,7 +98,7 @@ public class InlineTagUtilTest { } - + @Test - public void testBadInputExtractInlineTagsCarriageReturn() { + void badInputExtractInlineTagsCarriageReturn() { @@ -39697,42 +39697,42 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupport { +final class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void test() throws Exception { + void test() throws Exception { - + final String[] expected = { "21:9: " + getCheckMessage(MSG_KEY, 4, 3), @@ -51,7 +51,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testNoBitwise() throws Exception { + void noBitwise() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -59,7 +59,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testNullPointerException() throws Exception { + void nullPointerException() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -67,7 +67,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testWrongToken() { + void wrongToken() { @@ -39741,54 +39741,54 @@ final DetailAstImpl ast = new DetailAstImpl(); @@ -83,7 +83,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testSmall() throws Exception { + void small() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -91,7 +91,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testBooleanExpressionComplexityRecordsAndCompactCtors() throws Exception { + void booleanExpressionComplexityRecordsAndCompactCtors() throws Exception { - + final int max = 3; - + @@ -108,7 +108,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testLeaves() throws Exception { + void leaves() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -116,7 +116,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp } - + @Test - public void testRecordLeaves() throws Exception { + void recordLeaves() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- 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; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSupport { +final class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testTokens() { + void tokens() { @@ -39797,16 +39797,16 @@ .that(check.getRequiredTokens()) @@ -56,7 +56,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void test() throws Exception { + void test() throws Exception { - + final String[] expected = { "16:1: " + getCheckMessage(MSG_KEY, 4, 0, "[AnotherInnerClass, HashMap, HashSet, int]"), @@ -68,7 +68,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testExcludedPackageDirectPackages() throws Exception { + void excludedPackageDirectPackages() throws Exception { @@ -39815,7 +39815,7 @@ }; @@ -78,7 +78,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testExcludedPackageCommonPackages() throws Exception { + void excludedPackageCommonPackages() throws Exception { @@ -39824,16 +39824,16 @@ "32:5: " + getCheckMessage(MSG_KEY, 2, 0, "[BasicClientTlsStrategy, CommandSupport]"), @@ -89,7 +89,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testExcludedPackageWithEndingDot() throws Exception { + void excludedPackageWithEndingDot() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ClassDataAbstractionCouplingCheck.class); - + @@ -118,20 +118,20 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testExcludedPackageCommonPackagesAllIgnored() throws Exception { + void excludedPackageCommonPackagesAllIgnored() throws Exception { @@ -39841,14 +39841,14 @@ verifyWithInlineConfigParser( getPath("InputClassDataAbstractionCouplingExcludedPackagesAllIgnored.java"), expected); } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputClassDataAbstractionCoupling2.java"), expected); } - + @Test - public void testWrongToken() { + void wrongToken() { @@ -39857,63 +39857,63 @@ final DetailAstImpl ast = new DetailAstImpl(); @@ -147,7 +147,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testRegularExpression() throws Exception { + void regularExpression() throws Exception { - + final String[] expected = { "22:1: " + getCheckMessage(MSG_KEY, 2, 0, "[AnotherInnerClass, int]"), @@ -158,7 +158,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testEmptyRegularExpression() throws Exception { + void emptyRegularExpression() throws Exception { - + final String[] expected = { "22:1: " + getCheckMessage(MSG_KEY, 4, 0, "[AnotherInnerClass, HashMap, HashSet, int]"), @@ -170,7 +170,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testClassDataAbstractionCouplingRecords() throws Exception { + void classDataAbstractionCouplingRecords() throws Exception { - + final int maxAbstraction = 1; final String[] expected = { @@ -186,7 +186,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup } - + @Test - public void testNew() throws Exception { + void testNew() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java @@ -36,7 +36,7 @@ import java.util.Map; import java.util.Optional; import org.junit.jupiter.api.Test; - + -public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { +final class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -44,7 +44,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { - + final String[] expected = { "27:1: " + getCheckMessage(MSG_KEY, 3, 0), "59:1: " + getCheckMessage(MSG_KEY, 1, 0), @@ -54,7 +54,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludedPackagesDirectPackages() throws Exception { + void excludedPackagesDirectPackages() throws Exception { @@ -39922,7 +39922,7 @@ }; @@ -64,7 +64,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludedPackagesCommonPackages() throws Exception { + void excludedPackagesCommonPackages() throws Exception { @@ -39931,16 +39931,16 @@ "32:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -75,7 +75,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludedPackagesCommonPackagesWithEndingDot() throws Exception { + void excludedPackagesCommonPackagesWithEndingDot() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ClassFanOutComplexityCheck.class); - + checkConfig.addProperty("max", "0"); @@ -103,14 +103,14 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExcludedPackagesAllIgnored() throws Exception { + void excludedPackagesAllIgnored() throws Exception { @@ -39948,23 +39948,23 @@ verifyWithInlineConfigParser( getPath("InputClassFanOutComplexityExcludedPackagesAllIgnored.java"), expected); } - + @Test - public void test15() throws Exception { + void test15() throws Exception { - + final String[] expected = { "29:1: " + getCheckMessage(MSG_KEY, 1, 0), @@ -120,13 +120,13 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputClassFanOutComplexity2.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -39973,42 +39973,42 @@ final int[] actual = classFanOutComplexityCheckObj.getAcceptableTokens(); @@ -150,7 +150,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRegularExpression() throws Exception { + void regularExpression() throws Exception { - + final String[] expected = { "44:1: " + getCheckMessage(MSG_KEY, 2, 0), "76:1: " + getCheckMessage(MSG_KEY, 1, 0), @@ -160,7 +160,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyRegularExpression() throws Exception { + void emptyRegularExpression() throws Exception { - + final String[] expected = { "44:1: " + getCheckMessage(MSG_KEY, 3, 0), "76:1: " + getCheckMessage(MSG_KEY, 1, 0), @@ -170,7 +170,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithMultiDimensionalArray() throws Exception { + void withMultiDimensionalArray() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( @@ -178,14 +178,14 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageName() throws Exception { + void packageName() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputClassFanOutComplexityPackageName.java"), expected); } - + @Test - public void testExtends() throws Exception { + void testExtends() throws Exception { @@ -40017,7 +40017,7 @@ }; @@ -193,7 +193,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImplements() throws Exception { + void testImplements() throws Exception { @@ -40026,7 +40026,7 @@ }; @@ -201,7 +201,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { @@ -40035,7 +40035,7 @@ "45:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -215,7 +215,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImplementsAndNestedCount() throws Exception { + void implementsAndNestedCount() throws Exception { @@ -40044,7 +40044,7 @@ }; @@ -224,7 +224,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassFanOutComplexityRecords() throws Exception { + void classFanOutComplexityRecords() throws Exception { @@ -40053,14 +40053,14 @@ }; @@ -233,27 +233,27 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassFanOutComplexityIgnoreVar() throws Exception { + void classFanOutComplexityIgnoreVar() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputClassFanOutComplexityVar.java"), expected); } - + @Test - public void testClassFanOutComplexityRemoveIncorrectAnnotationToken() throws Exception { + void classFanOutComplexityRemoveIncorrectAnnotationToken() throws Exception { @@ -40068,7 +40068,7 @@ verifyWithInlineConfigParser( getPath("InputClassFanOutComplexityRemoveIncorrectAnnotationToken.java"), expected); } - + @Test - public void testClassFanOutComplexityRemoveIncorrectTypeParameter() throws Exception { + void classFanOutComplexityRemoveIncorrectTypeParameter() throws Exception { @@ -40076,7 +40076,7 @@ verifyWithInlineConfigParser( getPath("InputClassFanOutComplexityRemoveIncorrectTypeParameter.java"), expected); } - + @Test - public void testClassFanOutComplexityMultiCatchBitwiseOr() throws Exception { + void classFanOutComplexityMultiCatchBitwiseOr() throws Exception { @@ -40085,7 +40085,7 @@ }; @@ -263,7 +263,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThrows() throws Exception { + void testThrows() throws Exception { @@ -40154,60 +40154,60 @@ @@ -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 CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { +final class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchBlockAsSingleDecisionPointSetToTrue() throws Exception { + void switchBlockAsSingleDecisionPointSetToTrue() throws Exception { - + final String[] expected = { "14:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -45,7 +45,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchBlockAsSingleDecisionPointSetToFalse() throws Exception { + void switchBlockAsSingleDecisionPointSetToFalse() throws Exception { - + final String[] expected = { "14:5: " + getCheckMessage(MSG_KEY, 5, 0), @@ -55,7 +55,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsMaxComplexity() throws Exception { + void equalsMaxComplexity() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -63,7 +63,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { - + final String[] expected = { "15:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -82,7 +82,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCyclomaticComplexityRecords() throws Exception { + void cyclomaticComplexityRecords() throws Exception { - + final int max = 0; - + @@ -99,7 +99,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -40216,7 +40216,7 @@ final int[] expected = { @@ -123,7 +123,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -40225,15 +40225,15 @@ final int[] expected = { @@ -137,14 +137,14 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHighMax() throws Exception { + void highMax() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputCyclomaticComplexitySwitchBlocks4.java"), expected); } - + @Test - public void testDefaultMax() throws Exception { + void defaultMax() throws Exception { @@ -40243,51 +40243,51 @@ --- 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; - + /** Test case for the JavaNCSS-Check. */ // -@cs[AbbreviationAsWordInName] Test should be named as its main class. -public class JavaNCSSCheckTest extends AbstractModuleTestSupport { +final class JavaNCSSCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +40,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test() throws Exception { + void test() throws Exception { - + final String[] expected = { "12:1: " + getCheckMessage(MSG_FILE, 39, 2), @@ -62,7 +62,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualToMax() throws Exception { + void equalToMax() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -70,13 +70,13 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputJavaNCSS3.java"), expected); } - + @Test - public void testRecordsAndCompactCtors() throws Exception { + void recordsAndCompactCtors() throws Exception { - + final String[] expected = { "12:1: " + getCheckMessage(MSG_FILE, 89, 2), @@ -99,7 +99,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForMutation() throws Exception { + void forMutation() throws Exception { @@ -40296,7 +40296,7 @@ }; @@ -107,7 +107,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordMax() throws Exception { + void recordMax() throws Exception { @@ -40305,7 +40305,7 @@ "15:5: " + getCheckMessage(MSG_RECORD, 151, 150), @@ -117,7 +117,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -40314,7 +40314,7 @@ final int[] expected = { @@ -157,7 +157,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -40325,16 +40325,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java @@ -40,7 +40,7 @@ import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + // -@cs[AbbreviationAsWordInName] Can't change check name -public class NPathComplexityCheckTest extends AbstractModuleTestSupport { +final class NPathComplexityCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -48,7 +48,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCalculation() throws Exception { + void calculation() throws Exception { @@ -40343,7 +40343,7 @@ "17:17: " + getCheckMessage(MSG_KEY, 2, 0), @@ -70,7 +70,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCalculation2() throws Exception { + void calculation2() throws Exception { @@ -40352,7 +40352,7 @@ "18:5: " + getCheckMessage(MSG_KEY, 5, 0), @@ -92,7 +92,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCalculation3() throws Exception { + void calculation3() throws Exception { @@ -40361,17 +40361,17 @@ }; @@ -102,7 +102,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIntegerOverflow() throws Exception { + void integerOverflow() throws Exception { - + final long largerThanMaxInt = 3_486_784_401L; - + @@ -113,9 +113,9 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { verifyWithInlineConfigParser(getPath("InputNPathComplexityOverflow.java"), expected); } - + - @Test @SuppressWarnings("unchecked") - public void testStatefulFieldsClearedOnBeginTree1() { @@ -40379,11 +40379,11 @@ + void statefulFieldsClearedOnBeginTree1() { final DetailAstImpl ast = new DetailAstImpl(); ast.setType(TokenTypes.LITERAL_ELSE); - + @@ -151,9 +151,9 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { .isTrue(); } - + - @Test @SuppressWarnings("unchecked") - public void testStatefulFieldsClearedOnBeginTree2() { @@ -40394,7 +40394,7 @@ ast.setLineNo(5); @@ -173,7 +173,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStatefulFieldsClearedOnBeginTree3() throws Exception { + void statefulFieldsClearedOnBeginTree3() throws Exception { @@ -40412,50 +40412,50 @@ return TestUtil.getInternalState(processingTokenEnd, "endLineNo") == 0 @@ -198,13 +198,13 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNPathComplexityDefault2.java"), expected); } - + @Test - public void testNpathComplexityRecords() throws Exception { + void npathComplexityRecords() throws Exception { final int max = 1; - + final String[] expected = { @@ -219,7 +219,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNpathComplexitySwitchExpression() throws Exception { + void npathComplexitySwitchExpression() throws Exception { - + final int max = 1; - + @@ -235,7 +235,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBranchVisited() throws Exception { + void branchVisited() throws Exception { - + final String[] expected = { "13:3: " + getCheckMessage(MSG_KEY, 37, 20), @@ -245,7 +245,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCount() throws Exception { + void count() throws Exception { - + final String[] expected = { "11:5: " + getCheckMessage(MSG_KEY, 30, 20), @@ -257,7 +257,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -40464,7 +40464,7 @@ final int[] expected = { @@ -285,7 +285,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -40473,7 +40473,7 @@ final int[] expected = { @@ -313,7 +313,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultHooks() { + void defaultHooks() { @@ -40491,7 +40491,7 @@ final DetailAstImpl token = new DetailAstImpl(); @@ -354,7 +354,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitTokenBeforeExpressionRange() { + void visitTokenBeforeExpressionRange() { @@ -40503,15 +40503,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { +final class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testMethodsOnClass() throws Exception { + void methodsOnClass() throws Exception { @@ -40520,7 +40520,7 @@ "58:9: " + getCheckMessage(MSG_KEY, "static"), @@ -49,7 +49,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -40529,7 +40529,7 @@ final int[] expected = { @@ -59,7 +59,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testMethodsOnClassNoImpliedStaticEnum() throws Exception { + void methodsOnClassNoImpliedStaticEnum() throws Exception { @@ -40538,7 +40538,7 @@ "77:9: " + getCheckMessage(MSG_KEY, "static"), @@ -70,7 +70,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testMethodsOnClassNoImpliedStaticInterface() throws Exception { + void methodsOnClassNoImpliedStaticInterface() throws Exception { @@ -40547,7 +40547,7 @@ "63:5: " + getCheckMessage(MSG_KEY, "static"), @@ -81,14 +81,14 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testMethodsOnClassNoViolationsChecked() throws Exception { + void methodsOnClassNoViolationsChecked() throws Exception { @@ -40555,7 +40555,7 @@ verifyWithInlineConfigParser( getPath("InputClassMemberImpliedModifierOnClassNoViolations.java"), expected); } - + @Test - public void testMethodsOnInterface() throws Exception { + void methodsOnInterface() throws Exception { @@ -40564,7 +40564,7 @@ "67:13: " + getCheckMessage(MSG_KEY, "static"), @@ -102,7 +102,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testClassMemberImpliedModifierRecords() throws Exception { + void classMemberImpliedModifierRecords() throws Exception { @@ -40573,7 +40573,7 @@ "20:5: " + getCheckMessage(MSG_KEY, "static"), @@ -117,7 +117,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testClassMemberImpliedModifierNoViolationRecords() throws Exception { + void classMemberImpliedModifierNoViolationRecords() throws Exception { @@ -40582,7 +40582,7 @@ "20:5: " + getCheckMessage(MSG_KEY, "static"), @@ -129,7 +129,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testIllegalState() { + void illegalState() { @@ -40594,15 +40594,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { +final class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testMethodsOnInterfaceNoImpliedPublicAbstract() throws Exception { + void methodsOnInterfaceNoImpliedPublicAbstract() throws Exception { @@ -40611,7 +40611,7 @@ "27:5: " + getCheckMessage(MSG_KEY, "public"), @@ -50,7 +50,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -40620,7 +40620,7 @@ final int[] expected = { @@ -64,7 +64,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testMethodsOnInterfaceNoImpliedAbstractAllowImpliedPublic() throws Exception { + void methodsOnInterfaceNoImpliedAbstractAllowImpliedPublic() throws Exception { @@ -40629,7 +40629,7 @@ "38:5: " + getCheckMessage(MSG_KEY, "abstract"), @@ -74,7 +74,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testMethodsOnInterfaceNoImpliedPublicAllowImpliedAbstract() throws Exception { + void methodsOnInterfaceNoImpliedPublicAllowImpliedAbstract() throws Exception { @@ -40638,7 +40638,7 @@ "27:5: " + getCheckMessage(MSG_KEY, "public"), @@ -86,21 +86,21 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testMethodsOnInterfaceAllowImpliedPublicAbstract() throws Exception { + void methodsOnInterfaceAllowImpliedPublicAbstract() throws Exception { @@ -40646,7 +40646,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierMethodsOnInterface4.java"), expected); } - + @Test - public void testMethodsOnClassIgnored() throws Exception { + void methodsOnClassIgnored() throws Exception { @@ -40654,7 +40654,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierMethodsOnClass.java"), expected); } - + @Test - public void testMethodsOnInterfaceNestedNoImpliedPublicAbstract() throws Exception { + void methodsOnInterfaceNestedNoImpliedPublicAbstract() throws Exception { @@ -40663,7 +40663,7 @@ "29:9: " + getCheckMessage(MSG_KEY, "public"), @@ -114,7 +114,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testMethodsOnClassNestedNoImpliedPublicAbstract() throws Exception { + void methodsOnClassNestedNoImpliedPublicAbstract() throws Exception { @@ -40672,7 +40672,7 @@ "29:9: " + getCheckMessage(MSG_KEY, "public"), @@ -128,7 +128,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testFieldsOnInterfaceNoImpliedPublicStaticFinal() throws Exception { + void fieldsOnInterfaceNoImpliedPublicStaticFinal() throws Exception { @@ -40681,7 +40681,7 @@ "22:5: " + getCheckMessage(MSG_KEY, "static"), @@ -148,7 +148,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testFieldsOnInterfaceNoImpliedPublicStaticAllowImpliedFinal() throws Exception { + void fieldsOnInterfaceNoImpliedPublicStaticAllowImpliedFinal() throws Exception { @@ -40690,7 +40690,7 @@ "24:5: " + getCheckMessage(MSG_KEY, "static"), @@ -164,7 +164,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testFieldsOnInterfaceNoImpliedPublicFinalAllowImpliedStatic() throws Exception { + void fieldsOnInterfaceNoImpliedPublicFinalAllowImpliedStatic() throws Exception { @@ -40699,7 +40699,7 @@ "24:5: " + getCheckMessage(MSG_KEY, "final"), @@ -180,7 +180,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testFieldsOnInterfaceNoImpliedStaticFinalAllowImpliedPublic() throws Exception { + void fieldsOnInterfaceNoImpliedStaticFinalAllowImpliedPublic() throws Exception { @@ -40708,7 +40708,7 @@ "22:5: " + getCheckMessage(MSG_KEY, "static"), @@ -196,21 +196,21 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testFieldsOnInterfaceAllowImpliedPublicStaticFinal() throws Exception { + void fieldsOnInterfaceAllowImpliedPublicStaticFinal() throws Exception { @@ -40716,7 +40716,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierFieldsOnInterface5.java"), expected); } - + @Test - public void testFieldsOnClassIgnored() throws Exception { + void fieldsOnClassIgnored() throws Exception { @@ -40724,7 +40724,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierFieldsOnClass.java"), expected); } - + @Test - public void testNestedOnInterfaceNoImpliedPublicStatic() throws Exception { + void nestedOnInterfaceNoImpliedPublicStatic() throws Exception { @@ -40733,7 +40733,7 @@ "24:5: " + getCheckMessage(MSG_KEY, "public"), @@ -230,7 +230,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testNestedOnInterfaceNoImpliedStaticAllowImpliedPublic() throws Exception { + void nestedOnInterfaceNoImpliedStaticAllowImpliedPublic() throws Exception { @@ -40742,7 +40742,7 @@ "27:5: " + getCheckMessage(MSG_KEY, "static"), @@ -244,7 +244,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testNestedOnInterfaceNoImpliedPublicAllowImpliedStatic() throws Exception { + void nestedOnInterfaceNoImpliedPublicAllowImpliedStatic() throws Exception { @@ -40751,7 +40751,7 @@ "27:5: " + getCheckMessage(MSG_KEY, "public"), @@ -258,21 +258,21 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testNestedOnInterfaceAllowImpliedPublicStatic() throws Exception { + void nestedOnInterfaceAllowImpliedPublicStatic() throws Exception { @@ -40759,7 +40759,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierNestedOnInterface4.java"), expected); } - + @Test - public void testNestedOnClassIgnored() throws Exception { + void nestedOnClassIgnored() throws Exception { @@ -40767,7 +40767,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierNestedOnClass.java"), expected); } - + @Test - public void testNestedOnInterfaceNestedNoImpliedPublicStatic() throws Exception { + void nestedOnInterfaceNestedNoImpliedPublicStatic() throws Exception { @@ -40776,7 +40776,7 @@ "20:9: " + getCheckMessage(MSG_KEY, "static"), @@ -286,7 +286,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testNestedOnClassNestedNoImpliedPublicStatic() throws Exception { + void nestedOnClassNestedNoImpliedPublicStatic() throws Exception { @@ -40785,7 +40785,7 @@ "20:9: " + getCheckMessage(MSG_KEY, "static"), @@ -300,7 +300,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testPackageScopeInterface() throws Exception { + void packageScopeInterface() throws Exception { @@ -40794,7 +40794,7 @@ "22:5: " + getCheckMessage(MSG_KEY, "static"), @@ -330,14 +330,14 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS } - + @Test - public void testPrivateMethodsOnInterface() throws Exception { + void privateMethodsOnInterface() throws Exception { @@ -40802,7 +40802,7 @@ verifyWithInlineConfigParser( getPath("InputInterfaceMemberImpliedModifierPrivateMethods.java"), expected); } - + @Test - public void testIllegalState() { + void illegalState() { @@ -40814,15 +40814,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class ModifierOrderCheckTest extends AbstractModuleTestSupport { +final class ModifierOrderCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -40831,7 +40831,7 @@ assertWithMessage("Default required tokens are invalid") @@ -45,7 +45,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -40840,14 +40840,14 @@ "19:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), @@ -59,13 +59,13 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultMethods() throws Exception { + void defaultMethods() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputModifierOrderDefaultMethods.java"), expected); } - + @Test - public void testGetDefaultTokens() { + void getDefaultTokens() { @@ -40856,7 +40856,7 @@ final int[] expected = {TokenTypes.MODIFIERS}; @@ -82,7 +82,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -40865,7 +40865,7 @@ final int[] expected = {TokenTypes.MODIFIERS}; @@ -99,7 +99,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSkipTypeAnnotations() throws Exception { + void skipTypeAnnotations() throws Exception { @@ -40874,7 +40874,7 @@ }; @@ -107,7 +107,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationOnAnnotationDeclaration() throws Exception { + void annotationOnAnnotationDeclaration() throws Exception { @@ -40883,7 +40883,7 @@ }; @@ -115,7 +115,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testModifierOrderSealedAndNonSealed() throws Exception { + void modifierOrderSealedAndNonSealed() throws Exception { @@ -40892,7 +40892,7 @@ "26:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), @@ -129,7 +129,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testModifierOrderSealedAndNonSealedNoViolation() throws Exception { + void modifierOrderSealedAndNonSealedNoViolation() throws Exception { @@ -40904,15 +40904,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class RedundantModifierCheckTest extends AbstractModuleTestSupport { +final class RedundantModifierCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassesInsideOfInterfaces() throws Exception { + void classesInsideOfInterfaces() throws Exception { @@ -40921,7 +40921,7 @@ "25:5: " + getCheckMessage(MSG_KEY, "public"), @@ -49,7 +49,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -40930,7 +40930,7 @@ "60:9: " + getCheckMessage(MSG_KEY, "public"), @@ -70,14 +70,14 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStaticMethodInInterface() throws Exception { + void staticMethodInInterface() throws Exception { @@ -40938,7 +40938,7 @@ verifyWithInlineConfigParser( getPath("InputRedundantModifierStaticMethodInInterface.java"), expected); } - + @Test - public void testFinalInInterface() throws Exception { + void finalInInterface() throws Exception { @@ -40947,7 +40947,7 @@ }; @@ -85,7 +85,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumConstructorIsImplicitlyPrivate() throws Exception { + void enumConstructorIsImplicitlyPrivate() throws Exception { @@ -40956,7 +40956,7 @@ }; @@ -94,7 +94,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerTypeInInterfaceIsImplicitlyStatic() throws Exception { + void innerTypeInInterfaceIsImplicitlyStatic() throws Exception { @@ -40965,25 +40965,25 @@ }; @@ -103,7 +103,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotPublicClassConstructorHasNotPublicModifier() throws Exception { + void notPublicClassConstructorHasNotPublicModifier() throws Exception { - + final String[] expected = { "22:5: " + getCheckMessage(MSG_KEY, "public"), @@ -113,7 +113,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedClassConsInPublicInterfaceHasValidPublicModifier() throws Exception { + void nestedClassConsInPublicInterfaceHasValidPublicModifier() throws Exception { - + final String[] expected = { "22:17: " + getCheckMessage(MSG_KEY, "public"), @@ -127,7 +127,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -40992,7 +40992,7 @@ final int[] expected = { @@ -146,7 +146,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongTokenType() { + void wrongTokenType() { @@ -41001,7 +41001,7 @@ ast.initialize(TokenTypes.LITERAL_NULL, "null"); @@ -165,7 +165,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41010,7 +41010,7 @@ final int[] expected = CommonUtil.EMPTY_INT_ARRAY; @@ -173,7 +173,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedStaticEnum() throws Exception { + void nestedStaticEnum() throws Exception { @@ -41019,7 +41019,7 @@ "16:9: " + getCheckMessage(MSG_KEY, "static"), @@ -184,7 +184,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalInAnonymousClass() throws Exception { + void finalInAnonymousClass() throws Exception { @@ -41028,7 +41028,7 @@ }; @@ -193,7 +193,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalInTryWithResource() throws Exception { + void finalInTryWithResource() throws Exception { @@ -41037,7 +41037,7 @@ "43:14: " + getCheckMessage(MSG_KEY, "final"), @@ -204,7 +204,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFinalInAbstractMethods() throws Exception { + void finalInAbstractMethods() throws Exception { @@ -41046,7 +41046,7 @@ "16:49: " + getCheckMessage(MSG_KEY, "final"), @@ -217,7 +217,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumMethods() throws Exception { + void enumMethods() throws Exception { @@ -41055,7 +41055,7 @@ }; @@ -226,7 +226,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumStaticMethodsInPublicClass() throws Exception { + void enumStaticMethodsInPublicClass() throws Exception { @@ -41064,7 +41064,7 @@ }; @@ -235,7 +235,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationOnEnumConstructor() throws Exception { + void annotationOnEnumConstructor() throws Exception { @@ -41073,7 +41073,7 @@ }; @@ -244,7 +244,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrivateMethodInPrivateClass() throws Exception { + void privateMethodInPrivateClass() throws Exception { @@ -41082,7 +41082,7 @@ }; @@ -253,7 +253,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResourcesBlock() throws Exception { + void tryWithResourcesBlock() throws Exception { @@ -41091,7 +41091,7 @@ }; @@ -261,7 +261,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedDef() throws Exception { + void nestedDef() throws Exception { @@ -41100,7 +41100,7 @@ "11:5: " + getCheckMessage(MSG_KEY, "static"), @@ -291,7 +291,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecords() throws Exception { + void records() throws Exception { @@ -41112,42 +41112,42 @@ @@ -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 AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport { +final class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final int expectedCapitalCount = 4; - + final String[] expected = { @@ -51,7 +51,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeNamesForThreePermittedCapitalLetters() throws Exception { + void typeNamesForThreePermittedCapitalLetters() throws Exception { final int expectedCapitalCount = 4; - + final String[] expected = { @@ -65,7 +65,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeNamesForFourPermittedCapitalLetters() throws Exception { + void typeNamesForFourPermittedCapitalLetters() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -76,7 +76,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeNamesForFivePermittedCapitalLetters() throws Exception { + void typeNamesForFivePermittedCapitalLetters() throws Exception { @@ -41156,107 +41156,107 @@ "45:11: " + getWarningMessage("AbstractINNERRClass", expectedCapitalCount), @@ -87,7 +87,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNames() throws Exception { + void typeAndVariablesAndMethodNames() throws Exception { final int expectedCapitalCount = 6; - + final String[] expected = { @@ -102,7 +102,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithNoIgnores() throws Exception { + void typeAndVariablesAndMethodNamesWithNoIgnores() throws Exception { final int expectedCapitalCount = 6; - + final String[] expected = { @@ -122,7 +122,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnores() throws Exception { + void typeAndVariablesAndMethodNamesWithIgnores() throws Exception { final int expectedCapitalCount = 6; - + final String[] expected = { @@ -138,7 +138,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnoresFinal() throws Exception { + void typeAndVariablesAndMethodNamesWithIgnoresFinal() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -155,7 +155,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnoresStatic() throws Exception { + void typeAndVariablesAndMethodNamesWithIgnoresStatic() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -172,7 +172,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnoresStaticFinal() throws Exception { + void typeAndVariablesAndMethodNamesWithIgnoresStaticFinal() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -190,7 +190,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnoresNonStaticFinal() throws Exception { + void typeAndVariablesAndMethodNamesWithIgnoresNonStaticFinal() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -219,7 +219,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnoresFinalKeepStaticFinal() throws Exception { + void typeAndVariablesAndMethodNamesWithIgnoresFinalKeepStaticFinal() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -242,8 +242,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeAndVariablesAndMethodNamesWithIgnoresStaticKeepStaticFinal() - throws Exception { + void typeAndVariablesAndMethodNamesWithIgnoresStaticKeepStaticFinal() throws Exception { final int expectedCapitalCount = 5; - + final String[] expected = { @@ -266,7 +265,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeNamesForThreePermittedCapitalLettersWithOverriddenMethod() throws Exception { + void typeNamesForThreePermittedCapitalLettersWithOverriddenMethod() throws Exception { final int expectedCapitalCount = 4; - + final String[] expected = { @@ -278,7 +277,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testOverriddenMethod() throws Exception { + void overriddenMethod() throws Exception { final int expectedCapitalCount = 4; - + final String[] expected = { @@ -293,7 +292,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testTypeNamesForZeroPermittedCapitalLetter() throws Exception { + void typeNamesForZeroPermittedCapitalLetter() throws Exception { @@ -41265,52 +41265,52 @@ "20:16: " + getWarningMessage("NonAAAAbstractClassName6", expectedCapitalCount), @@ -329,7 +328,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testNullPointerException() throws Exception { + void nullPointerException() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -338,7 +337,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testAbbreviationAsWordInNameCheckEnhancedInstanceof() throws Exception { + void abbreviationAsWordInNameCheckEnhancedInstanceof() throws Exception { - + final int expectedCapitalCount = 4; - + @@ -355,8 +354,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testAbbreviationAsWordInNameCheckEnhancedInstanceofAllowXmlLength1() - throws Exception { + void abbreviationAsWordInNameCheckEnhancedInstanceofAllowXmlLength1() throws Exception { - + final int expectedCapitalCount = 2; - + @@ -375,7 +373,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testAbbreviationAsWordInNameCheckRecords() throws Exception { + void abbreviationAsWordInNameCheckRecords() throws Exception { - + final int expectedCapitalCount = 4; - + @@ -406,14 +404,14 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testReceiver() throws Exception { + void receiver() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputAbbreviationAsWordInNameReceiver.java"), expected); } - + @Test - public void testInputAbbreviationAsWordInNameTypeSnakeStyle() throws Exception { + void inputAbbreviationAsWordInNameTypeSnakeStyle() throws Exception { @@ -41319,7 +41319,7 @@ "16:17: " + getWarningMessage("HYBRID_LOCK_PATH", 4), @@ -431,7 +429,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testAnnotation() throws Exception { + void annotation() throws Exception { @@ -41331,51 +41331,51 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + -public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { +final class AbstractClassNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalAbstractClassName() throws Exception { + void illegalAbstractClassName() throws Exception { - + final String pattern = "^Abstract.+$"; - + @@ -50,7 +50,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomFormat() throws Exception { + void customFormat() throws Exception { - + final String[] expected = { "13:1: " @@ -68,7 +68,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalClassType() throws Exception { + void illegalClassType() throws Exception { - + final String[] expected = { "18:1: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractClassType"), @@ -79,7 +79,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllVariants() throws Exception { + void allVariants() throws Exception { - + final String pattern = "^Abstract.+$"; - + @@ -99,7 +99,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFalsePositive() throws Exception { + void falsePositive() throws Exception { @@ -41384,7 +41384,7 @@ "13:1: " @@ -118,7 +118,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -41393,7 +41393,7 @@ final int[] expected = { @@ -128,7 +128,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41403,12 +41403,12 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AccessModifierOptionTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AccessModifierOptionTest.java @@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; - + import org.junit.jupiter.api.Test; - + -public class AccessModifierOptionTest { +final class AccessModifierOptionTest { - + @Test - public void testDefaultCase() { + void defaultCase() { @@ -41417,7 +41417,7 @@ .isEqualTo("PUBLIC"); @@ -42,7 +42,7 @@ public class AccessModifierOptionTest { } - + @Test - public void testCase() { + void testCase() { @@ -41429,70 +41429,70 @@ @@ -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 CatchParameterNameCheckTest extends AbstractModuleTestSupport { +final class CatchParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTokens() { + void tokens() { final CatchParameterNameCheck catchParameterNameCheck = new CatchParameterNameCheck(); final int[] expected = {TokenTypes.PARAMETER_DEF}; - + @@ -48,14 +48,14 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfigurationOnCorrectFile() throws Exception { + void defaultConfigurationOnCorrectFile() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputCatchParameterNameSimple.java"), expected); } - + @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[] expected = { @@ -73,7 +73,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomFormatFromJavadoc() throws Exception { + void customFormatFromJavadoc() throws Exception { - + final String[] expected = { "13:28: " + getCheckMessage(MSG_INVALID_PATTERN, "e", "^[a-z][a-zA-Z0-9]+$"), @@ -84,7 +84,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomFormatWithNoAnchors() throws Exception { + void customFormatWithNoAnchors() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- 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; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + -public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { +final class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetClassRequiredTokens() { + void getClassRequiredTokens() { @@ -41501,25 +41501,25 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassDefault() throws Exception { + void classDefault() throws Exception { - + final String pattern = "^[A-Z]$"; - + @@ -56,7 +56,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassFooName() throws Exception { + void classFooName() throws Exception { - + final String pattern = "^foo$"; - + @@ -68,7 +68,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -41531,15 +41531,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class ConstantNameCheckTest extends AbstractModuleTestSupport { +final class ConstantNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41548,7 +41548,7 @@ assertWithMessage("Default required tokens are invalid") @@ -46,7 +46,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalRegexp() throws Exception { + void illegalRegexp() throws Exception { @@ -41557,58 +41557,58 @@ try { @@ -64,7 +64,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @@ -76,7 +76,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAccessControlTuning() throws Exception { + void accessControlTuning() throws Exception { - + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @@ -87,7 +87,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceAndAnnotation() throws Exception { + void interfaceAndAnnotation() throws Exception { - + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @@ -99,13 +99,13 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault1() throws Exception { + void default1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputConstantName.java"), expected); } - + @Test - public void testIntoInterface() throws Exception { + void intoInterface() throws Exception { - + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @@ -123,21 +123,21 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIntoInterfaceExcludePublic() throws Exception { + void intoInterfaceExcludePublic() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputConstantNameInterfaceIgnorePublic.java"), expected); } - + @Test - public void testStaticMethodInInterface() throws Exception { + void staticMethodInInterface() throws Exception { @@ -41616,7 +41616,7 @@ verifyWithInlineConfigParser( getPath("InputConstantNameStaticModifierInInterface.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -41628,15 +41628,15 @@ @@ -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 IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { +final class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -41645,72 +41645,72 @@ TokenTypes.CLASS_DEF, @@ -59,7 +59,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { final IllegalIdentifierNameCheck illegalIdentifierNameCheck = new IllegalIdentifierNameCheck(); final int[] expected = CommonUtil.EMPTY_INT_ARRAY; - + @@ -69,7 +69,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalIdentifierNameDefault() throws Exception { + void illegalIdentifierNameDefault() throws Exception { - + final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; - + @@ -92,7 +92,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalIdentifierNameOpenTransitive() throws Exception { + void illegalIdentifierNameOpenTransitive() throws Exception { final String format = "(?i)^(?!(record|yield|var|permits|sealed|open|transitive)$).+$"; - + final String[] expected = { @@ -116,7 +116,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalIdentifierNameParameterReceiver() throws Exception { + void illegalIdentifierNameParameterReceiver() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -125,7 +125,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalIdentifierNameUnderscore() throws Exception { + void illegalIdentifierNameUnderscore() throws Exception { final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; - + final String[] expected = { @@ -136,7 +136,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalIdentifierNameLambda() throws Exception { + void illegalIdentifierNameLambda() 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 +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.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 InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSupport { +final class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -41719,7 +41719,7 @@ final int[] expected = {TokenTypes.TYPE_PARAMETER}; @@ -45,7 +45,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41728,36 +41728,36 @@ assertWithMessage("Default required tokens are invalid") @@ -54,7 +54,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testInterfaceDefault() throws Exception { + void interfaceDefault() throws Exception { - + final String pattern = "^[A-Z]$"; - + @@ -65,7 +65,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo } - + @Test - public void testInterfaceFooName() throws Exception { + void interfaceFooName() throws Exception { - + final String pattern = "^foo$"; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckTest.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 LambdaParameterNameCheckTest extends AbstractModuleTestSupport { +final class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41766,7 +41766,7 @@ }; @@ -45,7 +45,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptableTokens() { + void acceptableTokens() { @@ -41775,36 +41775,36 @@ }; @@ -56,7 +56,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testParametersInLambda() throws Exception { + void parametersInLambda() throws Exception { - + final String pattern = "^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"; - + @@ -71,7 +71,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaParameterNameSwitchExpression() throws Exception { + void lambdaParameterNameSwitchExpression() 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 @@ -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 LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { +final class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41813,32 +41813,32 @@ "LocalFinalVariableNameCheck#getRequiredTokens should return empty array " @@ -45,7 +45,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -56,7 +56,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSet() throws Exception { + void set() throws Exception { - + final String pattern = "[A-Z]+"; - + @@ -67,13 +67,13 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerClass() throws Exception { + void innerClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLocalFinalVariableNameInnerClass.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -41847,20 +41847,20 @@ final int[] actual = localFinalVariableNameCheckObj.getAcceptableTokens(); @@ -84,7 +84,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResources() throws Exception { + void tryWithResources() throws Exception { - + final String pattern = "[A-Z]+"; - + @@ -99,7 +99,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResourcesJava9() throws Exception { + void tryWithResourcesJava9() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java @@ -41868,60 +41868,60 @@ @@ -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 LocalVariableNameCheckTest extends AbstractModuleTestSupport { +final class LocalVariableNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final LocalVariableNameCheck localVariableNameCheck = new LocalVariableNameCheck(); final int[] expected = {TokenTypes.VARIABLE_DEF}; - + @@ -45,7 +45,7 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -59,13 +59,13 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerClass() throws Exception { + void innerClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLocalVariableNameInnerClass.java"), expected); } - + @Test - public void testLoopVariables() throws Exception { + void loopVariables() throws Exception { - + final String pattern = "^[a-z]{2,}[a-zA-Z0-9]*$"; - + --- 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; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + -public class MemberNameCheckTest extends AbstractModuleTestSupport { +final class MemberNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -41930,97 +41930,97 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpecified() throws Exception { + void specified() throws Exception { - + final String pattern = "^m[A-Z][a-zA-Z0-9]*$"; - + @@ -55,7 +55,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInnerClass() throws Exception { + void innerClass() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -66,7 +66,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaults() throws Exception { + void defaults() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -80,7 +80,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUnderlined() throws Exception { + void underlined() throws Exception { - + final String pattern = "^_[a-z]*$"; - + @@ -94,7 +94,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPublicOnly() throws Exception { + void publicOnly() throws Exception { - + final String pattern = "^_[a-z]*$"; - + @@ -105,7 +105,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testProtectedOnly() throws Exception { + void protectedOnly() throws Exception { - + final String pattern = "^_[a-z]*$"; - + @@ -116,7 +116,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageOnly() throws Exception { + void packageOnly() throws Exception { - + final String pattern = "^_[a-z]*$"; - + @@ -127,7 +127,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrivateOnly() throws Exception { + void privateOnly() throws Exception { - + final String pattern = "^_[a-z]*$"; - + @@ -138,7 +138,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotPrivate() throws Exception { + void notPrivate() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -151,7 +151,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void memberNameExtended() throws Exception { + void memberNameExtended() throws Exception { - + final String pattern = "^[a-z][a-z0-9][a-zA-Z0-9]*$"; - + @@ -193,7 +193,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42032,15 +42032,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MethodNameCheckTest extends AbstractModuleTestSupport { +final class MethodNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -42049,79 +42049,79 @@ assertWithMessage("Default required tokens are invalid") @@ -45,7 +45,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -56,7 +56,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodEqClass() throws Exception { + void methodEqClass() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -80,7 +80,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodEqClassAllow() throws Exception { + void methodEqClassAllow() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + final String[] expected = { @@ -98,7 +98,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAccessTuning() throws Exception { + void accessTuning() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + final String[] expected = { @@ -114,7 +114,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testForNpe() throws Exception { + void forNpe() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -122,7 +122,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOverriddenMethods() throws Exception { + void overriddenMethods() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -135,7 +135,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfacesExcludePublic() throws Exception { + void interfacesExcludePublic() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + final String[] expected = { @@ -148,7 +148,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfacesExcludePrivate() throws Exception { + void interfacesExcludePrivate() throws Exception { final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + final String[] expected = { @@ -163,7 +163,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42130,27 +42130,27 @@ final int[] expected = { @@ -173,7 +173,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordInInterfaceBody() throws Exception { + void recordInInterfaceBody() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.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 MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport { +final class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42159,7 +42159,7 @@ final int[] expected = {TokenTypes.TYPE_PARAMETER}; @@ -45,7 +45,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -42168,36 +42168,36 @@ assertWithMessage("Default required tokens are invalid") @@ -54,7 +54,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testMethodDefault() throws Exception { + void methodDefault() throws Exception { - + final String pattern = "^[A-Z]$"; - + @@ -69,7 +69,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testMethodFooName() throws Exception { + void methodFooName() throws Exception { - + final String pattern = "^foo$"; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.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 PackageNameCheckTest extends AbstractModuleTestSupport { +final class PackageNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class PackageNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -42206,23 +42206,23 @@ assertWithMessage("Default required tokens are invalid") @@ -44,7 +44,7 @@ public class PackageNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpecified() throws Exception { + void specified() throws Exception { - + final String pattern = "[A-Z]+"; - + @@ -57,13 +57,13 @@ public class PackageNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputPackageNameSimple.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42234,15 +42234,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class ParameterNameCheckTest extends AbstractModuleTestSupport { +final class ParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -42251,23 +42251,23 @@ assertWithMessage("Default required tokens are invalid") @@ -45,13 +45,13 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCatch() throws Exception { + void testCatch() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterNameCatchOnly.java"), expected); } - + @Test - public void testSpecified() throws Exception { + void specified() throws Exception { - + final String pattern = "^a[A-Z][a-zA-Z0-9]*$"; - + @@ -64,7 +64,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceInAccessModifierProperty() throws Exception { + void whitespaceInAccessModifierProperty() throws Exception { @@ -42276,14 +42276,14 @@ "14:69: " + getCheckMessage(MSG_INVALID_PATTERN, "parameter1", pattern), @@ -75,13 +75,13 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterName.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42292,34 +42292,34 @@ final int[] expected = { @@ -91,7 +91,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSkipMethodsWithOverrideAnnotationTrue() throws Exception { + void skipMethodsWithOverrideAnnotationTrue() throws Exception { - + final String pattern = "^h$"; - + @@ -108,7 +108,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSkipMethodsWithOverrideAnnotationFalse() throws Exception { + void skipMethodsWithOverrideAnnotationFalse() throws Exception { - + final String pattern = "^h$"; - + @@ -126,7 +126,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPublicAccessModifier() throws Exception { + void publicAccessModifier() throws Exception { - + final String pattern = "^h$"; - + @@ -142,32 +142,32 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIsOverriddenNoNullPointerException() throws Exception { + void isOverriddenNoNullPointerException() throws Exception { @@ -42327,28 +42327,28 @@ verifyWithInlineConfigParser( getPath("InputParameterNameOverrideAnnotationNoNPE.java"), expected); } - + @Test - public void testReceiverParameter() throws Exception { + void receiverParameter() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterNameReceiver.java"), expected); } - + @Test - public void testLambdaParameterNoViolationAtAll() throws Exception { + void lambdaParameterNoViolationAtAll() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterNameLambda.java"), expected); } - + @Test - public void testWhitespaceInConfig() throws Exception { + void whitespaceInConfig() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterNameWhitespaceInConfig.java"), expected); } - + @Test - public void testSetAccessModifiers() throws Exception { + void setAccessModifiers() throws Exception { @@ -42360,53 +42360,53 @@ @@ -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 PatternVariableNameCheckTest extends AbstractModuleTestSupport { +final class PatternVariableNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final PatternVariableNameCheck patternVariableNameCheck = new PatternVariableNameCheck(); final int[] expected = {TokenTypes.PATTERN_VARIABLE_DEF}; - + @@ -44,7 +44,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -65,7 +65,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPatternVariableNameNoSingleChar() throws Exception { + void patternVariableNameNoSingleChar() 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; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + -public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { +final class RecordComponentNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetClassRequiredTokens() { + void getClassRequiredTokens() { @@ -42415,25 +42415,25 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordDefault() throws Exception { + void recordDefault() throws Exception { - + final String pattern = "^[a-z][a-zA-Z0-9]*$"; - + @@ -58,7 +58,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassFooName() throws Exception { + void classFooName() throws Exception { - + final String pattern = "^[a-z0-9]+$"; - + @@ -73,7 +73,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42445,15 +42445,15 @@ @@ -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 RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport { +final class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testGetClassRequiredTokens() { + void getClassRequiredTokens() { @@ -42462,25 +42462,25 @@ assertWithMessage("Default required tokens are invalid") @@ -43,7 +43,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testRecordDefault() throws Exception { + void recordDefault() throws Exception { - + final String pattern = "^[A-Z]$"; - + @@ -57,7 +57,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testClassFooName() throws Exception { + void classFooName() throws Exception { - + final String pattern = "^foo$"; - + @@ -71,7 +71,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42492,15 +42492,15 @@ @@ -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 StaticVariableNameCheckTest extends AbstractModuleTestSupport { +final class StaticVariableNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -42509,30 +42509,30 @@ assertWithMessage("Default required tokens are invalid") @@ -44,7 +44,7 @@ public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpecified() throws Exception { + void specified() throws Exception { - + final String pattern = "^s[A-Z][a-zA-Z0-9]*$"; - + @@ -55,19 +55,19 @@ public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAccessTuning() throws Exception { + void accessTuning() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputStaticVariableName2.java"), expected); } - + @Test - public void testInterfaceOrAnnotationBlock() throws Exception { + void interfaceOrAnnotationBlock() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputStaticVariableName.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42544,15 +42544,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.DEFAUL import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class TypeNameCheckTest extends AbstractModuleTestSupport { +final class TypeNameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpecified() throws Exception { + void specified() throws Exception { @@ -42561,7 +42561,7 @@ }; @@ -41,7 +41,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -42570,7 +42570,7 @@ "17:22: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderInterface", DEFAULT_PATTERN), @@ -52,7 +52,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassSpecific() throws Exception { + void classSpecific() throws Exception { @@ -42579,7 +42579,7 @@ }; @@ -60,7 +60,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceSpecific() throws Exception { + void interfaceSpecific() throws Exception { @@ -42588,7 +42588,7 @@ }; @@ -68,7 +68,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnumSpecific() throws Exception { + void enumSpecific() throws Exception { @@ -42597,7 +42597,7 @@ }; @@ -76,7 +76,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationSpecific() throws Exception { + void annotationSpecific() throws Exception { @@ -42606,11 +42606,11 @@ }; @@ -84,7 +84,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTypeNameRecords() throws Exception { + void typeNameRecords() throws Exception { - + final String[] expected = { "23:10: " + getCheckMessage(MSG_INVALID_PATTERN, "Third_Name", DEFAULT_PATTERN), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java @@ -42618,21 +42618,21 @@ @@ -24,12 +24,13 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_DUPL import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_ILLEGAL_REGEXP; import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck.MSG_REQUIRED_REGEXP; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.util.List; import org.junit.jupiter.api.Test; - + -public class RegexpCheckTest extends AbstractModuleTestSupport { +final class RegexpCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +38,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -42641,7 +42641,7 @@ .that(regexpCheck.getAcceptableTokens()) @@ -45,7 +46,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -42650,14 +42650,14 @@ .that(checkObj.getRequiredTokens()) @@ -53,13 +54,13 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRequiredPass() throws Exception { + void requiredPass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSemantic.java"), expected); } - + @Test - public void testRequiredFail() throws Exception { + void requiredFail() throws Exception { @@ -42666,28 +42666,28 @@ }; @@ -67,25 +68,25 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpCheckDefault.java"), expected); } - + @Test - public void testRequiredNoDuplicatesPass() throws Exception { + void requiredNoDuplicatesPass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSemantic3.java"), expected); } - + @Test - public void testSetDuplicatesTrue() throws Exception { + void setDuplicatesTrue() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSemantic4.java"), expected); } - + @Test - public void testRequiredNoDuplicatesFail() throws Exception { + void requiredNoDuplicatesFail() throws Exception { @@ -42696,21 +42696,21 @@ "32: " + getCheckMessage(MSG_DUPLICATE_REGEXP, "Boolean x = new Boolean"), @@ -94,19 +95,19 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalPass() throws Exception { + void illegalPass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSemantic6.java"), expected); } - + @Test - public void testStopEarly() throws Exception { + void stopEarly() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpCheckStopEarly.java"), expected); } - + @Test - public void testIllegalFailBelowErrorLimit() throws Exception { + void illegalFailBelowErrorLimit() throws Exception { @@ -42719,7 +42719,7 @@ "16: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "^import"), @@ -116,7 +117,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIllegalFailAboveErrorLimit() throws Exception { + void illegalFailAboveErrorLimit() throws Exception { @@ -42728,7 +42728,7 @@ + "the check is aborting, there may be more unreported errors."; @@ -128,7 +129,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessagePropertyGood() throws Exception { + void messagePropertyGood() throws Exception { @@ -42737,7 +42737,7 @@ }; @@ -136,7 +137,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessagePropertyBad() throws Exception { + void messagePropertyBad() throws Exception { @@ -42746,7 +42746,7 @@ }; @@ -144,7 +145,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessagePropertyBad2() throws Exception { + void messagePropertyBad2() throws Exception { @@ -42755,7 +42755,7 @@ }; @@ -152,7 +153,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseTrue() throws Exception { + void ignoreCaseTrue() throws Exception { @@ -42764,7 +42764,7 @@ }; @@ -160,7 +161,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseFalse() throws Exception { + void ignoreCaseFalse() throws Exception { @@ -42773,7 +42773,7 @@ }; @@ -171,14 +172,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsCppStyle() throws Exception { + void ignoreCommentsCppStyle() throws Exception { @@ -42781,7 +42781,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment.java"), expected); } - + @Test - public void testIgnoreCommentsFalseCppStyle() throws Exception { + void ignoreCommentsFalseCppStyle() throws Exception { @@ -42790,7 +42790,7 @@ "16: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "don't\\suse trailing comments"), @@ -187,14 +188,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsBlockStyle() throws Exception { + void ignoreCommentsBlockStyle() throws Exception { @@ -42798,7 +42798,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment3.java"), expected); } - + @Test - public void testIgnoreCommentsFalseBlockStyle() throws Exception { + void ignoreCommentsFalseBlockStyle() throws Exception { @@ -42807,7 +42807,7 @@ }; @@ -202,26 +203,26 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsMultipleBlockStyle() throws Exception { + void ignoreCommentsMultipleBlockStyle() throws Exception { @@ -42815,21 +42815,21 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment5.java"), expected); } - + @Test - public void testIgnoreCommentsMultiLine() throws Exception { + void ignoreCommentsMultiLine() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment6.java"), expected); } - + @Test - public void testIgnoreCommentsInlineStart() throws Exception { + void ignoreCommentsInlineStart() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment7.java"), expected); } - + @Test - public void testIgnoreCommentsInlineEnd() throws Exception { + void ignoreCommentsInlineEnd() throws Exception { @@ -42838,7 +42838,7 @@ }; @@ -229,7 +230,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsInlineMiddle() throws Exception { + void ignoreCommentsInlineMiddle() throws Exception { @@ -42847,7 +42847,7 @@ }; @@ -237,20 +238,20 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsNoSpaces() throws Exception { + void ignoreCommentsNoSpaces() throws Exception { @@ -42855,14 +42855,14 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment10.java"), expected); } - + @Test - public void testOnFileStartingWithEmptyLine() throws Exception { + void onFileStartingWithEmptyLine() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpStartingWithEmptyLine.java"), expected); } - + @Test - public void testIgnoreCommentsCppStyleWithIllegalPatternFalse() throws Exception { + void ignoreCommentsCppStyleWithIllegalPatternFalse() throws Exception { @@ -42871,7 +42871,7 @@ "1: " + getCheckMessage(MSG_REQUIRED_REGEXP, "don't use trailing comments"), @@ -259,18 +260,18 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStateIsClearedOnBeginTreeErrorCount() throws Exception { + void stateIsClearedOnBeginTreeErrorCount() throws Exception { @@ -42885,7 +42885,7 @@ + ImmutableList.of("12: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "^import")); verifyWithInlineConfigParser(file1, file2, expectedFromFile1, expectedFromFile2); } - + @Test - public void testStateIsClearedOnBeginTreeMatchCount() throws Exception { + void stateIsClearedOnBeginTreeMatchCount() throws Exception { @@ -42894,7 +42894,7 @@ final List expectedFirstInput = List.of(CommonUtil.EMPTY_STRING_ARRAY); @@ -279,7 +280,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOnFileStartingWithEmptyLine2() throws Exception { + void onFileStartingWithEmptyLine2() throws Exception { @@ -42908,21 +42908,21 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_MINIMUM; import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_STACKOVERFLOW; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -36,7 +37,7 @@ import java.nio.file.Files; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - + -public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { +final class RegexpMultilineCheckTest extends AbstractModuleTestSupport { - + @TempDir public File temporaryFolder; - + @@ -46,7 +47,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -42931,7 +42931,7 @@ }; @@ -54,7 +55,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessageProperty() throws Exception { + void messageProperty() throws Exception { @@ -42940,7 +42940,7 @@ }; @@ -62,7 +63,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseTrue() throws Exception { + void ignoreCaseTrue() throws Exception { @@ -42949,14 +42949,14 @@ }; @@ -70,13 +71,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseFalse() throws Exception { + void ignoreCaseFalse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpMultilineSemantic4.java"), expected); } - + @Test - public void testIllegalFailBelowErrorLimit() throws Exception { + void illegalFailBelowErrorLimit() throws Exception { @@ -42965,7 +42965,7 @@ "17: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "^import"), @@ -86,7 +87,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCarriageReturn() throws Exception { + void carriageReturn() throws Exception { @@ -42974,16 +42974,16 @@ checkConfig.addProperty("maximum", "0"); @@ -96,15 +97,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { }; - + final File file = File.createTempFile("junit", null, temporaryFolder); - Files.write( - file.toPath(), - "first line \r\n second line \n\r third line".getBytes(StandardCharsets.UTF_8)); + Files.write(file.toPath(), "first line \r\n second line \n\r third line".getBytes(UTF_8)); - + verify(checkConfig, file.getPath(), expected); } - + @Test - public void testMaximum() throws Exception { + void maximum() throws Exception { @@ -42992,13 +42992,13 @@ checkConfig.addProperty("maximum", "1"); @@ -113,9 +112,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { }; - + final File file = File.createTempFile("junit", null, temporaryFolder); - Files.write( - file.toPath(), - "first line \r\n second line \n\r third line".getBytes(StandardCharsets.UTF_8)); + Files.write(file.toPath(), "first line \r\n second line \n\r third line".getBytes(UTF_8)); - + verify(checkConfig, file.getPath(), expected); } @@ -126,16 +123,14 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { @@ -43010,26 +43010,26 @@ final TestLoggingReporter reporter = new TestLoggingReporter(); final DetectorOptions detectorOptions = DetectorOptions.newBuilder().reporter(reporter).format("\\r").maximum(1).build(); - + final MultilineDetector detector = new MultilineDetector(detectorOptions); final File file = File.createTempFile("junit", null, temporaryFolder); - Files.write( - file.toPath(), - "first line \r\n second line \n\r third line".getBytes(StandardCharsets.UTF_8)); + Files.write(file.toPath(), "first line \r\n second line \n\r third line".getBytes(UTF_8)); - + detector.processLines(new FileText(file, StandardCharsets.UTF_8.name())); detector.processLines(new FileText(file, StandardCharsets.UTF_8.name())); @@ -145,13 +140,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpMultilineSemantic6.java"), expected); } - + @Test - public void testNullFormat() throws Exception { + void nullFormat() throws Exception { @@ -43038,7 +43038,7 @@ }; @@ -159,7 +154,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyFormat() throws Exception { + void emptyFormat() throws Exception { @@ -43047,7 +43047,7 @@ }; @@ -167,7 +162,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoStackOverflowError() throws Exception { + void noStackOverflowError() throws Exception { @@ -43056,14 +43056,14 @@ checkConfig.addProperty("format", "(x|y)*"); @@ -177,13 +172,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { }; - + final File file = File.createTempFile("junit", null, temporaryFolder); - Files.write(file.toPath(), makeLargeXyString().toString().getBytes(StandardCharsets.UTF_8)); + Files.write(file.toPath(), makeLargeXyString().toString().getBytes(UTF_8)); - + verify(checkConfig, file.getPath(), expected); } - + @Test - public void testMinimum() throws Exception { + void minimum() throws Exception { @@ -43072,14 +43072,14 @@ checkConfig.addProperty("minimum", "5"); @@ -192,13 +187,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { }; - + final File file = File.createTempFile("junit", null, temporaryFolder); - Files.write(file.toPath(), "".getBytes(StandardCharsets.UTF_8)); + Files.write(file.toPath(), "".getBytes(UTF_8)); - + verify(checkConfig, file.getPath(), expected); } - + @Test - public void testMinimumWithCustomMessage() throws Exception { + void minimumWithCustomMessage() throws Exception { @@ -43088,23 +43088,23 @@ checkConfig.addProperty("minimum", "5"); @@ -208,7 +203,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { }; - + final File file = File.createTempFile("junit", null, temporaryFolder); - Files.write(file.toPath(), "".getBytes(StandardCharsets.UTF_8)); + Files.write(file.toPath(), "".getBytes(UTF_8)); - + verify(checkConfig, file.getPath(), expected); } @@ -221,13 +216,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGoodLimit() throws Exception { + void goodLimit() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpMultilineSemantic9.java"), expected); } - + @Test - public void testMultilineSupport() throws Exception { + void multilineSupport() throws Exception { @@ -43113,7 +43113,7 @@ }; @@ -235,7 +230,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultilineSupportNotGreedy() throws Exception { + void multilineSupportNotGreedy() throws Exception { @@ -43125,7 +43125,7 @@ @@ -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 com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -43136,15 +43136,15 @@ -import java.util.Collections; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; - + -public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { +final class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -42,14 +42,14 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultConfigurationOnValidInput() throws Exception { + void defaultConfigurationOnValidInput() throws Exception { @@ -43152,7 +43152,7 @@ verify( checkConfig, getPath("InputRegexpOnFilenameSemantic.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testDefaultProperties() throws Exception { + void defaultProperties() throws Exception { @@ -43161,7 +43161,7 @@ final String[] expected = { @@ -59,7 +59,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFileMatches() throws Exception { + void matchFileMatches() throws Exception { @@ -43170,7 +43170,7 @@ checkConfig.addProperty("fileNamePattern", ".*\\.java"); @@ -71,7 +71,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFileNotMatches() throws Exception { + void matchFileNotMatches() throws Exception { @@ -43179,7 +43179,7 @@ checkConfig.addProperty("fileNamePattern", "BAD.*"); @@ -80,7 +80,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFileMatches() throws Exception { + void notMatchFileMatches() throws Exception { @@ -43188,7 +43188,7 @@ checkConfig.addProperty("fileNamePattern", ".*\\.properties"); @@ -92,7 +92,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFileNotMatches() throws Exception { + void notMatchFileNotMatches() throws Exception { @@ -43197,7 +43197,7 @@ checkConfig.addProperty("fileNamePattern", ".*\\.java"); @@ -101,7 +101,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFolderMatches() throws Exception { + void matchFolderMatches() throws Exception { @@ -43206,7 +43206,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); @@ -113,7 +113,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFolderNotMatches() throws Exception { + void matchFolderNotMatches() throws Exception { @@ -43215,7 +43215,7 @@ checkConfig.addProperty("folderPattern", "BAD.*"); @@ -122,7 +122,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFolderMatches() throws Exception { + void notMatchFolderMatches() throws Exception { @@ -43224,7 +43224,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]gov[\\\\/].*"); @@ -134,7 +134,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFolderNotMatches() throws Exception { + void notMatchFolderNotMatches() throws Exception { @@ -43233,7 +43233,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); @@ -143,7 +143,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFolderAndFileMatches() throws Exception { + void matchFolderAndFileMatches() throws Exception { @@ -43242,7 +43242,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); @@ -156,7 +156,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFolderAndFileNotMatchesBoth() throws Exception { + void matchFolderAndFileNotMatchesBoth() throws Exception { @@ -43251,7 +43251,7 @@ checkConfig.addProperty("folderPattern", "BAD.*"); @@ -166,7 +166,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFolderAndFileNotMatchesFile() throws Exception { + void matchFolderAndFileNotMatchesFile() throws Exception { @@ -43260,7 +43260,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); @@ -176,7 +176,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchFolderAndFileNotMatchesFolder() throws Exception { + void matchFolderAndFileNotMatchesFolder() throws Exception { @@ -43269,7 +43269,7 @@ checkConfig.addProperty("folderPattern", "BAD.*"); @@ -186,7 +186,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFolderAndFileMatches() throws Exception { + void notMatchFolderAndFileMatches() throws Exception { @@ -43278,7 +43278,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]com[\\\\/].*"); @@ -199,7 +199,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFolderAndFileNotMatchesFolder() throws Exception { + void notMatchFolderAndFileNotMatchesFolder() throws Exception { @@ -43287,7 +43287,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]javastrangefolder[\\\\/].*"); @@ -209,7 +209,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotMatchFolderAndFileNotMatchesFile() throws Exception { + void notMatchFolderAndFileNotMatchesFile() throws Exception { @@ -43296,7 +43296,7 @@ checkConfig.addProperty("folderPattern", ".*[\\\\/]govstrangefolder[\\\\/].*"); @@ -219,7 +219,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreExtension() throws Exception { + void ignoreExtension() throws Exception { @@ -43305,7 +43305,7 @@ checkConfig.addProperty("ignoreFileNameExtensions", "true"); @@ -228,7 +228,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreExtensionNoExtension() throws Exception { + void ignoreExtensionNoExtension() throws Exception { @@ -43314,7 +43314,7 @@ checkConfig.addProperty("ignoreFileNameExtensions", "true"); @@ -236,7 +236,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testException() throws Exception { + void exception() throws Exception { @@ -43332,7 +43332,7 @@ .that(ex) @@ -253,7 +253,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithFileWithoutParent() throws Exception { + void withFileWithoutParent() throws Exception { @@ -43344,15 +43344,15 @@ @@ -31,7 +31,7 @@ import java.io.File; import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; - + -public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { +final class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { - + private static final String[] EMPTY = {}; - + @@ -41,7 +41,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -43361,7 +43361,7 @@ }; @@ -49,7 +49,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessageProperty() throws Exception { + void messageProperty() throws Exception { @@ -43370,23 +43370,23 @@ }; @@ -57,7 +57,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseTrue() throws Exception { + void ignoreCaseTrue() throws Exception { - + final String[] expected = { "78: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), @@ -66,13 +66,13 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseFalse() throws Exception { + void ignoreCaseFalse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSinglelineSemantic4.java"), expected); } - + @Test - public void testMinimum() throws Exception { + void minimum() throws Exception { @@ -43395,7 +43395,7 @@ }; @@ -81,7 +81,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSetMessage() throws Exception { + void setMessage() throws Exception { @@ -43404,13 +43404,13 @@ }; @@ -90,7 +90,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMaximum() throws Exception { + void maximum() throws Exception { verifyWithInlineConfigParser(getPath("InputRegexpSinglelineSemantic7.java"), EMPTY); } - + @@ -100,7 +100,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { * @throws Exception some Exception */ @@ -43422,17 +43422,17 @@ final DetectorOptions detectorOptions = @@ -117,12 +117,12 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { verifyWithInlineConfigParser(getPath("InputRegexpSinglelineSemantic9.java"), EMPTY); } - + @Test - public void testMessage() throws Exception { + void message() throws Exception { - + final String[] expected = { "17: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java @@ -43440,15 +43440,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { +final class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -43457,7 +43457,7 @@ .that(regexpSinglelineJavaCheck.getAcceptableTokens()) @@ -43,7 +43,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -43466,7 +43466,7 @@ .that(checkObj.getRequiredTokens()) @@ -51,7 +51,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIt() throws Exception { + void it() throws Exception { @@ -43475,7 +43475,7 @@ }; @@ -59,7 +59,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMessageProperty() throws Exception { + void messageProperty() throws Exception { @@ -43484,7 +43484,7 @@ }; @@ -67,7 +67,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseTrue() throws Exception { + void ignoreCaseTrue() throws Exception { @@ -43493,14 +43493,14 @@ }; @@ -75,13 +75,13 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCaseFalse() throws Exception { + void ignoreCaseFalse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSinglelineJavaSemantic4.java"), expected); } - + @Test - public void testIgnoreCommentsCppStyle() throws Exception { + void ignoreCommentsCppStyle() throws Exception { @@ -43509,7 +43509,7 @@ verifyWithInlineConfigParser( @@ -89,7 +89,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsFalseCppStyle() throws Exception { + void ignoreCommentsFalseCppStyle() throws Exception { @@ -43518,7 +43518,7 @@ "16: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "don't\\suse trailing comments"), @@ -99,7 +99,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsBlockStyle() throws Exception { + void ignoreCommentsBlockStyle() throws Exception { @@ -43527,7 +43527,7 @@ verifyWithInlineConfigParser( @@ -107,7 +107,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsFalseBlockStyle() throws Exception { + void ignoreCommentsFalseBlockStyle() throws Exception { @@ -43536,7 +43536,7 @@ }; @@ -116,7 +116,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsMultipleBlockStyle() throws Exception { + void ignoreCommentsMultipleBlockStyle() throws Exception { @@ -43545,7 +43545,7 @@ verifyWithInlineConfigParser( @@ -124,21 +124,21 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsMultiLine() throws Exception { + void ignoreCommentsMultiLine() throws Exception { @@ -43553,7 +43553,7 @@ verifyWithInlineConfigParser( getPath("InputRegexpSinglelineJavaTrailingComment6.java"), expected); } - + @Test - public void testIgnoreCommentsInlineStart() throws Exception { + void ignoreCommentsInlineStart() throws Exception { @@ -43561,7 +43561,7 @@ verifyWithInlineConfigParser( getPath("InputRegexpSinglelineJavaTrailingComment7.java"), expected); } - + @Test - public void testIgnoreCommentsInlineEnd() throws Exception { + void ignoreCommentsInlineEnd() throws Exception { @@ -43570,7 +43570,7 @@ }; @@ -147,7 +147,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsInlineMiddle() throws Exception { + void ignoreCommentsInlineMiddle() throws Exception { @@ -43579,7 +43579,7 @@ }; @@ -156,7 +156,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreCommentsNoSpaces() throws Exception { + void ignoreCommentsNoSpaces() throws Exception { @@ -43588,7 +43588,7 @@ verifyWithInlineConfigParser( @@ -164,7 +164,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1371588() throws Exception { + void test1371588() throws Exception { @@ -43597,21 +43597,21 @@ verifyWithInlineConfigParser( @@ -172,19 +172,19 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testExistingInDoc() throws Exception { + void existingInDoc() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSinglelineJavaSemantic5.java"), expected); } - + @Test - public void testExistingInCode() throws Exception { + void existingInCode() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputRegexpSinglelineJavaSemantic6.java"), expected); } - + @Test - public void testMissing() throws Exception { + void missing() throws Exception { @@ -43620,7 +43620,7 @@ }; @@ -192,7 +192,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -43631,16 +43631,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + /** Unit test for AnonInnerLengthCheck. */ -public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { +final class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -43649,7 +43649,7 @@ assertWithMessage("Default required tokens are invalid") @@ -44,7 +44,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -43658,7 +43658,7 @@ final int[] expected = {TokenTypes.LITERAL_NEW}; @@ -53,7 +53,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -43667,7 +43667,7 @@ }; @@ -61,7 +61,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonDefault() throws Exception { + void nonDefault() throws Exception { @@ -43679,15 +43679,15 @@ @@ -32,16 +32,16 @@ import java.util.Collection; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport { +final class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/executablestatementcount"; } - + - @Test @SuppressWarnings("unchecked") - public void testStatefulFieldsClearedOnBeginTree() { @@ -43698,52 +43698,52 @@ final ExecutableStatementCountCheck check = new ExecutableStatementCountCheck(); @@ -56,7 +56,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testMaxZero() throws Exception { + void maxZero() throws Exception { - + final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY, 3, 0), @@ -76,7 +76,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testMethodDef() throws Exception { + void methodDef() throws Exception { - + final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY, 3, 0), @@ -91,7 +91,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testCtorDef() throws Exception { + void ctorDef() throws Exception { - + final String[] expected = { "12:5: " + getCheckMessage(MSG_KEY, 2, 0), "22:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -101,7 +101,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testStaticInit() throws Exception { + void staticInit() throws Exception { - + final String[] expected = { "13:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -111,7 +111,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testInstanceInit() throws Exception { + void instanceInit() throws Exception { - + final String[] expected = { "13:5: " + getCheckMessage(MSG_KEY, 2, 0), @@ -122,7 +122,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testVisitTokenWithWrongTokenType() { + void visitTokenWithWrongTokenType() { @@ -43752,7 +43752,7 @@ ast.initialize(new CommonToken(TokenTypes.ENUM, "ENUM")); @@ -135,7 +135,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testLeaveTokenWithWrongTokenType() { + void leaveTokenWithWrongTokenType() { @@ -43761,45 +43761,45 @@ ast.initialize(new CommonToken(TokenTypes.ENUM, "ENUM")); @@ -148,7 +148,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testDefaultConfiguration() throws Exception { + void defaultConfiguration() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser( @@ -156,7 +156,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testExecutableStatementCountRecords() throws Exception { + void executableStatementCountRecords() throws Exception { - + final int max = 1; - + @@ -174,7 +174,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport } - + @Test - public void testExecutableStatementCountLambdas() throws Exception { + void executableStatementCountLambdas() throws Exception { - + final int max = 1; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class FileLengthCheckTest extends AbstractModuleTestSupport { +final class FileLengthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class FileLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAlarm() throws Exception { + void alarm() throws Exception { @@ -43808,28 +43808,28 @@ }; @@ -44,25 +44,25 @@ public class FileLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAlarmDefault() throws Exception { + void alarmDefault() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFileLengthDefault.java"), expected); } - + @Test - public void testFileLengthEqualToMaxLength() throws Exception { + void fileLengthEqualToMaxLength() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFileLength2.java"), expected); } - + @Test - public void testOk() throws Exception { + void ok() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputFileLength3.java"), expected); } - + @Test - public void testArgs() throws Exception { + void args() throws Exception { @@ -43838,15 +43838,15 @@ checkConfig.addProperty("max", "abc"); @@ -79,14 +79,14 @@ public class FileLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoAlarmByExtension() throws Exception { + void noAlarmByExtension() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputFileLength4.java"), expected); } - + @Test - public void testExtensions() { + void extensions() { @@ -43858,15 +43858,15 @@ @@ -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 LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { +final class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -43875,7 +43875,7 @@ assertWithMessage("Default required tokens are invalid") @@ -44,7 +44,7 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -43884,7 +43884,7 @@ final int[] expected = {TokenTypes.LAMBDA}; @@ -53,7 +53,7 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -43893,7 +43893,7 @@ "28:27: " + getCheckMessage(MSG_KEY, 12, 10), @@ -66,14 +66,14 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultSwitchExpressions() throws Exception { + void defaultSwitchExpressions() throws Exception { @@ -43901,7 +43901,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputLambdaBodyLengthSwitchExps.java"), expected); } - + @Test - public void testMaxLimitIsDifferent() throws Exception { + void maxLimitIsDifferent() throws Exception { @@ -43913,15 +43913,15 @@ @@ -27,7 +27,7 @@ import de.thetaphi.forbiddenapis.SuppressForbidden; import java.nio.charset.CodingErrorAction; import org.junit.jupiter.api.Test; - + -public class LineLengthCheckTest extends AbstractModuleTestSupport { +final class LineLengthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSimple() throws Exception { + void simple() throws Exception { @@ -43930,7 +43930,7 @@ }; @@ -43,7 +43,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void shouldLogActualLineLength() throws Exception { + void shouldLogActualLineLength() throws Exception { @@ -43939,7 +43939,7 @@ }; @@ -51,7 +51,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void shouldNotLogLongImportStatements() throws Exception { + void shouldNotLogLongImportStatements() throws Exception { @@ -43948,7 +43948,7 @@ }; @@ -59,7 +59,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void shouldNotLogLongPackageStatements() throws Exception { + void shouldNotLogLongPackageStatements() throws Exception { @@ -43957,7 +43957,7 @@ }; @@ -68,7 +68,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void shouldNotLogLongLinks() throws Exception { + void shouldNotLogLongLinks() throws Exception { @@ -43966,7 +43966,7 @@ }; @@ -76,7 +76,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void countUnicodePointsOnce() throws Exception { + void countUnicodePointsOnce() throws Exception { @@ -43975,7 +43975,7 @@ }; @@ -84,7 +84,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineLengthIgnoringPackageStatements() throws Exception { + void lineLengthIgnoringPackageStatements() throws Exception { @@ -43984,7 +43984,7 @@ "22: " + getCheckMessage(MSG_KEY, 75, 86), @@ -97,7 +97,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineLengthIgnoringImportStatements() throws Exception { + void lineLengthIgnoringImportStatements() throws Exception { @@ -44005,15 +44005,15 @@ @@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MethodCountCheckTest extends AbstractModuleTestSupport { +final class MethodCountCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44022,7 +44022,7 @@ assertWithMessage("Default required tokens are invalid") @@ -48,7 +48,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44031,117 +44031,117 @@ final int[] expected = { @@ -65,7 +65,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaults() throws Exception { + void defaults() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -73,7 +73,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThreesOne() throws Exception { + void threesOne() throws Exception { - + final String[] expected = { "15:1: " + getCheckMessage(MSG_PACKAGE_METHODS, 4, 3), @@ -87,7 +87,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testThreesTwo() throws Exception { + void threesTwo() throws Exception { - + final String[] expected = { "14:1: " + getCheckMessage(MSG_PACKAGE_METHODS, 4, 3), @@ -103,7 +103,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEnum() throws Exception { + void testEnum() throws Exception { - + final String[] expected = { "21:5: " + getCheckMessage(MSG_PRIVATE_METHODS, 1, 0), @@ -114,7 +114,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithPackageModifier() throws Exception { + void withPackageModifier() throws Exception { - + final String[] expected = { "15:1: " + getCheckMessage(MSG_MANY_METHODS, 5, 2), @@ -124,7 +124,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOnInterfaceDefinitionWithField() throws Exception { + void onInterfaceDefinitionWithField() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -132,7 +132,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithInterfaceDefinitionInClass() throws Exception { + void withInterfaceDefinitionInClass() throws Exception { - + final String[] expected = { "15:1: " + getCheckMessage(MSG_MANY_METHODS, 2, 1), @@ -142,7 +142,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPartialTokens() throws Exception { + void partialTokens() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -150,7 +150,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCountMethodToCorrectDefinition() throws Exception { + void countMethodToCorrectDefinition() throws Exception { - + final String[] expected = { "22:5: " + getCheckMessage(MSG_MANY_METHODS, 2, 1), @@ -160,7 +160,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceMemberScopeIsPublic() throws Exception { + void interfaceMemberScopeIsPublic() throws Exception { - + final String[] expected = { "17:5: " + getCheckMessage(MSG_PUBLIC_METHODS, 2, 1), @@ -172,7 +172,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodCountRecords() throws Exception { + void methodCountRecords() throws Exception { final int max = 2; - + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.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 MethodLengthCheckTest extends AbstractModuleTestSupport { +final class MethodLengthCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44150,7 +44150,7 @@ "MethodLengthCheck#getRequiredTokens should return empty array " + "by default") @@ -44,7 +44,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44159,14 +44159,14 @@ final int[] expected = { @@ -55,13 +55,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testItOne() throws Exception { + void itOne() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodLengthSimpleOne.java"), expected); } - + @Test - public void testItTwo() throws Exception { + void itTwo() throws Exception { @@ -44175,14 +44175,14 @@ }; @@ -69,13 +69,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCountEmptyIsFalse() throws Exception { + void countEmptyIsFalse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodLengthCountEmptyIsFalse.java"), expected); } - + @Test - public void testWithComments() throws Exception { + void withComments() throws Exception { @@ -44191,7 +44191,7 @@ }; @@ -83,7 +83,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCountEmpty() throws Exception { + void countEmpty() throws Exception { @@ -44200,59 +44200,59 @@ "24:5: " + getCheckMessage(MSG_KEY, 3, max, "AA"), @@ -96,19 +96,19 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAbstractOne() throws Exception { + void abstractOne() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodLengthModifierOne.java"), expected); } - + @Test - public void testAbstractTwo() throws Exception { + void abstractTwo() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodLengthModifierTwo.java"), expected); } - + @Test - public void testTextBlocks() throws Exception { + void textBlocks() throws Exception { final int max = 2; - + final String[] expected = { @@ -123,7 +123,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsAndCompactCtors() throws Exception { + void recordsAndCompactCtors() throws Exception { - + final int max = 2; - + @@ -140,7 +140,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordsAndCompactCtorsCountEmpty() throws Exception { + void recordsAndCompactCtorsCountEmpty() throws Exception { final int max = 2; - + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java @@ -32,7 +32,7 @@ import java.io.File; import java.util.Optional; import org.junit.jupiter.api.Test; - + -public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { +final class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -40,7 +40,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44261,7 +44261,7 @@ TokenTypes.CLASS_DEF, @@ -55,7 +55,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44270,7 +44270,7 @@ final int[] expected = { @@ -70,7 +70,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -44279,27 +44279,27 @@ }; @@ -78,19 +78,19 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMax30() throws Exception { + void max30() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeNumberSimple1.java"), expected); } - + @Test - public void testWithInnerClass() throws Exception { + void withInnerClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOuterTypeNumberEmptyInner.java"), expected); } - + @Test - public void testWithRecords() throws Exception { + void withRecords() throws Exception { - + final int max = 1; - + @@ -109,7 +109,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { * @throws Exception if there is an error. */ @@ -44334,15 +44334,15 @@ @@ -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 ParameterNumberCheckTest extends AbstractModuleTestSupport { +final class ParameterNumberCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44351,7 +44351,7 @@ "ParameterNumberCheck#getRequiredTokens should return empty array " + "by default") @@ -44,7 +44,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44360,7 +44360,7 @@ final int[] expected = { @@ -55,7 +55,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -44369,7 +44369,7 @@ }; @@ -63,7 +63,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNum() throws Exception { + void num() throws Exception { @@ -44378,14 +44378,14 @@ }; @@ -71,13 +71,13 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMaxParam() throws Exception { + void maxParam() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParameterNumberSimple3.java"), expected); } - + @Test - public void shouldLogActualParameterNumber() throws Exception { + void shouldLogActualParameterNumber() throws Exception { @@ -44394,7 +44394,7 @@ }; @@ -85,7 +85,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreOverriddenMethods() throws Exception { + void ignoreOverriddenMethods() throws Exception { @@ -44403,7 +44403,7 @@ }; @@ -93,7 +93,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreOverriddenMethodsFalse() throws Exception { + void ignoreOverriddenMethodsFalse() throws Exception { @@ -44415,15 +44415,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { +final class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44432,7 +44432,7 @@ final int[] expected = { @@ -48,7 +48,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44441,58 +44441,58 @@ final int[] expected = { @@ -59,7 +59,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final int max = 8; - + @@ -77,7 +77,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentNumberTopLevel1() throws Exception { + void recordComponentNumberTopLevel1() throws Exception { - + final int max = 8; - + @@ -90,7 +90,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentNumberTopLevel2() throws Exception { + void recordComponentNumberTopLevel2() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -99,7 +99,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentNumberMax1() throws Exception { + void recordComponentNumberMax1() throws Exception { - + final int max = 1; - + @@ -125,7 +125,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentNumberMax20() throws Exception { + void recordComponentNumberMax20() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser( @@ -133,7 +133,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testRecordComponentNumberPrivateModifier() throws Exception { + void recordComponentNumberPrivateModifier() throws Exception { - + final int max = 8; - + @@ -155,7 +155,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { * @throws Exception if an error occurs. */ @@ -44507,15 +44507,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { +final class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44524,7 +44524,7 @@ assertWithMessage("Default required tokens are invalid") @@ -47,7 +47,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -44533,7 +44533,7 @@ }; @@ -56,7 +56,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceOption() throws Exception { + void spaceOption() throws Exception { @@ -44542,7 +44542,7 @@ }; @@ -64,7 +64,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44567,7 +44567,7 @@ final WrapOption option = WrapOption.valueOf("EOL"); assertWithMessage("Result of valueOf is invalid").that(option).isEqualTo(WrapOption.EOL); } - + @Test - public void testWithEmoji() throws Exception { + void withEmoji() throws Exception { @@ -44576,16 +44576,16 @@ "28:25: " + getCheckMessage(MSG_NOT_PRECEDED, ";"), @@ -104,7 +104,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(EmptyForInitializerPadCheck.class); checkConfig.addProperty("option", "invalid_option"); - + @@ -125,7 +125,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -44597,15 +44597,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { +final class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44614,7 +44614,7 @@ assertWithMessage("Default required tokens are invalid") @@ -46,7 +46,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -44623,7 +44623,7 @@ "46:33: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), @@ -56,7 +56,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceOption() throws Exception { + void spaceOption() throws Exception { @@ -44632,7 +44632,7 @@ }; @@ -64,7 +64,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithEmoji() throws Exception { + void withEmoji() throws Exception { @@ -44641,7 +44641,7 @@ }; @@ -72,7 +72,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44650,16 +44650,16 @@ final int[] expected = { @@ -82,7 +82,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -100,7 +100,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -44668,7 +44668,7 @@ }; @@ -109,7 +109,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testUppercaseOptionProperty() throws Exception { + void uppercaseOptionProperty() throws Exception { @@ -44680,15 +44680,15 @@ @@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { +final class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -44697,25 +44697,25 @@ "EmptyLineSeparatorCheck#getRequiredTokens should return empty array " + "by default") @@ -48,7 +48,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { - + final String[] expected = { "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), @@ -65,7 +65,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowNoEmptyLineBetweenFields() throws Exception { + void allowNoEmptyLineBetweenFields() throws Exception { - + final String[] expected = { "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), @@ -81,7 +81,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testHeader() throws Exception { + void header() throws Exception { @@ -44724,7 +44724,7 @@ }; @@ -89,7 +89,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleEmptyLinesBetweenClassMembers() throws Exception { + void multipleEmptyLinesBetweenClassMembers() throws Exception { @@ -44733,14 +44733,14 @@ "17:1: " + getCheckMessage(MSG_MULTIPLE_LINES, "import"), @@ -104,20 +104,20 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testFormerArrayIndexOutOfBounds() throws Exception { + void formerArrayIndexOutOfBounds() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputEmptyLineSeparatorFormerException.java"), expected); } - + @Test - public void testAllowMultipleFieldInClass() throws Exception { + void allowMultipleFieldInClass() throws Exception { @@ -44748,7 +44748,7 @@ verifyWithInlineConfigParser( getPath("InputEmptyLineSeparatorMultipleFieldsInClass.java"), expected); } - + @Test - public void testAllowMultipleImportSeparatedFromPackage() throws Exception { + void allowMultipleImportSeparatedFromPackage() throws Exception { @@ -44757,7 +44757,7 @@ }; @@ -126,14 +126,14 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportSeparatedFromPackage() throws Exception { + void importSeparatedFromPackage() throws Exception { @@ -44765,7 +44765,7 @@ verifyWithInlineConfigParser( getPath("InputEmptyLineSeparatorImportSeparatedFromPackage.java"), expected); } - + @Test - public void testStaticImport() throws Exception { + void staticImport() throws Exception { @@ -44774,7 +44774,7 @@ }; @@ -141,7 +141,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlockCommentNotSeparatedFromPackage() throws Exception { + void blockCommentNotSeparatedFromPackage() throws Exception { @@ -44783,7 +44783,7 @@ }; @@ -150,7 +150,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSingleCommentNotSeparatedFromPackage() throws Exception { + void singleCommentNotSeparatedFromPackage() throws Exception { @@ -44792,7 +44792,7 @@ }; @@ -159,7 +159,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassDefinitionNotSeparatedFromPackage() throws Exception { + void classDefinitionNotSeparatedFromPackage() throws Exception { @@ -44801,7 +44801,7 @@ }; @@ -168,7 +168,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommentAfterPackageWithImports() throws Exception { + void commentAfterPackageWithImports() throws Exception { @@ -44810,7 +44810,7 @@ }; @@ -177,7 +177,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadocCommentAfterPackageWithImports() throws Exception { + void javadocCommentAfterPackageWithImports() throws Exception { @@ -44819,7 +44819,7 @@ "2:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "/*"), @@ -187,7 +187,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPackageImportsClassInSingleLine() throws Exception { + void packageImportsClassInSingleLine() throws Exception { @@ -44828,7 +44828,7 @@ "13:101: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), @@ -197,7 +197,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineAfterPackageForPackageAst() throws Exception { + void emptyLineAfterPackageForPackageAst() throws Exception { @@ -44837,7 +44837,7 @@ }; @@ -206,14 +206,14 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineAfterPackageForImportAst() throws Exception { + void emptyLineAfterPackageForImportAst() throws Exception { @@ -44845,7 +44845,7 @@ verifyWithInlineConfigParser( getPath("InputEmptyLineSeparatorEmptyLineAfterPackageForImportAst.java"), expected); } - + @Test - public void testClassDefinitionAndCommentNotSeparatedFromPackage() throws Exception { + void classDefinitionAndCommentNotSeparatedFromPackage() throws Exception { @@ -44854,7 +44854,7 @@ "15:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), @@ -224,21 +224,21 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBlockCommentSeparatedFromPackage() throws Exception { + void blockCommentSeparatedFromPackage() throws Exception { @@ -44862,7 +44862,7 @@ verifyWithInlineConfigParser( getPath("InputEmptyLineSeparatorBlockCommentSeparatedFromPackage.java"), expected); } - + @Test - public void testSingleCommentSeparatedFromPackage() throws Exception { + void singleCommentSeparatedFromPackage() throws Exception { @@ -44870,7 +44870,7 @@ verifyWithInlineConfigParser( getPath("InputEmptyLineSeparatorSingleCommentSeparatedFromPackage.java"), expected); } - + @Test - public void testEnumMembers() throws Exception { + void enumMembers() throws Exception { @@ -44879,7 +44879,7 @@ "27:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), @@ -251,7 +251,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInterfaceFields() throws Exception { + void interfaceFields() throws Exception { @@ -44888,7 +44888,7 @@ "25:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), @@ -263,7 +263,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -44897,7 +44897,7 @@ final int[] expected = { @@ -285,7 +285,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrePreviousLineEmptiness() throws Exception { + void prePreviousLineEmptiness() throws Exception { @@ -44906,7 +44906,7 @@ final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -293,7 +293,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPrePreviousLineIsEmpty() throws Exception { + void prePreviousLineIsEmpty() throws Exception { @@ -44915,7 +44915,7 @@ final String[] expected = { @@ -303,7 +303,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testPreviousLineEmptiness() throws Exception { + void previousLineEmptiness() throws Exception { @@ -44924,7 +44924,7 @@ "26:5: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), @@ -316,7 +316,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDisAllowMultipleEmptyLinesInsideClassMembers() throws Exception { + void disAllowMultipleEmptyLinesInsideClassMembers() throws Exception { @@ -44933,7 +44933,7 @@ "30:11: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), @@ -330,7 +330,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowMultipleEmptyLinesInsideClassMembers() throws Exception { + void allowMultipleEmptyLinesInsideClassMembers() throws Exception { @@ -44942,28 +44942,28 @@ }; @@ -339,25 +339,25 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testImportsAndStaticImports() throws Exception { + void importsAndStaticImports() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputEmptyLineSeparatorImports.java"), expected); } - + @Test - public void testAllowPackageAnnotation() throws Exception { + void allowPackageAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("packageinfo/test1/package-info.java"), expected); } - + @Test - public void testAllowJavadocBeforePackage() throws Exception { + void allowJavadocBeforePackage() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("packageinfo/test2/package-info.java"), expected); } - + @Test - public void testDisAllowBlockCommentBeforePackage() throws Exception { + void disAllowBlockCommentBeforePackage() throws Exception { @@ -44972,7 +44972,7 @@ }; @@ -365,7 +365,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowSingleLineCommentPackage() throws Exception { + void allowSingleLineCommentPackage() throws Exception { @@ -44981,7 +44981,7 @@ }; @@ -373,7 +373,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonPackageInfoWithJavadocBeforePackage() throws Exception { + void nonPackageInfoWithJavadocBeforePackage() throws Exception { @@ -44990,7 +44990,7 @@ }; @@ -382,7 +382,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testClassOnly() throws Exception { + void classOnly() throws Exception { @@ -44999,7 +44999,7 @@ }; @@ -391,7 +391,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLineSeparationBeforeComments() throws Exception { + void lineSeparationBeforeComments() throws Exception { @@ -45008,7 +45008,7 @@ "16:1: " + getCheckMessage(MSG_MULTIPLE_LINES, "//"), @@ -436,7 +436,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreEmptyLinesBeforeCommentsWhenItIsAllowed() throws Exception { + void ignoreEmptyLinesBeforeCommentsWhenItIsAllowed() throws Exception { @@ -45017,7 +45017,7 @@ "239:5: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "INTERFACE_DEF"), @@ -445,14 +445,14 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoViolationsOnEmptyLinesBeforeComments() throws Exception { + void noViolationsOnEmptyLinesBeforeComments() throws Exception { @@ -45025,7 +45025,7 @@ verifyWithInlineConfigParser( getPath("InputEmptyLineSeparatorNoViolationOnEmptyLineBeforeComments.java"), expected); } - + @Test - public void testEmptyLineSeparatorRecordsAndCompactCtors() throws Exception { + void emptyLineSeparatorRecordsAndCompactCtors() throws Exception { @@ -45034,25 +45034,25 @@ "18:5: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "RECORD_DEF"), @@ -476,7 +476,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorRecordsAndCompactCtorsNoEmptyLines() throws Exception { + void emptyLineSeparatorRecordsAndCompactCtorsNoEmptyLines() throws Exception { - + final String[] expected = { "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), @@ -490,7 +490,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorMultipleSingleTypeVariables() throws Exception { + void emptyLineSeparatorMultipleSingleTypeVariables() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -499,7 +499,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorEmptyLinesInsideClassMembersRecursive() throws Exception { + void emptyLineSeparatorEmptyLinesInsideClassMembersRecursive() throws Exception { @@ -45061,7 +45061,7 @@ }; @@ -507,7 +507,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorNewMethodDef() throws Exception { + void emptyLineSeparatorNewMethodDef() throws Exception { @@ -45070,7 +45070,7 @@ "38:26: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), @@ -516,7 +516,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorPostFixCornerCases() throws Exception { + void emptyLineSeparatorPostFixCornerCases() throws Exception { @@ -45079,7 +45079,7 @@ "32:29: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), @@ -527,7 +527,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorAnnotation() throws Exception { + void emptyLineSeparatorAnnotation() throws Exception { @@ -45088,23 +45088,23 @@ }; @@ -535,7 +535,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLineSeparatorWithEmoji() throws Exception { + void emptyLineSeparatorWithEmoji() throws Exception { - + final String[] expected = { "22:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), @@ -547,13 +547,13 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleLines() throws Exception { + void multipleLines() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputEmptyLineSeparatorMultipleLines.java"), expected); } - + @Test - public void testMultipleLines2() throws Exception { + void multipleLines2() throws Exception { @@ -45113,7 +45113,7 @@ }; @@ -561,7 +561,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleLines3() throws Exception { + void multipleLines3() throws Exception { @@ -45125,15 +45125,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacter import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { +final class FileTabCharacterCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45142,7 +45142,7 @@ }; @@ -41,7 +41,7 @@ public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomMessage() throws Exception { + void customMessage() throws Exception { @@ -45151,7 +45151,7 @@ final String[] expected = { @@ -51,7 +51,7 @@ public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVerbose() throws Exception { + void verbose() throws Exception { @@ -45163,15 +45163,15 @@ @@ -40,7 +40,7 @@ import java.util.Optional; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { +final class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -48,7 +48,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -45180,7 +45180,7 @@ TokenTypes.GENERIC_START, TokenTypes.GENERIC_END, @@ -59,7 +59,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45189,7 +45189,7 @@ "22:14: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), @@ -100,7 +100,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAtTheStartOfTheLine() throws Exception { + void atTheStartOfTheLine() throws Exception { @@ -45198,7 +45198,7 @@ "18:2: " + getCheckMessage(MSG_WS_PRECEDED, "<"), @@ -109,7 +109,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedGeneric() throws Exception { + void nestedGeneric() throws Exception { @@ -45207,28 +45207,28 @@ }; @@ -117,25 +117,25 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testList() throws Exception { + void list() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputGenericWhitespaceList.java"), expected); } - + @Test - public void testInnerClass() throws Exception { + void innerClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputGenericWhitespaceInnerClass.java"), expected); } - + @Test - public void testMethodReferences() throws Exception { + void methodReferences() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputGenericWhitespaceMethodRef1.java"), expected); } - + @Test - public void testMethodReferences2() throws Exception { + void methodReferences2() throws Exception { @@ -45237,14 +45237,14 @@ }; @@ -143,13 +143,13 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGenericEndsTheLine() throws Exception { + void genericEndsTheLine() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputGenericWhitespaceEndsTheLine.java"), expected); } - + @Test - public void testGenericWhitespaceWithEmoji() throws Exception { + void genericWhitespaceWithEmoji() throws Exception { @@ -45271,7 +45271,7 @@ + depth -> ((Number) depth).intValue() == 0)) .isTrue(); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -45280,7 +45280,7 @@ final int[] expected = { @@ -196,7 +199,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWrongTokenType() { + void wrongTokenType() { @@ -45292,15 +45292,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MethodParamPadCheckTest extends AbstractModuleTestSupport { +final class MethodParamPadCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -45309,7 +45309,7 @@ "MethodParamPadCheck#getRequiredTokens should return empty array " + "by default") @@ -47,7 +47,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45318,7 +45318,7 @@ "23:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), @@ -72,7 +72,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowLineBreaks() throws Exception { + void allowLineBreaks() throws Exception { @@ -45327,7 +45327,7 @@ "23:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), @@ -88,7 +88,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceOption() throws Exception { + void spaceOption() throws Exception { @@ -45336,7 +45336,7 @@ "18:14: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), @@ -117,7 +117,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodParamPadRecords() throws Exception { + void methodParamPadRecords() throws Exception { @@ -45345,14 +45345,14 @@ "20:34: " + getCheckMessage(MSG_WS_PRECEDED, "("), @@ -134,13 +134,13 @@ 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); } - + @Test - public void testMethodParamPadCheckWithEmoji() throws Exception { + void methodParamPadCheckWithEmoji() throws Exception { @@ -45361,7 +45361,7 @@ "21:30: " + getCheckMessage(MSG_WS_PRECEDED, "("), @@ -156,7 +156,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -45370,16 +45370,16 @@ final int[] expected = { @@ -172,7 +172,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -190,7 +190,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -45391,22 +45391,22 @@ @@ -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 NoLineWrapCheckTest extends AbstractModuleTestSupport { +final class NoLineWrapCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,13 +33,13 @@ public class NoLineWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCaseWithoutLineWrapping() throws Exception { + void caseWithoutLineWrapping() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNoLineWrapGood.java"), expected); } - + @Test - public void testDefaultTokensLineWrapping() throws Exception { + void defaultTokensLineWrapping() throws Exception { @@ -45415,7 +45415,7 @@ "13:1: " + getCheckMessage(MSG_KEY, "import"), @@ -49,7 +49,7 @@ public class NoLineWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCustomTokensLineWrapping() throws Exception { + void customTokensLineWrapping() throws Exception { @@ -45424,11 +45424,11 @@ "17:1: " + getCheckMessage(MSG_KEY, "import"), @@ -61,7 +61,7 @@ public class NoLineWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoLineWrapRecordsAndCompactCtors() throws Exception { + void noLineWrapRecordsAndCompactCtors() throws Exception { - + final String[] expected = { "13:9: " + getCheckMessage(MSG_KEY, "CTOR_DEF"), --- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java @@ -45436,15 +45436,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.antlr.v4.runtime.CommonToken; import org.junit.jupiter.api.Test; - + -public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { +final class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45453,14 +45453,14 @@ "11:11: " + getCheckMessage(MSG_KEY, "."), @@ -61,13 +61,13 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAssignment() throws Exception { + void assignment() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputNoWhitespaceAfterTestAssignment.java"), expected); } - + @Test - public void testDotAllowLineBreaks() throws Exception { + void dotAllowLineBreaks() throws Exception { @@ -45469,7 +45469,7 @@ "129:23: " + getCheckMessage(MSG_KEY, "."), @@ -78,7 +78,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTypecast() throws Exception { + void typecast() throws Exception { @@ -45478,7 +45478,7 @@ "89:13: " + getCheckMessage(MSG_KEY, ")"), @@ -88,7 +88,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayDeclarations() throws Exception { + void arrayDeclarations() throws Exception { @@ -45487,7 +45487,7 @@ "16:23: " + getCheckMessage(MSG_KEY, "someStuff3"), @@ -116,7 +116,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayDeclarations2() throws Exception { + void arrayDeclarations2() throws Exception { @@ -45496,13 +45496,13 @@ "25:41: " + getCheckMessage(MSG_KEY, "create"), @@ -166,12 +166,12 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayDeclarations3() throws Exception { + void arrayDeclarations3() throws Exception { verifyWithInlineConfigParser(getPath("InputNoWhitespaceAfterArrayDeclarations3.java")); } - + @Test - public void testSynchronized() throws Exception { + void testSynchronized() throws Exception { @@ -45511,13 +45511,13 @@ }; @@ -179,12 +179,12 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNpe() throws Exception { + void npe() throws Exception { verifyWithInlineConfigParser(getPath("InputNoWhitespaceAfterTestNpe.java")); } - + @Test - public void testMethodReference() throws Exception { + void methodReference() throws Exception { @@ -45526,7 +45526,7 @@ }; @@ -192,7 +192,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodReferenceAfter() throws Exception { + void methodReferenceAfter() throws Exception { @@ -45535,7 +45535,7 @@ }; @@ -201,7 +201,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayDeclarator() throws Exception { + void arrayDeclarator() throws Exception { @@ -45544,7 +45544,7 @@ }; @@ -210,7 +210,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVisitTokenSwitchReflection() { + void visitTokenSwitchReflection() { @@ -45553,7 +45553,7 @@ final DetailAstImpl astArrayDeclarator = mockAST(TokenTypes.ARRAY_DECLARATOR, "["); @@ -230,7 +230,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllTokens() throws Exception { + void allTokens() throws Exception { @@ -45562,7 +45562,7 @@ "11:11: " + getCheckMessage(MSG_KEY, "."), @@ -259,14 +259,14 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayDeclarationsAndAnnotations() throws Exception { + void arrayDeclarationsAndAnnotations() throws Exception { @@ -45570,7 +45570,7 @@ verifyWithInlineConfigParser( getPath("InputNoWhitespaceAfterArrayDeclarationsAndAnno.java"), expected); } - + @Test - public void testArrayNewTypeStructure() throws Exception { + void arrayNewTypeStructure() throws Exception { @@ -45579,25 +45579,25 @@ "54:27: " + getCheckMessage(MSG_KEY, "int"), @@ -297,7 +297,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayNewGenericTypeArgument() throws Exception { + void arrayNewGenericTypeArgument() throws Exception { - + final String[] expected = { "59:15: " + getCheckMessage(MSG_KEY, "i"), @@ -323,7 +323,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoWhitespaceAfterWithEmoji() throws Exception { + void noWhitespaceAfterWithEmoji() throws Exception { - + final String[] expected = { "16:16: " + getCheckMessage(MSG_KEY, "String"), @@ -339,7 +339,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoWhitespaceAfterSynchronized() throws Exception { + void noWhitespaceAfterSynchronized() throws Exception { @@ -45609,15 +45609,15 @@ @@ -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 NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleTestSupport { +final class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45626,7 +45626,7 @@ "15:20: " + getCheckMessage(MSG_KEY, ":"), @@ -56,7 +56,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT } - + @Test - public void testDefaultNonCompilable() throws Exception { + void defaultNonCompilable() throws Exception { @@ -45635,7 +45635,7 @@ "36:22: " + getCheckMessage(MSG_KEY, ":"), @@ -74,7 +74,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT } - + @Test - public void testAcceptableTokenIsColon() { + void acceptableTokenIsColon() { @@ -45647,15 +45647,15 @@ @@ -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 NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { +final class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45664,7 +45664,7 @@ "34:22: " + getCheckMessage(MSG_KEY, "--"), @@ -53,7 +53,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDot() throws Exception { + void dot() throws Exception { @@ -45673,7 +45673,7 @@ "10:5: " + getCheckMessage(MSG_KEY, "."), @@ -66,7 +66,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDotAllowLineBreaks() throws Exception { + void dotAllowLineBreaks() throws Exception { @@ -45682,7 +45682,7 @@ "133:18: " + getCheckMessage(MSG_KEY, "."), @@ -77,7 +77,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodReference() throws Exception { + void methodReference() throws Exception { @@ -45691,7 +45691,7 @@ }; @@ -85,7 +85,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDotAtTheStartOfTheLine() throws Exception { + void dotAtTheStartOfTheLine() throws Exception { @@ -45700,7 +45700,7 @@ }; @@ -93,7 +93,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodRefAtTheStartOfTheLine() throws Exception { + void methodRefAtTheStartOfTheLine() throws Exception { @@ -45709,7 +45709,7 @@ }; @@ -102,7 +102,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyForLoop() throws Exception { + void emptyForLoop() throws Exception { @@ -45718,16 +45718,16 @@ }; @@ -110,7 +110,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoWhitespaceBeforeTextBlocksWithTabIndent() throws Exception { + void noWhitespaceBeforeTextBlocksWithTabIndent() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -119,7 +119,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoWhitespaceBeforeWithEmoji() throws Exception { + void noWhitespaceBeforeWithEmoji() throws Exception { @@ -45739,15 +45739,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class OperatorWrapCheckTest extends AbstractModuleTestSupport { +final class OperatorWrapCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45756,7 +45756,7 @@ "24:15: " + getCheckMessage(MSG_LINE_NEW, "-"), @@ -48,7 +48,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testOpWrapEol() throws Exception { + void opWrapEol() throws Exception { @@ -45765,7 +45765,7 @@ "30:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "&&"), @@ -58,7 +58,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonDefOpsDefault() throws Exception { + void nonDefOpsDefault() throws Exception { @@ -45774,7 +45774,7 @@ }; @@ -66,7 +66,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNonDefOpsWrapEol() throws Exception { + void nonDefOpsWrapEol() throws Exception { @@ -45783,7 +45783,7 @@ "40:21: " + getCheckMessage(MSG_LINE_PREVIOUS, "::"), @@ -75,7 +75,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAssignEol() throws Exception { + void assignEol() throws Exception { @@ -45792,7 +45792,7 @@ }; @@ -83,7 +83,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEol() throws Exception { + void eol() throws Exception { @@ -45801,7 +45801,7 @@ "22:17: " + getCheckMessage(MSG_LINE_PREVIOUS, "*"), @@ -99,7 +99,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNl() throws Exception { + void nl() throws Exception { @@ -45810,7 +45810,7 @@ "21:19: " + getCheckMessage(MSG_LINE_NEW, "*"), @@ -114,7 +114,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArraysAssign() throws Exception { + void arraysAssign() throws Exception { @@ -45819,7 +45819,7 @@ "36:28: " + getCheckMessage(MSG_LINE_NEW, "="), @@ -124,7 +124,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGuardedPattern() throws Exception { + void guardedPattern() throws Exception { @@ -45828,23 +45828,23 @@ "54:31: " + getCheckMessage(MSG_LINE_NEW, "&&"), @@ -142,13 +142,13 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResources() throws Exception { + void tryWithResources() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputOperatorWrapTryWithResources.java"), expected); } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -167,7 +167,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -45856,15 +45856,15 @@ @@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import com.puppycrawl.tools.checkstyle.utils.TokenUtil; import org.junit.jupiter.api.Test; - + -public class ParenPadCheckTest extends AbstractModuleTestSupport { +final class ParenPadCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,7 +41,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -45873,7 +45873,7 @@ "65:37: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -57,7 +57,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpace() throws Exception { + void space() throws Exception { @@ -45882,7 +45882,7 @@ "36:23: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -99,7 +99,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultForIterator() throws Exception { + void defaultForIterator() throws Exception { @@ -45891,7 +45891,7 @@ "27:36: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -113,7 +113,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceEmptyForIterator() throws Exception { + void spaceEmptyForIterator() throws Exception { @@ -45900,14 +45900,14 @@ "18:35: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -129,20 +129,20 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1322879() throws Exception { + void test1322879() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParenPadWithSpace.java"), expected); } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -45915,7 +45915,7 @@ verifyWithInlineConfigParser( getPath("InputParenPadToCheckTrimFunctionInOptionProperty.java"), expected); } - + @Test - public void testNospaceWithComplexInput() throws Exception { + void nospaceWithComplexInput() throws Exception { @@ -45924,7 +45924,7 @@ "55:28: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -270,7 +270,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testConfigureTokens() throws Exception { + void configureTokens() throws Exception { @@ -45933,16 +45933,16 @@ "121:22: " + getCheckMessage(MSG_WS_FOLLOWED, "("), @@ -303,7 +303,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -322,7 +322,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaAssignment() throws Exception { + void lambdaAssignment() throws Exception { @@ -45951,7 +45951,7 @@ "20:45: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -341,7 +341,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaAssignmentWithSpace() throws Exception { + void lambdaAssignmentWithSpace() throws Exception { @@ -45960,7 +45960,7 @@ "20:43: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -358,7 +358,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaCheckDisabled() throws Exception { + void lambdaCheckDisabled() throws Exception { @@ -45969,7 +45969,7 @@ "27:63: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -369,7 +369,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaCheckDisabledWithSpace() throws Exception { + void lambdaCheckDisabledWithSpace() throws Exception { @@ -45978,7 +45978,7 @@ "30:33: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -378,7 +378,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaCheckOnly() throws Exception { + void lambdaCheckOnly() throws Exception { @@ -45987,7 +45987,7 @@ "17:45: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -393,7 +393,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaCheckOnlyWithSpace() throws Exception { + void lambdaCheckOnlyWithSpace() throws Exception { @@ -45996,7 +45996,7 @@ "17:43: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -408,7 +408,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaCheckOnlyWithSpace1() throws Exception { + void lambdaCheckOnlyWithSpace1() throws Exception { @@ -46005,7 +46005,7 @@ }; @@ -416,7 +416,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResources() throws Exception { + void tryWithResources() throws Exception { @@ -46014,7 +46014,7 @@ "21:61: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -426,7 +426,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTryWithResourcesAndSuppression() throws Exception { + void tryWithResourcesAndSuppression() throws Exception { @@ -46023,54 +46023,54 @@ "23:13: " + getCheckMessage(MSG_WS_FOLLOWED, "("), @@ -438,13 +438,13 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoStackoverflowError() throws Exception { + void noStackoverflowError() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithLimitedResources(getPath("InputParenPadNoStackoverflowError.java"), expected); } - + @Test - public void testParenPadCheckRecords() throws Exception { + void parenPadCheckRecords() throws Exception { - + final String[] expected = { "20:21: " + getCheckMessage(MSG_WS_FOLLOWED, "("), @@ -465,7 +465,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testParenPadCheckRecordsWithSpace() throws Exception { + void parenPadCheckRecordsWithSpace() throws Exception { - + final String[] expected = { "25:19: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -486,7 +486,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testParenPadCheckEmoji() throws Exception { + void parenPadCheckEmoji() throws Exception { - + final String[] expected = { "25:45: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -500,7 +500,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testParenPadForSynchronized() throws Exception { + void parenPadForSynchronized() throws Exception { - + final String[] expected = { "18:29: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -509,7 +509,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testParenPadForEnum() throws Exception { + void parenPadForEnum() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputParenPadForEnum.java"), expected); @@ -524,7 +524,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { @@ -46087,15 +46087,15 @@ @@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { +final class SeparatorWrapCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -37,7 +37,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDot() throws Exception { + void dot() throws Exception { @@ -46104,7 +46104,7 @@ }; @@ -45,7 +45,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testComma() throws Exception { + void comma() throws Exception { @@ -46113,7 +46113,7 @@ }; @@ -53,7 +53,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodRef() throws Exception { + void methodRef() throws Exception { @@ -46122,7 +46122,7 @@ }; @@ -61,7 +61,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetDefaultTokens() { + void getDefaultTokens() { @@ -46131,16 +46131,16 @@ final int[] expected = { @@ -71,7 +71,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidOption() throws Exception { + void invalidOption() throws Exception { - + try { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; @@ -90,7 +90,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEllipsis() throws Exception { + void ellipsis() throws Exception { @@ -46149,7 +46149,7 @@ }; @@ -98,7 +98,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayDeclarator() throws Exception { + void arrayDeclarator() throws Exception { @@ -46158,7 +46158,7 @@ }; @@ -106,7 +106,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWithEmoji() throws Exception { + void withEmoji() throws Exception { @@ -46167,7 +46167,7 @@ "16:57: " + getCheckMessage(MSG_LINE_NEW, '['), @@ -119,7 +119,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTrimOptionProperty() throws Exception { + void trimOptionProperty() throws Exception { @@ -46176,7 +46176,7 @@ }; @@ -127,7 +127,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCommaOnNewLine() throws Exception { + void commaOnNewLine() throws Exception { @@ -46188,22 +46188,22 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { +final class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -34,20 +34,20 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNoSpaceErrors() throws Exception { + void noSpaceErrors() throws Exception { verifyWithInlineConfigParser( getPath("InputSingleSpaceSeparatorNoErrors.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testNoStackoverflowError() throws Exception { + void noStackoverflowError() throws Exception { @@ -46211,16 +46211,16 @@ getPath("InputSingleSpaceSeparatorNoStackoverflowError.java"), CommonUtil.EMPTY_STRING_ARRAY); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { final SingleSpaceSeparatorCheck check = new SingleSpaceSeparatorCheck(); - + assertWithMessage("Invalid acceptable tokens") @@ -56,7 +56,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceErrors() throws Exception { + void spaceErrors() throws Exception { @@ -46229,7 +46229,7 @@ "8:28: " + getCheckMessage(MSG_KEY), @@ -96,7 +96,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceErrorsAroundComments() throws Exception { + void spaceErrorsAroundComments() throws Exception { @@ -46238,7 +46238,7 @@ "12:43: " + getCheckMessage(MSG_KEY), @@ -110,7 +110,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceErrorsInChildNodes() throws Exception { + void spaceErrorsInChildNodes() throws Exception { @@ -46247,7 +46247,7 @@ }; @@ -119,7 +119,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMinColumnNo() throws Exception { + void minColumnNo() throws Exception { @@ -46256,7 +46256,7 @@ }; @@ -128,7 +128,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceInStartOfTheLine() throws Exception { + void whitespaceInStartOfTheLine() throws Exception { @@ -46265,7 +46265,7 @@ }; @@ -137,7 +137,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceErrorsIfCommentsIgnored() throws Exception { + void spaceErrorsIfCommentsIgnored() throws Exception { @@ -46274,15 +46274,15 @@ }; @@ -146,14 +146,14 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmpty() throws Exception { + void empty() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("InputSingleSpaceSeparatorEmpty.java"), expected); } - + @Test - public void testSpaceErrorsWithEmoji() throws Exception { + void spaceErrorsWithEmoji() throws Exception { @@ -46291,7 +46291,7 @@ "16:17: " + getCheckMessage(MSG_KEY), @@ -173,7 +173,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpaceErrorsAroundCommentsWithEmoji() throws Exception { + void spaceErrorsAroundCommentsWithEmoji() throws Exception { @@ -46303,15 +46303,15 @@ @@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { +final class TypecastParenPadCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -38,7 +38,7 @@ public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -46320,7 +46320,7 @@ "86:22: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -47,7 +47,7 @@ public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSpace() throws Exception { + void space() throws Exception { @@ -46329,14 +46329,14 @@ "84:27: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), @@ -63,13 +63,13 @@ public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1322879() throws Exception { + void test1322879() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputTypecastParenPadWhitespaceAround.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -46348,15 +46348,15 @@ @@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { +final class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -35,7 +35,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -46365,7 +46365,7 @@ .that(checkObj.getRequiredTokens()) @@ -43,7 +43,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -46374,7 +46374,7 @@ "74:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), @@ -52,7 +52,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testCast() throws Exception { + void cast() throws Exception { @@ -46383,7 +46383,7 @@ }; @@ -60,7 +60,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testMultilineCast() throws Exception { + void multilineCast() throws Exception { @@ -46392,7 +46392,7 @@ }; @@ -68,7 +68,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSemi() throws Exception { + void semi() throws Exception { @@ -46401,7 +46401,7 @@ "57:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), @@ -78,7 +78,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralWhile() throws Exception { + void literalWhile() throws Exception { @@ -46410,7 +46410,7 @@ }; @@ -86,7 +86,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralIf() throws Exception { + void literalIf() throws Exception { @@ -46419,7 +46419,7 @@ }; @@ -94,7 +94,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralElse() throws Exception { + void literalElse() throws Exception { @@ -46428,7 +46428,7 @@ }; @@ -102,7 +102,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralFor() throws Exception { + void literalFor() throws Exception { @@ -46437,7 +46437,7 @@ }; @@ -110,7 +110,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralFinally() throws Exception { + void literalFinally() throws Exception { @@ -46446,7 +46446,7 @@ "17:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "finally"), @@ -119,7 +119,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralReturn() throws Exception { + void literalReturn() throws Exception { @@ -46455,7 +46455,7 @@ "21:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "return"), @@ -130,7 +130,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralDo() throws Exception { + void literalDo() throws Exception { @@ -46464,7 +46464,7 @@ }; @@ -138,7 +138,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralYield() throws Exception { + void literalYield() throws Exception { @@ -46473,7 +46473,7 @@ }; @@ -147,7 +147,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralSynchronized() throws Exception { + void literalSynchronized() throws Exception { @@ -46482,7 +46482,7 @@ "31:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "synchronized"), @@ -157,7 +157,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoWhile() throws Exception { + void doWhile() throws Exception { @@ -46491,7 +46491,7 @@ }; @@ -165,7 +165,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralTry() throws Exception { + void literalTry() throws Exception { @@ -46500,7 +46500,7 @@ "24:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "try"), @@ -174,7 +174,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralCatch() throws Exception { + void literalCatch() throws Exception { @@ -46509,7 +46509,7 @@ }; @@ -182,7 +182,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralCase() throws Exception { + void literalCase() throws Exception { @@ -46518,7 +46518,7 @@ }; @@ -190,7 +190,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralCase2() throws Exception { + void literalCase2() throws Exception { @@ -46527,7 +46527,7 @@ }; @@ -198,7 +198,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyForIterator() throws Exception { + void emptyForIterator() throws Exception { @@ -46536,7 +46536,7 @@ "21:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), @@ -207,7 +207,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testTypeArgumentAndParameterCommas() throws Exception { + void typeArgumentAndParameterCommas() throws Exception { @@ -46545,14 +46545,14 @@ "20:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), @@ -217,13 +217,13 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1322879() throws Exception { + void test1322879() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputWhitespaceAfterAround.java"), expected); } - + @Test - public void testCountUnicodeCorrectly() throws Exception { + void countUnicodeCorrectly() throws Exception { @@ -46561,7 +46561,7 @@ }; @@ -232,7 +232,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testVarargs() throws Exception { + void varargs() throws Exception { @@ -46570,7 +46570,7 @@ "18:25: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "..."), @@ -244,7 +244,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchStatements() throws Exception { + void switchStatements() throws Exception { @@ -46579,7 +46579,7 @@ "31:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "switch"), @@ -260,7 +260,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaExpressions() throws Exception { + void lambdaExpressions() throws Exception { @@ -46588,7 +46588,7 @@ "19:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"), @@ -271,7 +271,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAfterWithEmoji() throws Exception { + void whitespaceAfterWithEmoji() throws Exception { @@ -46600,15 +46600,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { +final class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGetRequiredTokens() { + void getRequiredTokens() { @@ -46617,7 +46617,7 @@ "WhitespaceAroundCheck#getRequiredTokens should return empty array by default") @@ -45,7 +45,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testKeywordsAndOperators() throws Exception { + void keywordsAndOperators() throws Exception { @@ -46626,7 +46626,7 @@ "32:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -93,7 +93,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSimpleInput() throws Exception { + void simpleInput() throws Exception { @@ -46635,7 +46635,7 @@ "169:26: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -106,7 +106,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testStartOfTheLine() throws Exception { + void startOfTheLine() throws Exception { @@ -46644,7 +46644,7 @@ }; @@ -114,7 +114,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBraces() throws Exception { + void braces() throws Exception { @@ -46653,7 +46653,7 @@ "70:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), @@ -133,7 +133,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testBracesInMethodsAndConstructors() throws Exception { + void bracesInMethodsAndConstructors() throws Exception { @@ -46662,7 +46662,7 @@ "70:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), @@ -146,7 +146,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testArrayInitialization() throws Exception { + void arrayInitialization() throws Exception { @@ -46671,7 +46671,7 @@ "25:37: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), @@ -162,7 +162,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testGenericsTokensAreFlagged() throws Exception { + void genericsTokensAreFlagged() throws Exception { @@ -46680,14 +46680,14 @@ "27:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "&"), @@ -171,13 +171,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void test1322879And1649038() throws Exception { + void test1322879And1649038() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputWhitespaceAround1.java"), expected); } - + @Test - public void testAllowDoubleBraceInitialization() throws Exception { + void allowDoubleBraceInitialization() throws Exception { @@ -46696,7 +46696,7 @@ "32:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), @@ -191,7 +191,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testIgnoreEnhancedForColon() throws Exception { + void ignoreEnhancedForColon() throws Exception { @@ -46705,7 +46705,7 @@ }; @@ -199,7 +199,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyTypes() throws Exception { + void emptyTypes() throws Exception { @@ -46714,7 +46714,7 @@ "45:95: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -213,7 +213,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyLoops() throws Exception { + void emptyLoops() throws Exception { @@ -46723,7 +46723,7 @@ "56:66: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -231,7 +231,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchWhitespaceAround() throws Exception { + void switchWhitespaceAround() throws Exception { @@ -46732,7 +46732,7 @@ }; @@ -239,7 +239,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testDoWhileWhitespaceAround() throws Exception { + void doWhileWhitespaceAround() throws Exception { @@ -46741,14 +46741,14 @@ }; @@ -247,13 +247,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void allowEmptyMethods() throws Exception { + void allowEmptyMethods() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputWhitespaceAround3.java"), expected); } - + @Test - public void testGetAcceptableTokens() { + void getAcceptableTokens() { @@ -46757,7 +46757,7 @@ final int[] expected = { @@ -318,7 +318,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyTypesIsSetToFalseAndNonEmptyClasses() throws Exception { + void allowEmptyTypesIsSetToFalseAndNonEmptyClasses() throws Exception { @@ -46766,7 +46766,7 @@ "35:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), @@ -341,7 +341,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyTypesIsSetToTrueAndNonEmptyClasses() throws Exception { + void allowEmptyTypesIsSetToTrueAndNonEmptyClasses() throws Exception { @@ -46775,7 +46775,7 @@ "34:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), @@ -360,7 +360,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testNotAllowEmptyLambdaExpressionsByDefault() throws Exception { + void notAllowEmptyLambdaExpressionsByDefault() throws Exception { @@ -46784,7 +46784,7 @@ "27:28: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -374,7 +374,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testAllowEmptyLambdaExpressionsWithAllowEmptyLambdaParameter() throws Exception { + void allowEmptyLambdaExpressionsWithAllowEmptyLambdaParameter() throws Exception { @@ -46793,7 +46793,7 @@ "32:30: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -386,7 +386,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAroundLambda() throws Exception { + void whitespaceAroundLambda() throws Exception { @@ -46802,14 +46802,14 @@ "28:48: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"), @@ -395,13 +395,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAroundEmptyCatchBlock() throws Exception { + void whitespaceAroundEmptyCatchBlock() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputWhitespaceAroundCatch.java"), expected); } - + @Test - public void testWhitespaceAroundVarargs() throws Exception { + void whitespaceAroundVarargs() throws Exception { @@ -46818,7 +46818,7 @@ "20:37: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "..."), @@ -416,7 +416,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAroundRecords() throws Exception { + void whitespaceAroundRecords() throws Exception { @@ -46827,7 +46827,7 @@ "26:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -445,7 +445,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAroundAllowEmptyCompactCtors() throws Exception { + void whitespaceAroundAllowEmptyCompactCtors() throws Exception { @@ -46836,7 +46836,7 @@ "26:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -474,14 +474,14 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAroundRecordsAllowEmptyTypes() throws Exception { + void whitespaceAroundRecordsAllowEmptyTypes() throws Exception { @@ -46844,7 +46844,7 @@ verifyWithInlineConfigParser( getNonCompilablePath("InputWhitespaceAroundRecordsAllowEmptyTypes.java"), expected); } - + @Test - public void testWhitespaceAroundAllTokens() throws Exception { + void whitespaceAroundAllTokens() throws Exception { @@ -46853,7 +46853,7 @@ "27:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "<"), @@ -497,7 +497,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { } - + @Test - public void testWhitespaceAroundAfterEmoji() throws Exception { + void whitespaceAroundAfterEmoji() throws Exception { @@ -46865,15 +46865,15 @@ @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import java.util.regex.Pattern; import org.junit.jupiter.api.Test; - + -public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSupport { +final class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -36,7 +36,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu } - + @Test - public void testAccept() { + void accept() { @@ -46882,7 +46882,7 @@ createExclusionBeforeExecutionFileFilter(fileName); @@ -47,7 +47,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu } - + @Test - public void testAcceptOnNullFile() { + void acceptOnNullFile() { @@ -46891,7 +46891,7 @@ createExclusionBeforeExecutionFileFilter(fileName); @@ -56,7 +56,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu } - + @Test - public void testReject() { + void reject() { @@ -46900,22 +46900,22 @@ createExclusionBeforeExecutionFileFilter(fileName); @@ -67,7 +67,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu } - + @Test - public void testFileExclusion() throws Exception { + void fileExclusion() throws Exception { final String[] filteredViolations = CommonUtil.EMPTY_STRING_ARRAY; - + final String[] unfilteredViolations = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElementTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElementTest.java @@ -25,10 +25,10 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class CsvFilterElementTest { +final class CsvFilterElementTest { - + @Test - public void testDecideSingle() { + void decideSingle() { @@ -46924,7 +46924,7 @@ assertWithMessage("equal").that(filter.accept(0)).isTrue(); @@ -36,7 +36,7 @@ public class CsvFilterElementTest { } - + @Test - public void testDecidePair() { + void decidePair() { @@ -46933,7 +46933,7 @@ assertWithMessage("equal 0").that(filter.accept(0)).isTrue(); @@ -45,7 +45,7 @@ public class CsvFilterElementTest { } - + @Test - public void testDecideRange() { + void decideRange() { @@ -46942,7 +46942,7 @@ assertWithMessage("equal 0").that(filter.accept(0)).isTrue(); @@ -55,7 +55,7 @@ public class CsvFilterElementTest { } - + @Test - public void testDecideEmptyRange() { + void decideEmptyRange() { @@ -46951,7 +46951,7 @@ assertWithMessage("equal 0").that(filter.accept(0)).isFalse(); @@ -65,7 +65,7 @@ public class CsvFilterElementTest { } - + @Test - public void testDecideRangePlusValue() { + void decideRangePlusValue() { @@ -46960,14 +46960,14 @@ assertWithMessage("equal 0").that(filter.accept(0)).isTrue(); @@ -76,13 +76,13 @@ public class CsvFilterElementTest { } - + @Test - public void testEmptyChain() { + void emptyChain() { final CsvFilterElement filter = new CsvFilterElement(""); assertWithMessage("0").that(filter.accept(0)).isFalse(); } - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { @@ -46979,10 +46979,10 @@ @@ -25,10 +25,10 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class IntMatchFilterElementTest { +final class IntMatchFilterElementTest { - + @Test - public void testDecide() { + void decide() { @@ -46991,14 +46991,14 @@ assertWithMessage("equal").that(filter.accept(0)).isTrue(); @@ -36,13 +36,13 @@ public class IntMatchFilterElementTest { } - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { final EqualsVerifierReport ev = EqualsVerifier.forClass(IntMatchFilterElement.class).report(); assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); } - + @Test - public void testToString() { + void testToString() { @@ -47010,10 +47010,10 @@ @@ -25,10 +25,10 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class IntRangeFilterElementTest { +final class IntRangeFilterElementTest { - + @Test - public void testDecide() { + void decide() { @@ -47022,7 +47022,7 @@ assertWithMessage("in range").that(filter.accept(0)).isTrue(); @@ -38,7 +38,7 @@ public class IntRangeFilterElementTest { } - + @Test - public void testDecideSingle() { + void decideSingle() { @@ -47031,7 +47031,7 @@ assertWithMessage("in range").that(filter.accept(0)).isTrue(); @@ -46,7 +46,7 @@ public class IntRangeFilterElementTest { } - + @Test - public void testDecideEmpty() { + void decideEmpty() { @@ -47040,7 +47040,7 @@ assertWithMessage("out").that(filter.accept(0)).isFalse(); @@ -56,7 +56,7 @@ public class IntRangeFilterElementTest { } - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { @@ -47052,12 +47052,12 @@ @@ -28,12 +28,12 @@ import com.puppycrawl.tools.checkstyle.api.SeverityLevel; import com.puppycrawl.tools.checkstyle.api.Violation; import org.junit.jupiter.api.Test; - + -public class SeverityMatchFilterTest { +final class SeverityMatchFilterTest { - + private final SeverityMatchFilter filter = new SeverityMatchFilter(); - + @Test - public void testDefault() { + void testDefault() { @@ -47066,7 +47066,7 @@ final SeverityLevel errorLevel = SeverityLevel.ERROR; @@ -49,7 +49,7 @@ public class SeverityMatchFilterTest { } - + @Test - public void testSeverity() { + void severity() { @@ -47075,7 +47075,7 @@ // event with no message has severity level INFO @@ -67,7 +67,7 @@ public class SeverityMatchFilterTest { } - + @Test - public void testAcceptOnMatch() { + void acceptOnMatch() { @@ -47084,7 +47084,7 @@ final AuditEvent ev = new AuditEvent(this, "Test.java"); @@ -86,7 +86,7 @@ public class SeverityMatchFilterTest { } - + @Test - public void testConfigure() throws CheckstyleException { + void configure() throws CheckstyleException { @@ -47096,25 +47096,25 @@ @@ -30,23 +30,23 @@ import nl.jqno.equalsverifier.Warning; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class SuppressFilterElementTest { +final class SuppressFilterElementTest { - + private SuppressFilterElement filter; - + @BeforeEach - public void setUp() { + void setUp() { filter = new SuppressFilterElement("Test", "Test", null, null, null, null); } - + @Test - public void testDecideDefault() { + void decideDefault() { final AuditEvent ev = new AuditEvent(this, "Test.java"); assertWithMessage(ev.getFileName()).that(filter.accept(ev)).isTrue(); } - + @Test - public void testDecideViolation() { + void decideViolation() { @@ -47123,7 +47123,7 @@ // deny because there are matches on file and check names @@ -54,7 +54,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByMessage() { + void decideByMessage() { @@ -47132,7 +47132,7 @@ final SuppressFilterElement filter1 = @@ -66,7 +66,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByLine() { + void decideByLine() { @@ -47141,7 +47141,7 @@ final SuppressFilterElement filter1 = @@ -82,7 +82,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByColumn() { + void decideByColumn() { @@ -47150,7 +47150,7 @@ final SuppressFilterElement filter1 = @@ -96,27 +96,27 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByFileNameAndModuleMatchingFileNameNull() { + void decideByFileNameAndModuleMatchingFileNameNull() { @@ -47158,14 +47158,14 @@ final AuditEvent ev = new AuditEvent(this, null, message); assertWithMessage("Filter should accept valid event").that(filter.accept(ev)).isTrue(); } - + @Test - public void testDecideByFileNameAndModuleMatchingMessageNull() { + void decideByFileNameAndModuleMatchingMessageNull() { final AuditEvent ev = new AuditEvent(this, "ATest.java", null); assertWithMessage("Filter should accept valid event").that(filter.accept(ev)).isTrue(); } - + @Test - public void testDecideByFileNameAndModuleMatchingModuleNull() { + void decideByFileNameAndModuleMatchingModuleNull() { @@ -47173,7 +47173,7 @@ final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); assertWithMessage("Filter should not accept invalid event").that(filter.accept(ev)).isFalse(); } - + @Test - public void testDecideByFileNameAndModuleMatchingModuleEqual() { + void decideByFileNameAndModuleMatchingModuleEqual() { @@ -47182,7 +47182,7 @@ final SuppressFilterElement myFilter = @@ -126,7 +126,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByFileNameAndModuleMatchingModuleNotEqual() { + void decideByFileNameAndModuleMatchingModuleNotEqual() { @@ -47191,7 +47191,7 @@ final SuppressFilterElement myFilter = @@ -136,14 +136,14 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByFileNameAndModuleMatchingRegExpNotMatch() { + void decideByFileNameAndModuleMatchingRegExpNotMatch() { @@ -47199,7 +47199,7 @@ final AuditEvent ev = new AuditEvent(this, "T1est", message); assertWithMessage("Filter should accept valid event").that(filter.accept(ev)).isTrue(); } - + @Test - public void testDecideByFileNameAndModuleMatchingRegExpMatch() { + void decideByFileNameAndModuleMatchingRegExpMatch() { @@ -47208,7 +47208,7 @@ final SuppressFilterElement myFilter = @@ -152,7 +152,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByFileNameAndModuleMatchingCheckRegExpNotMatch() { + void decideByFileNameAndModuleMatchingCheckRegExpNotMatch() { @@ -47217,7 +47217,7 @@ final SuppressFilterElement myFilter = @@ -161,7 +161,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByFileNameAndModuleMatchingCheckRegExpMatch() { + void decideByFileNameAndModuleMatchingCheckRegExpMatch() { @@ -47226,7 +47226,7 @@ final SuppressFilterElement myFilter = @@ -171,7 +171,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testDecideByFileNameAndSourceNameCheckRegExpNotMatch() { + void decideByFileNameAndSourceNameCheckRegExpNotMatch() { @@ -47235,7 +47235,7 @@ final SuppressFilterElement myFilter = @@ -182,7 +182,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testEquals() { + void testEquals() { @@ -47244,7 +47244,7 @@ final SuppressFilterElement filterBased = @@ -213,7 +213,7 @@ public class SuppressFilterElementTest { } - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { @@ -47256,15 +47256,15 @@ @@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class SuppressWarningsFilterTest extends AbstractModuleTestSupport { +final class SuppressWarningsFilterTest extends AbstractModuleTestSupport { - + private static final String[] ALL_MESSAGES = { "48:5: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), @@ -73,14 +73,14 @@ public class SuppressWarningsFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNone() throws Exception { + void none() throws Exception { @@ -47272,7 +47272,7 @@ verifySuppressedWithParser( getPath("InputSuppressWarningsFilterWithoutFilter.java"), suppressed); } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -47281,7 +47281,7 @@ + getCheckMessage( @@ -102,7 +102,7 @@ public class SuppressWarningsFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressById() throws Exception { + void suppressById() throws Exception { @@ -47293,7 +47293,7 @@ @@ -22,6 +22,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 com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -47307,15 +47307,15 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSupport { +final class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSupport { - + private static final String[] ALL_MESSAGES = { "46:17: " @@ -126,7 +126,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testNone() throws Exception { + void none() throws Exception { @@ -47324,7 +47324,7 @@ "36:17: " @@ -207,7 +207,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -47333,7 +47333,7 @@ + getCheckMessage( @@ -235,7 +235,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testCheckC() throws Exception { + void checkC() throws Exception { @@ -47342,7 +47342,7 @@ + getCheckMessage( @@ -249,7 +249,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testCheckCpp() throws Exception { + void checkCpp() throws Exception { @@ -47351,7 +47351,7 @@ + getCheckMessage( @@ -272,7 +272,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testUsingVariableMessage() throws Exception { + void usingVariableMessage() throws Exception { @@ -47360,7 +47360,7 @@ "109:11: " + getCheckMessage(IllegalCatchCheck.class, IllegalCatchCheck.MSG_KEY, "Exception"), @@ -282,7 +282,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testUsingNonMatchingVariableMessage() throws Exception { + void usingNonMatchingVariableMessage() throws Exception { @@ -47369,7 +47369,7 @@ getPath("InputSuppressWithNearbyCommentFilterUsingNonMatchingVariableMessage.java"), @@ -290,7 +290,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testUsingVariableCheckOnNextLine() throws Exception { + void usingVariableCheckOnNextLine() throws Exception { @@ -47378,7 +47378,7 @@ + getCheckMessage( @@ -302,7 +302,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testUsingVariableCheckOnPreviousLine() throws Exception { + void usingVariableCheckOnPreviousLine() throws Exception { @@ -47387,7 +47387,7 @@ + getCheckMessage( @@ -314,7 +314,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testVariableCheckOnVariableNumberOfLines() throws Exception { + void variableCheckOnVariableNumberOfLines() throws Exception { @@ -47396,7 +47396,7 @@ + getCheckMessage( @@ -336,7 +336,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testEqualsAndHashCodeOfTagClass() { + void equalsAndHashCodeOfTagClass() { @@ -47405,7 +47405,7 @@ getTagsAfterExecution(filter, "filename", "//SUPPRESS CHECKSTYLE ignore").get(0); @@ -356,7 +356,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testInvalidInfluenceFormat() throws Exception { + void invalidInfluenceFormat() throws Exception { @@ -47414,7 +47414,7 @@ createModuleConfig(SuppressWithNearbyCommentFilter.class); @@ -381,7 +381,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testInfluenceFormat() throws Exception { + void influenceFormat() throws Exception { @@ -47423,7 +47423,7 @@ + getCheckMessage( @@ -413,7 +413,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testInvalidCheckFormat() throws Exception { + void invalidCheckFormat() throws Exception { @@ -47432,7 +47432,7 @@ createModuleConfig(SuppressWithNearbyCommentFilter.class); @@ -437,12 +437,11 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testAcceptNullViolation() { + void acceptNullViolation() { @@ -47447,7 +47447,7 @@ assertWithMessage("Filter should accept null violation") @@ -451,7 +450,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testAcceptNullFileContents() { + void acceptNullFileContents() { @@ -47456,7 +47456,7 @@ final TreeWalkerAuditEvent auditEvent = @@ -461,7 +460,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testToStringOfTagClass() { + void toStringOfTagClass() { @@ -47465,7 +47465,7 @@ getTagsAfterExecution(filter, "filename", "//SUPPRESS CHECKSTYLE ignore").get(0); @@ -473,7 +472,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testToStringOfTagClassWithId() { + void toStringOfTagClassWithId() { @@ -47474,7 +47474,7 @@ final Object tag = @@ -486,14 +485,14 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testUsingTagMessageRegexp() throws Exception { + void usingTagMessageRegexp() throws Exception { @@ -47482,7 +47482,7 @@ verifySuppressedWithParser( getPath("InputSuppressWithNearbyCommentFilterUsingTagMessageRegexp.java"), suppressed); } - + @Test - public void testSuppressByCheck() throws Exception { + void suppressByCheck() throws Exception { @@ -47491,7 +47491,7 @@ + getCheckMessage( @@ -536,7 +535,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testSuppressById() throws Exception { + void suppressById() throws Exception { @@ -47500,7 +47500,7 @@ + getCheckMessage( @@ -579,7 +578,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testSuppressByCheckAndId() throws Exception { + void suppressByCheckAndId() throws Exception { @@ -47509,7 +47509,7 @@ + getCheckMessage( @@ -622,7 +621,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testSuppressByCheckAndNonMatchingId() throws Exception { + void suppressByCheckAndNonMatchingId() throws Exception { @@ -47518,7 +47518,7 @@ "41:17: " @@ -655,7 +654,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void tesSuppressByIdAndMessage() throws Exception { + void tesSuppressByIdAndMessage() throws Exception { @@ -47527,7 +47527,7 @@ + getCheckMessage( @@ -692,7 +691,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void tesSuppressByCheckAndMessage() throws Exception { + void tesSuppressByCheckAndMessage() throws Exception { @@ -47536,7 +47536,7 @@ + getCheckMessage( @@ -729,7 +728,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo } - + @Test - public void testTagsAreClearedEachRun() { + void tagsAreClearedEachRun() { @@ -47548,96 +47548,96 @@ @@ -39,7 +39,7 @@ import java.io.IOException; import java.util.List; import org.junit.jupiter.api.Test; - + -public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport { +final class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport { - + private static final String REGEXP_SINGLELINE_CHECK_FORMAT = "this should not appear"; - + @@ -49,7 +49,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testDefaultConfig() throws Exception { + void defaultConfig() throws Exception { final int expectedLineLength = 90; final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @@ -77,7 +77,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNearbyTextPattern() throws Exception { + void nearbyTextPattern() throws Exception { final int expectedLineLength = 90; - + final String[] violationMessages = { @@ -108,7 +108,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testCheckPattern() throws Exception { + void checkPattern() throws Exception { final int expectedLineLength = 80; - + final String[] violationMessages = { @@ -130,7 +130,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testMessagePattern() throws Exception { + void messagePattern() throws Exception { final int expectedLineLength = 90; - + final String[] violationMessages = { @@ -152,7 +152,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testIdPattern() throws Exception { + void idPattern() throws Exception { final int expectedLineLength = 80; - + final String[] violationMessages = { @@ -174,7 +174,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testLineRangePositive3() throws Exception { + void lineRangePositive3() throws Exception { final int expectedLineLength = 92; - + final String[] violationMessages = { @@ -206,7 +206,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testLineRangeNegative2() throws Exception { + void lineRangeNegative2() throws Exception { final int expectedLineLength = 91; - + final String[] violationMessages = { @@ -237,7 +237,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testVariableCheckPatternAndLineRange() throws Exception { + void variableCheckPatternAndLineRange() throws Exception { final int expectedLineLength = 85; - + final String[] violationMessages = { @@ -265,7 +265,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNearbyTextPatternAny() throws Exception { + void nearbyTextPatternAny() throws Exception { final int expectedLineLength = 76; - + final String[] violationMessages = { @@ -283,7 +283,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNearbyTextPatternCompactVariableCheckPattern() throws Exception { + void nearbyTextPatternCompactVariableCheckPattern() throws Exception { @@ -47646,16 +47646,16 @@ "27:13: " + getCheckMessage(MagicNumberCheck.class, MagicNumberCheck.MSG_KEY, "43"), @@ -302,7 +302,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNearbyTextPatternUrlLineLengthSuppression() throws Exception { + void nearbyTextPatternUrlLineLengthSuppression() throws Exception { final int expectedLineLength = 90; - + final String[] violationMessages = { @@ -323,7 +323,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testInvalidCheckPattern() throws Exception { + void invalidCheckPattern() throws Exception { @@ -47664,7 +47664,7 @@ }; @@ -343,7 +343,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testInvalidIdPattern() throws Exception { + void invalidIdPattern() throws Exception { @@ -47673,7 +47673,7 @@ }; @@ -363,7 +363,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testInvalidMessagePattern() throws Exception { + void invalidMessagePattern() throws Exception { @@ -47682,7 +47682,7 @@ }; @@ -383,7 +383,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport } - + @Test - public void testInvalidLineRange() throws Exception { + void invalidLineRange() throws Exception { @@ -47723,7 +47723,7 @@ - public void testSuppressionsAreClearedEachRun() throws IOException { + void suppressionsAreClearedEachRun() throws IOException { final SuppressWithNearbyTextFilter filter = new SuppressWithNearbyTextFilter(); - + final List suppressions1 = @@ -522,7 +522,7 @@ public class SuppressWithNearbyTextFilterTest extends AbstractModuleTestSupport * @throws IOException if an error occurs while formatting the path to the input file. @@ -47732,22 +47732,22 @@ - public void testCachedFileAbsolutePathHasChangedEachRun() throws IOException { + void cachedFileAbsolutePathHasChangedEachRun() throws IOException { final SuppressWithNearbyTextFilter filter = new SuppressWithNearbyTextFilter(); - + final String cachedFileAbsolutePath1 = --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterTest.java @@ -46,7 +46,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSupport { +final class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSupport { - + private static final String MSG_REGEXP_EXCEEDED = "regexp.exceeded"; - + @@ -56,7 +56,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testFilterWithDefaultConfig() throws Exception { + void filterWithDefaultConfig() throws Exception { @@ -47756,7 +47756,7 @@ "28:1: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), @@ -75,7 +75,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testChangeOffAndOnFormat() throws Exception { + void changeOffAndOnFormat() throws Exception { @@ -47765,7 +47765,7 @@ "27:30: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), @@ -95,7 +95,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressionCommentsInXmlFile() throws Exception { + void suppressionCommentsInXmlFile() throws Exception { @@ -47774,7 +47774,7 @@ filterCfg.addProperty("offCommentFormat", "CS-OFF"); @@ -121,7 +121,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressionCommentsInPropertiesFile() throws Exception { + void suppressionCommentsInPropertiesFile() throws Exception { @@ -47783,7 +47783,7 @@ filterCfg.addProperty("offCommentFormat", "# CHECKSTYLE:OFF"); @@ -147,7 +147,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressionCommentsInSqlFile() throws Exception { + void suppressionCommentsInSqlFile() throws Exception { @@ -47792,7 +47792,7 @@ filterCfg.addProperty("offCommentFormat", "-- CHECKSTYLE OFF"); @@ -173,7 +173,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressionCommentsInJavaScriptFile() throws Exception { + void suppressionCommentsInJavaScriptFile() throws Exception { @@ -47801,7 +47801,7 @@ }; @@ -190,7 +190,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testInvalidCheckFormat() throws Exception { + void invalidCheckFormat() throws Exception { @@ -47810,7 +47810,7 @@ filterCfg.addProperty("checkFormat", "e[l"); @@ -225,7 +225,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testInvalidIdFormat() throws Exception { + void invalidIdFormat() throws Exception { @@ -47819,7 +47819,7 @@ filterCfg.addProperty("idFormat", "e[l"); @@ -252,7 +252,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testInvalidMessageFormat() throws Exception { + void invalidMessageFormat() throws Exception { @@ -47828,7 +47828,7 @@ filterCfg.addProperty("messageFormat", "e[l"); @@ -287,7 +287,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testInvalidMessageFormatInSqlFile() throws Exception { + void invalidMessageFormatInSqlFile() throws Exception { @@ -47837,7 +47837,7 @@ filterCfg.addProperty("onCommentFormat", "CSON (\\w+)"); @@ -321,7 +321,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testAcceptNullViolation() { + void acceptNullViolation() { @@ -47855,7 +47855,7 @@ final EqualsVerifierReport ev = @@ -343,7 +343,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressByCheck() throws Exception { + void suppressByCheck() throws Exception { @@ -47864,7 +47864,7 @@ }; @@ -367,7 +367,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressByModuleId() throws Exception { + void suppressByModuleId() throws Exception { @@ -47873,7 +47873,7 @@ + getCheckMessage(RegexpSinglelineCheck.class, MSG_REGEXP_EXCEEDED, ".*[a-zA-Z][0-9].*"), @@ -398,7 +398,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressByCheckAndModuleId() throws Exception { + void suppressByCheckAndModuleId() throws Exception { @@ -47882,16 +47882,16 @@ }; @@ -424,7 +424,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressByCheckAndNonMatchingModuleId() throws Exception { + void suppressByCheckAndNonMatchingModuleId() throws Exception { final String[] suppressedViolationMessages = CommonUtil.EMPTY_STRING_ARRAY; - + final String[] expectedViolationMessages = { @@ -448,7 +448,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressByModuleIdWithNullModuleId() throws Exception { + void suppressByModuleIdWithNullModuleId() throws Exception { @@ -47900,7 +47900,7 @@ + getCheckMessage(RegexpSinglelineCheck.class, MSG_REGEXP_EXCEEDED, ".*[a-zA-Z][0-9].*"), @@ -479,7 +479,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testSuppressedByIdJavadocCheck() throws Exception { + void suppressedByIdJavadocCheck() throws Exception { @@ -47909,7 +47909,7 @@ "32:9: " + getCheckMessage(JavadocMethodCheck.class, MSG_UNUSED_TAG, "@param", "unused"), @@ -499,7 +499,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testAcceptThrowsIllegalStateExceptionAsFileNotFound() { + void acceptThrowsIllegalStateExceptionAsFileNotFound() { @@ -47918,7 +47918,7 @@ 1, @@ -538,7 +538,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testFilterWithCustomMessageFormat() throws Exception { + void filterWithCustomMessageFormat() throws Exception { @@ -47927,7 +47927,7 @@ }; @@ -562,7 +562,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testFilterWithIdAndCustomMessageFormat() throws Exception { + void filterWithIdAndCustomMessageFormat() throws Exception { @@ -47936,7 +47936,7 @@ filterCfg.addProperty("offCommentFormat", "CHECKSTYLE stop (\\w+) (\\w+)"); @@ -600,7 +600,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testFilterWithCheckAndCustomMessageFormat() throws Exception { + void filterWithCheckAndCustomMessageFormat() throws Exception { @@ -47945,7 +47945,7 @@ filterCfg.addProperty("offCommentFormat", "CHECKSTYLE stop (\\w+) (\\w+)"); @@ -638,7 +638,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu } - + @Test - public void testFilterWithDirectory() throws IOException { + void filterWithDirectory() throws IOException { @@ -47957,15 +47957,15 @@ @@ -51,7 +51,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.Test; - + -public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { +final class SuppressionCommentFilterTest extends AbstractModuleTestSupport { - + private static final String[] ALL_MESSAGES = { "45:17: " @@ -96,7 +96,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNone() throws Exception { + void none() throws Exception { @@ -47973,7 +47973,7 @@ "35:17: " + getCheckMessage( @@ -148,7 +148,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { - + // Suppress all checks between default comments @Test - public void testDefault() throws Exception { @@ -47983,7 +47983,7 @@ + getCheckMessage( @@ -164,7 +164,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckC() throws Exception { + void checkC() throws Exception { @@ -47992,7 +47992,7 @@ + getCheckMessage( @@ -176,7 +176,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testCheckCpp() throws Exception { + void checkCpp() throws Exception { @@ -48000,7 +48000,7 @@ "48:17: " + getCheckMessage( @@ -188,7 +188,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { - + // Suppress all checks between CS_OFF and CS_ON @Test - public void testOffFormat() throws Exception { @@ -48019,7 +48019,7 @@ + getCheckMessage( @@ -219,7 +219,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testArgumentSuppression() throws Exception { + void argumentSuppression() throws Exception { @@ -48028,7 +48028,7 @@ }; @@ -227,7 +227,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testExpansion() throws Exception { + void expansion() throws Exception { @@ -48037,7 +48037,7 @@ + getCheckMessage( @@ -243,7 +243,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testMessage() throws Exception { + void message() throws Exception { @@ -48046,7 +48046,7 @@ } @@ -259,7 +259,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsAndHashCodeOfTagClass() { + void equalsAndHashCodeOfTagClass() { @@ -48055,7 +48055,7 @@ EqualsVerifier.forClass(tag.getClass()).usingGetClass().report(); @@ -267,7 +267,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testToStringOfTagClass() { + void toStringOfTagClass() { @@ -48064,7 +48064,7 @@ .that(tag.toString()) @@ -277,7 +277,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testToStringOfTagClassWithMessage() { + void toStringOfTagClassWithMessage() { @@ -48073,7 +48073,7 @@ final Object tag = getTagsAfterExecution(filter, "filename", "//CHECKSTYLE:ON").get(0); @@ -289,7 +289,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testCompareToOfTagClass() { + void compareToOfTagClass() { @@ -48082,7 +48082,7 @@ final Comparable tag1 = tags1.get(0); @@ -311,7 +311,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidCheckFormat() throws Exception { + void invalidCheckFormat() throws Exception { @@ -48091,7 +48091,7 @@ filterConfig.addProperty("checkFormat", "e[l"); @@ -332,7 +332,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidMessageFormat() throws Exception { + void invalidMessageFormat() throws Exception { @@ -48100,7 +48100,7 @@ filterConfig.addProperty("messageFormat", "e[l"); @@ -353,7 +353,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptNullViolation() { + void acceptNullViolation() { @@ -48109,7 +48109,7 @@ new FileContents( @@ -367,7 +367,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptNullFileContents() { + void acceptNullFileContents() { @@ -48118,7 +48118,7 @@ final TreeWalkerAuditEvent auditEvent = @@ -377,7 +377,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressByCheck() throws Exception { + void suppressByCheck() throws Exception { @@ -48127,7 +48127,7 @@ + getCheckMessage( @@ -414,7 +414,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressById() throws Exception { + void suppressById() throws Exception { @@ -48136,7 +48136,7 @@ + getCheckMessage( @@ -451,7 +451,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressByCheckAndId() throws Exception { + void suppressByCheckAndId() throws Exception { @@ -48145,7 +48145,7 @@ + getCheckMessage( @@ -488,7 +488,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressByIdAndMessage() throws Exception { + void suppressByIdAndMessage() throws Exception { @@ -48154,7 +48154,7 @@ + getCheckMessage( @@ -522,7 +522,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressByCheckAndMessage() throws Exception { + void suppressByCheckAndMessage() throws Exception { @@ -48163,7 +48163,7 @@ + getCheckMessage( @@ -556,7 +556,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testFindNearestMatchDontAllowSameColumn() { + void findNearestMatchDontAllowSameColumn() { @@ -48172,7 +48172,7 @@ new FileContents( @@ -575,7 +575,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testTagsAreClearedEachRun() { + void tagsAreClearedEachRun() { @@ -48181,11 +48181,11 @@ getTagsAfterExecution(suppressionCommentFilter, "filename1", "//CHECKSTYLE:OFF", "line2"); @@ -615,7 +615,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testCachingByFileContentsInstance() throws Exception { + void cachingByFileContentsInstance() throws Exception { - + final File file = new File(getPath("InputSuppressionCommentFilterSuppressById6.java")); final DetailAST rootAst = JavaParser.parseFile(file, JavaParser.Options.WITH_COMMENTS); --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java @@ -48193,15 +48193,15 @@ @@ -39,7 +39,7 @@ import java.net.URL; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - + -public class SuppressionFilterTest extends AbstractModuleTestSupport { +final class SuppressionFilterTest extends AbstractModuleTestSupport { - + @TempDir public File temporaryFolder; - + @@ -49,7 +49,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAccept() throws Exception { + void accept() throws Exception { @@ -48210,7 +48210,7 @@ final SuppressionFilter filter = createSuppressionFilter(fileName, optional); @@ -62,7 +62,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptFalse() throws Exception { + void acceptFalse() throws Exception { @@ -48219,7 +48219,7 @@ final SuppressionFilter filter = createSuppressionFilter(fileName, optional); @@ -77,7 +77,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptOnNullFile() throws CheckstyleException { + void acceptOnNullFile() throws CheckstyleException { @@ -48228,7 +48228,7 @@ final SuppressionFilter filter = createSuppressionFilter(fileName, optional); @@ -89,7 +89,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonExistentSuppressionFileWithFalseOptional() { + void nonExistentSuppressionFileWithFalseOptional() { @@ -48237,7 +48237,7 @@ final boolean optional = false; @@ -103,7 +103,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testExistingInvalidSuppressionFileWithTrueOptional() throws IOException { + void existingInvalidSuppressionFileWithTrueOptional() throws IOException { @@ -48246,7 +48246,7 @@ final boolean optional = true; @@ -118,7 +118,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testExistingSuppressionFileWithTrueOptional() throws Exception { + void existingSuppressionFileWithTrueOptional() throws Exception { @@ -48255,7 +48255,7 @@ final SuppressionFilter filter = createSuppressionFilter(fileName, optional); @@ -131,7 +131,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonExistentSuppressionFileWithTrueOptional() throws Exception { + void nonExistentSuppressionFileWithTrueOptional() throws Exception { @@ -48264,7 +48264,7 @@ final SuppressionFilter filter = createSuppressionFilter(fileName, optional); @@ -144,7 +144,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonExistentSuppressionUrlWithTrueOptional() throws Exception { + void nonExistentSuppressionUrlWithTrueOptional() throws Exception { @@ -48273,16 +48273,16 @@ final SuppressionFilter filter = createSuppressionFilter(fileName, optional); @@ -157,7 +157,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testUseCacheLocalFileExternalResourceContentDoesNotChange() throws Exception { + void useCacheLocalFileExternalResourceContentDoesNotChange() throws Exception { final DefaultConfiguration filterConfig = createModuleConfig(SuppressionFilter.class); filterConfig.addProperty("file", getPath("InputSuppressionFilterNone.xml")); - + @@ -173,7 +173,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testUseCacheRemoteFileExternalResourceContentDoesNotChange() throws Exception { + void useCacheRemoteFileExternalResourceContentDoesNotChange() throws Exception { @@ -48291,7 +48291,7 @@ "https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/site/resources/" @@ -262,7 +262,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testXpathSuppression() throws Exception { + void xpathSuppression() throws Exception { @@ -48300,7 +48300,7 @@ final String[] expected = { @@ -280,7 +280,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppression2() throws Exception { + void suppression2() throws Exception { @@ -48309,7 +48309,7 @@ "19:29: " @@ -295,7 +295,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppression3() throws Exception { + void suppression3() throws Exception { @@ -48321,15 +48321,15 @@ @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { +final class SuppressionSingleFilterTest extends AbstractModuleTestSupport { - + private static final String FORMAT = "TODO$"; private static final String MESSAGE = @@ -39,7 +39,7 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testDefault() throws Exception { + void testDefault() throws Exception { @@ -48338,7 +48338,7 @@ }; @@ -47,7 +47,7 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testMatching() throws Exception { + void matching() throws Exception { @@ -48347,35 +48347,35 @@ }; @@ -55,31 +55,31 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingLineNumber() throws Exception { + void nonMatchingLineNumber() throws Exception { final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser(getPath("InputSuppressionSingleFilter4.java"), suppressed); } - + @Test - public void testNonMatchingColumnNumber() throws Exception { + void nonMatchingColumnNumber() throws Exception { final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser(getPath("InputSuppressionSingleFilter5.java"), suppressed); } - + @Test - public void testNonMatchingFileRegexp() throws Exception { + void nonMatchingFileRegexp() throws Exception { final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser(getPath("InputSuppressionSingleFilter6.java"), suppressed); } - + @Test - public void testNonMatchingModuleId() throws Exception { + void nonMatchingModuleId() throws Exception { final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser(getPath("InputSuppressionSingleFilter7.java"), suppressed); } - + @Test - public void testMatchingModuleId() throws Exception { + void matchingModuleId() throws Exception { @@ -48384,21 +48384,21 @@ }; @@ -87,19 +87,19 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingChecks() throws Exception { + void nonMatchingChecks() throws Exception { final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser(getPath("InputSuppressionSingleFilter8.java"), suppressed); } - + @Test - public void testNotMatchingMessage() throws Exception { + void notMatchingMessage() throws Exception { final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; verifySuppressedWithParser(getPath("InputSuppressionSingleFilter9.java"), suppressed); } - + @Test - public void testMatchMessage() throws Exception { + void matchMessage() throws Exception { @@ -48410,7 +48410,7 @@ @@ -23,19 +23,19 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.MSG_KEY; import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -48423,15 +48423,15 @@ import nl.jqno.equalsverifier.EqualsVerifierReport; import nl.jqno.equalsverifier.Warning; import org.junit.jupiter.api.Test; - + -public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { +final class SuppressionXpathFilterTest extends AbstractModuleTestSupport { - + private static final String PATTERN = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @@ -49,7 +49,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptOne() throws Exception { + void acceptOne() throws Exception { @@ -48440,7 +48440,7 @@ getPath("InputSuppressionXpathFilterAcceptOne.java"), @@ -58,7 +58,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptTwo() throws Exception { + void acceptTwo() throws Exception { @@ -48449,7 +48449,7 @@ + getCheckMessage( @@ -75,7 +75,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testAcceptOnNullFile() throws Exception { + void acceptOnNullFile() throws Exception { @@ -48458,7 +48458,7 @@ getPath("InputSuppressionXpathFilterAcceptOnNullFile.java"), @@ -84,7 +84,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonExistentSuppressionFileWithFalseOptional() throws Exception { + void nonExistentSuppressionFileWithFalseOptional() throws Exception { @@ -48467,7 +48467,7 @@ final boolean optional = false; @@ -98,7 +98,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testExistingInvalidSuppressionFileWithTrueOptional() throws Exception { + void existingInvalidSuppressionFileWithTrueOptional() throws Exception { @@ -48476,7 +48476,7 @@ final boolean optional = true; @@ -115,7 +115,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testExistingSuppressionFileWithTrueOptional() throws Exception { + void existingSuppressionFileWithTrueOptional() throws Exception { @@ -48485,7 +48485,7 @@ getPath("InputSuppressionXpathFilterAcceptWithOptionalTrue.java"), @@ -124,7 +124,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testNonExistentSuppressionFileWithTrueOptional() throws Exception { + void nonExistentSuppressionFileWithTrueOptional() throws Exception { @@ -48494,7 +48494,7 @@ getPath("InputSuppressionXpathFilterNonExistentFileWithTrueOptional.java"), @@ -133,7 +133,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testReject() throws Exception { + void reject() throws Exception { @@ -48503,7 +48503,7 @@ + getCheckMessage(ConstantNameCheck.class, MSG_INVALID_PATTERN, "bad_name", PATTERN), @@ -145,7 +145,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsAndHashCode() { + void equalsAndHashCode() { @@ -48512,7 +48512,7 @@ .usingGetClass() @@ -156,11 +156,11 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testExternalResource() throws Exception { + void externalResource() throws Exception { @@ -48526,7 +48526,7 @@ } @@ -175,7 +175,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testFalseEncodeString() throws Exception { + void falseEncodeString() throws Exception { @@ -48535,7 +48535,7 @@ "17:24: " + getCheckMessage(IllegalTokenTextCheck.class, MSG_KEY, pattern), @@ -206,7 +206,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testFalseEncodeChar() throws Exception { + void falseEncodeChar() throws Exception { @@ -48544,16 +48544,16 @@ "17:14: " + getCheckMessage(IllegalTokenTextCheck.class, MSG_KEY, pattern), @@ -229,7 +229,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testXpathSuppression() throws Exception { + void xpathSuppression() throws Exception { for (int test = 1; test <= 4; test++) { - + final String[] expected = { @@ -248,7 +248,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testXpathSuppression2() throws Exception { + void xpathSuppression2() throws Exception { @@ -48562,7 +48562,7 @@ "18:14: " + getCheckMessage(IllegalTokenTextCheck.class, MSG_KEY, pattern), @@ -265,7 +265,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testXpathSuppression3() throws Exception { + void xpathSuppression3() throws Exception { @@ -48571,7 +48571,7 @@ "18:14: " + getCheckMessage(IllegalTokenTextCheck.class, MSG_KEY, pattern), @@ -282,7 +282,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { } - + @Test - public void testXpathSuppression4() throws Exception { + void xpathSuppression4() throws Exception { @@ -48583,15 +48583,15 @@ @@ -41,7 +41,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import org.junit.jupiter.api.Test; - + -public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport { +final class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -49,7 +49,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testMatching() throws Exception { + void matching() throws Exception { @@ -48600,7 +48600,7 @@ }; @@ -65,7 +65,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingTokenType() throws Exception { + void nonMatchingTokenType() throws Exception { @@ -48609,7 +48609,7 @@ }; @@ -79,7 +79,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingLineNumber() throws Exception { + void nonMatchingLineNumber() throws Exception { @@ -48618,7 +48618,7 @@ "21:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), @@ -96,7 +96,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingColumnNumber() throws Exception { + void nonMatchingColumnNumber() throws Exception { @@ -48627,7 +48627,7 @@ + getCheckMessage( @@ -114,7 +114,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testComplexQuery() throws Exception { + void complexQuery() throws Exception { @@ -48636,7 +48636,7 @@ "28:16: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "123"), @@ -130,7 +130,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testIncorrectQuery() { + void incorrectQuery() { @@ -48645,7 +48645,7 @@ final Object test = @@ -145,7 +145,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNoQuery() throws Exception { + void noQuery() throws Exception { @@ -48654,7 +48654,7 @@ }; @@ -161,7 +161,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNullFileName() throws Exception { + void nullFileName() throws Exception { @@ -48663,7 +48663,7 @@ }; @@ -175,7 +175,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingFileRegexp() throws Exception { + void nonMatchingFileRegexp() throws Exception { @@ -48672,7 +48672,7 @@ }; @@ -189,7 +189,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testInvalidFileRegexp() { + void invalidFileRegexp() { @@ -48681,7 +48681,7 @@ filter.setFiles("e[l"); @@ -202,7 +202,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testInvalidCheckRegexp() { + void invalidCheckRegexp() { @@ -48690,16 +48690,16 @@ filter.setChecks("e[l"); @@ -215,7 +215,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNullViolation() throws Exception { + void nullViolation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -226,7 +226,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingModuleId() throws Exception { + void nonMatchingModuleId() throws Exception { @@ -48708,7 +48708,7 @@ }; @@ -240,7 +240,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testMatchingModuleId() throws Exception { + void matchingModuleId() throws Exception { @@ -48717,7 +48717,7 @@ }; @@ -256,7 +256,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingChecks() throws Exception { + void nonMatchingChecks() throws Exception { @@ -48726,7 +48726,7 @@ }; @@ -270,7 +270,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNonMatchingFileNameModuleIdAndCheck() throws Exception { + void nonMatchingFileNameModuleIdAndCheck() throws Exception { @@ -48735,7 +48735,7 @@ }; @@ -283,7 +283,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testNullModuleIdAndNonMatchingChecks() throws Exception { + void nullModuleIdAndNonMatchingChecks() throws Exception { @@ -48744,7 +48744,7 @@ }; @@ -296,7 +296,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testDecideByMessage() throws Exception { + void decideByMessage() throws Exception { @@ -48753,7 +48753,7 @@ "30:21: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "3.14"), @@ -315,7 +315,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testThrowException() throws Exception { + void throwException() throws Exception { @@ -48762,7 +48762,7 @@ createSuppressionXpathSingleFilter( @@ -341,7 +341,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testAllNullConfiguration() throws Exception { + void allNullConfiguration() throws Exception { @@ -48771,7 +48771,7 @@ }; @@ -355,7 +355,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testDecideByIdAndExpression() throws Exception { + void decideByIdAndExpression() throws Exception { @@ -48780,7 +48780,7 @@ }; @@ -371,7 +371,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testDefaultFileProperty() throws Exception { + void defaultFileProperty() throws Exception { @@ -48789,7 +48789,7 @@ }; @@ -387,7 +387,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testDecideByCheck() throws Exception { + void decideByCheck() throws Exception { @@ -48798,7 +48798,7 @@ }; @@ -403,7 +403,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport } - + @Test - public void testDecideById() throws Exception { + void decideById() throws Exception { @@ -48812,22 +48812,22 @@ - public void testUpdateFilterSettingsInRunTime() throws Exception { + void updateFilterSettingsInRunTime() throws Exception { final File file = new File(getPath("InputSuppressionXpathSingleFilterComplexQuery.java")); - + final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; import org.xml.sax.InputSource; - + /** Tests SuppressionsLoader. */ -public class SuppressionsLoaderTest extends AbstractPathTestSupport { +final class SuppressionsLoaderTest extends AbstractPathTestSupport { - + @Override protected String getPackageLocation() { @@ -44,7 +44,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testNoSuppressions() throws Exception { + void noSuppressions() throws Exception { @@ -48836,7 +48836,7 @@ final FilterSet fc2 = new FilterSet(); @@ -54,7 +54,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadFromUrl() throws Exception { + void loadFromUrl() throws Exception { @@ -48845,7 +48845,7 @@ + "files/suppressions_none.xml", @@ -78,7 +78,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadFromMalformedUrl() { + void loadFromMalformedUrl() { @@ -48854,7 +48854,7 @@ assertWithMessage("exception expected").fail(); @@ -90,7 +90,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadFromNonExistentUrl() { + void loadFromNonExistentUrl() { @@ -48863,7 +48863,7 @@ assertWithMessage("exception expected").fail(); @@ -102,7 +102,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testMultipleSuppression() throws Exception { + void multipleSuppression() throws Exception { @@ -48872,7 +48872,7 @@ final FilterSet fc2 = new FilterSet(); @@ -128,7 +128,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testNoFile() throws IOException { + void noFile() throws IOException { @@ -48881,7 +48881,7 @@ SuppressionsLoader.loadSuppressions(fn); @@ -148,7 +148,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testNoCheck() throws IOException { + void noCheck() throws IOException { @@ -48890,7 +48890,7 @@ SuppressionsLoader.loadSuppressions(fn); @@ -168,7 +168,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testBadInt() throws IOException { + void badInt() throws IOException { @@ -48899,25 +48899,25 @@ SuppressionsLoader.loadSuppressions(fn); @@ -219,7 +219,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testUnableToFindSuppressions() { + void unableToFindSuppressions() { final String sourceName = "InputSuppressionsLoaderNone.xml"; - + try { @@ -236,7 +236,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testUnableToReadSuppressions() { + void unableToReadSuppressions() { final String sourceName = "InputSuppressionsLoaderNone.xml"; - + try { @@ -253,7 +253,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testNoCheckNoId() throws IOException { + void noCheckNoId() throws IOException { @@ -48926,16 +48926,16 @@ SuppressionsLoader.loadSuppressions(fn); @@ -266,7 +266,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testNoCheckYesId() throws Exception { + void noCheckYesId() throws Exception { final String fn = getPath("InputSuppressionsLoaderId.xml"); final FilterSet set = SuppressionsLoader.loadSuppressions(fn); - + @@ -274,7 +274,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testInvalidFileFormat() throws IOException { + void invalidFileFormat() throws IOException { @@ -48944,7 +48944,7 @@ SuppressionsLoader.loadSuppressions(fn); @@ -287,7 +287,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testLoadFromClasspath() throws Exception { + void loadFromClasspath() throws Exception { @@ -48953,7 +48953,7 @@ final FilterSet fc2 = new FilterSet(); @@ -297,7 +297,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testSettingModuleId() throws Exception { + void settingModuleId() throws Exception { @@ -48962,16 +48962,16 @@ final SuppressFilterElement suppressElement = @@ -308,7 +308,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testXpathSuppressions() throws Exception { + void xpathSuppressions() throws Exception { final String fn = getPath("InputSuppressionsLoaderXpathCorrect.xml"); final Set filterSet = SuppressionsLoader.loadXpathSuppressions(fn); - + @@ -325,7 +325,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testXpathInvalidFileFormat() throws IOException { + void xpathInvalidFileFormat() throws IOException { @@ -48980,7 +48980,7 @@ SuppressionsLoader.loadXpathSuppressions(fn); @@ -341,7 +341,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testXpathNoCheckNoId() throws IOException { + void xpathNoCheckNoId() throws IOException { @@ -48989,25 +48989,25 @@ SuppressionsLoader.loadXpathSuppressions(fn); @@ -357,7 +357,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { } - + @Test - public void testXpathNoCheckYesId() throws Exception { + void xpathNoCheckYesId() throws Exception { final String fn = getPath("InputSuppressionsLoaderXpathId.xml"); final Set filterSet = SuppressionsLoader.loadXpathSuppressions(fn); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElementTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElementTest.java @@ -39,13 +39,13 @@ import nl.jqno.equalsverifier.EqualsVerifierReport; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class XpathFilterElementTest extends AbstractModuleTestSupport { +final class XpathFilterElementTest extends AbstractModuleTestSupport { - + private File file; private FileContents fileContents; - + @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { @@ -49016,7 +49016,7 @@ } @@ -56,7 +56,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testMatching() throws Exception { + void matching() throws Exception { @@ -49025,7 +49025,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); @@ -65,7 +65,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingTokenType() throws Exception { + void nonMatchingTokenType() throws Exception { @@ -49034,7 +49034,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); @@ -74,7 +74,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingLineNumber() throws Exception { + void nonMatchingLineNumber() throws Exception { @@ -49043,7 +49043,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); @@ -83,7 +83,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingColumnNumber() throws Exception { + void nonMatchingColumnNumber() throws Exception { @@ -49052,7 +49052,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); @@ -92,7 +92,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testComplexQuery() throws Exception { + void complexQuery() throws Exception { @@ -49061,7 +49061,7 @@ + "../../IDENT[@text='countTokens']] " @@ -108,7 +108,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testInvalidCheckRegexp() { + void invalidCheckRegexp() { @@ -49070,7 +49070,7 @@ assertWithMessage("Exception is expected but got " + test).fail(); @@ -120,7 +120,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testIncorrectQuery() { + void incorrectQuery() { @@ -49079,7 +49079,7 @@ final Object test = @@ -135,7 +135,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNoQuery() throws Exception { + void noQuery() throws Exception { @@ -49088,7 +49088,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, null); @@ -143,7 +143,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNullFileName() { + void nullFileName() { @@ -49097,7 +49097,7 @@ final TreeWalkerAuditEvent ev = new TreeWalkerAuditEvent(null, null, null, null); @@ -151,7 +151,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingFileRegexp() throws Exception { + void nonMatchingFileRegexp() throws Exception { @@ -49106,7 +49106,7 @@ final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); @@ -159,7 +159,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingFilePattern() throws Exception { + void nonMatchingFilePattern() throws Exception { @@ -49115,7 +49115,7 @@ final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); @@ -167,7 +167,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingCheckRegexp() throws Exception { + void nonMatchingCheckRegexp() throws Exception { @@ -49124,7 +49124,7 @@ final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); @@ -175,7 +175,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingCheckPattern() throws Exception { + void nonMatchingCheckPattern() throws Exception { @@ -49133,7 +49133,7 @@ final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); @@ -183,7 +183,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNullViolation() { + void nullViolation() { @@ -49142,7 +49142,7 @@ final TreeWalkerAuditEvent ev = new TreeWalkerAuditEvent(null, file.getName(), null, null); @@ -191,7 +191,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingModuleId() throws Exception { + void nonMatchingModuleId() throws Exception { @@ -49151,7 +49151,7 @@ "InputXpathFilterElementSuppressByXpath", "Test", null, "id19", null); @@ -207,7 +207,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testMatchingModuleId() throws Exception { + void matchingModuleId() throws Exception { @@ -49160,7 +49160,7 @@ new XpathFilterElement( @@ -224,7 +224,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingChecks() throws Exception { + void nonMatchingChecks() throws Exception { @@ -49169,7 +49169,7 @@ new XpathFilterElement( @@ -241,7 +241,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNonMatchingFileNameModuleIdAndCheck() throws Exception { + void nonMatchingFileNameModuleIdAndCheck() throws Exception { @@ -49178,7 +49178,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", null, null, null, xpath); @@ -250,7 +250,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testNullModuleIdAndNonMatchingChecks() throws Exception { + void nullModuleIdAndNonMatchingChecks() throws Exception { @@ -49187,7 +49187,7 @@ new XpathFilterElement( @@ -260,7 +260,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testDecideByMessage() throws Exception { + void decideByMessage() throws Exception { @@ -49196,7 +49196,7 @@ final TreeWalkerAuditEvent ev = @@ -276,7 +276,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testThrowException() { + void throwException() { @@ -49205,7 +49205,7 @@ new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); @@ -295,7 +295,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsAndHashCode() throws Exception { + void equalsAndHashCode() throws Exception { @@ -49217,29 +49217,29 @@ @@ -30,7 +30,7 @@ import java.nio.charset.StandardCharsets; import java.util.Arrays; import org.junit.jupiter.api.Test; - + -public class AstRegressionTest extends AbstractTreeTestSupport { +final class AstRegressionTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -38,115 +38,115 @@ public class AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testClassAstTree1() throws Exception { + void classAstTree1() throws Exception { verifyAst( getPath("ExpectedRegressionJavaClass1Ast.txt"), getPath("InputRegressionJavaClass1.java")); } - + @Test - public void testClassAstTree2() throws Exception { + void classAstTree2() throws Exception { verifyAst( getPath("ExpectedRegressionJavaClass2Ast.txt"), getPath("InputRegressionJavaClass2.java")); } - + @Test - public void testJava8ClassAstTree1() throws Exception { + void java8ClassAstTree1() throws Exception { @@ -49247,7 +49247,7 @@ getPath("ExpectedRegressionJava8Class1Ast.txt"), getPath("InputRegressionJava8Class1.java")); } - + @Test - public void testJava8ClassAstTree2() throws Exception { + void java8ClassAstTree2() throws Exception { @@ -49255,7 +49255,7 @@ getPath("ExpectedRegressionJava8Class2Ast.txt"), getPath("InputRegressionJava8Class2.java")); } - + @Test - public void testJava9TryWithResourcesAstTree() throws Exception { + void java9TryWithResourcesAstTree() throws Exception { @@ -49263,7 +49263,7 @@ getPath("ExpectedJava9TryWithResources.txt"), getPath("/java9/InputJava9TryWithResources.java")); } - + @Test - public void testAdvanceJava9TryWithResourcesAstTree() throws Exception { + void advanceJava9TryWithResourcesAstTree() throws Exception { @@ -49271,7 +49271,7 @@ getPath("ExpectedAdvanceJava9TryWithResources.txt"), getPath("/java9/InputAdvanceJava9TryWithResources.java")); } - + @Test - public void testInputSemicolonBetweenImports() throws Exception { + void inputSemicolonBetweenImports() throws Exception { @@ -49279,7 +49279,7 @@ getPath("ExpectedSemicolonBetweenImportsAst.txt"), getNonCompilablePath("InputSemicolonBetweenImports.java")); } - + @Test - public void testInterfaceAstTree1() throws Exception { + void interfaceAstTree1() throws Exception { @@ -49287,7 +49287,7 @@ getPath("ExpectedRegressionJavaInterface1Ast.txt"), getPath("InputRegressionJavaInterface1.java")); } - + @Test - public void testInterfaceAstTree2() throws Exception { + void interfaceAstTree2() throws Exception { @@ -49295,7 +49295,7 @@ getPath("ExpectedRegressionJavaInterface2Ast.txt"), getPath("InputRegressionJavaInterface2.java")); } - + @Test - public void testJava8InterfaceAstTree1() throws Exception { + void java8InterfaceAstTree1() throws Exception { @@ -49303,21 +49303,21 @@ getPath("ExpectedRegressionJava8Interface1Ast.txt"), getPath("InputRegressionJava8Interface1.java")); } - + @Test - public void testEnumAstTree1() throws Exception { + void enumAstTree1() throws Exception { verifyAst( getPath("ExpectedRegressionJavaEnum1Ast.txt"), getPath("InputRegressionJavaEnum1.java")); } - + @Test - public void testEnumAstTree2() throws Exception { + void enumAstTree2() throws Exception { verifyAst( getPath("ExpectedRegressionJavaEnum2Ast.txt"), getPath("InputRegressionJavaEnum2.java")); } - + @Test - public void testAnnotationAstTree1() throws Exception { + void annotationAstTree1() throws Exception { @@ -49325,7 +49325,7 @@ getPath("ExpectedRegressionJavaAnnotation1Ast.txt"), getPath("InputRegressionJavaAnnotation1.java")); } - + @Test - public void testTypecast() throws Exception { + void typecast() throws Exception { @@ -49333,7 +49333,7 @@ getPath("ExpectedRegressionJavaTypecastAst.txt"), getPath("InputRegressionJavaTypecast.java")); } - + @Test - public void testJava14InstanceofWithPatternMatching() throws Exception { + void java14InstanceofWithPatternMatching() throws Exception { @@ -49341,7 +49341,7 @@ getPath("java14/ExpectedJava14InstanceofWithPatternMatchingAST.txt"), getNonCompilablePath("java14/InputJava14InstanceofWithPatternMatching.java")); } - + @Test - public void testCharLiteralSurrogatePair() throws Exception { + void charLiteralSurrogatePair() throws Exception { @@ -49349,7 +49349,7 @@ getPath("ExpectedCharLiteralSurrogatePair.txt"), getPath("InputCharLiteralSurrogatePair.java")); } - + @Test - public void testCustomAstTree() throws Exception { + void customAstTree() throws Exception { @@ -49358,7 +49358,7 @@ verifyAstRaw(getPath("ExpectedRegressionEmptyAst.txt"), "\n"); @@ -170,7 +170,7 @@ public class AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testNewlineCr() throws Exception { + void newlineCr() throws Exception { @@ -49367,7 +49367,7 @@ getPath("InputAstRegressionNewlineCrAtEndOfFile.java"), @@ -178,105 +178,105 @@ public class AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testJava14Records() throws Exception { + void java14Records() throws Exception { @@ -49375,7 +49375,7 @@ getPath("java14/ExpectedJava14Records.txt"), getNonCompilablePath("java14/InputJava14Records.java")); } - + @Test - public void testJava14RecordsTopLevel() throws Exception { + void java14RecordsTopLevel() throws Exception { @@ -49383,7 +49383,7 @@ getPath("java14/ExpectedJava14RecordsTopLevel.txt"), getNonCompilablePath("java14/InputJava14RecordsTopLevel.java")); } - + @Test - public void testJava14LocalRecordAnnotation() throws Exception { + void java14LocalRecordAnnotation() throws Exception { @@ -49391,7 +49391,7 @@ getPath("java14/ExpectedJava14LocalRecordAnnotation.txt"), getNonCompilablePath("java14/InputJava14LocalRecordAnnotation.java")); } - + @Test - public void testJava14TextBlocks() throws Exception { + void java14TextBlocks() throws Exception { @@ -49399,7 +49399,7 @@ getPath("java14/ExpectedJava14TextBlocks.txt"), getNonCompilablePath("java14/InputJava14TextBlocks.java")); } - + @Test - public void testJava14TextBlocksEscapes() throws Exception { + void java14TextBlocksEscapes() throws Exception { @@ -49407,7 +49407,7 @@ getPath("java14/ExpectedJava14TextBlocksEscapesAreOneChar.txt"), getNonCompilablePath("java14/InputJava14TextBlocksEscapesAreOneChar.java")); } - + @Test - public void testJava14SwitchExpression() throws Exception { + void java14SwitchExpression() throws Exception { @@ -49415,7 +49415,7 @@ getPath("java14/ExpectedJava14SwitchExpression.txt"), getNonCompilablePath("java14/InputJava14SwitchExpression.java")); } - + @Test - public void testInputJava14TextBlocksTabSize() throws Exception { + void inputJava14TextBlocksTabSize() throws Exception { @@ -49423,7 +49423,7 @@ getPath("java14/ExpectedJava14TextBlocksTabSize.txt"), getNonCompilablePath("java14/InputJava14TextBlocksTabSize.java")); } - + @Test - public void testInputEscapedS() throws Exception { + void inputEscapedS() throws Exception { @@ -49431,7 +49431,7 @@ getPath("java14/ExpectedJava14EscapedS.txt"), getNonCompilablePath("java14/InputJava14EscapedS.java")); } - + @Test - public void testInputSealedAndPermits() throws Exception { + void inputSealedAndPermits() throws Exception { @@ -49439,7 +49439,7 @@ getPath("java15/ExpectedAstRegressionSealedAndPermits.txt"), getNonCompilablePath("java15/InputAstRegressionSealedAndPermits.java")); } - + @Test - public void testInputTopLevelNonSealed() throws Exception { + void inputTopLevelNonSealed() throws Exception { @@ -49447,7 +49447,7 @@ getPath("java15/ExpectedTopLevelNonSealed.txt"), getNonCompilablePath("java15/InputTopLevelNonSealed.java")); } - + @Test - public void testPatternVariableWithModifiers() throws Exception { + void patternVariableWithModifiers() throws Exception { @@ -49455,7 +49455,7 @@ getPath("java16/ExpectedPatternVariableWithModifiers.txt"), getNonCompilablePath("java16/InputPatternVariableWithModifiers.java")); } - + @Test - public void testInputMethodDefArrayDeclarator() throws Exception { + void inputMethodDefArrayDeclarator() throws Exception { @@ -49463,7 +49463,7 @@ getPath("ExpectedAstRegressionMethodDefArrayDeclarator.txt"), getPath("InputAstRegressionMethodDefArrayDeclarator.java")); } - + @Test - public void testInputCstyleArrayDefinition() throws Exception { + void inputCstyleArrayDefinition() throws Exception { @@ -49471,7 +49471,7 @@ getPath("ExpectedAstRegressionCStyleArrayDefinition.txt"), getPath("InputAstRegressionCStyleArrayDefinition.java")); } - + @Test - public void testInputAnnotatedMethodVariableArityParam() throws Exception { + void inputAnnotatedMethodVariableArityParam() throws Exception { @@ -49479,7 +49479,7 @@ getPath("ExpectedAstRegressionAnnotatedMethodVariableArityParam.txt"), getPath("InputAstRegressionAnnotatedMethodVariableArityParam.java")); } - + @Test - public void testInputManyAlternativesInMultiCatch() throws Exception { + void inputManyAlternativesInMultiCatch() throws Exception { @@ -49491,10 +49491,10 @@ @@ -25,10 +25,10 @@ import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CharStreams; import org.junit.jupiter.api.Test; - + -public class CrAwareLexerTest { +final class CrAwareLexerTest { - + @Test - public void testConsumeCarriageReturnZeroCharPositionInLine() { + void consumeCarriageReturnZeroCharPositionInLine() { @@ -49503,7 +49503,7 @@ final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); @@ -40,7 +40,7 @@ public class CrAwareLexerTest { } - + @Test - public void testConsumeCarriageReturnNewline() { + void consumeCarriageReturnNewline() { @@ -49512,7 +49512,7 @@ final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); @@ -52,7 +52,7 @@ public class CrAwareLexerTest { } - + @Test - public void testConsumeWindowsNewlineZeroCharPositionInLine() { + void consumeWindowsNewlineZeroCharPositionInLine() { @@ -49521,7 +49521,7 @@ final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); @@ -65,7 +65,7 @@ public class CrAwareLexerTest { } - + @Test - public void testConsumeWindowsNewline() { + void consumeWindowsNewline() { @@ -49532,16 +49532,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/EmbeddedNullCharTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests that embedded nulls in string literals does not halt parsing. */ -public class EmbeddedNullCharTest extends AbstractModuleTestSupport { +final class EmbeddedNullCharTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class EmbeddedNullCharTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49552,10 +49552,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJava14LexerTest.java @@ -20,21 +20,21 @@ package com.puppycrawl.tools.checkstyle.grammar; - + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; +import static java.nio.charset.StandardCharsets.UTF_8; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; @@ -49563,30 +49563,30 @@ -import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; - + /** Tests GeneratedJava14Lexer. */ -public class GeneratedJava14LexerTest extends AbstractModuleTestSupport { +final class GeneratedJava14LexerTest extends AbstractModuleTestSupport { - + /** Is {@code true} if current default encoding is UTF-8. */ private static final boolean IS_UTF8 = - Charset.forName(System.getProperty("file.encoding")).equals(StandardCharsets.UTF_8); + Charset.forName(System.getProperty("file.encoding")).equals(UTF_8); - + @Override protected String getPackageLocation() { @@ -42,7 +42,7 @@ public class GeneratedJava14LexerTest extends AbstractModuleTestSupport { } - + @Test - public void testUnexpectedChar() throws Exception { + void unexpectedChar() throws Exception { // Encoding problems will occur if default encoding is not UTF-8 Assumptions.assumeTrue(IS_UTF8, "Problems with encoding may occur"); - + @@ -59,7 +59,7 @@ public class GeneratedJava14LexerTest extends AbstractModuleTestSupport { } - + @Test - public void testSemicolonBetweenImports() throws Exception { + void semicolonBetweenImports() throws Exception { @@ -49597,11 +49597,11 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java @@ -20,15 +20,15 @@ package com.puppycrawl.tools.checkstyle.grammar; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.Collections.lastIndexOfSubList; +import static java.util.stream.Collectors.toUnmodifiableList; - + import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageLexer; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -49612,14 +49612,14 @@ -import java.util.stream.Collectors; import org.antlr.v4.runtime.VocabularyImpl; import org.junit.jupiter.api.Test; - + @@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; * @noinspectionreason ClassIndependentOfModule - architecture of test modules requires this * structure */ -public class GeneratedJavaTokenTypesTest { +final class GeneratedJavaTokenTypesTest { - + /** * New tokens must be added onto the end of the list with new numbers, and old tokens must remain @@ -52,7 +52,7 @@ public class GeneratedJavaTokenTypesTest { @@ -49644,11 +49644,11 @@ - .filter(Objects::nonNull) - .collect(Collectors.toUnmodifiableList()); + Arrays.stream(nullableSymbolicNames).filter(Objects::nonNull).collect(toUnmodifiableList()); - + // Since the following tokens are not declared in the 'tokens' block, // they will always appear last in the list of symbolic names provided @@ -335,7 +333,7 @@ public class GeneratedJavaTokenTypesTest { - + // Get the starting index of the sublist of tokens, or -1 if sublist // is not present. - final int lastIndexOfSublist = Collections.lastIndexOfSubList(allTokenNames, unusedTokenNames); @@ -49660,16 +49660,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/HexFloatsTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests hex floats and doubles can be parsed. */ -public class HexFloatsTest extends AbstractModuleTestSupport { +final class HexFloatsTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class HexFloatsTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49681,15 +49681,15 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class Java14RecordsTest extends AbstractModuleTestSupport { +final class Java14RecordsTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,7 +31,7 @@ public class Java14RecordsTest extends AbstractModuleTestSupport { } - + @Test - public void testJava14Records() throws Exception { + void java14Records() throws Exception { @@ -49700,16 +49700,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7DiamondTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests Java 7 diamond can be parsed. */ -public class Java7DiamondTest extends AbstractModuleTestSupport { +final class Java7DiamondTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class Java7DiamondTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49720,16 +49720,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7MultiCatchTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests Java 7 multi-catch can be parsed. */ -public class Java7MultiCatchTest extends AbstractModuleTestSupport { +final class Java7MultiCatchTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class Java7MultiCatchTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49740,16 +49740,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7NumericalLiteralsTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests Java 7 numerical literals can be parsed. */ -public class Java7NumericalLiteralsTest extends AbstractModuleTestSupport { +final class Java7NumericalLiteralsTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class Java7NumericalLiteralsTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49760,16 +49760,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7StringSwitchTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests Java 7 String in switch can be parsed. */ -public class Java7StringSwitchTest extends AbstractModuleTestSupport { +final class Java7StringSwitchTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class Java7StringSwitchTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49780,16 +49780,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7TryWithResourcesTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests Java 7 try-with-resources can be parsed. */ -public class Java7TryWithResourcesTest extends AbstractModuleTestSupport { +final class Java7TryWithResourcesTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class Java7TryWithResourcesTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49800,16 +49800,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java9TryWithResourcesTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests Java 9 try-with-resources can be parsed. */ -public class Java9TryWithResourcesTest extends AbstractModuleTestSupport { +final class Java9TryWithResourcesTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class Java9TryWithResourcesTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49820,16 +49820,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/LineCommentAtTheEndOfFileTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Checks that file can be parsed, when it ends on line-comment but without new-line. */ -public class LineCommentAtTheEndOfFileTest extends AbstractModuleTestSupport { +final class LineCommentAtTheEndOfFileTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class LineCommentAtTheEndOfFileTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49841,15 +49841,15 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MultiDimensionalArraysInGenericsTest extends AbstractModuleTestSupport { +final class MultiDimensionalArraysInGenericsTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,7 +31,7 @@ public class MultiDimensionalArraysInGenericsTest extends AbstractModuleTestSupp } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49860,16 +49860,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/UnicodeEscapeTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests that extended unicode escapes can be parsed. */ -public class UnicodeEscapeTest extends AbstractModuleTestSupport { +final class UnicodeEscapeTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class UnicodeEscapeTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49880,16 +49880,16 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/VarargTest.java @@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + /** Tests varargs can be parsed. */ -public class VarargTest extends AbstractModuleTestSupport { +final class VarargTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class VarargTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -49901,15 +49901,15 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; import com.puppycrawl.tools.checkstyle.JavaParser; import org.junit.jupiter.api.Test; - + -public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { +final class Antlr4AstRegressionTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -31,229 +31,229 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testPackage() throws Exception { + void testPackage() throws Exception { @@ -49917,7 +49917,7 @@ getPath("ExpectedAntlr4AstRegressionPackage.txt"), getPath("InputAntlr4AstRegressionPackage.java")); } - + @Test - public void testSimple() throws Exception { + void simple() throws Exception { @@ -49925,7 +49925,7 @@ getPath("ExpectedAntlr4AstRegressionSimple.txt"), getPath("InputAntlr4AstRegressionSimple.java")); } - + @Test - public void testAnno() throws Exception { + void anno() throws Exception { @@ -49933,7 +49933,7 @@ getPath("ExpectedAntlr4AstRegressionSimpleWithAnno.txt"), getPath("InputAntlr4AstRegressionSimpleWithAnno.java")); } - + @Test - public void testImports() throws Exception { + void imports() throws Exception { @@ -49941,7 +49941,7 @@ getPath("ExpectedAntlr4AstRegressionImports.txt"), getPath("InputAntlr4AstRegressionImports.java")); } - + @Test - public void testConstructorCall() throws Exception { + void constructorCall() throws Exception { @@ -49949,7 +49949,7 @@ getPath("ExpectedAntlr4AstRegressionConstructorCall.txt"), getPath("InputAntlr4AstRegressionConstructorCall.java")); } - + @Test - public void testMethodCall() throws Exception { + void methodCall() throws Exception { @@ -49957,14 +49957,14 @@ getPath("ExpectedAntlr4AstRegressionMethodCall.txt"), getPath("InputAntlr4AstRegressionMethodCall.java")); } - + @Test - public void testRegressionJavaClass1() throws Exception { + void regressionJavaClass1() throws Exception { verifyAst( getPath("ExpectedRegressionJavaClass1Ast.txt"), getPath("InputRegressionJavaClass1.java")); } - + @Test - public void testRegressionAnnotationLocation() throws Exception { + void regressionAnnotationLocation() throws Exception { @@ -49972,7 +49972,7 @@ getPath("ExpectedAntlr4AstRegressionAnnotationLocation.txt"), getPath("InputAntlr4AstRegressionAnnotationLocation.java")); } - + @Test - public void testRegressionKeywordsAndOperators() throws Exception { + void regressionKeywordsAndOperators() throws Exception { @@ -49980,7 +49980,7 @@ getPath("ExpectedAntlr4AstRegressionKeywordsAndOperators.txt"), getPath("InputAntlr4AstRegressionKeywordsAndOperators.java")); } - + @Test - public void testRegressionDiamondOperators() throws Exception { + void regressionDiamondOperators() throws Exception { @@ -49988,7 +49988,7 @@ getPath("ExpectedAntlr4AstRegressionKeywordsAndOperators.txt"), getPath("InputAntlr4AstRegressionKeywordsAndOperators.java")); } - + @Test - public void testSingleLineBlocks() throws Exception { + void singleLineBlocks() throws Exception { @@ -49996,7 +49996,7 @@ getPath("ExpectedAntlr4AstRegressionSingleLineBlocks.txt"), getPath("InputAntlr4AstRegressionSingleLineBlocks.java")); } - + @Test - public void testExpressionList() throws Exception { + void expressionList() throws Exception { @@ -50004,7 +50004,7 @@ getPath("ExpectedAntlr4AstRegressionExpressionList.txt"), getPath("InputAntlr4AstRegressionExpressionList.java")); } - + @Test - public void testNewTypeTree() throws Exception { + void newTypeTree() throws Exception { @@ -50012,7 +50012,7 @@ getPath("ExpectedAntlr4AstRegressionNewTypeTree.txt"), getPath("InputAntlr4AstRegressionNewTypeTree.java")); } - + @Test - public void testFallThroughDefault() throws Exception { + void fallThroughDefault() throws Exception { @@ -50020,14 +50020,14 @@ getPath("ExpectedAntlr4AstRegressionFallThroughDefault.txt"), getPath("InputAntlr4AstRegressionFallThroughDefault.java")); } - + @Test - public void testPackageAnnotation() throws Exception { + void packageAnnotation() throws Exception { verifyAst( getPath("ExpectedAntlr4AstRegressionPackageAnnotation.txt"), getPath("package-info.java")); } - + @Test - public void testAnnotationOnSameLine1() throws Exception { + void annotationOnSameLine1() throws Exception { @@ -50035,7 +50035,7 @@ getPath("ExpectedAntlr4AstRegressionAnnotationOnSameLine.txt"), getPath("InputAntlr4AstRegressionAnnotationOnSameLine.java")); } - + @Test - public void testAnnotationOnSameLine2() throws Exception { + void annotationOnSameLine2() throws Exception { @@ -50043,7 +50043,7 @@ getPath("ExpectedAntlr4AstRegressionAnnotationOnSameLine2.txt"), getPath("InputAntlr4AstRegressionAnnotationOnSameLine2.java")); } - + @Test - public void testSuppressWarnings() throws Exception { + void suppressWarnings() throws Exception { @@ -50051,7 +50051,7 @@ getPath("ExpectedAntlr4AstRegressionSuppressWarnings.txt"), getPath("InputAntlr4AstRegressionSuppressWarnings.java")); } - + @Test - public void testBadOverride() throws Exception { + void badOverride() throws Exception { @@ -50059,7 +50059,7 @@ getPath("ExpectedAntlr4AstRegressionBadOverride.txt"), getPath("InputAntlr4AstRegressionBadOverride.java")); } - + @Test - public void testTrickySwitch() throws Exception { + void trickySwitch() throws Exception { @@ -50067,7 +50067,7 @@ getPath("ExpectedAntlr4AstRegressionTrickySwitch.txt"), getPath("InputAntlr4AstRegressionTrickySwitch.java")); } - + @Test - public void testExplicitInitialization() throws Exception { + void explicitInitialization() throws Exception { @@ -50075,7 +50075,7 @@ getPath("ExpectedAntlr4AstRegressionExplicitInitialization.txt"), getPath("InputAntlr4AstRegressionExplicitInitialization.java")); } - + @Test - public void testTypeParams() throws Exception { + void typeParams() throws Exception { @@ -50083,7 +50083,7 @@ getPath("ExpectedAntlr4AstRegressionTypeParams.txt"), getPath("InputAntlr4AstRegressionTypeParams.java")); } - + @Test - public void testForLoops() throws Exception { + void forLoops() throws Exception { @@ -50091,7 +50091,7 @@ getPath("ExpectedAntlr4AstRegressionForLoops.txt"), getPath("InputAntlr4AstRegressionForLoops.java")); } - + @Test - public void testIllegalCatch() throws Exception { + void illegalCatch() throws Exception { @@ -50099,7 +50099,7 @@ getPath("ExpectedAntlr4AstRegressionIllegalCatch.txt"), getPath("InputAntlr4AstRegressionIllegalCatch.java")); } - + @Test - public void testNestedTypeParametersAndArrayDeclarators() throws Exception { + void nestedTypeParametersAndArrayDeclarators() throws Exception { @@ -50107,7 +50107,7 @@ getPath("ExpectedAntlr4AstRegressionNestedTypeParametersAndArrayDeclarators.txt"), getPath("InputAntlr4AstRegressionNestedTypeParametersAndArrayDeclarators.java")); } - + @Test - public void testNewLineAtEndOfFileCr() throws Exception { + void newLineAtEndOfFileCr() throws Exception { @@ -50115,7 +50115,7 @@ getPath("ExpectedAntlr4AstRegressionNewLineAtEndOfFileCr.txt"), getPath("InputAntlr4AstRegressionNewLineAtEndOfFileCr.java")); } - + @Test - public void testWeirdCtor() throws Exception { + void weirdCtor() throws Exception { @@ -50123,7 +50123,7 @@ getPath("ExpectedAntlr4AstRegressionWeirdCtor.txt"), getPath("InputAntlr4AstRegressionWeirdCtor.java")); } - + @Test - public void testAnnotationOnQualifiedTypes() throws Exception { + void annotationOnQualifiedTypes() throws Exception { @@ -50131,7 +50131,7 @@ getPath("ExpectedAntlr4AstRegressionAnnotationOnQualifiedTypes.txt"), getPath("InputAntlr4AstRegressionAnnotationOnQualifiedTypes.java")); } - + @Test - public void testAnnotationOnArrays() throws Exception { + void annotationOnArrays() throws Exception { @@ -50139,7 +50139,7 @@ getPath("ExpectedAntlr4AstRegressionAnnotationOnArrays.txt"), getPath("InputAntlr4AstRegressionAnnotationOnArrays.java")); } - + @Test - public void testMethodRefs() throws Exception { + void methodRefs() throws Exception { @@ -50147,7 +50147,7 @@ getPath("ExpectedAntlr4AstRegressionMethodRefs.txt"), getPath("InputAntlr4AstRegressionMethodRefs.java")); } - + @Test - public void testEmbeddedBlockComments() throws Exception { + void embeddedBlockComments() throws Exception { @@ -50155,7 +50155,7 @@ getPath("ExpectedAntlr4AstRegressionEmbeddedBlockComments.txt"), getPath("InputAntlr4AstRegressionEmbeddedBlockComments.java")); } - + @Test - public void testJava16LocalEnumAndInterface() throws Exception { + void java16LocalEnumAndInterface() throws Exception { @@ -50163,7 +50163,7 @@ getPath("ExpectedAntlr4AstRegressionJava16LocalEnumAndInterface.txt"), getNonCompilablePath("InputAntlr4AstRegressionJava16LocalEnumAndInterface.java")); } - + @Test - public void testTrickySwitchWithComments() throws Exception { + void trickySwitchWithComments() throws Exception { @@ -50172,7 +50172,7 @@ getPath("InputAntlr4AstRegressionTrickySwitchWithComments.java"), @@ -261,7 +261,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testCassandraInputWithComments() throws Exception { + void cassandraInputWithComments() throws Exception { @@ -50181,7 +50181,7 @@ getPath("InputAntlr4AstRegressionCassandraInputWithComments.java"), @@ -269,7 +269,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testCommentsOnAnnotationsAndEnums() throws Exception { + void commentsOnAnnotationsAndEnums() throws Exception { @@ -50190,7 +50190,7 @@ getPath("InputAntlr4AstRegressionCommentsOnAnnotationsAndEnums.java"), @@ -277,7 +277,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testUncommon() throws Exception { + void uncommon() throws Exception { @@ -50199,7 +50199,7 @@ getNonCompilablePath("InputAntlr4AstRegressionUncommon.java"), @@ -285,7 +285,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testUncommon2() throws Exception { + void uncommon2() throws Exception { @@ -50208,7 +50208,7 @@ getNonCompilablePath("InputAntlr4AstRegressionUncommon2.java"), @@ -293,7 +293,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testTrickyYield() throws Exception { + void trickyYield() throws Exception { @@ -50217,7 +50217,7 @@ getPath("InputAntlr4AstRegressionTrickyYield.java"), @@ -301,7 +301,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testSingleCommaInArrayInit() throws Exception { + void singleCommaInArrayInit() throws Exception { @@ -50226,7 +50226,7 @@ getPath("InputAntlr4AstRegressionSingleCommaInArrayInit.java"), @@ -309,7 +309,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testUncommon3() throws Exception { + void uncommon3() throws Exception { @@ -50235,7 +50235,7 @@ getNonCompilablePath("InputAntlr4AstRegressionUncommon3.java"), @@ -317,7 +317,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testUncommon4() throws Exception { + void uncommon4() throws Exception { @@ -50244,7 +50244,7 @@ getPath("InputAntlr4AstRegressionUncommon4.java"), @@ -325,14 +325,14 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testQualifiedConstructorParameter() throws Exception { + void qualifiedConstructorParameter() throws Exception { @@ -50252,7 +50252,7 @@ getPath("ExpectedAntlr4AstRegressionQualifiedConstructorParameter.txt"), getNonCompilablePath("InputAntlr4AstRegressionQualifiedConstructorParameter.java")); } - + @Test - public void testJava15FinalLocalRecord() throws Exception { + void java15FinalLocalRecord() throws Exception { @@ -50261,7 +50261,7 @@ getNonCompilablePath("InputAntlr4AstRegressionJava15FinalLocalRecord.java"), @@ -340,28 +340,28 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testUnusualAnnotation() throws Exception { + void unusualAnnotation() throws Exception { @@ -50269,7 +50269,7 @@ getPath("ExpectedAntlr4AstRegressionUnusualAnnotation.txt"), getPath("InputAntlr4AstRegressionUnusualAnnotation.java")); } - + @Test - public void testLambda() throws Exception { + void lambda() throws Exception { @@ -50277,7 +50277,7 @@ getPath("ExpectedAntlr4AstRegressionLambda.txt"), getPath("InputAntlr4AstRegressionLambda.java")); } - + @Test - public void testExpressions() throws Exception { + void expressions() throws Exception { @@ -50285,7 +50285,7 @@ getPath("ExpectedAntlr4AstRegressionExpressions.txt"), getPath("InputAntlr4AstRegressionExpressions.java")); } - + @Test - public void testInterfaceMemberAlternativePrecedence() throws Exception { + void interfaceMemberAlternativePrecedence() throws Exception { @@ -50297,15 +50297,15 @@ @@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.antlr4; import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; import org.junit.jupiter.api.Test; - + -public class Java17AstRegressionTest extends AbstractTreeTestSupport { +final class Java17AstRegressionTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -30,49 +30,49 @@ public class Java17AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testPatternsInSwitch() throws Exception { + void patternsInSwitch() throws Exception { @@ -50313,7 +50313,7 @@ getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInSwitch.txt"), getNonCompilablePath("InputAntlr4AstRegressionPatternsInSwitch.java")); } - + @Test - public void testPatternsInIfStatement() throws Exception { + void patternsInIfStatement() throws Exception { @@ -50321,7 +50321,7 @@ getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInIfStatement.txt"), getNonCompilablePath("InputAntlr4AstRegressionPatternsInIfStatement.java")); } - + @Test - public void testPatternsInWhile() throws Exception { + void patternsInWhile() throws Exception { @@ -50329,7 +50329,7 @@ getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInWhile.txt"), getNonCompilablePath("InputAntlr4AstRegressionPatternsInWhile.java")); } - + @Test - public void testPatternsInTernary() throws Exception { + void patternsInTernary() throws Exception { @@ -50337,7 +50337,7 @@ getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInTernary.txt"), getNonCompilablePath("InputAntlr4AstRegressionPatternsInTernary.java")); } - + @Test - public void testPatternsInFor() throws Exception { + void patternsInFor() throws Exception { @@ -50345,7 +50345,7 @@ getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInFor.txt"), getNonCompilablePath("InputAntlr4AstRegressionPatternsInFor.java")); } - + @Test - public void testPatternMatchingInSwitch() throws Exception { + void patternMatchingInSwitch() throws Exception { @@ -50353,7 +50353,7 @@ getNonCompilablePath("ExpectedAntlr4AstRegressionPatternMatchingInSwitch.txt"), getNonCompilablePath("InputAntlr4AstRegressionPatternMatchingInSwitch.java")); } - + @Test - public void testCaseDefault() throws Exception { + void caseDefault() throws Exception { @@ -50364,10 +50364,10 @@ +++ 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; @@ -50379,15 +50379,15 @@ 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 { @@ -50402,10 +50402,10 @@ +++ 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; @@ -50416,15 +50416,15 @@ 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 { @@ -50441,15 +50441,15 @@ @@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.JavaParser; import com.puppycrawl.tools.checkstyle.api.Comment; import org.junit.jupiter.api.Test; - + -public class CommentsTest extends AbstractTreeTestSupport { +final class CommentsTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -34,7 +34,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } - + @Test - public void testCompareExpectedTreeWithInput1() throws Exception { + void compareExpectedTreeWithInput1() throws Exception { @@ -50458,7 +50458,7 @@ getPath("InputComments1.java"), @@ -42,7 +42,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } - + @Test - public void testCompareExpectedTreeWithInput2() throws Exception { + void compareExpectedTreeWithInput2() throws Exception { @@ -50467,7 +50467,7 @@ getPath("InputComments2.java"), @@ -50,7 +50,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } - + @Test - public void testToString() { + void testToString() { @@ -50476,7 +50476,7 @@ .that(comment.toString()) @@ -59,7 +59,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } - + @Test - public void testGetCommentMeasures() { + void getCommentMeasures() { @@ -50485,7 +50485,7 @@ " * Creates new instance.", @@ -84,7 +84,7 @@ public class CommentsTest extends AbstractTreeTestSupport { } - + @Test - public void testIntersects() { + void intersects() { @@ -50497,15 +50497,15 @@ @@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.java19; import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; import org.junit.jupiter.api.Test; - + -public class Java19AstRegressionTest extends AbstractTreeTestSupport { +final class Java19AstRegressionTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -30,84 +30,84 @@ public class Java19AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testPatternsInSwitch() throws Exception { + void patternsInSwitch() throws Exception { @@ -50513,7 +50513,7 @@ getNonCompilablePath("ExpectedJava19PatternsInSwitchLabels.txt"), getNonCompilablePath("InputJava19PatternsInSwitchLabels.java")); } - + @Test - public void testPatternsInNullSwitch1() throws Exception { + void patternsInNullSwitch1() throws Exception { @@ -50521,7 +50521,7 @@ getNonCompilablePath("ExpectedJava19PatternsInNullSwitch1.txt"), getNonCompilablePath("InputJava19PatternsInNullSwitch1.java")); } - + @Test - public void testPatternsInNullSwitch2() throws Exception { + void patternsInNullSwitch2() throws Exception { @@ -50529,7 +50529,7 @@ getNonCompilablePath("ExpectedJava19PatternsInNullSwitch2.txt"), getNonCompilablePath("InputJava19PatternsInNullSwitch2.java")); } - + @Test - public void testAnnotationsOnBinding() throws Exception { + void annotationsOnBinding() throws Exception { @@ -50537,7 +50537,7 @@ getNonCompilablePath("ExpectedJava19PatternsAnnotationsOnBinding.txt"), getNonCompilablePath("InputJava19PatternsAnnotationsOnBinding.java")); } - + @Test - public void testTrickyWhenUsage() throws Exception { + void trickyWhenUsage() throws Exception { @@ -50545,7 +50545,7 @@ getNonCompilablePath("ExpectedJava19PatternsTrickyWhenUsage.txt"), getNonCompilablePath("InputJava19PatternsTrickyWhenUsage.java")); } - + @Test - public void testLotsOfOperators() throws Exception { + void lotsOfOperators() throws Exception { @@ -50553,7 +50553,7 @@ getNonCompilablePath("ExpectedJava19BindingsWithLotsOfOperators.txt"), getNonCompilablePath("InputJava19BindingsWithLotsOfOperators.java")); } - + @Test - public void testRecordPatternsWithNestedDecomposition() throws Exception { + void recordPatternsWithNestedDecomposition() throws Exception { @@ -50561,7 +50561,7 @@ getPath("ExpectedRecordPatternsPreviewNestedDecomposition.txt"), getNonCompilablePath("InputRecordPatternsPreviewNestedDecomposition.java")); } - + @Test - public void testRecordPatternsPreview() throws Exception { + void recordPatternsPreview() throws Exception { @@ -50569,7 +50569,7 @@ getPath("ExpectedRecordPatternsPreview.txt"), getNonCompilablePath("InputRecordPatternsPreview.java")); } - + @Test - public void testGenericRecordDecomposition() throws Exception { + void genericRecordDecomposition() throws Exception { @@ -50577,7 +50577,7 @@ getNonCompilablePath("ExpectedGenericRecordDeconstructionPattern.txt"), getNonCompilablePath("InputGenericRecordDeconstructionPattern.java")); } - + @Test - public void testGuardsWithExtraParenthesis() throws Exception { + void guardsWithExtraParenthesis() throws Exception { @@ -50585,7 +50585,7 @@ getNonCompilablePath("ExpectedJava19GuardsWithExtraParenthesis.txt"), getNonCompilablePath("InputJava19GuardsWithExtraParenthesis.java")); } - + @Test - public void testBindingWithModifiers() throws Exception { + void bindingWithModifiers() throws Exception { @@ -50593,7 +50593,7 @@ getNonCompilablePath("ExpectedJava19BindingWithModifiers.txt"), getNonCompilablePath("InputJava19BindingWithModifiers.java")); } - + @Test - public void test() throws Exception { + void test() throws Exception { @@ -50605,15 +50605,15 @@ @@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.java20; import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; import org.junit.jupiter.api.Test; - + -public class Java20AstRegressionTest extends AbstractTreeTestSupport { +final class Java20AstRegressionTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -30,14 +30,14 @@ public class Java20AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testRecordDecompositionEnhancedForLoop() throws Exception { + void recordDecompositionEnhancedForLoop() throws Exception { @@ -50621,7 +50621,7 @@ getNonCompilablePath("ExpectedJava20RecordDecompositionEnhancedForLoop.txt"), getNonCompilablePath("InputJava20RecordDecompositionEnhancedForLoop.java")); } - + @Test - public void testRecordDecompositionEnhancedForLoopTricky() throws Exception { + void recordDecompositionEnhancedForLoopTricky() throws Exception { @@ -50633,15 +50633,15 @@ @@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.java21; import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; import org.junit.jupiter.api.Test; - + -public class Java21AstRegressionTest extends AbstractTreeTestSupport { +final class Java21AstRegressionTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -30,7 +30,7 @@ public class Java21AstRegressionTest extends AbstractTreeTestSupport { } - + @Test - public void testBasicStringTemplate() throws Exception { + void basicStringTemplate() throws Exception { @@ -50662,92 +50662,92 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class AnnotationTest extends AbstractModuleTestSupport { +final class AnnotationTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,73 +31,73 @@ public class AnnotationTest extends AbstractModuleTestSupport { } - + @Test - public void testSimpleTypeAnnotation() throws Exception { + void simpleTypeAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations1.java"), expected); } - + @Test - public void testAnnotationOnClass() throws Exception { + void annotationOnClass() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations2.java"), expected); } - + @Test - public void testClassCastTypeAnnotation() throws Exception { + void classCastTypeAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations3.java"), expected); } - + @Test - public void testMethodParametersTypeAnnotation() throws Exception { + void methodParametersTypeAnnotation() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations4.java"), expected); } - + @Test - public void testAnnotationInThrows() throws Exception { + void annotationInThrows() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations5.java"), expected); } - + @Test - public void testAnnotationInGeneric() throws Exception { + void annotationInGeneric() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations6.java"), expected); } - + @Test - public void testAnnotationOnConstructorCall() throws Exception { + void annotationOnConstructorCall() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations7.java"), expected); } - + @Test - public void testAnnotationNestedCall() throws Exception { + void annotationNestedCall() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations8.java"), expected); } - + @Test - public void testAnnotationOnWildcards() throws Exception { + void annotationOnWildcards() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations9.java"), expected); } - + @Test - public void testAnnotationInCatchParameters() throws Exception { + void annotationInCatchParameters() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations10.java"), expected); } - + @Test - public void testAnnotationInTypeParameters() throws Exception { + void annotationInTypeParameters() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputAnnotations11.java"), expected); } - + @Test - public void testAnnotationOnVarargs() throws Exception { + void annotationOnVarargs() throws Exception { @@ -50759,15 +50759,15 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class AnnotationsOnArrayTest extends AbstractModuleTestSupport { +final class AnnotationsOnArrayTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,7 +31,7 @@ public class AnnotationsOnArrayTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -50779,22 +50779,22 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class DefaultMethodsTest extends AbstractModuleTestSupport { +final class DefaultMethodsTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,13 +31,13 @@ public class DefaultMethodsTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputDefaultMethods.java"), expected); } - + @Test - public void testSwitch() throws Exception { + void testSwitch() throws Exception { @@ -50806,134 +50806,134 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class LambdaTest extends AbstractModuleTestSupport { +final class LambdaTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,109 +31,109 @@ public class LambdaTest extends AbstractModuleTestSupport { } - + @Test - public void testLambdaInVariableInitialization() throws Exception { + void lambdaInVariableInitialization() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda1.java"), expected); } - + @Test - public void testWithoutArgsOneLineLambdaBody() throws Exception { + void withoutArgsOneLineLambdaBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda2.java"), expected); } - + @Test - public void testWithoutArgsFullLambdaBody() throws Exception { + void withoutArgsFullLambdaBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda3.java"), expected); } - + @Test - public void testWithOneArgWithOneLineBody() throws Exception { + void withOneArgWithOneLineBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda4.java"), expected); } - + @Test - public void testWithOneArgWithFullBody() throws Exception { + void withOneArgWithFullBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda5.java"), expected); } - + @Test - public void testWithOneArgWithoutTypeOneLineBody() throws Exception { + void withOneArgWithoutTypeOneLineBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda6.java"), expected); } - + @Test - public void testWithOneArgWithoutTypeFullBody() throws Exception { + void withOneArgWithoutTypeFullBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda7.java"), expected); } - + @Test - public void testWithFewArgsWithoutTypeOneLineBody() throws Exception { + void withFewArgsWithoutTypeOneLineBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda8.java"), expected); } - + @Test - public void testWithFewArgsWithoutTypeFullBody() throws Exception { + void withFewArgsWithoutTypeFullBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda9.java"), expected); } - + @Test - public void testWithOneArgWithoutParenthesesWithoutTypeOneLineBody() throws Exception { + void withOneArgWithoutParenthesesWithoutTypeOneLineBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda10.java"), expected); } - + @Test - public void testWithOneArgWithoutParenthesesWithoutTypeFullBody() throws Exception { + void withOneArgWithoutParenthesesWithoutTypeFullBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda11.java"), expected); } - + @Test - public void testWithFewArgWithTypeOneLine() throws Exception { + void withFewArgWithTypeOneLine() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda12.java"), expected); } - + @Test - public void testWithFewArgWithTypeFullBody() throws Exception { + void withFewArgWithTypeFullBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda13.java"), expected); } - + @Test - public void testWithMultilineBody() throws Exception { + void withMultilineBody() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda14.java"), expected); } - + @Test - public void testCasesFromSpec() throws Exception { + void casesFromSpec() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda15.java"), expected); } - + @Test - public void testWithTypecast() throws Exception { + void withTypecast() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda16.java"), expected); } - + @Test - public void testInAssignment() throws Exception { + void inAssignment() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputLambda17.java"), expected); } - + @Test - public void testInTernary() throws Exception { + void inTernary() throws Exception { @@ -50945,57 +50945,57 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class MethodReferencesTest extends AbstractModuleTestSupport { +final class MethodReferencesTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,43 +31,43 @@ public class MethodReferencesTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodReferences.java"), expected); } - + @Test - public void testFromSpec() throws Exception { + void fromSpec() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodReferences2.java"), expected); } - + @Test - public void testGenericInPostfixExpressionBeforeReference() throws Exception { + void genericInPostfixExpressionBeforeReference() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodReferences3.java"), expected); } - + @Test - public void testArrayAfterGeneric() throws Exception { + void arrayAfterGeneric() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodReferences4.java"), expected); } - + @Test - public void testFromHibernate() throws Exception { + void fromHibernate() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodReferences5.java"), expected); } - + @Test - public void testFromSpring() throws Exception { + void fromSpring() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputMethodReferences6.java"), expected); } - + @Test - public void testMethodReferences7() throws Exception { + void methodReferences7() throws Exception { @@ -51007,15 +51007,15 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class ReceiverParameterTest extends AbstractModuleTestSupport { +final class ReceiverParameterTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,7 +31,7 @@ public class ReceiverParameterTest extends AbstractModuleTestSupport { } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -51027,15 +51027,15 @@ @@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class TypeUseAnnotationsOnQualifiedTypesTest extends AbstractModuleTestSupport { +final class TypeUseAnnotationsOnQualifiedTypesTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -31,7 +31,7 @@ public class TypeUseAnnotationsOnQualifiedTypesTest extends AbstractModuleTestSu } - + @Test - public void testCanParse() throws Exception { + void canParse() throws Exception { @@ -51050,7 +51050,7 @@ */ -public class GeneratedJavadocTokenTypesTest { +final class GeneratedJavadocTokenTypesTest { - + private static final String MSG = "Ensure that token numbers generated for the elements" @@ -50,7 +50,7 @@ public class GeneratedJavadocTokenTypesTest { @@ -51079,12 +51079,12 @@ */ -public class JavadocParseTreeTest extends AbstractTreeTestSupport { +final class JavadocParseTreeTest extends AbstractTreeTestSupport { - + @Override protected String getPackageLocation() { @@ -46,402 +46,402 @@ public class JavadocParseTreeTest extends AbstractTreeTestSupport { } - + @Test - public void oneSimpleHtmlTag() throws Exception { + void oneSimpleHtmlTag() throws Exception { @@ -51092,7 +51092,7 @@ getHtmlPath("expectedOneSimpleHtmlTagAst.txt"), getHtmlPath("InputOneSimpleHtmlTag.javadoc")); } - + @Test - public void textBeforeJavadocTags() throws Exception { + void textBeforeJavadocTags() throws Exception { @@ -51100,7 +51100,7 @@ getDocPath("expectedTextBeforeJavadocTagsAst.txt"), getDocPath("InputTextBeforeJavadocTags.javadoc")); } - + @Test - public void customJavadocTags() throws Exception { + void customJavadocTags() throws Exception { @@ -51108,7 +51108,7 @@ getDocPath("expectedCustomJavadocTagsAst.txt"), getDocPath("InputCustomJavadocTags.javadoc")); } - + @Test - public void javadocTagDescriptionWithInlineTags() throws Exception { + void javadocTagDescriptionWithInlineTags() throws Exception { @@ -51116,21 +51116,21 @@ getDocPath("expectedJavadocTagDescriptionWithInlineTagsAst.txt"), getDocPath("InputJavadocTagDescriptionWithInlineTags.javadoc")); } - + @Test - public void leadingAsterisks() throws Exception { + void leadingAsterisks() throws Exception { verifyJavadocTree( getPath("expectedLeadingAsterisksAst.txt"), getPath("InputLeadingAsterisks.javadoc")); } - + @Test - public void authorWithMailto() throws Exception { + void authorWithMailto() throws Exception { verifyJavadocTree( getDocPath("expectedAuthorWithMailtoAst.txt"), getDocPath("InputAuthorWithMailto.javadoc")); } - + @Test - public void htmlTagsInParagraph() throws Exception { + void htmlTagsInParagraph() throws Exception { @@ -51138,14 +51138,14 @@ getHtmlPath("expectedHtmlTagsInParagraphAst.txt"), getHtmlPath("InputHtmlTagsInParagraph.javadoc")); } - + @Test - public void linkInlineTags() throws Exception { + void linkInlineTags() throws Exception { verifyJavadocTree( getDocPath("expectedLinkInlineTagsAst.txt"), getDocPath("InputLinkInlineTags.javadoc")); } - + @Test - public void seeReferenceWithFewNestedClasses() throws Exception { + void seeReferenceWithFewNestedClasses() throws Exception { @@ -51153,26 +51153,26 @@ getDocPath("expectedSeeReferenceWithFewNestedClassesAst.txt"), getDocPath("InputSeeReferenceWithFewNestedClasses.javadoc")); } - + @Test - public void paramWithGeneric() throws Exception { + void paramWithGeneric() throws Exception { verifyJavadocTree( getDocPath("expectedParamWithGenericAst.txt"), getDocPath("InputParamWithGeneric.javadoc")); } - + @Test - public void serial() throws Exception { + void serial() throws Exception { verifyJavadocTree(getDocPath("expectedSerialAst.txt"), getDocPath("InputSerial.javadoc")); } - + @Test - public void since() throws Exception { + void since() throws Exception { verifyJavadocTree(getDocPath("expectedSinceAst.txt"), getDocPath("InputSince.javadoc")); } - + @Test - public void unclosedAndClosedParagraphs() throws Exception { + void unclosedAndClosedParagraphs() throws Exception { @@ -51180,7 +51180,7 @@ getHtmlPath("expectedUnclosedAndClosedParagraphsAst.txt"), getHtmlPath("InputUnclosedAndClosedParagraphs.javadoc")); } - + @Test - public void listWithUnclosedItemInUnclosedParagraph() throws Exception { + void listWithUnclosedItemInUnclosedParagraph() throws Exception { @@ -51188,7 +51188,7 @@ getHtmlPath("expectedListWithUnclosedItemInUnclosedParagraphAst.txt"), getHtmlPath("InputListWithUnclosedItemInUnclosedParagraph.javadoc")); } - + @Test - public void unclosedParagraphFollowedByJavadocTag() throws Exception { + void unclosedParagraphFollowedByJavadocTag() throws Exception { @@ -51196,7 +51196,7 @@ getHtmlPath("expectedUnclosedParagraphFollowedByJavadocTagAst.txt"), getHtmlPath("InputUnclosedParagraphFollowedByJavadocTag.javadoc")); } - + @Test - public void allJavadocInlineTags() throws Exception { + void allJavadocInlineTags() throws Exception { @@ -51204,7 +51204,7 @@ getDocPath("expectedAllJavadocInlineTagsAst.txt"), getDocPath("InputAllJavadocInlineTags.javadoc")); } - + @Test - public void docRootInheritDoc() throws Exception { + void docRootInheritDoc() throws Exception { @@ -51212,7 +51212,7 @@ getDocPath("expectedDocRootInheritDocAst.txt"), getDocPath("InputDocRootInheritDoc.javadoc")); } - + @Test - public void fewWhiteSpacesAsSeparator() throws Exception { + void fewWhiteSpacesAsSeparator() throws Exception { @@ -51220,7 +51220,7 @@ getDocPath("expectedFewWhiteSpacesAsSeparatorAst.txt"), getDocPath("InputFewWhiteSpacesAsSeparator.javadoc")); } - + @Test - public void mixedCaseOfHtmlTags() throws Exception { + void mixedCaseOfHtmlTags() throws Exception { @@ -51228,13 +51228,13 @@ getHtmlPath("expectedMixedCaseOfHtmlTagsAst.txt"), getHtmlPath("InputMixedCaseOfHtmlTags.javadoc")); } - + @Test - public void htmlComments() throws Exception { + void htmlComments() throws Exception { verifyJavadocTree(getHtmlPath("expectedCommentsAst.txt"), getHtmlPath("InputComments.javadoc")); } - + @Test - public void negativeNumberInAttribute() throws Exception { + void negativeNumberInAttribute() throws Exception { @@ -51242,28 +51242,28 @@ getHtmlPath("expectedNegativeNumberInAttributeAst.txt"), getHtmlPath("InputNegativeNumberInAttribute.javadoc")); } - + @Test - public void dollarInLink() throws Exception { + void dollarInLink() throws Exception { verifyJavadocTree( getDocPath("expectedDollarInLinkAst.txt"), getDocPath("InputDollarInLink.javadoc")); } - + @Test - public void dotCharacterInCustomTags() throws Exception { + void dotCharacterInCustomTags() throws Exception { verifyJavadocTree( getDocPath("expectedCustomTagWithDotAst.txt"), getDocPath("InputCustomTagWithDot.javadoc")); } - + @Test - public void testLinkToPackage() throws Exception { + void linkToPackage() throws Exception { verifyJavadocTree( getDocPath("expectedLinkToPackageAst.txt"), getDocPath("InputLinkToPackage.javadoc")); } - + @Test - public void testLeadingAsterisksExtended() throws Exception { + void leadingAsterisksExtended() throws Exception { @@ -51271,7 +51271,7 @@ getPath("expectedLeadingAsterisksExtendedAst.txt"), getPath("InputLeadingAsterisksExtended.javadoc")); } - + @Test - public void testInlineCustomJavadocTag() throws Exception { + void inlineCustomJavadocTag() throws Exception { @@ -51279,7 +51279,7 @@ getDocPath("expectedInlineCustomJavadocTagAst.txt"), getDocPath("InputInlineCustomJavadocTag.javadoc")); } - + @Test - public void testAttributeValueWithoutQuotes() throws Exception { + void attributeValueWithoutQuotes() throws Exception { @@ -51287,14 +51287,14 @@ getHtmlPath("expectedAttributeValueWithoutQuotesAst.txt"), getHtmlPath("InputAttributeValueWithoutQuotes.javadoc")); } - + @Test - public void testClosedOtherTag() throws Exception { + void closedOtherTag() throws Exception { verifyJavadocTree( getHtmlPath("expectedClosedOtherTagAst.txt"), getHtmlPath("InputClosedOtherTag.javadoc")); } - + @Test - public void testAllStandardJavadocTags() throws Exception { + void allStandardJavadocTags() throws Exception { @@ -51302,7 +51302,7 @@ getDocPath("expectedAllStandardJavadocTagsAst.txt"), getDocPath("InputAllStandardJavadocTags.javadoc")); } - + @Test - public void testAsteriskInJavadocInlineTag() throws Exception { + void asteriskInJavadocInlineTag() throws Exception { @@ -51310,7 +51310,7 @@ getDocPath("expectedAsteriskInJavadocInlineTagAst.txt"), getDocPath("InputAsteriskInJavadocInlineTag.javadoc")); } - + @Test - public void testAsteriskInLiteral() throws Exception { + void asteriskInLiteral() throws Exception { @@ -51318,7 +51318,7 @@ getDocPath("expectedAsteriskInLiteralAst.txt"), getDocPath("InputAsteriskInLiteral.javadoc")); } - + @Test - public void testInnerBracesInCodeTag() throws Exception { + void innerBracesInCodeTag() throws Exception { @@ -51326,7 +51326,7 @@ getDocPath("expectedInnerBracesInCodeTagAst.txt"), getDocPath("InputInnerBracesInCodeTag.javadoc")); } - + @Test - public void testNewlineAndAsteriskInParameters() throws Exception { + void newlineAndAsteriskInParameters() throws Exception { @@ -51334,14 +51334,14 @@ getDocPath("expectedNewlineAndAsteriskInParametersAst.txt"), getDocPath("InputNewlineAndAsteriskInParameters.javadoc")); } - + @Test - public void testTwoLinkTagsInRow() throws Exception { + void twoLinkTagsInRow() throws Exception { verifyJavadocTree( getDocPath("expectedTwoLinkTagsInRowAst.txt"), getDocPath("InputTwoLinkTagsInRow.javadoc")); } - + @Test - public void testJavadocWithCrAsNewline() throws Exception { + void javadocWithCrAsNewline() throws Exception { @@ -51349,7 +51349,7 @@ getPath("expectedJavadocWithCrAsNewlineAst.txt"), getPath("InputJavadocWithCrAsNewline.javadoc")); } - + @Test - public void testNestingWithSingletonElement() throws Exception { + void nestingWithSingletonElement() throws Exception { @@ -51357,14 +51357,14 @@ getHtmlPath("expectedNestingWithSingletonElementAst.txt"), getHtmlPath("InputNestingWithSingletonElement.javadoc")); } - + @Test - public void testVoidElements() throws Exception { + void voidElements() throws Exception { verifyJavadocTree( getHtmlPath("expectedVoidElementsAst.txt"), getHtmlPath("InputVoidElements.javadoc")); } - + @Test - public void testHtmlVoidElementEmbed() throws Exception { + void htmlVoidElementEmbed() throws Exception { @@ -51372,7 +51372,7 @@ getHtmlPath("expectedHtmlVoidElementEmbedAst.txt"), getHtmlPath("InputHtmlVoidElementEmbed.javadoc")); } - + @Test - public void testSpaceBeforeDescriptionInBlockJavadocTags() throws Exception { + void spaceBeforeDescriptionInBlockJavadocTags() throws Exception { @@ -51380,7 +51380,7 @@ getDocPath("expectedSpaceBeforeDescriptionInBlockJavadocTagsAst.txt"), getDocPath("InputSpaceBeforeDescriptionInBlockJavadocTags.javadoc")); } - + @Test - public void testEmptyDescriptionBeforeTags() throws Exception { + void emptyDescriptionBeforeTags() throws Exception { @@ -51388,7 +51388,7 @@ getDocPath("expectedEmptyDescriptionBeforeTags.txt"), getDocPath("InputEmptyDescriptionBeforeTags.javadoc")); } - + @Test - public void testSpaceBeforeDescriptionInInlineTags() throws Exception { + void spaceBeforeDescriptionInInlineTags() throws Exception { @@ -51396,7 +51396,7 @@ getDocPath("expectedSpaceBeforeArgsInInlineTagsAst.txt"), getDocPath("InputSpaceBeforeArgsInInlineTags.javadoc")); } - + @Test - public void testHtmlVoidElementKeygen() throws Exception { + void htmlVoidElementKeygen() throws Exception { @@ -51404,7 +51404,7 @@ getHtmlPath("expectedHtmlVoidElementKeygenAst.txt"), getHtmlPath("InputHtmlVoidElementKeygen.javadoc")); } - + @Test - public void testHtmlVoidElementSource() throws Exception { + void htmlVoidElementSource() throws Exception { @@ -51412,7 +51412,7 @@ getHtmlPath("expectedHtmlVoidElementSourceAst.txt"), getHtmlPath("InputHtmlVoidElementSource.javadoc")); } - + @Test - public void testHtmlVoidElementTrack() throws Exception { + void htmlVoidElementTrack() throws Exception { @@ -51420,7 +51420,7 @@ getHtmlPath("expectedHtmlVoidElementTrackAst.txt"), getHtmlPath("InputHtmlVoidElementTrack.javadoc")); } - + @Test - public void testHtmlVoidElementWbr() throws Exception { + void htmlVoidElementWbr() throws Exception { @@ -51428,14 +51428,14 @@ getHtmlPath("expectedHtmlVoidElementWbrAst.txt"), getHtmlPath("InputHtmlVoidElementWbr.javadoc")); } - + @Test - public void testOptgroupHtmlTag() throws Exception { + void optgroupHtmlTag() throws Exception { verifyJavadocTree( getHtmlPath("expectedOptgroupHtmlTagAst.txt"), getHtmlPath("InputOptgroupHtmlTag.javadoc")); } - + @Test - public void testNonTightOptgroupHtmlTag() throws Exception { + void nonTightOptgroupHtmlTag() throws Exception { @@ -51443,14 +51443,14 @@ getHtmlPath("expectedNonTightOptgroupHtmlTagAst.txt"), getHtmlPath("InputNonTightOptgroupHtmlTag.javadoc")); } - + @Test - public void testRbHtmlTag() throws Exception { + void rbHtmlTag() throws Exception { verifyJavadocTree( getHtmlPath("expectedRbHtmlTagAst.txt"), getHtmlPath("InputRbHtmlTag.javadoc")); } - + @Test - public void testNonTightRbHtmlTag() throws Exception { + void nonTightRbHtmlTag() throws Exception { @@ -51458,14 +51458,14 @@ getHtmlPath("expectedNonTightRbHtmlTagAst.txt"), getHtmlPath("InputNonTightRbHtmlTag.javadoc")); } - + @Test - public void testRtHtmlTag() throws Exception { + void rtHtmlTag() throws Exception { verifyJavadocTree( getHtmlPath("expectedRtHtmlTagAst.txt"), getHtmlPath("InputRtHtmlTag.javadoc")); } - + @Test - public void testNonTightRtHtmlTag() throws Exception { + void nonTightRtHtmlTag() throws Exception { @@ -51473,14 +51473,14 @@ getHtmlPath("expectedNonTightRtHtmlTagAst.txt"), getHtmlPath("InputNonTightRtHtmlTag.javadoc")); } - + @Test - public void testRtcHtmlTag() throws Exception { + void rtcHtmlTag() throws Exception { verifyJavadocTree( getHtmlPath("expectedRtcHtmlTagAst.txt"), getHtmlPath("InputRtcHtmlTag.javadoc")); } - + @Test - public void testNonTightRtcHtmlTag() throws Exception { + void nonTightRtcHtmlTag() throws Exception { @@ -51488,14 +51488,14 @@ getHtmlPath("expectedNonTightRtcHtmlTagAst.txt"), getHtmlPath("InputNonTightRtcHtmlTag.javadoc")); } - + @Test - public void testRpHtmlTag() throws Exception { + void rpHtmlTag() throws Exception { verifyJavadocTree( getHtmlPath("expectedRpHtmlTagAst.txt"), getHtmlPath("InputRpHtmlTag.javadoc")); } - + @Test - public void testNonTightRpHtmlTag() throws Exception { + void nonTightRpHtmlTag() throws Exception { @@ -51503,7 +51503,7 @@ getHtmlPath("expectedNonTightRpHtmlTagAst.txt"), getHtmlPath("InputNonTightRpHtmlTag.javadoc")); } - + @Test - public void testLeadingAsteriskAfterSeeTag() throws Exception { + void leadingAsteriskAfterSeeTag() throws Exception { @@ -51511,7 +51511,7 @@ getDocPath("expectedLeadingAsteriskAfterSeeTagAst.txt"), getDocPath("InputLeadingAsteriskAfterSeeTag.javadoc")); } - + @Test - public void testUppercaseInPackageName() throws Exception { + void uppercaseInPackageName() throws Exception { @@ -51519,27 +51519,27 @@ getDocPath("expectedUppercaseInPackageNameAst.txt"), getDocPath("InputUppercaseInPackageName.javadoc")); } - + @Test - public void testParagraph() throws Exception { + void paragraph() throws Exception { verifyJavadocTree( getHtmlPath("expectedParagraphAst.txt"), getHtmlPath("InputParagraph.javadoc")); } - + @Test - public void testCdata() throws Exception { + void cdata() throws Exception { verifyJavadocTree(getHtmlPath("expectedCdataAst.txt"), getHtmlPath("InputCdata.javadoc")); } - + @Test - public void testCrAsNewlineMultiline() throws Exception { + void crAsNewlineMultiline() throws Exception { verifyJavadocTree( getPath("expectedCrAsNewlineMultiline.txt"), getPath("InputCrAsNewlineMultiline.javadoc")); } - + @Test - public void testDosLineEndingAsNewlineMultiline() throws Exception { + void dosLineEndingAsNewlineMultiline() throws Exception { @@ -51551,48 +51551,48 @@ @@ -25,10 +25,10 @@ import javax.swing.event.CellEditorListener; import javax.swing.event.ChangeEvent; import org.junit.jupiter.api.Test; - + -class BaseCellEditorTest { +final class BaseCellEditorTest { - + @Test - public void testToString() { + void testToString() { - + final BaseCellEditor cellEditor = new BaseCellEditor(); - + @@ -36,7 +36,7 @@ class BaseCellEditorTest { } - + @Test - public void testStopCellEditing() { + void stopCellEditing() { - + final BaseCellEditor cellEditor = new BaseCellEditor(); - + @@ -44,7 +44,7 @@ class BaseCellEditorTest { } - + @Test - public void testFireEditingStoppedAndCanceled() { + void fireEditingStoppedAndCanceled() { - + final BaseCellEditor cellEditor = new BaseCellEditor(); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/CodeSelectorPresentationTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/CodeSelectorPresentationTest.java @@ -32,7 +32,7 @@ import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class CodeSelectorPresentationTest extends AbstractPathTestSupport { +final class CodeSelectorPresentationTest extends AbstractPathTestSupport { - + private MainFrameModel model; - + @@ -41,7 +41,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { private ImmutableList linesToPosition; - + @BeforeEach - public void loadFile() throws Exception { + void loadFile() throws Exception { @@ -51601,7 +51601,7 @@ model.openFile(new File(getPath("InputCodeSelectorPresentation.java"))); @@ -73,7 +73,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { } - + @Test - public void testDetailASTSelection() { + void detailASTSelection() { @@ -51610,7 +51610,7 @@ assertWithMessage("Invalid selection start").that(selector.getSelectionStart()).isEqualTo(94); @@ -81,7 +81,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { } - + @Test - public void testDetailASTLeafSelection() { + void detailASTLeafSelection() { @@ -51619,7 +51619,7 @@ selector.findSelectionPositions(); @@ -90,7 +90,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { } - + @Test - public void testDetailASTNoSelection() { + void detailASTNoSelection() { @@ -51628,7 +51628,7 @@ selector.findSelectionPositions(); @@ -99,7 +99,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { } - + @Test - public void testDetailNodeSelection() { + void detailNodeSelection() { @@ -51637,7 +51637,7 @@ model @@ -113,7 +113,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { } - + @Test - public void testDetailNodeLeafSelection() { + void detailNodeLeafSelection() { @@ -51649,22 +51649,22 @@ @@ -33,7 +33,7 @@ import java.util.Locale; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class MainFrameModelTest extends AbstractModuleTestSupport { +final class MainFrameModelTest extends AbstractModuleTestSupport { - + private static final String FILE_NAME_TEST_DATA = "InputMainFrameModel.java"; private static final String FILE_NAME_NON_EXISTENT = "non-existent.file"; @@ -49,13 +49,13 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @BeforeEach - public void prepareTestData() throws IOException { + void prepareTestData() throws IOException { model = new MainFrameModel(); testData = new File(getPath(FILE_NAME_TEST_DATA)); } - + @Test - public void testParseModeEnum() { + void parseModeEnum() { @@ -51673,7 +51673,7 @@ case PLAIN_JAVA: @@ -80,7 +80,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileWithParseModePlainJava() throws Exception { + void openFileWithParseModePlainJava() throws Exception { @@ -51682,61 +51682,61 @@ verifyCorrectTestDataInFrameModel(); @@ -90,7 +90,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileWithParseModeJavaWithComments() throws Exception { + void openFileWithParseModeJavaWithComments() throws Exception { model.setParseMode(ParseMode.JAVA_WITH_COMMENTS); model.openFile(testData); - + @@ -98,7 +98,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileWithParseModeJavaWithJavadocAndComments() throws Exception { + void openFileWithParseModeJavaWithJavadocAndComments() throws Exception { model.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); model.openFile(testData); - + @@ -106,7 +106,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileNullParameter() throws Exception { + void openFileNullParameter() throws Exception { model.openFile(testData); - + model.openFile(null); @@ -116,7 +116,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileNullParameter2() throws Exception { + void openFileNullParameter2() throws Exception { model.openFile(null); - + assertWithMessage("Test is null").that(model.getText()).isNull(); @@ -128,7 +128,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileNonExistentFile() throws IOException { + void openFileNonExistentFile() throws IOException { final File nonExistentFile = new File(getPath(FILE_NAME_NON_EXISTENT)); - + try { @@ -147,7 +147,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileNonCompilableFile() throws IOException { + void openFileNonCompilableFile() throws IOException { final File nonCompilableFile = new File(getNonCompilablePath(FILE_NAME_NON_COMPILABLE)); - + try { @@ -196,7 +196,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldAcceptDirectory() { + void shouldAcceptDirectory() { @@ -51745,7 +51745,7 @@ assertWithMessage("MainFrame should accept directory") @@ -205,7 +205,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldAcceptFile() throws IOException { + void shouldAcceptFile() throws IOException { @@ -51754,7 +51754,7 @@ .that(MainFrameModel.shouldAcceptFile(javaFile)) @@ -213,7 +213,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldNotAcceptNonJavaFile() { + void shouldNotAcceptNonJavaFile() { @@ -51763,7 +51763,7 @@ when(nonJavaFile.getName()).thenReturn(FILE_NAME_NON_JAVA); @@ -223,7 +223,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testShouldNotAcceptNonExistentFile() throws IOException { + void shouldNotAcceptNonExistentFile() throws IOException { @@ -51772,7 +51772,7 @@ .that(MainFrameModel.shouldAcceptFile(nonExistentFile)) @@ -231,7 +231,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { } - + @Test - public void testOpenFileForUnknownParseMode() throws IOException { + void openFileForUnknownParseMode() throws IOException { @@ -51784,27 +51784,27 @@ @@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test; import org.mockito.MockedConstruction; import org.mockito.MockedStatic; - + -public class MainFrameTest extends AbstractGuiTestSupport { +final class MainFrameTest extends AbstractGuiTestSupport { - + private static final String TEST_FILE_NAME = "InputMainFrame.java"; private static final String NON_EXISTENT_FILE_NAME = "non-existent.file"; @@ -59,17 +59,17 @@ public class MainFrameTest extends AbstractGuiTestSupport { } - + @BeforeEach - public void prepare() { + void prepare() { mainFrame = new MainFrame(); } - + @AfterEach - public void tearDown() { + void tearDown() { Arrays.stream(mainFrame.getOwnedWindows()).forEach(Window::dispose); } - + @Test - public void testOpenFile() throws IOException { + void openFile() throws IOException { @@ -51822,7 +51822,7 @@ mainFrame.openFile(file); @@ -99,7 +99,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { } - + @Test - public void testChangeMode() { + void changeMode() { @@ -51849,7 +51849,7 @@ mockConstruction( @@ -162,7 +162,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { } - + @Test - public void testExpandButton() { + void expandButton() { @@ -51858,7 +51858,7 @@ expandButton.doClick(); @@ -176,7 +176,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { } - + @Test - public void testFindNodeButton() throws IOException { + void findNodeButton() throws IOException { @@ -51870,10 +51870,10 @@ @@ -28,7 +28,7 @@ import javax.swing.SwingUtilities; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - + -public class MainTest extends AbstractGuiTestSupport { +final class MainTest extends AbstractGuiTestSupport { - + @Override protected String getPackageLocation() { @@ -43,7 +43,7 @@ public class MainTest extends AbstractGuiTestSupport { @@ -51890,15 +51890,15 @@ @@ -38,7 +38,7 @@ import java.io.File; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class ParseTreeTableModelTest extends AbstractPathTestSupport { +final class ParseTreeTableModelTest extends AbstractPathTestSupport { - + private DetailAST classDef; - + @@ -48,7 +48,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @BeforeEach - public void loadTree() throws Exception { + void loadTree() throws Exception { @@ -51907,14 +51907,14 @@ new File(getPath("InputParseTreeTablePresentation.java")), @@ -57,13 +57,13 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testChildCount() { + void childCount() { final int childCount = new ParseTreeTableModel(null).getChildCount(classDef); assertWithMessage("Invalid child count").that(childCount).isEqualTo(5); } - + @Test - public void testChild() { + void child() { @@ -51923,7 +51923,7 @@ final int type = ((DetailAST) child).getType(); @@ -71,7 +71,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testCommentChildCount() { + void commentChildCount() { @@ -51932,7 +51932,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -81,7 +81,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testChildCountInJavaAndJavadocMode() { + void childCountInJavaAndJavadocMode() { @@ -51941,7 +51941,7 @@ final int childCount = parseTree.getChildCount(classDef); @@ -89,7 +89,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testChildInJavaAndJavadocMode() { + void childInJavaAndJavadocMode() { @@ -51950,7 +51950,7 @@ final Object child = parseTree.getChild(classDef, 1); @@ -99,7 +99,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testCommentChildCountInJavaAndJavadocMode() { + void commentChildCountInJavaAndJavadocMode() { @@ -51959,7 +51959,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -109,7 +109,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testCommentChildInJavaAndJavadocMode() { + void commentChildInJavaAndJavadocMode() { @@ -51968,7 +51968,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -119,7 +119,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocCommentChildCount() { + void javadocCommentChildCount() { @@ -51977,7 +51977,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -131,7 +131,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocCommentChild() { + void javadocCommentChild() { @@ -51986,7 +51986,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -149,7 +149,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocChildCount() { + void javadocChildCount() { @@ -51995,7 +51995,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -163,7 +163,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocChild() { + void javadocChild() { @@ -52004,7 +52004,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -179,7 +179,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testGetIndexOfChild() { + void getIndexOfChild() { @@ -52013,7 +52013,7 @@ final ParseTreeTableModel parseTree = new ParseTreeTableModel(null); @@ -195,7 +195,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testGetValueAt() { + void getValueAt() { @@ -52022,7 +52022,7 @@ .that(classIdentNode) @@ -223,7 +223,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testGetValueAtDetailNode() { + void getValueAtDetailNode() { @@ -52031,7 +52031,7 @@ assertWithMessage("Comment classDef cannot be null").that(commentContentNode).isNotNull(); @@ -258,7 +258,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testColumnMethods() { + void columnMethods() { @@ -52040,7 +52040,7 @@ .that(parseTree.getColumnClass(0)) @@ -279,7 +279,7 @@ public class ParseTreeTableModelTest extends AbstractPathTestSupport { } - + @Test - public void testColumnNames() { + void columnNames() { @@ -52052,15 +52052,15 @@ @@ -34,7 +34,7 @@ import java.io.File; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { +final class ParseTreeTablePresentationTest extends AbstractPathTestSupport { - + private DetailAST tree; - + @@ -44,7 +44,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @BeforeEach - public void loadTree() throws Exception { + void loadTree() throws Exception { @@ -52069,7 +52069,7 @@ new File(getPath("InputParseTreeTablePresentation.java")), @@ -54,7 +54,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testRoot() throws Exception { + void root() throws Exception { @@ -52078,14 +52078,14 @@ new File(getPath("InputParseTreeTablePresentation.java")), @@ -63,13 +63,13 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testChildCount() { + void childCount() { final int childCount = new ParseTreeTablePresentation(null).getChildCount(tree); assertWithMessage("Invalid child count").that(childCount).isEqualTo(5); } - + @Test - public void testChildCountInJavaAndJavadocMode() { + void childCountInJavaAndJavadocMode() { @@ -52094,7 +52094,7 @@ final int childCount = parseTree.getChildCount(tree); @@ -77,7 +77,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testChild() { + void child() { @@ -52103,7 +52103,7 @@ final int type = ((DetailAST) child).getType(); @@ -87,7 +87,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testChildInJavaAndJavadocMode() { + void childInJavaAndJavadocMode() { @@ -52112,7 +52112,7 @@ final Object child = parseTree.getChild(tree, 1); @@ -99,7 +99,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testCommentChildCount() { + void commentChildCount() { @@ -52121,7 +52121,7 @@ parseTree.setParseMode(ParseMode.JAVA_WITH_COMMENTS); @@ -108,7 +108,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testCommentChildCountInJavaAndJavadocMode() { + void commentChildCountInJavaAndJavadocMode() { @@ -52130,7 +52130,7 @@ final DetailAST commentContentNode = @@ -123,7 +123,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testCommentChildInJavaAndJavadocMode() { + void commentChildInJavaAndJavadocMode() { @@ -52139,7 +52139,7 @@ final DetailAST commentContentNode = @@ -138,7 +138,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocCommentChildCount() { + void javadocCommentChildCount() { @@ -52148,7 +52148,7 @@ final int commentChildCount = parseTree.getChildCount(commentContentNode); @@ -149,7 +149,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocCommentChild() { + void javadocCommentChild() { @@ -52157,7 +52157,7 @@ parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); @@ -167,7 +167,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocChildCount() { + void javadocChildCount() { @@ -52166,7 +52166,7 @@ parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); @@ -180,7 +180,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testJavadocChild() { + void javadocChild() { @@ -52175,7 +52175,7 @@ parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); @@ -195,7 +195,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testGetIndexOfChild() { + void getIndexOfChild() { @@ -52189,11 +52189,11 @@ - public void testGetValueAt() { + void getValueAt() { final DetailAST node = tree.getFirstChild().getNextSibling().getNextSibling().getNextSibling(); - + assertWithMessage("Expected a non-null identifier node here").that(node).isNotNull(); @@ -253,7 +253,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testGetValueAtDetailNode() { + void getValueAtDetailNode() { @@ -52202,7 +52202,7 @@ final int nodeType = commentContentNode.getType(); @@ -292,7 +292,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testColumnMethods() { + void columnMethods() { @@ -52211,7 +52211,7 @@ .that(parseTree.getColumnClass(0)) @@ -313,7 +313,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { } - + @Test - public void testColumnNames() { + void columnNames() { @@ -52223,15 +52223,15 @@ @@ -35,7 +35,7 @@ import javax.swing.tree.TreePath; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class TreeTableTest extends AbstractGuiTestSupport { +final class TreeTableTest extends AbstractGuiTestSupport { - + private static final String TEST_FILE_NAME = "InputTreeTable.java"; - + @@ -47,7 +47,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @BeforeEach - public void prepare() throws Exception { + void prepare() throws Exception { @@ -52240,7 +52240,7 @@ treeTable = new TreeTable(model.getParseTreeTableModel()); @@ -58,7 +58,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testExpandOnMouseDoubleClick() { + void expandOnMouseDoubleClick() { @@ -52249,7 +52249,7 @@ assertWithMessage("The tree should be initially expanded") @@ -75,7 +75,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testNothingChangedOnMouseSingleClick() { + void nothingChangedOnMouseSingleClick() { @@ -52258,7 +52258,7 @@ assertWithMessage("The tree should be initially expanded") @@ -88,7 +88,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testExpandOnEnterKey() { + void expandOnEnterKey() { @@ -52267,7 +52267,7 @@ final ActionListener actionForEnter = @@ -107,7 +107,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testFindNodesAllClassDefs() throws IOException { + void findNodesAllClassDefs() throws IOException { @@ -52276,7 +52276,7 @@ final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); @@ -128,7 +128,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testFindNodesIdent() throws IOException { + void findNodesIdent() throws IOException { @@ -52285,7 +52285,7 @@ final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); @@ -163,7 +163,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testFindNodesMissingElements() throws IOException { + void findNodesMissingElements() throws IOException { @@ -52294,7 +52294,7 @@ final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); @@ -179,7 +179,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testFindNodesUnexpectedTokenAtStart() throws IOException { + void findNodesUnexpectedTokenAtStart() throws IOException { @@ -52303,7 +52303,7 @@ final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); @@ -195,7 +195,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testFindNodesInvalidCharacterInExpression() throws IOException { + void findNodesInvalidCharacterInExpression() throws IOException { @@ -52312,21 +52312,21 @@ final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); @@ -211,7 +211,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { } - + @Test - public void testTreeModelAdapterMethods() throws IOException { + void treeModelAdapterMethods() throws IOException { final MainFrame mainFrame = new MainFrame(); mainFrame.openFile(new File(getPath("InputTreeTableXpathAreaPanel.java"))); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.stream.Collectors.toUnmodifiableSet; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; @@ -53,11 +54,10 @@ import java.util.Map.Entry; @@ -52336,10 +52336,10 @@ -import java.util.stream.Collectors; import java.util.stream.Stream; import org.junit.jupiter.api.Test; - + -public class AllChecksTest extends AbstractModuleTestSupport { +final class AllChecksTest extends AbstractModuleTestSupport { - + private static final Locale[] ALL_LOCALES = { Locale.CHINESE, @@ -85,20 +85,20 @@ public class AllChecksTest extends AbstractModuleTestSupport { @@ -52447,7 +52447,7 @@ "GENERIC_START") - .collect(Collectors.toUnmodifiableSet())); + .collect(toUnmodifiableSet())); - + // google GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( @@ -381,13 +381,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { @@ -52543,20 +52543,20 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + @Override @@ -517,7 +517,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllModulesWithDefaultConfiguration() throws Exception { + void allModulesWithDefaultConfiguration() throws Exception { final String inputFilePath = getPath("InputAllChecksDefaultConfig.java"); final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + @@ -537,7 +537,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testDefaultTokensAreSubsetOfAcceptableTokens() throws Exception { + void defaultTokensAreSubsetOfAcceptableTokens() throws Exception { @@ -52565,7 +52565,7 @@ final AbstractCheck testedCheck = @@ -554,7 +554,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testRequiredTokensAreSubsetOfAcceptableTokens() throws Exception { + void requiredTokensAreSubsetOfAcceptableTokens() throws Exception { @@ -52574,7 +52574,7 @@ final AbstractCheck testedCheck = @@ -571,7 +571,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testRequiredTokensAreSubsetOfDefaultTokens() throws Exception { + void requiredTokensAreSubsetOfDefaultTokens() throws Exception { @@ -52583,7 +52583,7 @@ final AbstractCheck testedCheck = @@ -588,7 +588,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllModulesHaveMultiThreadAnnotation() throws Exception { + void allModulesHaveMultiThreadAnnotation() throws Exception { @@ -52592,34 +52592,34 @@ || ModuleReflectionUtil.isFilterModule(module) @@ -608,7 +608,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllModulesAreReferencedInConfigFile() throws Exception { + void allModulesAreReferencedInConfigFile() throws Exception { final Set modulesReferencedInConfig = CheckUtil.getConfigCheckStyleModules(); final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); - + @@ -625,7 +625,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllCheckTokensAreReferencedInCheckstyleConfigFile() throws Exception { + void allCheckTokensAreReferencedInCheckstyleConfigFile() throws Exception { final Configuration configuration = ConfigurationUtil.loadConfiguration("config/checkstyle-checks.xml"); - + @@ -634,7 +634,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllCheckTokensAreReferencedInGoogleConfigFile() throws Exception { + void allCheckTokensAreReferencedInGoogleConfigFile() throws Exception { final Configuration configuration = ConfigurationUtil.loadConfiguration("src/main/resources/google_checks.xml"); - + @@ -732,7 +732,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllCheckstyleModulesHaveXdocDocumentation() throws Exception { + void allCheckstyleModulesHaveXdocDocumentation() throws Exception { @@ -52628,7 +52628,7 @@ final Set modulesNamesWhichHaveXdocs = XdocUtil.getModulesNamesWhichHaveXdoc(); @@ -754,7 +754,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllCheckstyleModulesInCheckstyleConfig() throws Exception { + void allCheckstyleModulesInCheckstyleConfig() throws Exception { @@ -52637,7 +52637,7 @@ moduleNames.removeAll(INTERNAL_MODULES); @@ -766,7 +766,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllCheckstyleChecksHaveMessage() throws Exception { + void allCheckstyleChecksHaveMessage() throws Exception { @@ -52646,12 +52646,12 @@ final Set messages = CheckUtil.getCheckMessages(module, false); @@ -785,7 +785,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { } - + @Test - public void testAllCheckstyleMessages() throws Exception { + void allCheckstyleMessages() throws Exception { final Map> usedMessages = new TreeMap<>(); - + // test validity of messages from modules --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllTestsTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllTestsTest.java @@ -52661,31 +52661,31 @@ */ -public class AllTestsTest { +final class AllTestsTest { - + @Test - public void testAllInputsHaveTest() throws Exception { + void allInputsHaveTest() throws Exception { final Map> allTests = new HashMap<>(); - + walk( @@ -69,7 +69,7 @@ public class AllTestsTest { } - + @Test - public void testAllTestsHaveProductionCode() throws Exception { + void allTestsHaveProductionCode() throws Exception { final Map> allTests = new HashMap<>(); - + walk( --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java @@ -41,7 +41,7 @@ import java.util.Optional; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class ArchUnitSuperClassTest { +final class ArchUnitSuperClassTest { - + /** * Classes not abiding to {@link #testChecksShouldHaveAllowedAbstractClassAsSuperclass()} rule. @@ -90,7 +90,7 @@ public class ArchUnitSuperClassTest { @@ -52711,10 +52711,10 @@ @@ -32,7 +32,7 @@ import com.tngtech.archunit.lang.EvaluationResult; import java.util.List; import org.junit.jupiter.api.Test; - + -public class ArchUnitTest { +final class ArchUnitTest { - + /** * Suppression list containing violations from {@code classShouldNotDependOnUtilPackages} @@ -92,7 +92,7 @@ public class ArchUnitTest { @@ -52739,10 +52739,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.stream.Collectors.toUnmodifiableSet; - + import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; import java.nio.file.Files; @@ -32,7 +33,6 @@ import java.util.Map; @@ -52756,19 +52756,19 @@ @@ -40,10 +40,10 @@ import org.w3c.dom.NodeList; import picocli.CommandLine; import picocli.CommandLine.Model.OptionSpec; - + -public class CliOptionsXdocsSyncTest { +final class CliOptionsXdocsSyncTest { - + @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 +85,7 @@ public class CliOptionsXdocsSyncTest { } - + @Test - public void validateCliUsageSection() throws Exception { + void validateCliUsageSection() throws Exception { @@ -52787,7 +52787,7 @@ .filter(names -> names.length() != 2) - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); - + assertWithMessage("Short parameters in Main.java and cmdline" + ".xml.vm should match") .that(shortParamsMain) @@ -138,7 +138,7 @@ public class CliOptionsXdocsSyncTest { @@ -52803,11 +52803,11 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java @@ -20,16 +20,17 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.Collections.emptyIterator; +import static java.util.stream.Collectors.toUnmodifiableList; - + +import com.google.common.collect.ImmutableList; import java.io.IOException; -import java.util.Collections; @@ -52827,24 +52827,24 @@ */ -public class CommitValidationTest { +final class CommitValidationTest { - + private static final List USERS_EXCLUDED_FROM_VALIDATION = - Collections.singletonList("dependabot[bot]"); + ImmutableList.of("dependabot[bot]"); - + private static final String ISSUE_COMMIT_MESSAGE_REGEX_PATTERN = "^Issue #\\d+: .*$"; private static final String PR_COMMIT_MESSAGE_REGEX_PATTERN = "^Pull #\\d+: .*$"; @@ -97,14 +98,14 @@ public class CommitValidationTest { CommitsResolutionMode.BY_LAST_COMMIT_AUTHOR; - + @Test - public void testHasCommits() throws Exception { + void hasCommits() throws Exception { final List lastCommits = getCommitsToCheck(); - + assertWithMessage("must have at least one commit to validate").that(lastCommits).isNotEmpty(); } - + @Test - public void testCommitMessage() { + void commitMessage() { @@ -52853,7 +52853,7 @@ .isEqualTo(3); @@ -146,7 +147,7 @@ public class CommitValidationTest { } - + @Test - public void testReleaseCommitMessage() { + void releaseCommitMessage() { @@ -52862,7 +52862,7 @@ validateCommitMessage("[maven-release-plugin] " + "prepare release checkstyle-10.8.0")) @@ -161,7 +162,7 @@ public class CommitValidationTest { } - + @Test - public void testRevertCommitMessage() { + void revertCommitMessage() { @@ -52871,7 +52871,7 @@ validateCommitMessage( @@ -179,7 +180,7 @@ public class CommitValidationTest { } - + @Test - public void testSupplementalPrefix() { + void supplementalPrefix() { @@ -52880,7 +52880,7 @@ .isEqualTo( @@ -209,7 +210,7 @@ public class CommitValidationTest { } - + @Test - public void testCommitMessageHasProperStructure() throws Exception { + void commitMessageHasProperStructure() throws Exception { @@ -52894,7 +52894,7 @@ - second = Collections.emptyIterator(); + second = emptyIterator(); } - + revCommitIteratorPair = @@ -317,7 +318,7 @@ public class CommitValidationTest { Spliterators.spliteratorUnknownSize(previousCommitsIterator, Spliterator.ORDERED); @@ -52903,18 +52903,18 @@ - .collect(Collectors.toUnmodifiableList()); + .collect(toUnmodifiableList()); } - + private static List getCommitsByLastCommitAuthor( @@ -384,8 +385,8 @@ public class CommitValidationTest { private final Iterator second; - + private RevCommitsPair() { - first = Collections.emptyIterator(); - second = Collections.emptyIterator(); + first = emptyIterator(); + second = emptyIterator(); } - + private RevCommitsPair(Iterator first, Iterator second) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java @@ -52924,7 +52924,7 @@ import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.fields; +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.toUnmodifiableMap; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.FileStatefulCheck; import com.puppycrawl.tools.checkstyle.GlobalStatefulCheck; @@ -52936,28 +52936,28 @@ -import java.util.function.Function; -import java.util.stream.Collectors; import org.junit.jupiter.api.Test; - + -public class ImmutabilityTest { +final class ImmutabilityTest { - + /** Immutable types canonical names. */ private static final Set IMMUTABLE_TYPES = @@ -99,7 +100,7 @@ public class ImmutabilityTest { - + /** List of fields not following {@link #testUtilClassesImmutability()} rule. */ private static final Set SUPPRESSED_FIELDS_IN_UTIL_CLASSES = - Set.of( + ImmutableSet.of( "com.puppycrawl.tools.checkstyle.utils.TokenUtil.TOKEN_IDS", "com.puppycrawl.tools.checkstyle.utils.XpathUtil.TOKEN_TYPES_WITH_TEXT_ATTRIBUTE"); - + @@ -164,7 +165,7 @@ public class ImmutabilityTest { - + /** List of classes not following {@link #testClassesWithMutableFieldsShouldBeStateful()} rule. */ private static final Set SUPPRESSED_CLASSES_FOR_STATEFUL_CHECK_RULE = - Set.of("com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"); + ImmutableSet.of("com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"); - + private static final JavaClasses CHECKSTYLE_CHECKS = new ClassFileImporter() @@ -191,13 +192,11 @@ public class ImmutabilityTest { @@ -52968,7 +52968,7 @@ - Collectors.toUnmodifiableMap( - ModuleDetails::getFullQualifiedName, Function.identity())); + .collect(toUnmodifiableMap(ModuleDetails::getFullQualifiedName, identity())); - + /** Test to ensure that fields in util classes are immutable. */ @Test - public void testUtilClassesImmutability() { @@ -52977,16 +52977,16 @@ new ClassFileImporter() .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) @@ -225,7 +224,7 @@ public class ImmutabilityTest { - + /** Test to ensure modules annotated with {@link StatelessCheck} contain immutable fields. */ @Test - public void testFieldsInStatelessChecksShouldBeImmutable() { + void fieldsInStatelessChecksShouldBeImmutable() { final DescribedPredicate moduleProperties = new ModulePropertyPredicate(); - + final ArchCondition beSuppressedField = @@ -247,7 +246,7 @@ public class ImmutabilityTest { - + /** Test to ensure classes with immutable fields are annotated with {@link StatelessCheck}. */ @Test - public void testClassesWithImmutableFieldsShouldBeStateless() { @@ -53002,7 +53002,7 @@ + void classesWithMutableFieldsShouldBeStateful() { final ArchCondition beSuppressedClass = new SuppressionArchCondition<>(SUPPRESSED_CLASSES_FOR_STATEFUL_CHECK_RULE, "be suppressed"); - + @@ -352,7 +351,7 @@ public class ImmutabilityTest { "Field <%s> should %s in %s", item.getFullName(), @@ -53017,7 +53017,7 @@ @@ -68,7 +68,7 @@ import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; - + -public class XdocsJavaDocsTest extends AbstractModuleTestSupport { +final class XdocsJavaDocsTest extends AbstractModuleTestSupport { private static final Map> FULLY_QUALIFIED_CLASS_NAMES = @@ -53025,7 +53025,7 @@ .put("int", int.class) @@ -115,7 +115,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { } - + @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { @@ -53039,14 +53039,14 @@ - public void testAllCheckSectionJavaDocs() throws Exception { + void allCheckSectionJavaDocs() throws Exception { final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); - + for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsMobileWrapperTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsMobileWrapperTest.java @@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.internal.utils.XdocUtil; import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; @@ -53054,13 +53054,13 @@ @@ -32,12 +33,12 @@ import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; - + -public class XdocsMobileWrapperTest { +final class XdocsMobileWrapperTest { - + - private static final Set NODES_TO_WRAP = Set.of("pre", "table", "svg", "img"); + private static final Set NODES_TO_WRAP = ImmutableSet.of("pre", "table", "svg", "img"); - + @Test - public void testAllCheckSectionMobileWrapper() throws Exception { + void allCheckSectionMobileWrapper() throws Exception { @@ -53070,14 +53070,14 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java @@ -21,6 +21,10 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; import static java.lang.Integer.parseInt; +import static java.util.Collections.unmodifiableSet; +import static java.util.regex.Pattern.DOTALL; +import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toUnmodifiableSet; - + import com.puppycrawl.tools.checkstyle.Checker; import com.puppycrawl.tools.checkstyle.ConfigurationLoader; @@ -55,7 +59,6 @@ import java.util.ArrayList; @@ -53103,11 +53103,11 @@ -public class XdocsPagesTest { +final class XdocsPagesTest { private static final Path SITE_PATH = Paths.get("src/site/site.xml"); - + private static final Path AVAILABLE_CHECKS_PATH = Paths.get("src/xdocs/checks.xml"); @@ -151,7 +153,7 @@ public class XdocsPagesTest { "CustomImportOrder.customImportOrderRules"); - + private static final Set SUN_MODULES = - Collections.unmodifiableSet(CheckUtil.getConfigSunStyleModules()); + unmodifiableSet(CheckUtil.getConfigSunStyleModules()); @@ -53116,11 +53116,11 @@ // and then remove this list eventually @@ -221,7 +223,7 @@ public class XdocsPagesTest { "WhitespaceAround"); - + private static final Set GOOGLE_MODULES = - Collections.unmodifiableSet(CheckUtil.getConfigGoogleStyleModules()); + unmodifiableSet(CheckUtil.getConfigGoogleStyleModules()); - + /** * Generate xdoc content from templates before validation. This method will be removed once summaries = readSummaries(); - + for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { @@ -331,7 +333,7 @@ public class XdocsPagesTest { } - + @Test - public void testCategoryIndexPageTableInSyncWithAllChecksPageTable() throws Exception { + void categoryIndexPageTableInSyncWithAllChecksPageTable() throws Exception { @@ -53169,7 +53169,7 @@ final String fileName = path.getFileName().toString(); @@ -384,7 +386,7 @@ public class XdocsPagesTest { } - + @Test - public void testAllSubSections() throws Exception { + void allSubSections() throws Exception { @@ -53178,7 +53178,7 @@ final String fileName = path.getFileName().toString(); @@ -441,7 +443,7 @@ public class XdocsPagesTest { } - + @Test - public void testAllXmlExamples() throws Exception { + void allXmlExamples() throws Exception { @@ -53187,12 +53187,12 @@ final String fileName = path.getFileName().toString(); @@ -564,7 +566,7 @@ public class XdocsPagesTest { } - + @Test - public void testAllCheckSections() throws Exception { + void allCheckSections() throws Exception { final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); - + for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { @@ -624,7 +626,7 @@ public class XdocsPagesTest { * method @@ -53201,7 +53201,7 @@ - public void testAllCheckSectionsEx() throws Exception { + void allCheckSectionsEx() throws Exception { final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); - + final Path path = Paths.get(XdocUtil.DIRECTORY_PATH + "/config.xml"); @@ -1364,7 +1366,7 @@ public class XdocsPagesTest { final Object[] array = (Object[]) value; @@ -53210,7 +53210,7 @@ - result = valuesStream.map(String.class::cast).sorted().collect(Collectors.joining(", ")); + result = valuesStream.map(String.class::cast).sorted().collect(joining(", ")); } - + if (result.isEmpty()) { @@ -1393,8 +1395,7 @@ public class XdocsPagesTest { } else { @@ -53233,7 +53233,7 @@ } @@ -1684,7 +1685,7 @@ public class XdocsPagesTest { } - + @Test - public void testAllStyleRules() throws Exception { + void allStyleRules() throws Exception { @@ -53242,7 +53242,7 @@ final String styleName = fileName.substring(0, fileName.lastIndexOf('_')); @@ -1989,7 +1990,7 @@ public class XdocsPagesTest { } - + @Test - public void testAllExampleMacrosHaveParagraphWithIdBeforeThem() throws Exception { + void allExampleMacrosHaveParagraphWithIdBeforeThem() throws Exception { @@ -53253,10 +53253,10 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java @@ -20,6 +20,7 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.stream.Collectors.toUnmodifiableSet; - + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; @@ -35,14 +36,13 @@ import java.util.List; @@ -53269,12 +53269,12 @@ import org.junit.jupiter.api.Test; import org.xml.sax.Attributes; import org.xml.sax.helpers.DefaultHandler; - + -public class XdocsUrlTest { +final class XdocsUrlTest { - + private static final String PACKAGE_NAME = "src/main/java/com/puppycrawl/tools/checkstyle/checks"; - + @@ -74,7 +74,7 @@ public class XdocsUrlTest { return AbstractCheck.class.isAssignableFrom(clazz) || AbstractFileSetCheck.class.isAssignableFrom(clazz); @@ -53286,7 +53286,7 @@ if (!TREE_WORKER.equals(checkName)) { @@ -96,7 +96,7 @@ public class XdocsUrlTest { } - + @Test - public void testXdocsUrl() throws Exception { + void xdocsUrl() throws Exception { @@ -53297,13 +53297,13 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java @@ -20,7 +20,12 @@ package com.puppycrawl.tools.checkstyle.internal; - + import static com.google.common.truth.Truth.assertWithMessage; +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.toCollection; +import static java.util.stream.Collectors.toUnmodifiableMap; +import static java.util.stream.Collectors.toUnmodifiableSet; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.Definitions; @@ -53318,10 +53318,10 @@ -import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class XpathRegressionTest extends AbstractModuleTestSupport { +final class XpathRegressionTest extends AbstractModuleTestSupport { - + // Checks that not compatible with SuppressionXpathFilter public static final Set INCOMPATIBLE_CHECK_NAMES = - Set.of( @@ -53340,15 +53340,15 @@ JavadocTypeCheck.class, @@ -115,7 +118,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { "VisibilityModifier"); - + // Modules that will never have xpath support ever because they not report violations - private static final Set NO_VIOLATION_MODULES = Set.of("SuppressWarningsHolder"); + private static final Set NO_VIOLATION_MODULES = ImmutableSet.of("SuppressWarningsHolder"); - + private static final Set SIMPLE_CHECK_NAMES = getSimpleCheckNames(); private static final Map ALLOWED_DIRECTORY_AND_CHECKS = @@ -136,9 +139,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { - + private static Map getAllowedDirectoryAndChecks() { return SIMPLE_CHECK_NAMES.stream() - .collect( @@ -53356,7 +53356,7 @@ - id -> id.toLowerCase(Locale.ENGLISH), Function.identity())); + .collect(toUnmodifiableMap(id -> id.toLowerCase(Locale.ENGLISH), identity())); } - + private static Set getInternalModules() { @@ -148,11 +149,11 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { final String[] packageTokens = moduleName.split("\\."); @@ -53365,7 +53365,7 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { @@ -53374,7 +53374,7 @@ } @@ -168,12 +169,12 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } - + @Test - public void validateIncompatibleJavadocCheckNames() throws IOException { + void validateIncompatibleJavadocCheckNames() throws IOException { @@ -53389,7 +53389,7 @@ final Set abstractJavadocCheckSimpleNames = @@ -187,7 +188,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } - + @Test - public void validateIntegrationTestClassNames() throws Exception { + void validateIntegrationTestClassNames() throws Exception { @@ -53407,7 +53407,7 @@ allChecks.removeAll(compatibleChecks); @@ -246,7 +247,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { } - + @Test - public void validateInputFiles() throws Exception { + void validateInputFiles() throws Exception { @@ -53417,20 +53417,20 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskLogStub.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskLogStub.java @@ -19,9 +19,10 @@ - + package com.puppycrawl.tools.checkstyle.internal.testmodules; - + +import static java.util.Collections.unmodifiableList; + import com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask; import java.util.ArrayList; -import java.util.Collections; import java.util.List; - + public final class CheckstyleAntTaskLogStub extends CheckstyleAntTask { @@ -39,6 +40,6 @@ public final class CheckstyleAntTaskLogStub extends CheckstyleAntTask { } - + public List getLoggedMessages() { - return Collections.unmodifiableList(loggedMessages); + return unmodifiableList(loggedMessages); @@ -53439,30 +53439,30 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskStub.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskStub.java @@ -19,16 +19,16 @@ - + package com.puppycrawl.tools.checkstyle.internal.testmodules; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask; import java.io.File; -import java.util.Collections; import java.util.List; - + public class CheckstyleAntTaskStub extends CheckstyleAntTask { - + @Override protected List scanFileSets() { - return Collections.singletonList(new MockFile()); + return ImmutableList.of(new MockFile()); } - + private static final class MockFile extends File { --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/TestRootModuleChecker.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/TestRootModuleChecker.java @@ -19,13 +19,14 @@ - + package com.puppycrawl.tools.checkstyle.internal.testmodules; - + +import static java.util.Collections.unmodifiableList; + import com.puppycrawl.tools.checkstyle.api.AuditListener; @@ -53473,23 +53473,23 @@ import java.util.ArrayList; -import java.util.Collections; import java.util.List; - + public class TestRootModuleChecker implements RootModule { @@ -85,7 +86,7 @@ public class TestRootModuleChecker implements RootModule { } - + public static List getFilesToCheck() { - return Collections.unmodifiableList(filesToCheck); + return unmodifiableList(filesToCheck); } - + public static Configuration getConfig() { --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/CheckUtil.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/CheckUtil.java @@ -19,6 +19,9 @@ - + package com.puppycrawl.tools.checkstyle.internal.utils; - + +import static java.util.stream.Collectors.toCollection; +import static java.util.stream.Collectors.toUnmodifiableSet; + @@ -53505,13 +53505,13 @@ import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; @@ -86,7 +88,7 @@ public final class CheckUtil { - + return name; }) - .collect(Collectors.toCollection(HashSet::new)); + .collect(toCollection(HashSet::new)); } - + /** @@ -145,7 +147,7 @@ public final class CheckUtil { final String packageName = "com.puppycrawl.tools.checkstyle"; @@ -53520,7 +53520,7 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + /** @@ -176,7 +178,7 @@ public final class CheckUtil { .map(ClassPath.ClassInfo::load) @@ -53529,14 +53529,14 @@ - .collect(Collectors.toUnmodifiableSet()); + .collect(toUnmodifiableSet()); } - + /** --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/XdocGenerator.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/XdocGenerator.java @@ -19,11 +19,12 @@ - + package com.puppycrawl.tools.checkstyle.internal.utils; - + +import static java.nio.charset.StandardCharsets.UTF_8; + import com.puppycrawl.tools.checkstyle.site.XdocsTemplateParser; @@ -53564,9 +53564,9 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/XdocUtil.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/XdocUtil.java @@ -19,13 +19,14 @@ - + package com.puppycrawl.tools.checkstyle.internal.utils; - + +import static java.util.stream.Collectors.toUnmodifiableSet; + import java.io.IOException; @@ -53587,7 +53587,7 @@ + return stream.collect(toUnmodifiableSet()); } } - + @@ -85,7 +86,7 @@ public final class XdocUtil { (path, attr) -> { return attr.isRegularFile() && path.toString().endsWith(".xml.template"); @@ -53596,21 +53596,21 @@ + return stream.collect(toUnmodifiableSet()); } } - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraperTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraperTest.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Map.Entry; import org.junit.jupiter.api.Test; - + -public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { +final class JavadocMetadataScraperTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testAtclauseOrderCheck() throws Exception { + void atclauseOrderCheck() throws Exception { @@ -53619,7 +53619,7 @@ getPath("InputJavadocMetadataScraperAtclauseOrderCheck.java"), @@ -50,7 +50,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationUseStyleCheck() throws Exception { + void annotationUseStyleCheck() throws Exception { @@ -53628,7 +53628,7 @@ getPath("InputJavadocMetadataScraperAnnotationUseStyleCheck.java"), @@ -61,7 +61,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testBeforeExecutionExclusionFileFilter() throws Exception { + void beforeExecutionExclusionFileFilter() throws Exception { @@ -53637,7 +53637,7 @@ getPath("InputJavadocMetadataScraperBeforeExecutionExclusionFileFilter.java"), @@ -74,7 +74,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testNoCodeInFileCheck() throws Exception { + void noCodeInFileCheck() throws Exception { @@ -53646,7 +53646,7 @@ getPath("InputJavadocMetadataScraperNoCodeInFileCheck.java"), @@ -85,7 +85,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyMisplacedDefaultValueCheck() { + void propertyMisplacedDefaultValueCheck() { @@ -53655,7 +53655,7 @@ assertThrows( @@ -101,7 +101,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyMisplacedTypeCheck() { + void propertyMisplacedTypeCheck() { @@ -53664,7 +53664,7 @@ assertThrows( @@ -118,7 +118,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyMissingDefaultValueCheck() { + void propertyMissingDefaultValueCheck() { @@ -53673,7 +53673,7 @@ assertThrows( @@ -135,7 +135,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyMissingTypeCheck() { + void propertyMissingTypeCheck() { @@ -53682,7 +53682,7 @@ assertThrows( @@ -151,7 +151,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyWithNoCodeTagCheck() throws Exception { + void propertyWithNoCodeTagCheck() throws Exception { @@ -53691,7 +53691,7 @@ getPath("InputJavadocMetadataScraperPropertyWithNoCodeTagCheck.java"), @@ -163,7 +163,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testRightCurlyCheck() throws Exception { + void rightCurlyCheck() throws Exception { @@ -53700,7 +53700,7 @@ getPath("InputJavadocMetadataScraperRightCurlyCheck.java"), CommonUtil.EMPTY_STRING_ARRAY); @@ -173,7 +173,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testSummaryJavadocCheck() throws Exception { + void summaryJavadocCheck() throws Exception { @@ -53709,7 +53709,7 @@ getPath("InputJavadocMetadataScraperSummaryJavadocCheck.java"), @@ -184,7 +184,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testSuppressWarningsFilter() throws Exception { + void suppressWarningsFilter() throws Exception { @@ -53718,7 +53718,7 @@ getPath("InputJavadocMetadataScraperSuppressWarningsFilter.java"), @@ -195,7 +195,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testWriteTagCheck() throws Exception { + void writeTagCheck() throws Exception { @@ -53727,21 +53727,21 @@ getPath("InputJavadocMetadataScraperWriteTagCheck.java"), CommonUtil.EMPTY_STRING_ARRAY); @@ -205,7 +205,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { } - + @Test - public void testEmptyDescription() throws Exception { + void emptyDescription() throws Exception { JavadocMetadataScraper.resetModuleDetailsStore(); - + final String[] expected = { --- a/src/test/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtilTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtilTest.java @@ -21,7 +21,9 @@ package com.puppycrawl.tools.checkstyle.meta; - + import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper.MSG_DESC_MISSING; +import static java.util.stream.Collectors.toCollection; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; @@ -53756,11 +53756,11 @@ import org.itsallcode.junit.sysextensions.SystemOutGuard; @@ -40,10 +41,10 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; - + @ExtendWith(SystemOutGuard.class) -public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { +final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { - + private final Set modulesContainingNoMetadataFile = - Set.of( + ImmutableSet.of( @@ -53775,7 +53775,7 @@ + void metadataFilesGenerationAllFiles(@SystemOutGuard.SysOut Capturable systemOut) throws Exception { systemOut.captureMuted(); - + @@ -117,12 +118,12 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { .filter(path -> !path.toString().endsWith(".properties")) .map(MetadataGeneratorUtilTest::getMetaFileName) @@ -53796,21 +53796,21 @@ @@ -29,7 +29,7 @@ import java.util.List; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.Test; - + -public class XmlMetaReaderTest extends AbstractPathTestSupport { +final class XmlMetaReaderTest extends AbstractPathTestSupport { - + @Override protected String getPackageLocation() { @@ -37,12 +37,12 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { } - + @Test - public void test() { + void test() { assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny()).hasSize(200); } - + @Test - public void testDuplicatePackage() { + void duplicatePackage() { @@ -53819,13 +53819,13 @@ "com.puppycrawl.tools.checkstyle.meta")) @@ -50,12 +50,12 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { } - + @Test - public void testBadPackage() { + void badPackage() { assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny("DOES.NOT.EXIST")).hasSize(200); } - + @Test - public void testReadXmlMetaCheckWithProperties() throws Exception { + void readXmlMetaCheckWithProperties() throws Exception { @@ -53834,7 +53834,7 @@ final ModuleDetails result = XmlMetaReader.read(is, ModuleType.CHECK); @@ -87,7 +87,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { } - + @Test - public void testReadXmlMetaCheckNoProperties() throws Exception { + void readXmlMetaCheckNoProperties() throws Exception { @@ -53843,7 +53843,7 @@ final ModuleDetails result = XmlMetaReader.read(is, ModuleType.CHECK); @@ -107,7 +107,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { } - + @Test - public void testReadXmlMetaFilter() throws Exception { + void readXmlMetaFilter() throws Exception { @@ -53852,7 +53852,7 @@ final ModuleDetails result = XmlMetaReader.read(is, ModuleType.FILTER); @@ -133,7 +133,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { } - + @Test - public void testReadXmlMetaFileFilter() throws Exception { + void readXmlMetaFileFilter() throws Exception { @@ -53861,7 +53861,7 @@ final ModuleDetails result = XmlMetaReader.read(is, ModuleType.FILEFILTER); @@ -158,7 +158,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { } - + @Test - public void testReadXmlMetaModuleTypeNull() throws Exception { + void readXmlMetaModuleTypeNull() throws Exception { @@ -53873,7 +53873,7 @@ @@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck.MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED; import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; - + +import com.google.common.collect.ImmutableSet; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.DetailAstImpl; @@ -53881,15 +53881,15 @@ @@ -31,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck; import java.util.Set; import org.junit.jupiter.api.Test; - + -public class AnnotationUtilTest extends AbstractModuleTestSupport { +final class AnnotationUtilTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +40,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testIsProperUtilsClass() { + void isProperUtilsClass() { @@ -53898,7 +53898,7 @@ assertWithMessage("Exception is expected").fail(); @@ -53,7 +54,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationNull() { + void containsAnnotationNull() { @@ -53907,7 +53907,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -65,7 +66,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationNull2() { + void containsAnnotationNull2() { @@ -53916,7 +53916,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -77,7 +78,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationFalse() { + void containsAnnotationFalse() { @@ -53925,7 +53925,7 @@ assertWithMessage("AnnotationUtil should not contain " + ast) @@ -86,7 +87,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationFalse2() { + void containsAnnotationFalse2() { @@ -53934,7 +53934,7 @@ final DetailAstImpl ast2 = new DetailAstImpl(); @@ -98,7 +99,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationTrue() { + void containsAnnotationTrue() { @@ -53943,7 +53943,7 @@ final DetailAstImpl ast2 = new DetailAstImpl(); @@ -113,7 +114,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationHolderNull() { + void annotationHolderNull() { @@ -53952,7 +53952,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -125,7 +126,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationNull() { + void annotationNull() { @@ -53961,7 +53961,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -137,7 +138,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationNull2() { + void annotationNull2() { @@ -53970,7 +53970,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -149,7 +150,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testAnnotationEmpty() { + void annotationEmpty() { @@ -53979,7 +53979,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -161,7 +162,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationWithNull() { + void containsAnnotationWithNull() { @@ -53988,7 +53988,7 @@ assertWithMessage("IllegalArgumentException is expected").fail(); @@ -173,9 +174,9 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationListWithNullAst() { + void containsAnnotationListWithNullAst() { @@ -54000,7 +54000,7 @@ assertWithMessage("Invalid exception message") @@ -185,7 +186,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationListWithNullList() { + void containsAnnotationListWithNullList() { @@ -54009,7 +54009,7 @@ try { @@ -199,26 +200,26 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationListWithEmptyList() { + void containsAnnotationListWithEmptyList() { @@ -54019,7 +54019,7 @@ final boolean result = AnnotationUtil.containsAnnotation(ast, annotations); assertWithMessage("An empty set should lead to a false result").that(result).isFalse(); } - + @Test - public void testContainsAnnotationListWithNoAnnotationNode() { + void containsAnnotationListWithNoAnnotationNode() { @@ -54032,7 +54032,7 @@ final boolean result = AnnotationUtil.containsAnnotation(ast, annotations); assertWithMessage("An empty ast should lead to a false result").that(result).isFalse(); } - + @Test - public void testContainsAnnotationListWithNoMatchingAnnotation() { + void containsAnnotationListWithNoMatchingAnnotation() { @@ -54048,7 +54048,7 @@ final boolean result = AnnotationUtil.containsAnnotation(ast, annotations); assertWithMessage("No matching annotation found").that(result).isFalse(); } - + @Test - public void testContainsAnnotation() { + void containsAnnotation() { @@ -54057,7 +54057,7 @@ final DetailAstImpl child = new DetailAstImpl(); @@ -258,7 +259,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationWithStringFalse() { + void containsAnnotationWithStringFalse() { @@ -54066,7 +54066,7 @@ final DetailAstImpl child = new DetailAstImpl(); @@ -283,7 +284,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testContainsAnnotationWithComment() { + void containsAnnotationWithComment() { @@ -54075,39 +54075,39 @@ final DetailAstImpl child = new DetailAstImpl(); @@ -311,7 +312,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testCompactNoUnchecked() throws Exception { + void compactNoUnchecked() throws Exception { - + final String[] expected = { "16:20: " @@ -335,7 +336,7 @@ public class AnnotationUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testValuePairAnnotation() throws Exception { + void valuePairAnnotation() throws Exception { - + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPositionTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPositionTest.java @@ -19,6 +19,7 @@ - + package com.puppycrawl.tools.checkstyle.utils; - + +import static com.google.common.base.Preconditions.checkState; import static com.google.common.truth.Truth.assertWithMessage; - + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; @@ -32,17 +33,17 @@ import java.util.List; import java.util.function.Function; import org.junit.jupiter.api.Test; - + -public class BlockCommentPositionTest extends AbstractModuleTestSupport { +final class BlockCommentPositionTest extends AbstractModuleTestSupport { - + @Test - public void testPrivateConstr() throws Exception { + void privateConstr() throws Exception { @@ -54115,7 +54115,7 @@ .that(TestUtil.isUtilsClassHasPrivateConstructor(BlockCommentPosition.class)) .isTrue(); } - + @Test - public void testJavaDocsRecognition() throws Exception { + void javaDocsRecognition() throws Exception { @@ -54124,7 +54124,7 @@ new BlockCommentPositionTestMetadata( @@ -88,7 +89,7 @@ public class BlockCommentPositionTest extends AbstractModuleTestSupport { } - + @Test - public void testJavaDocsRecognitionNonCompilable() throws Exception { + void javaDocsRecognitionNonCompilable() throws Exception { @@ -54147,15 +54147,15 @@ @@ -33,7 +33,7 @@ import java.nio.file.Files; import java.util.Properties; import org.junit.jupiter.api.Test; - + -public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { +final class ChainedPropertyUtilTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -41,14 +41,14 @@ public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -54163,7 +54163,7 @@ .that(isUtilsClassHasPrivateConstructor(ChainedPropertyUtil.class)) .isTrue(); } - + @Test - public void testPropertyChaining() throws Exception { + void propertyChaining() throws Exception { @@ -54172,7 +54172,7 @@ final Properties resolvedProperties = ChainedPropertyUtil.getResolvedProperties(properties); @@ -72,7 +72,7 @@ public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyChainingPropertyNotFound() throws Exception { + void propertyChainingPropertyNotFound() throws Exception { @@ -54181,7 +54181,7 @@ final Properties properties = loadProperties(propertiesFile); @@ -87,7 +87,7 @@ public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testPropertyChainingRecursiveUnresolvable() throws Exception { + void propertyChainingRecursiveUnresolvable() throws Exception { @@ -54192,7 +54192,7 @@ +++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilTest.java @@ -55,20 +55,20 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -54200,32 +54200,32 @@ .that(isUtilsClassHasPrivateConstructor(CheckUtil.class)) .isTrue(); } - + @Test - public void testParseDoubleWithIncorrectToken() { + void parseDoubleWithIncorrectToken() { final double parsedDouble = CheckUtil.parseDouble("1_02", TokenTypes.ASSIGN); assertWithMessage("Invalid parse result").that(parsedDouble).isEqualTo(Double.NaN); } - + @Test - public void testEquals() { + void testEquals() { final DetailAstImpl litStatic = new DetailAstImpl(); litStatic.setType(TokenTypes.LITERAL_STATIC); - + @@ -112,7 +112,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAccessModifierFromModifiersTokenWrongTokenType() { + void getAccessModifierFromModifiersTokenWrongTokenType() { final DetailAstImpl modifiers = new DetailAstImpl(); modifiers.setType(TokenTypes.METHOD_DEF); - + @@ -129,7 +129,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetTypeParameterNames() throws Exception { + void getTypeParameterNames() throws Exception { @@ -54234,7 +54234,7 @@ final List actual = CheckUtil.getTypeParameterNames(parameterizedClassNode); @@ -138,7 +138,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetTypeParameters() throws Exception { + void getTypeParameters() throws Exception { @@ -54243,25 +54243,25 @@ final List expected = @@ -149,7 +149,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testIsEqualsMethod() throws Exception { + void isEqualsMethod() throws Exception { final DetailAST equalsMethodNode = getNodeFromFile(TokenTypes.METHOD_DEF); final DetailAST someOtherMethod = equalsMethodNode.getNextSibling(); - + @@ -162,7 +162,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testIsNonVoidMethod() throws Exception { + void isNonVoidMethod() throws Exception { final DetailAST nonVoidMethod = getNodeFromFile(TokenTypes.METHOD_DEF); final DetailAST voidMethod = nonVoidMethod.getNextSibling(); - + @@ -175,7 +175,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetAccessModifierFromModifiersToken() throws Exception { + void getAccessModifierFromModifiersToken() throws Exception { @@ -54270,16 +54270,16 @@ CheckUtil.getAccessModifierFromModifiersToken( @@ -214,7 +214,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetFirstNode() throws Exception { + void getFirstNode() throws Exception { final DetailAST classDef = getNodeFromFile(TokenTypes.CLASS_DEF); - + final DetailAST firstChild = classDef.getFirstChild().getFirstChild(); @@ -223,7 +223,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetFirstNode1() { + void getFirstNode1() { @@ -54288,7 +54288,7 @@ child.setColumnNo(6); @@ -239,7 +239,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testGetFirstNode2() { + void getFirstNode2() { @@ -54297,7 +54297,7 @@ child.setColumnNo(5); @@ -255,7 +255,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testParseDoubleFloatingPointValues() { + void parseDoubleFloatingPointValues() { @@ -54306,7 +54306,7 @@ .isEqualTo(-0.05); @@ -277,7 +277,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testParseDoubleIntegerValues() { + void parseDoubleIntegerValues() { @@ -54315,7 +54315,7 @@ .isEqualTo(0.0); @@ -314,7 +314,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testParseClassNames() { + void parseClassNames() { @@ -54324,16 +54324,16 @@ final Set expected = new HashSet<>(); @@ -326,7 +326,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testEqualsAvoidNullCheck() throws Exception { + void equalsAvoidNullCheck() throws Exception { - + final String[] expected = { "14:28: " + getCheckMessage(EqualsAvoidNullCheck.class, MSG_EQUALS_AVOID_NULL), @@ -336,7 +336,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testMultipleVariableDeclarationsCheck() throws Exception { + void multipleVariableDeclarationsCheck() throws Exception { @@ -54342,7 +54342,7 @@ "14:5: " + getCheckMessage(MultipleVariableDeclarationsCheck.class, MSG_MULTIPLE), @@ -345,7 +345,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testNestedIfDepth() throws Exception { + void nestedIfDepth() throws Exception { @@ -54351,14 +54351,14 @@ "52:17: " + getCheckMessage(NestedIfDepthCheck.class, MSG_KEY, 2, 1), @@ -354,13 +354,13 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testJavaDocMethod() throws Exception { + void javaDocMethod() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; verifyWithInlineConfigParser(getPath("InputCheckUtil4.java"), expected); } - + @Test - public void testJavaDocMethod2() throws Exception { + void javaDocMethod2() throws Exception { @@ -54367,7 +54367,7 @@ }; @@ -368,7 +368,7 @@ public class CheckUtilTest extends AbstractModuleTestSupport { } - + @Test - public void testJavadoc() throws Exception { + void javadoc() throws Exception { @@ -54377,7 +54377,7 @@ @@ -402,6 +402,6 @@ public class CheckUtilTest extends AbstractModuleTestSupport { .that(node.isPresent()) .isTrue(); - + - return node.get(); + return node.orElseThrow(); } @@ -54385,12 +54385,12 @@ --- 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 - + import org.junit.jupiter.api.Test; - + -public class CodePointUtilTest { +final class CodePointUtilTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -54419,15 +54419,15 @@ @@ -48,7 +49,7 @@ import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; - + -public class CommonUtilTest extends AbstractPathTestSupport { +final class CommonUtilTest extends AbstractPathTestSupport { - + /** After appending to path produces equivalent, but denormalized path. */ private static final String PATH_DENORMALIZER = "/levelDown/.././"; @@ -59,7 +60,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -54435,7 +54435,7 @@ .that(isUtilsClassHasPrivateConstructor(CommonUtil.class)) .isTrue(); @@ -67,7 +68,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { - + /** Test CommonUtil.countCharInString. */ @Test - public void testLengthExpandedTabs() { @@ -54445,7 +54445,7 @@ .that(CommonUtil.lengthExpandedTabs(s1, s1.length(), 8)) @@ -103,7 +104,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testCreatePattern() { + void createPattern() { @@ -54454,7 +54454,7 @@ .isEqualTo("Test"); @@ -113,7 +114,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testBadRegex() { + void badRegex() { @@ -54463,7 +54463,7 @@ IllegalArgumentException.class, @@ -127,12 +128,12 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testBadRegex2() { + void badRegex2() { @@ -54478,7 +54478,7 @@ .that(ex) @@ -141,7 +142,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testFileExtensions() { + void fileExtensions() { @@ -54487,7 +54487,7 @@ assertWithMessage("Invalid file extension") @@ -174,42 +175,42 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testHasWhitespaceBefore() { + void hasWhitespaceBefore() { @@ -54495,7 +54495,7 @@ assertWithMessage("Invalid result").that(CommonUtil.hasWhitespaceBefore(4, " a")).isTrue(); assertWithMessage("Invalid result").that(CommonUtil.hasWhitespaceBefore(5, " a")).isFalse(); } - + @Test - public void testBaseClassNameForCanonicalName() { + void baseClassNameForCanonicalName() { @@ -54503,7 +54503,7 @@ .that(CommonUtil.baseClassName("java.util.List")) .isEqualTo("List"); } - + @Test - public void testBaseClassNameForSimpleName() { + void baseClassNameForSimpleName() { @@ -54511,23 +54511,23 @@ .that(CommonUtil.baseClassName("Set")) .isEqualTo("Set"); } - + @Test - public void testRelativeNormalizedPath() { + void relativeNormalizedPath() { final String relativePath = CommonUtil.relativizePath("/home", "/home/test"); - + assertWithMessage("Invalid relative path").that(relativePath).isEqualTo("test"); } - + @Test - public void testRelativeNormalizedPathWithNullBaseDirectory() { + void relativeNormalizedPathWithNullBaseDirectory() { final String relativePath = CommonUtil.relativizePath(null, "/tmp"); - + assertWithMessage("Invalid relative path").that(relativePath).isEqualTo("/tmp"); } - + @Test - public void testRelativeNormalizedPathWithDenormalizedBaseDirectory() throws IOException { + void relativeNormalizedPathWithDenormalizedBaseDirectory() throws IOException { @@ -54536,30 +54536,30 @@ final String basePath = sampleAbsolutePath + PATH_DENORMALIZER; @@ -220,19 +221,19 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testPattern() { + void pattern() { final boolean result = CommonUtil.isPatternValid("someValidPattern"); assertWithMessage("Should return true when pattern is valid").that(result).isTrue(); } - + @Test - public void testInvalidPattern() { + void invalidPattern() { final boolean result = CommonUtil.isPatternValid("some[invalidPattern"); assertWithMessage("Should return false when pattern is invalid").that(result).isFalse(); } - + @Test - public void testGetExistingConstructor() throws NoSuchMethodException { + void getExistingConstructor() throws NoSuchMethodException { final Constructor constructor = CommonUtil.getConstructor(String.class, String.class); - + assertWithMessage("Invalid constructor") @@ -241,7 +242,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testGetNonExistentConstructor() { + void getNonExistentConstructor() { @@ -54568,15 +54568,15 @@ IllegalStateException.class, @@ -255,7 +256,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testInvokeConstructor() throws NoSuchMethodException { + void invokeConstructor() throws NoSuchMethodException { final Constructor constructor = String.class.getConstructor(String.class); - + final String constructedString = CommonUtil.invokeConstructor(constructor, "string"); @@ -265,7 +266,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { - + @SuppressWarnings("rawtypes") @Test - public void testInvokeConstructorThatFails() throws NoSuchMethodException { @@ -54586,16 +54586,16 @@ assertThrows( @@ -280,7 +281,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testClose() { + void close() { final TestCloseable closeable = new TestCloseable(); - + CommonUtil.close(null); @@ -290,7 +291,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testCloseWithException() { + void closeWithException() { @@ -54604,7 +54604,7 @@ IllegalStateException.class, @@ -307,7 +308,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testFillTemplateWithStringsByRegexp() { + void fillTemplateWithStringsByRegexp() { @@ -54613,7 +54613,7 @@ CommonUtil.fillTemplateWithStringsByRegexp( @@ -328,7 +329,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testGetFileNameWithoutExtension() { + void getFileNameWithoutExtension() { @@ -54622,7 +54622,7 @@ .isEqualTo("filename"); @@ -341,7 +342,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testGetFileExtension() { + void getFileExtension() { @@ -54631,7 +54631,7 @@ .isEqualTo(""); @@ -354,133 +355,133 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testIsIdentifier() { + void isIdentifier() { @@ -54639,7 +54639,7 @@ .that(CommonUtil.isIdentifier("aValidIdentifier")) .isTrue(); } - + @Test - public void testIsIdentifierEmptyString() { + void isIdentifierEmptyString() { @@ -54647,7 +54647,7 @@ .that(CommonUtil.isIdentifier("")) .isFalse(); } - + @Test - public void testIsIdentifierInvalidFirstSymbol() { + void isIdentifierInvalidFirstSymbol() { @@ -54655,7 +54655,7 @@ .that(CommonUtil.isIdentifier("1InvalidIdentifier")) .isFalse(); } - + @Test - public void testIsIdentifierInvalidSymbols() { + void isIdentifierInvalidSymbols() { @@ -54663,7 +54663,7 @@ .that(CommonUtil.isIdentifier("invalid#Identifier")) .isFalse(); } - + @Test - public void testIsName() { + void isName() { @@ -54671,7 +54671,7 @@ .that(CommonUtil.isName("a.valid.Nam3")) .isTrue(); } - + @Test - public void testIsNameEmptyString() { + void isNameEmptyString() { @@ -54679,7 +54679,7 @@ .that(CommonUtil.isName("")) .isFalse(); } - + @Test - public void testIsNameInvalidFirstSymbol() { + void isNameInvalidFirstSymbol() { @@ -54687,7 +54687,7 @@ .that(CommonUtil.isName("1.invalid.name")) .isFalse(); } - + @Test - public void testIsNameEmptyPart() { + void isNameEmptyPart() { @@ -54695,7 +54695,7 @@ .that(CommonUtil.isName("invalid..name")) .isFalse(); } - + @Test - public void testIsNameEmptyLastPart() { + void isNameEmptyLastPart() { @@ -54703,7 +54703,7 @@ .that(CommonUtil.isName("invalid.name.")) .isFalse(); } - + @Test - public void testIsNameInvalidSymbol() { + void isNameInvalidSymbol() { @@ -54711,7 +54711,7 @@ .that(CommonUtil.isName("invalid.name#42")) .isFalse(); } - + @Test - public void testIsBlank() { + void isBlank() { @@ -54719,7 +54719,7 @@ .that(CommonUtil.isBlank("string")) .isFalse(); } - + @Test - public void testIsBlankAheadWhitespace() { + void isBlankAheadWhitespace() { @@ -54727,7 +54727,7 @@ .that(CommonUtil.isBlank(" string")) .isFalse(); } - + @Test - public void testIsBlankBehindWhitespace() { + void isBlankBehindWhitespace() { @@ -54735,7 +54735,7 @@ .that(CommonUtil.isBlank("string ")) .isFalse(); } - + @Test - public void testIsBlankWithWhitespacesAround() { + void isBlankWithWhitespacesAround() { @@ -54743,7 +54743,7 @@ .that(CommonUtil.isBlank(" string ")) .isFalse(); } - + @Test - public void testIsBlankWhitespaceInside() { + void isBlankWhitespaceInside() { @@ -54751,7 +54751,7 @@ .that(CommonUtil.isBlank("str ing")) .isFalse(); } - + @Test - public void testIsBlankNullString() { + void isBlankNullString() { @@ -54759,7 +54759,7 @@ .that(CommonUtil.isBlank(null)) .isTrue(); } - + @Test - public void testIsBlankWithEmptyString() { + void isBlankWithEmptyString() { @@ -54767,7 +54767,7 @@ .that(CommonUtil.isBlank("")) .isTrue(); } - + @Test - public void testIsBlankWithWhitespacesOnly() { + void isBlankWithWhitespacesOnly() { @@ -54775,22 +54775,22 @@ .that(CommonUtil.isBlank(" ")) .isTrue(); } - + @Test - public void testGetUriByFilenameFindsAbsoluteResourceOnClasspath() throws Exception { + void getUriByFilenameFindsAbsoluteResourceOnClasspath() throws Exception { final String filename = "/" + getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; final URI uri = CommonUtil.getUriByFilename(filename); - + @@ -491,7 +492,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testGetUriByFilenameFindsRelativeResourceOnClasspath() throws Exception { + void getUriByFilenameFindsRelativeResourceOnClasspath() throws Exception { final String filename = getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; final URI uri = CommonUtil.getUriByFilename(filename); - + @@ -507,7 +508,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { * interpreted relative to the current package "com/puppycrawl/tools/checkstyle/utils/" */ @@ -54808,7 +54808,7 @@ + final String content = IOUtils.toString(uri.toURL(), UTF_8); assertWithMessage("Content mismatches for: " + uri).that(content).startsWith("good"); } - + @Test - public void testGetUriByFilenameClasspathPrefixLoadConfig() throws Exception { + void getUriByFilenameClasspathPrefixLoadConfig() throws Exception { @@ -54817,7 +54817,7 @@ + getPackageLocation() @@ -537,7 +538,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testGetUriByFilenameFindsRelativeResourceOnClasspathPrefix() throws Exception { + void getUriByFilenameFindsRelativeResourceOnClasspathPrefix() throws Exception { @@ -54826,7 +54826,7 @@ + getPackageLocation() @@ -551,14 +552,14 @@ public class CommonUtilTest extends AbstractPathTestSupport { } - + @Test - public void testIsCodePointWhitespace() { + void isCodePointWhitespace() { @@ -54834,7 +54834,7 @@ assertThat(CommonUtil.isCodePointWhitespace(codePoints, 0)).isTrue(); assertThat(CommonUtil.isCodePointWhitespace(codePoints, 1)).isFalse(); } - + @Test - public void testLoadSuppressionsUriSyntaxException() throws Exception { + void loadSuppressionsUriSyntaxException() throws Exception { @@ -54846,12 +54846,12 @@ @@ -26,19 +26,19 @@ import java.io.File; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - + -public class FilterUtilTest { +final class FilterUtilTest { - + @TempDir public File temporaryFolder; - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -54859,7 +54859,7 @@ .that(isUtilsClassHasPrivateConstructor(FilterUtil.class)) .isTrue(); } - + @Test - public void testExistingFile() throws Exception { + void existingFile() throws Exception { @@ -54868,7 +54868,7 @@ .that(FilterUtil.isFileExists(file.getPath())) @@ -46,7 +46,7 @@ public class FilterUtilTest { } - + @Test - public void testNonExistentFile() { + void nonExistentFile() { @@ -54880,10 +54880,10 @@ @@ -35,10 +35,10 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTags; import java.util.List; import org.junit.jupiter.api.Test; - + -public class JavadocUtilTest { +final class JavadocUtilTest { - + @Test - public void testTags() { + void tags() { @@ -54892,7 +54892,7 @@ " * {@link List }, {@link List link text }", @@ -51,7 +51,7 @@ public class JavadocUtilTest { } - + @Test - public void testBlockTag() { + void blockTag() { @@ -54901,7 +54901,7 @@ }; @@ -61,7 +61,7 @@ public class JavadocUtilTest { } - + @Test - public void testTagType() { + void tagType() { @@ -54910,7 +54910,7 @@ }; @@ -75,7 +75,7 @@ public class JavadocUtilTest { } - + @Test - public void testInlineTagLinkText() { + void inlineTagLinkText() { @@ -54919,7 +54919,7 @@ }; @@ -88,7 +88,7 @@ public class JavadocUtilTest { } - + @Test - public void testInlineTagMethodRef() { + void inlineTagMethodRef() { @@ -54928,7 +54928,7 @@ }; @@ -101,7 +101,7 @@ public class JavadocUtilTest { } - + @Test - public void testTagPositions() { + void tagPositions() { @@ -54937,16 +54937,16 @@ }; @@ -128,7 +128,7 @@ public class JavadocUtilTest { } - + @Test - public void testInlineTagPositions() { + void inlineTagPositions() { final String[] text = {"/** Also {@link Name value} */"}; final Comment comment = new Comment(text, 1, 0, text[0].length()); - + @@ -143,7 +143,7 @@ public class JavadocUtilTest { } - + @Test - public void testInvalidTags() { + void invalidTags() { @@ -54955,7 +54955,7 @@ }; @@ -166,7 +166,7 @@ public class JavadocUtilTest { } - + @Test - public void testEmptyBlockComment() { + void emptyBlockComment() { @@ -54964,7 +54964,7 @@ .that(JavadocUtil.isJavadocComment(emptyComment)) @@ -174,7 +174,7 @@ public class JavadocUtilTest { } - + @Test - public void testEmptyBlockCommentAst() { + void emptyBlockCommentAst() { @@ -54973,7 +54973,7 @@ commentBegin.setText("/*"); @@ -196,7 +196,7 @@ public class JavadocUtilTest { } - + @Test - public void testEmptyJavadocComment() { + void emptyJavadocComment() { @@ -54982,7 +54982,7 @@ .that(JavadocUtil.isJavadocComment(emptyJavadocComment)) @@ -204,7 +204,7 @@ public class JavadocUtilTest { } - + @Test - public void testEmptyJavadocCommentAst() { + void emptyJavadocCommentAst() { @@ -54991,7 +54991,7 @@ commentBegin.setText("/*"); @@ -233,21 +233,21 @@ public class JavadocUtilTest { } - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -54999,7 +54999,7 @@ .that(isUtilsClassHasPrivateConstructor(JavadocUtil.class)) .isTrue(); } - + @Test - public void testGetTokenNameForId() { + void getTokenNameForId() { @@ -55007,7 +55007,7 @@ .that(JavadocUtil.getTokenName(JavadocTokenTypes.EOF)) .isEqualTo("EOF"); } - + @Test - public void testGetTokenNameForLargeId() { + void getTokenNameForLargeId() { @@ -55016,7 +55016,7 @@ assertWithMessage("exception expected").fail(); @@ -259,7 +259,7 @@ public class JavadocUtilTest { } - + @Test - public void testGetTokenNameForInvalidId() { + void getTokenNameForInvalidId() { @@ -55025,7 +55025,7 @@ assertWithMessage("exception expected").fail(); @@ -271,7 +271,7 @@ public class JavadocUtilTest { } - + @Test - public void testGetTokenNameForLowerBoundInvalidId() { + void getTokenNameForLowerBoundInvalidId() { @@ -55034,7 +55034,7 @@ assertWithMessage("exception expected").fail(); @@ -283,7 +283,7 @@ public class JavadocUtilTest { } - + @Test - public void testGetTokenIdThatIsUnknown() { + void getTokenIdThatIsUnknown() { @@ -55043,24 +55043,24 @@ assertWithMessage("exception expected").fail(); @@ -295,14 +295,14 @@ public class JavadocUtilTest { } - + @Test - public void testGetTokenId() { + void getTokenId() { final int tokenId = JavadocUtil.getTokenId("JAVADOC"); - + assertWithMessage("Invalid token id").that(tokenId).isEqualTo(JavadocTokenTypes.JAVADOC); } - + @Test - public void testGetJavadocCommentContent() { + void getJavadocCommentContent() { final DetailAstImpl detailAST = new DetailAstImpl(); final DetailAstImpl javadoc = new DetailAstImpl(); - + @@ -314,7 +314,7 @@ public class JavadocUtilTest { } - + @Test - public void testGetFirstToken() { + void getFirstToken() { @@ -55069,16 +55069,16 @@ basetag.setType(JavadocTokenTypes.BASE_TAG); @@ -331,7 +331,7 @@ public class JavadocUtilTest { } - + @Test - public void testGetPreviousSibling() { + void getPreviousSibling() { final JavadocNodeImpl root = new JavadocNodeImpl(); - + final JavadocNodeImpl node = new JavadocNodeImpl(); @@ -350,14 +350,14 @@ public class JavadocUtilTest { } - + @Test - public void testGetLastTokenName() { + void getLastTokenName() { @@ -55086,7 +55086,7 @@ .that(JavadocUtil.getTokenName(10094)) .isEqualTo("RP"); } - + @Test - public void testEscapeAllControlChars() { + void escapeAllControlChars() { @@ -55098,10 +55098,10 @@ @@ -39,17 +39,17 @@ import java.io.File; import java.util.List; import org.junit.jupiter.api.Test; - + -public class ModuleReflectionUtilTest { +final class ModuleReflectionUtilTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -55109,7 +55109,7 @@ .that(isUtilsClassHasPrivateConstructor(ModuleReflectionUtil.class)) .isTrue(); } - + @Test - public void testIsCheckstyleModule() { + void isCheckstyleModule() { @@ -55118,7 +55118,7 @@ .isTrue(); @@ -74,7 +74,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsValidCheckstyleClass() { + void isValidCheckstyleClass() { @@ -55127,7 +55127,7 @@ .isTrue(); @@ -93,7 +93,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsCheckstyleCheck() { + void isCheckstyleCheck() { @@ -55136,7 +55136,7 @@ .isTrue(); @@ -103,7 +103,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsFileSetModule() { + void isFileSetModule() { @@ -55145,7 +55145,7 @@ .isTrue(); @@ -113,7 +113,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsFilterModule() { + void isFilterModule() { @@ -55154,7 +55154,7 @@ .isTrue(); @@ -123,7 +123,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsFileFilterModule() { + void isFileFilterModule() { @@ -55163,7 +55163,7 @@ .isTrue(); @@ -133,7 +133,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsTreeWalkerFilterModule() { + void isTreeWalkerFilterModule() { @@ -55172,7 +55172,7 @@ .isTrue(); @@ -143,7 +143,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsAuditListener() { + void isAuditListener() { @@ -55181,7 +55181,7 @@ .isTrue(); @@ -153,7 +153,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testIsRootModule() { + void isRootModule() { @@ -55190,7 +55190,7 @@ .isTrue(); @@ -163,7 +163,7 @@ public class ModuleReflectionUtilTest { } - + @Test - public void testKeepEclipseHappy() { + void keepEclipseHappy() { @@ -55202,10 +55202,10 @@ @@ -26,17 +26,17 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + -public class ParserUtilTest { +final class ParserUtilTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -55213,7 +55213,7 @@ .that(isUtilsClassHasPrivateConstructor(ParserUtil.class)) .isTrue(); } - + @Test - public void testCreationOfFakeCommentBlock() { + void creationOfFakeCommentBlock() { @@ -55225,10 +55225,10 @@ @@ -28,17 +28,17 @@ import com.puppycrawl.tools.checkstyle.api.Scope; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import org.junit.jupiter.api.Test; - + -public class ScopeUtilTest { +final class ScopeUtilTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -55236,7 +55236,7 @@ .that(isUtilsClassHasPrivateConstructor(ScopeUtil.class)) .isTrue(); } - + @Test - public void testInClassBlock() { + void inClassBlock() { @@ -55245,7 +55245,7 @@ .isFalse(); @@ -76,7 +76,7 @@ public class ScopeUtilTest { } - + @Test - public void testInEnumBlock() { + void inEnumBlock() { @@ -55254,7 +55254,7 @@ .isFalse(); @@ -114,7 +114,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsInCodeBlock() { + void isInCodeBlock() { @@ -55263,7 +55263,7 @@ .isFalse(); @@ -139,7 +139,7 @@ public class ScopeUtilTest { } - + @Test - public void testInRecordBlock() { + void inRecordBlock() { @@ -55272,7 +55272,7 @@ .isFalse(); @@ -177,42 +177,42 @@ public class ScopeUtilTest { } - + @Test - public void testIsOuterMostTypeInterface() { + void isOuterMostTypeInterface() { @@ -55280,7 +55280,7 @@ .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.INTERFACE_DEF, TokenTypes.MODIFIERS))) .isFalse(); } - + @Test - public void testIsOuterMostTypeAnnotation() { + void isOuterMostTypeAnnotation() { @@ -55288,7 +55288,7 @@ .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.ANNOTATION_DEF, TokenTypes.MODIFIERS))) .isFalse(); } - + @Test - public void testIsOuterMostTypeEnum() { + void isOuterMostTypeEnum() { @@ -55296,7 +55296,7 @@ .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.ENUM_DEF, TokenTypes.MODIFIERS))) .isFalse(); } - + @Test - public void testIsOuterMostTypeClass() { + void isOuterMostTypeClass() { @@ -55304,7 +55304,7 @@ .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.CLASS_DEF, TokenTypes.MODIFIERS))) .isFalse(); } - + @Test - public void testIsOuterMostTypePackageDef() { + void isOuterMostTypePackageDef() { @@ -55312,7 +55312,7 @@ .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.PACKAGE_DEF, TokenTypes.DOT))) .isTrue(); } - + @Test - public void testIsLocalVariableDefCatch() { + void isLocalVariableDefCatch() { @@ -55321,7 +55321,7 @@ ScopeUtil.isLocalVariableDef( @@ -221,7 +221,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsLocalVariableDefUnexpected() { + void isLocalVariableDefUnexpected() { @@ -55330,7 +55330,7 @@ .isFalse(); @@ -231,7 +231,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsLocalVariableDefResource() { + void isLocalVariableDefResource() { @@ -55339,7 +55339,7 @@ modifiers.setType(TokenTypes.MODIFIERS); @@ -251,7 +251,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsLocalVariableDefVariable() { + void isLocalVariableDefVariable() { @@ -55348,7 +55348,7 @@ .isTrue(); @@ -269,7 +269,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsClassFieldDef() { + void isClassFieldDef() { @@ -55357,7 +55357,7 @@ ScopeUtil.isClassFieldDef( @@ -286,7 +286,7 @@ public class ScopeUtilTest { } - + @Test - public void testSurroundingScope() { + void surroundingScope() { @@ -55366,7 +55366,7 @@ getNodeWithParentScope(TokenTypes.LITERAL_PUBLIC, "public", TokenTypes.ANNOTATION_DEF)); @@ -307,7 +307,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsInScope() { + void isInScope() { @@ -55375,7 +55375,7 @@ ScopeUtil.isInScope( @@ -325,14 +325,14 @@ public class ScopeUtilTest { } - + @Test - public void testSurroundingScopeOfNodeChildOfLiteralNewIsAnoninner() { + void surroundingScopeOfNodeChildOfLiteralNewIsAnoninner() { @@ -55383,7 +55383,7 @@ ScopeUtil.getSurroundingScope(getNode(TokenTypes.LITERAL_NEW, TokenTypes.IDENT)); assertWithMessage("Invalid surrounding scope").that(scope).isEqualTo(Scope.ANONINNER); } - + @Test - public void testIsInInterfaceBlock() { + void isInInterfaceBlock() { @@ -55392,7 +55392,7 @@ TokenTypes.INTERFACE_DEF, @@ -349,7 +349,7 @@ public class ScopeUtilTest { } - + @Test - public void testIsInAnnotationBlock() { + void isInAnnotationBlock() { @@ -55401,7 +55401,7 @@ TokenTypes.ANNOTATION_DEF, @@ -366,7 +366,7 @@ public class ScopeUtilTest { } - + @Test - public void testisInInterfaceOrAnnotationBlock() { + void isInInterfaceOrAnnotationBlock() { @@ -55413,10 +55413,10 @@ @@ -34,17 +34,17 @@ import java.util.Optional; import java.util.TreeMap; import org.junit.jupiter.api.Test; - + -public class TokenUtilTest { +final class TokenUtilTest { - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -55424,25 +55424,25 @@ .that(isUtilsClassHasPrivateConstructor(TokenUtil.class)) .isTrue(); } - + @Test - public void testGetIntFromAccessibleField() throws NoSuchFieldException { + void getIntFromAccessibleField() throws NoSuchFieldException { final Field field = Integer.class.getField("MAX_VALUE"); final int maxValue = TokenUtil.getIntFromField(field, 0); - + @@ -52,7 +52,7 @@ public class TokenUtilTest { } - + @Test - public void testGetIntFromInaccessibleField() throws NoSuchFieldException { + void getIntFromInaccessibleField() throws NoSuchFieldException { final Field field = Integer.class.getDeclaredField("value"); - + try { @@ -72,7 +72,7 @@ public class TokenUtilTest { } - + @Test - public void testNameToValueMapFromPublicIntFields() { + void nameToValueMapFromPublicIntFields() { @@ -55451,7 +55451,7 @@ final Map expectedMap = new TreeMap<>(); @@ -85,7 +85,7 @@ public class TokenUtilTest { } - + @Test - public void testInvertMap() { + void invertMap() { @@ -55460,7 +55460,7 @@ map.put("ONE", 1); @@ -103,7 +103,7 @@ public class TokenUtilTest { } - + @Test - public void testTokenValueIncorrect() throws IllegalAccessException { + void tokenValueIncorrect() throws IllegalAccessException { @@ -55469,7 +55469,7 @@ for (final Field field : fields) { @@ -131,7 +131,7 @@ public class TokenUtilTest { } - + @Test - public void testTokenValueCorrect() throws IllegalAccessException { + void tokenValueCorrect() throws IllegalAccessException { @@ -55478,7 +55478,7 @@ // Only process the int declarations. @@ -147,7 +147,7 @@ public class TokenUtilTest { } - + @Test - public void testTokenValueIncorrect2() { + void tokenValueIncorrect2() { @@ -55487,7 +55487,7 @@ TokenUtil.getTokenName(id); @@ -160,7 +160,7 @@ public class TokenUtilTest { } - + @Test - public void testTokenIdIncorrect() { + void tokenIdIncorrect() { @@ -55496,7 +55496,7 @@ TokenUtil.getTokenId(id); @@ -173,7 +173,7 @@ public class TokenUtilTest { } - + @Test - public void testShortDescriptionIncorrect() { + void shortDescriptionIncorrect() { @@ -55505,7 +55505,7 @@ TokenUtil.getShortDescription(id); @@ -186,7 +186,7 @@ public class TokenUtilTest { } - + @Test - public void testIsCommentType() { + void isCommentType() { @@ -55514,51 +55514,51 @@ .isTrue(); @@ -211,14 +211,14 @@ public class TokenUtilTest { } - + @Test - public void testGetTokenTypesTotalNumber() { + void getTokenTypesTotalNumber() { final int tokenTypesTotalNumber = TokenUtil.getTokenTypesTotalNumber(); - + assertWithMessage("Invalid token total number").that(tokenTypesTotalNumber).isEqualTo(194); } - + @Test - public void testGetAllTokenIds() { + void getAllTokenIds() { final int[] allTokenIds = TokenUtil.getAllTokenIds(); final int sum = Arrays.stream(allTokenIds).sum(); - + @@ -227,7 +227,7 @@ public class TokenUtilTest { } - + @Test - public void testGetTokenNameWithGreatestPossibleId() { + void getTokenNameWithGreatestPossibleId() { final int id = TokenTypes.COMMENT_CONTENT; final String tokenName = TokenUtil.getTokenName(id); - + @@ -235,7 +235,7 @@ public class TokenUtilTest { } - + @Test - public void testCorrectBehaviourOfGetTokenId() { + void correctBehaviourOfGetTokenId() { final String id = "COMPILATION_UNIT"; - + assertWithMessage("Invalid token id") @@ -244,7 +244,7 @@ public class TokenUtilTest { } - + @Test - public void testCorrectBehaviourOfShortDescription() { + void correctBehaviourOfShortDescription() { final String id = "COMPILATION_UNIT"; final String shortDescription = TokenUtil.getShortDescription(id); - + @@ -254,7 +254,7 @@ public class TokenUtilTest { } - + @Test - public void testFindFirstTokenByPredicate() { + void findFirstTokenByPredicate() { @@ -55567,7 +55567,7 @@ final DetailAstImpl firstSibling = new DetailAstImpl(); @@ -274,7 +274,7 @@ public class TokenUtilTest { } - + @Test - public void testForEachChild() { + void forEachChild() { @@ -55576,7 +55576,7 @@ final DetailAstImpl firstSibling = new DetailAstImpl(); @@ -296,7 +296,7 @@ public class TokenUtilTest { } - + @Test - public void testIsTypeDeclaration() { + void isTypeDeclaration() { @@ -55585,7 +55585,7 @@ .isTrue(); @@ -315,7 +315,7 @@ public class TokenUtilTest { } - + @Test - public void testIsOfTypeTrue() { + void isOfTypeTrue() { @@ -55594,7 +55594,7 @@ astForTest.setType(type); @@ -331,7 +331,7 @@ public class TokenUtilTest { } - + @Test - public void testIsOfTypeFalse() { + void isOfTypeFalse() { @@ -55603,7 +55603,7 @@ final DetailAstImpl astForTest2 = null; @@ -352,7 +352,7 @@ public class TokenUtilTest { } - + @Test - public void testIsBooleanLiteralType() { + void isBooleanLiteralType() { @@ -55617,7 +55617,7 @@ 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 com.puppycrawl.tools.checkstyle.DetailAstImpl; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; @@ -32,25 +33,24 @@ import com.puppycrawl.tools.checkstyle.xpath.AbstractNode; @@ -55629,12 +55629,12 @@ import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - + -public class XpathUtilTest { +final class XpathUtilTest { - + @TempDir public File tempFolder; - + @Test - public void testIsProperUtilsClass() throws ReflectiveOperationException { + void isProperUtilsClass() throws ReflectiveOperationException { @@ -55642,7 +55642,7 @@ .that(isUtilsClassHasPrivateConstructor(XpathUtil.class)) .isTrue(); } - + @Test - public void testSupportsTextAttribute() { + void supportsTextAttribute() { @@ -55651,7 +55651,7 @@ .isTrue(); @@ -78,7 +78,7 @@ public class XpathUtilTest { } - + @Test - public void testGetValue() { + void getValue() { @@ -55660,7 +55660,7 @@ .isEqualTo("HELLO WORLD"); @@ -94,10 +94,10 @@ public class XpathUtilTest { } - + @Test - public void testPrintXpathNotComment() throws Exception { + void printXpathNotComment() throws Exception { @@ -55673,7 +55673,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -113,10 +113,10 @@ public class XpathUtilTest { } - + @Test - public void testPrintXpathComment() throws Exception { + void printXpathComment() throws Exception { @@ -55686,7 +55686,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -128,10 +128,10 @@ public class XpathUtilTest { } - + @Test - public void testPrintXpathTwo() throws Exception { + void printXpathTwo() throws Exception { @@ -55699,7 +55699,7 @@ "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", @@ -155,10 +155,10 @@ public class XpathUtilTest { } - + @Test - public void testInvalidXpath() throws IOException { + void invalidXpath() throws IOException { @@ -55712,7 +55712,7 @@ XpathUtil.printXpathBranch(invalidXpath, file); @@ -176,7 +176,7 @@ public class XpathUtilTest { } - + @Test - public void testCreateChildren() { + void createChildren() { @@ -55724,18 +55724,18 @@ @@ -28,31 +28,31 @@ import net.sf.saxon.tree.iter.AxisIterator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class AttributeNodeTest { +final class AttributeNodeTest { - + private static AttributeNode attributeNode; - + @BeforeEach - public void init() { + void init() { attributeNode = new AttributeNode("name", "value"); } - + @Test - public void testGetNamespaceUri() { + void getNamespaceUri() { @@ -55743,7 +55743,7 @@ .that(attributeNode.getNamespaceUri()) .isEqualTo(NamespaceUri.NULL); } - + @Test - public void testGetUri() { + void getUri() { @@ -55751,7 +55751,7 @@ .that(attributeNode.getURI()) .isEqualTo(""); } - + @Test - public void testCompareOrder() { + void compareOrder() { @@ -55760,7 +55760,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -64,7 +64,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetDepth() { + void getDepth() { @@ -55769,7 +55769,7 @@ assertWithMessage("Invalid exception message") @@ -74,14 +74,14 @@ public class AttributeNodeTest { } - + @Test - public void testHasChildNodes() { + void hasChildNodes() { @@ -55777,7 +55777,7 @@ .that(attributeNode.hasChildNodes()) .isFalse(); } - + @Test - public void testGetAttributeValue() { + void getAttributeValue() { @@ -55786,7 +55786,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -93,7 +93,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetChildren() { + void getChildren() { @@ -55795,7 +55795,7 @@ assertWithMessage("Invalid exception message") @@ -103,7 +103,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetParent() { + void getParent() { @@ -55804,7 +55804,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -115,7 +115,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetRoot() { + void getRoot() { @@ -55813,7 +55813,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -127,14 +127,14 @@ public class AttributeNodeTest { } - + @Test - public void testGetStringValue() { + void getStringValue() { @@ -55821,7 +55821,7 @@ .that(attributeNode.getStringValue()) .isEqualTo("value"); } - + @Test - public void testIterate() { + void iterate() { @@ -55830,7 +55830,7 @@ } catch (UnsupportedOperationException ex) { @@ -145,7 +145,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetLineNumber() { + void getLineNumber() { @@ -55839,7 +55839,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -157,7 +157,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetColumnNumber() { + void getColumnNumber() { @@ -55848,7 +55848,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -169,7 +169,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetTokenType() { + void getTokenType() { @@ -55857,7 +55857,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -181,7 +181,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetUnderlyingNode() { + void getUnderlyingNode() { @@ -55866,7 +55866,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -193,7 +193,7 @@ public class AttributeNodeTest { } - + @Test - public void testGetAllNamespaces() { + void getAllNamespaces() { @@ -55878,15 +55878,15 @@ @@ -39,7 +39,7 @@ import net.sf.saxon.tree.iter.EmptyIterator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class ElementNodeTest extends AbstractPathTestSupport { +final class ElementNodeTest extends AbstractPathTestSupport { - + private static RootNode rootNode; - + @@ -49,14 +49,14 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @BeforeEach - public void init() throws Exception { + void init() throws Exception { @@ -55894,25 +55894,25 @@ final DetailAST rootAst = JavaParser.parseFile(file, JavaParser.Options.WITHOUT_COMMENTS); rootNode = new RootNode(rootAst); } - + @Test - public void testParentChildOrdering() { + void parentChildOrdering() { final DetailAstImpl detailAST = new DetailAstImpl(); detailAST.setType(TokenTypes.VARIABLE_DEF); - + @@ -75,7 +75,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testSiblingsOrdering() { + void siblingsOrdering() { final DetailAstImpl detailAst1 = new DetailAstImpl(); detailAst1.setType(TokenTypes.VARIABLE_DEF); - + @@ -99,7 +99,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testCompareOrderWrongInstance() throws Exception { + void compareOrderWrongInstance() throws Exception { @@ -55921,7 +55921,7 @@ final int result = nodes.get(0).compareOrder(null); @@ -107,7 +107,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetParent() throws Exception { + void getParent() throws Exception { @@ -55930,7 +55930,7 @@ assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); @@ -118,7 +118,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testRootOfElementNode() throws Exception { + void rootOfElementNode() throws Exception { @@ -55939,7 +55939,7 @@ assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); @@ -132,7 +132,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetNodeByValueNumInt() throws Exception { + void getNodeByValueNumInt() throws Exception { @@ -55948,7 +55948,7 @@ assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); @@ -141,7 +141,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetNodeByValueStringLiteral() throws Exception { + void getNodeByValueStringLiteral() throws Exception { @@ -55957,7 +55957,7 @@ assertWithMessage("Invalid number of nodes").that(nodes).hasSize(2); @@ -150,14 +150,14 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetNodeByValueWithSameTokenText() throws Exception { + void getNodeByValueWithSameTokenText() throws Exception { @@ -55965,7 +55965,7 @@ final List nodes = getXpathItems(xPath, rootNode); assertWithMessage("Invalid number of nodes").that(nodes).hasSize(0); } - + @Test - public void testGetAttributeValue() { + void getAttributeValue() { @@ -55974,7 +55974,7 @@ detailAST.setText("HelloWorld"); @@ -170,7 +170,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetAttributeCached() { + void getAttributeCached() { @@ -55983,7 +55983,7 @@ detailAST.setText("HelloWorld"); @@ -185,7 +185,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetAttributeValueNoAttribute() { + void getAttributeValueNoAttribute() { @@ -55992,7 +55992,7 @@ detailAST.setText("HelloWorld"); @@ -198,7 +198,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetAttributeValueWrongAttribute() { + void getAttributeValueWrongAttribute() { @@ -56001,7 +56001,7 @@ detailAST.setText("HelloWorld"); @@ -211,7 +211,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIterateAxisEmptyChildren() { + void iterateAxisEmptyChildren() { @@ -56010,7 +56010,7 @@ final ElementNode elementNode = new ElementNode(rootNode, rootNode, detailAST, 1, 0); @@ -224,7 +224,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIterateAxisWithChildren() { + void iterateAxisWithChildren() { @@ -56019,27 +56019,27 @@ final DetailAstImpl childAst = new DetailAstImpl(); @@ -240,7 +240,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIterateAxisWithNoSiblings() { + void iterateAxisWithNoSiblings() { final DetailAstImpl detailAST = new DetailAstImpl(); detailAST.setType(TokenTypes.VARIABLE_DEF); - + --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java @@ -36,7 +36,7 @@ import net.sf.saxon.tree.iter.EmptyIterator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class RootNodeTest extends AbstractPathTestSupport { +final class RootNodeTest extends AbstractPathTestSupport { - + private static RootNode rootNode; - + @@ -46,14 +46,14 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @BeforeEach - public void init() throws Exception { + void init() throws Exception { @@ -56047,7 +56047,7 @@ final DetailAST rootAst = JavaParser.parseFile(file, JavaParser.Options.WITHOUT_COMMENTS); rootNode = new RootNode(rootAst); } - + @Test - public void testCompareOrder() { + void compareOrder() { @@ -56056,7 +56056,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -65,7 +65,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testXpath() throws Exception { + void xpath() throws Exception { @@ -56065,13 +56065,13 @@ assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); @@ -79,24 +79,24 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetDepth() { + void getDepth() { assertWithMessage("Root node depth should be 0").that(rootNode.getDepth()).isEqualTo(0); } - + @Test - public void testGetTokenType() { + void getTokenType() { @@ -56079,19 +56079,19 @@ .that(rootNode.getTokenType()) .isEqualTo(TokenTypes.COMPILATION_UNIT); } - + @Test - public void testGetLineNumber() { + void getLineNumber() { assertWithMessage("Invalid line number").that(rootNode.getLineNumber()).isEqualTo(1); } - + @Test - public void testGetColumnNumber() { + void getColumnNumber() { assertWithMessage("Invalid column number").that(rootNode.getColumnNumber()).isEqualTo(0); } - + @@ -106,7 +106,7 @@ public class RootNodeTest extends AbstractPathTestSupport { * Test exists until https://github.com/checkstyle/checkstyle/issues/4997 */ @@ -56103,13 +56103,13 @@ nonRealNode.setLineNo(555); @@ -119,12 +119,12 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetLocalPart() { + void getLocalPart() { assertWithMessage("Invalid local part").that(rootNode.getLocalPart()).isEqualTo("ROOT"); } - + @Test - public void testIterate() { + void iterate() { @@ -56118,7 +56118,7 @@ .that(following) @@ -158,7 +158,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testRootWithNullDetailAst() { + void rootWithNullDetailAst() { @@ -56127,7 +56127,7 @@ .that(emptyRootNode.hasChildNodes()) @@ -177,7 +177,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetStringValue() { + void getStringValue() { @@ -56136,7 +56136,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -189,7 +189,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetAttributeValue() { + void getAttributeValue() { @@ -56145,7 +56145,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -201,7 +201,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetDeclaredNamespaces() { + void getDeclaredNamespaces() { @@ -56154,7 +56154,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -213,7 +213,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIsId() { + void isId() { @@ -56163,7 +56163,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -225,7 +225,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIsIdref() { + void isIdref() { @@ -56172,7 +56172,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -237,7 +237,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIsNilled() { + void isNilled() { @@ -56181,7 +56181,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -249,7 +249,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testIsStreamed() { + void isStreamed() { @@ -56190,7 +56190,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -261,7 +261,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetConfiguration() { + void getConfiguration() { @@ -56199,7 +56199,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -273,7 +273,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testSetSystemId() { + void setSystemId() { @@ -56208,7 +56208,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -285,7 +285,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetSystemId() { + void getSystemId() { @@ -56217,7 +56217,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -297,7 +297,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetPublicId() { + void getPublicId() { @@ -56226,7 +56226,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -309,7 +309,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testBaseUri() { + void baseUri() { @@ -56235,7 +56235,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -321,7 +321,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testSaveLocation() { + void saveLocation() { @@ -56244,7 +56244,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -333,7 +333,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetStringValueCs() { + void getStringValueCs() { @@ -56253,7 +56253,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -345,7 +345,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testFingerprint() { + void fingerprint() { @@ -56262,7 +56262,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -357,7 +357,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetDisplayName() { + void getDisplayName() { @@ -56271,7 +56271,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -369,7 +369,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetPrefix() { + void getPrefix() { @@ -56280,7 +56280,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -381,7 +381,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetSchemaType() { + void getSchemaType() { @@ -56289,7 +56289,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -393,7 +393,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testAtomize() { + void atomize() { @@ -56298,7 +56298,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -405,7 +405,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGenerateId() { + void generateId() { @@ -56307,7 +56307,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -417,7 +417,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testCopy() { + void copy() { @@ -56316,7 +56316,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -429,7 +429,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testGetAllNamespaces() { + void getAllNamespaces() { @@ -56325,7 +56325,7 @@ assertWithMessage("Exception is excepted").fail(); @@ -441,7 +441,7 @@ public class RootNodeTest extends AbstractPathTestSupport { } - + @Test - public void testSameNodeInfo() { + void sameNodeInfo() { @@ -56337,15 +56337,15 @@ @@ -31,7 +31,7 @@ import java.util.List; import net.sf.saxon.om.NodeInfo; import org.junit.jupiter.api.Test; - + -public class XpathMapperTest extends AbstractModuleTestSupport { +final class XpathMapperTest extends AbstractModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -39,7 +39,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testNodeOrdering() throws Exception { + void nodeOrdering() throws Exception { @@ -56354,7 +56354,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -60,7 +60,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testFullPath() throws Exception { + void fullPath() throws Exception { @@ -56363,7 +56363,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -79,7 +79,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testParent() throws Exception { + void parent() throws Exception { @@ -56372,7 +56372,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -94,7 +94,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testCurlyBrackets() throws Exception { + void curlyBrackets() throws Exception { @@ -56381,7 +56381,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -110,7 +110,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testOr() throws Exception { + void or() throws Exception { @@ -56390,7 +56390,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -129,7 +129,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testComplexQueryOne() throws Exception { + void complexQueryOne() throws Exception { @@ -56399,7 +56399,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -142,7 +142,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testComplexQueryTwo() throws Exception { + void complexQueryTwo() throws Exception { @@ -56408,7 +56408,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -156,7 +156,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testComplexQueryThree() throws Exception { + void complexQueryThree() throws Exception { @@ -56417,7 +56417,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -176,7 +176,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testAttributeOr() throws Exception { + void attributeOr() throws Exception { @@ -56426,7 +56426,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -194,7 +194,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testAttributeAnd() throws Exception { + void attributeAnd() throws Exception { @@ -56435,7 +56435,7 @@ + "../..[./IDENT[@text='InputXpathMapperAst']]]"; @@ -212,7 +212,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAllElementsWithAttribute() throws Exception { + void queryAllElementsWithAttribute() throws Exception { @@ -56444,7 +56444,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -220,7 +220,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementByIndex() throws Exception { + void queryElementByIndex() throws Exception { @@ -56453,7 +56453,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -237,7 +237,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAllVariableDefinitionsWithAttribute() throws Exception { + void queryAllVariableDefinitionsWithAttribute() throws Exception { @@ -56462,7 +56462,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -245,7 +245,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAllVariableDefWrongAttribute() throws Exception { + void queryAllVariableDefWrongAttribute() throws Exception { @@ -56471,7 +56471,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -253,7 +253,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAllMethodDefinitionsInContext() throws Exception { + void queryAllMethodDefinitionsInContext() throws Exception { @@ -56480,7 +56480,7 @@ final List objectNodes = getXpathItems(objectXpath, rootNode); @@ -279,7 +279,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAllClassDefinitions() throws Exception { + void queryAllClassDefinitions() throws Exception { @@ -56489,7 +56489,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -296,7 +296,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryByMethodName() throws Exception { + void queryByMethodName() throws Exception { @@ -56498,7 +56498,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -311,7 +311,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryMethodDefinitionsByClassName() throws Exception { + void queryMethodDefinitionsByClassName() throws Exception { @@ -56507,7 +56507,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -332,7 +332,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryByClassNameAndMethodName() throws Exception { + void queryByClassNameAndMethodName() throws Exception { @@ -56516,7 +56516,7 @@ + "//METHOD_DEF[./IDENT[@text='getSomeMethod']]"; @@ -349,7 +349,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryClassDefinitionByClassName() throws Exception { + void queryClassDefinitionByClassName() throws Exception { @@ -56525,7 +56525,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -364,7 +364,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryWrongClassName() throws Exception { + void queryWrongClassName() throws Exception { @@ -56534,7 +56534,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -372,7 +372,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryWrongXpath() throws Exception { + void queryWrongXpath() throws Exception { @@ -56543,7 +56543,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -380,7 +380,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAncestor() throws Exception { + void queryAncestor() throws Exception { @@ -56552,7 +56552,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -394,7 +394,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAncestorOrSelf() throws Exception { + void queryAncestorOrSelf() throws Exception { @@ -56561,7 +56561,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -413,7 +413,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryDescendant() throws Exception { + void queryDescendant() throws Exception { @@ -56570,7 +56570,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -421,7 +421,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryDescendantOrSelf() throws Exception { + void queryDescendantOrSelf() throws Exception { @@ -56579,7 +56579,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -441,7 +441,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryNoChild() throws Exception { + void queryNoChild() throws Exception { @@ -56588,7 +56588,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -449,7 +449,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryNoDescendant() throws Exception { + void queryNoDescendant() throws Exception { @@ -56597,7 +56597,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -457,7 +457,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryRootNotImplementedAxis() throws Exception { + void queryRootNotImplementedAxis() throws Exception { @@ -56606,7 +56606,7 @@ try { @@ -471,7 +471,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementNotImplementedAxis() throws Exception { + void queryElementNotImplementedAxis() throws Exception { @@ -56615,7 +56615,7 @@ try { @@ -485,7 +485,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQuerySelf() throws Exception { + void querySelf() throws Exception { @@ -56624,7 +56624,7 @@ final List objectNodes = getXpathItems(objectXpath, rootNode); @@ -502,7 +502,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryNonExistentAttribute() throws Exception { + void queryNonExistentAttribute() throws Exception { @@ -56633,7 +56633,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -513,7 +513,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryRootSelf() throws Exception { + void queryRootSelf() throws Exception { @@ -56642,7 +56642,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -521,7 +521,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryAnnotation() throws Exception { + void queryAnnotation() throws Exception { @@ -56651,7 +56651,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -535,7 +535,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryNonExistentAnnotation() throws Exception { + void queryNonExistentAnnotation() throws Exception { @@ -56660,7 +56660,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -543,7 +543,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryEnumDef() throws Exception { + void queryEnumDef() throws Exception { @@ -56669,7 +56669,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, enumRootNode)); @@ -555,7 +555,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryEnumElementsNumber() throws Exception { + void queryEnumElementsNumber() throws Exception { @@ -56678,7 +56678,7 @@ final List nodes = getXpathItems(xpath, enumRootNode); @@ -563,7 +563,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryEnumElementByName() throws Exception { + void queryEnumElementByName() throws Exception { @@ -56687,7 +56687,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, enumRootNode)); @@ -579,7 +579,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryInterfaceDef() throws Exception { + void queryInterfaceDef() throws Exception { @@ -56696,7 +56696,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, interfaceRootNode)); @@ -591,7 +591,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryInterfaceMethodDefNumber() throws Exception { + void queryInterfaceMethodDefNumber() throws Exception { @@ -56705,7 +56705,7 @@ final List nodes = getXpathItems(xpath, interfaceRootNode); @@ -599,7 +599,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryInterfaceParameterDef() throws Exception { + void queryInterfaceParameterDef() throws Exception { @@ -56714,7 +56714,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, interfaceRootNode)); @@ -614,7 +614,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testIdent() throws Exception { + void ident() throws Exception { @@ -56723,7 +56723,7 @@ final List nodes = getXpathItems(xpath, rootNode); @@ -629,7 +629,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testIdentByText() throws Exception { + void identByText() throws Exception { @@ -56732,7 +56732,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -648,7 +648,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testNumVariableByItsValue() throws Exception { + void numVariableByItsValue() throws Exception { @@ -56741,7 +56741,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -664,7 +664,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testStringVariableByItsValue() throws Exception { + void stringVariableByItsValue() throws Exception { @@ -56750,7 +56750,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -682,7 +682,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testSameNodesByNameAndByText() throws Exception { + void sameNodesByNameAndByText() throws Exception { @@ -56759,7 +56759,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -692,7 +692,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodDefByAnnotationValue() throws Exception { + void methodDefByAnnotationValue() throws Exception { @@ -56768,7 +56768,7 @@ + " and .//*[@text='good']]]"; @@ -709,7 +709,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testFirstImport() throws Exception { + void firstImport() throws Exception { @@ -56777,7 +56777,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -721,7 +721,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testSecondImport() throws Exception { + void secondImport() throws Exception { @@ -56786,7 +56786,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -734,7 +734,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testThirdImport() throws Exception { + void thirdImport() throws Exception { @@ -56795,7 +56795,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -748,7 +748,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testLastImport() throws Exception { + void lastImport() throws Exception { @@ -56804,7 +56804,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -768,7 +768,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testFirstCaseGroup() throws Exception { + void firstCaseGroup() throws Exception { @@ -56813,7 +56813,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" @@ -788,7 +788,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testSecondCaseGroup() throws Exception { + void secondCaseGroup() throws Exception { @@ -56822,7 +56822,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" @@ -809,7 +809,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testThirdCaseGroup() throws Exception { + void thirdCaseGroup() throws Exception { @@ -56831,7 +56831,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" @@ -831,7 +831,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testFourthCaseGroup() throws Exception { + void fourthCaseGroup() throws Exception { @@ -56840,7 +56840,7 @@ + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" @@ -854,7 +854,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementFollowingSibling() throws Exception { + void queryElementFollowingSibling() throws Exception { @@ -56849,7 +56849,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -873,7 +873,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementNoFollowingSibling() throws Exception { + void queryElementNoFollowingSibling() throws Exception { @@ -56858,7 +56858,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -881,7 +881,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementFollowingSiblingRcurly() throws Exception { + void queryElementFollowingSiblingRcurly() throws Exception { @@ -56867,7 +56867,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -897,7 +897,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementFollowing() throws Exception { + void queryElementFollowing() throws Exception { @@ -56876,7 +56876,7 @@ final List actual = getXpathItems(xpath, rootNode); @@ -907,7 +907,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementFollowingTwo() throws Exception { + void queryElementFollowingTwo() throws Exception { @@ -56885,7 +56885,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -928,7 +928,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementFollowingMethodDef() throws Exception { + void queryElementFollowingMethodDef() throws Exception { @@ -56894,7 +56894,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -948,7 +948,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementNoFollowing() throws Exception { + void queryElementNoFollowing() throws Exception { @@ -56903,7 +56903,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -956,7 +956,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementPrecedingSibling() throws Exception { + void queryElementPrecedingSibling() throws Exception { @@ -56912,7 +56912,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -977,7 +977,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementPrecedingSiblingVariableDef() throws Exception { + void queryElementPrecedingSiblingVariableDef() throws Exception { @@ -56921,7 +56921,7 @@ final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); @@ -996,7 +996,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementPrecedingSiblingArray() throws Exception { + void queryElementPrecedingSiblingArray() throws Exception { @@ -56930,7 +56930,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -1014,7 +1014,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementPrecedingOne() throws Exception { + void queryElementPrecedingOne() throws Exception { @@ -56939,7 +56939,7 @@ final DetailAST[] actual = @@ -1023,7 +1023,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementPrecedingTwo() throws Exception { + void queryElementPrecedingTwo() throws Exception { @@ -56948,7 +56948,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -1038,7 +1038,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQueryElementPrecedingLiteralPublic() throws Exception { + void queryElementPrecedingLiteralPublic() throws Exception { @@ -56957,7 +56957,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -1052,7 +1052,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testTextBlockByItsValue() throws Exception { + void textBlockByItsValue() throws Exception { @@ -56966,7 +56966,7 @@ + "[@text='\\n &1line\\n >2line\\n <3line\\n ']]"; @@ -1071,7 +1071,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testQuerySingleLineCommentByCommentContent() throws Exception { + void querySingleLineCommentByCommentContent() throws Exception { @@ -56975,7 +56975,7 @@ final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); @@ -1085,7 +1085,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { } - + @Test - public void testManyNestedNodes() throws Exception { + void manyNestedNodes() throws Exception { @@ -56985,9 +56985,9 @@ --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGeneratorTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGeneratorTest.java @@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.xpath; - + import static com.google.common.truth.Truth.assertWithMessage; - + +import com.google.common.collect.ImmutableList; import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; import com.puppycrawl.tools.checkstyle.JavaParser; @@ -57000,15 +57000,15 @@ import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; - + -public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { +final class XpathQueryGeneratorTest extends AbstractModuleTestSupport { - + private static final int DEFAULT_TAB_WIDTH = 4; - + @@ -51,14 +51,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @BeforeEach - public void init() throws Exception { + void init() throws Exception { @@ -57016,7 +57016,7 @@ fileText = new FileText(file, StandardCharsets.UTF_8.name()); rootAst = JavaParser.parseFile(file, JavaParser.Options.WITH_COMMENTS); } - + @Test - public void testClassDef() { + void classDef() { @@ -57025,7 +57025,7 @@ final XpathQueryGenerator queryGenerator = @@ -76,7 +76,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testMethodDef() { + void methodDef() { @@ -57034,7 +57034,7 @@ final XpathQueryGenerator queryGenerator = @@ -96,7 +96,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testVariableDef() { + void variableDef() { @@ -57043,7 +57043,7 @@ final XpathQueryGenerator queryGenerator = @@ -126,14 +126,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testLcurly() { + void lcurly() { @@ -57060,7 +57060,7 @@ assertWithMessage("Generated queries do not match expected ones") @@ -142,14 +142,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testRcurly() { + void rcurly() { @@ -57077,7 +57077,7 @@ assertWithMessage("Generated queries do not match expected ones") @@ -158,7 +158,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testExpr() { + void expr() { @@ -57086,7 +57086,7 @@ final XpathQueryGenerator queryGenerator = @@ -176,14 +176,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testLparen() { + void lparen() { @@ -57103,7 +57103,7 @@ assertWithMessage("Generated queries do not match expected ones") @@ -192,7 +192,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testEmpty() { + void empty() { @@ -57112,7 +57112,7 @@ final XpathQueryGenerator queryGenerator = @@ -202,7 +202,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testPackage() { + void testPackage() { @@ -57121,7 +57121,7 @@ final XpathQueryGenerator queryGenerator = @@ -216,21 +216,21 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testImport() { + void testImport() { @@ -57137,7 +57137,7 @@ .that(actual) .isEqualTo(expected); } - + @Test - public void testMethodParams() { + void methodParams() { @@ -57146,7 +57146,7 @@ final XpathQueryGenerator queryGenerator = @@ -262,14 +262,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitch() { + void testSwitch() { @@ -57163,7 +57163,7 @@ assertWithMessage("Generated queries do not match expected ones") @@ -278,7 +278,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testSwitchCase() { + void switchCase() { @@ -57172,7 +57172,7 @@ final XpathQueryGenerator queryGenerator = @@ -298,7 +298,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testVariableStringLiteral() { + void variableStringLiteral() { @@ -57181,7 +57181,7 @@ final XpathQueryGenerator queryGenerator = @@ -320,14 +320,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testComma() { + void comma() { @@ -57198,7 +57198,7 @@ + "./IDENT[@text='foo']]/SLIST/LITERAL_FOR/FOR_ITERATOR/ELIST/COMMA"); @@ -337,7 +337,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testLiteralVoid() { + void literalVoid() { @@ -57207,7 +57207,7 @@ final XpathQueryGenerator queryGenerator = @@ -355,42 +355,42 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testFirstImport() { + void firstImport() { @@ -57223,7 +57223,7 @@ .that(actual) .isEqualTo(expected); } - + @Test - public void testLastImport() { + void lastImport() { @@ -57239,7 +57239,7 @@ .that(actual) .isEqualTo(expected); } - + @Test - public void testImportByText() { + void importByText() { @@ -57256,7 +57256,7 @@ .that(actual) @@ -398,22 +398,21 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testIdent() { + void ident() { @@ -57273,7 +57273,7 @@ .that(actual) .isEqualTo(expected); } - + @Test - public void testTabWidthBeforeMethodDef() throws Exception { + void tabWidthBeforeMethodDef() throws Exception { @@ -57282,7 +57282,7 @@ final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); @@ -440,7 +439,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testTabWidthAfterVoidLiteral() throws Exception { + void tabWidthAfterVoidLiteral() throws Exception { @@ -57291,7 +57291,7 @@ final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); @@ -464,7 +463,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testTabWidthBeforeSlist() throws Exception { + void tabWidthBeforeSlist() throws Exception { @@ -57309,7 +57309,7 @@ + "/METHOD_DEF[./IDENT[@text='tabAfterMe']]/SLIST"); @@ -485,7 +484,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testTabWidthEndOfLine() throws Exception { + void tabWidthEndOfLine() throws Exception { @@ -57327,7 +57327,7 @@ assertWithMessage("Generated queries do not match expected ones") @@ -505,7 +504,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testClassDefWithTokenType() { + void classDefWithTokenType() { @@ -57345,7 +57345,7 @@ .that(actual) .isEqualTo(expected); } - + @Test - public void testConstructorWithTreeWalkerAuditEvent() { + void constructorWithTreeWalkerAuditEvent() { @@ -57354,7 +57354,7 @@ final TreeWalkerAuditEvent event = @@ -541,7 +539,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testEscapeCharacters() throws Exception { + void escapeCharacters() throws Exception { @@ -57363,7 +57363,7 @@ final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); @@ -589,7 +587,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testTextBlocks() throws Exception { + void textBlocks() throws Exception { @@ -57381,7 +57381,7 @@ + "VARIABLE_DEF[./IDENT[@text='testOne']]/ASSIGN/EXPR/" @@ -613,7 +611,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testTextBlocksWithNewLine() throws Exception { + void textBlocksWithNewLine() throws Exception { @@ -57399,7 +57399,7 @@ + "VARIABLE_DEF[./IDENT[@text='testOne']]/ASSIGN/EXPR/" @@ -638,7 +636,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testTextBlocksWithNewCrlf() throws Exception { + void textBlocksWithNewCrlf() throws Exception { @@ -57417,7 +57417,7 @@ + "VARIABLE_DEF[./IDENT[@text='testOne']]/ASSIGN/EXPR/" @@ -664,7 +662,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testXpath() throws Exception { + void xpath() throws Exception { @@ -57435,7 +57435,7 @@ + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Foo3']]/OBJBLOCK/COMMA[2]"); @@ -686,7 +684,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testXpath2() throws Exception { + void xpath2() throws Exception { @@ -57453,7 +57453,7 @@ assertWithMessage("Generated queries do not match expected ones") @@ -707,7 +705,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { } - + @Test - public void testXpath3() throws Exception { + void xpath3() throws Exception { @@ -57465,133 +57465,133 @@ @@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f import net.sf.saxon.om.NodeInfo; import org.junit.jupiter.api.Test; - + -public class DescendantIteratorTest { +final class DescendantIteratorTest { - + @Test - public void testIncludeSelf() { + void includeSelf() { final NodeInfo startNode = findNode("CLASS_DEF"); - + try (DescendantIterator iterator = @@ -46,7 +46,7 @@ public class DescendantIteratorTest { } - + @Test - public void testWithoutSelf() { + void withoutSelf() { final NodeInfo startNode = findNode("CLASS_DEF"); - + try (DescendantIterator iterator = @@ -62,7 +62,7 @@ public class DescendantIteratorTest { } - + @Test - public void testWithNull() { + void withNull() { final NodeInfo startNode = findNode("CLASS_DEF"); - + try (DescendantIterator iterator = new DescendantIterator(startNode, null)) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/FollowingIteratorTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/FollowingIteratorTest.java @@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f import net.sf.saxon.om.NodeInfo; import org.junit.jupiter.api.Test; - + -public class FollowingIteratorTest { +final class FollowingIteratorTest { - + @Test - public void testFollowingSibling() { + void followingSibling() { final NodeInfo startNode = findNode("ANNOTATIONS"); - + try (FollowingIterator iterator = new FollowingIterator(startNode)) { @@ -45,7 +45,7 @@ public class FollowingIteratorTest { } - + @Test - public void testNoSibling() { + void noSibling() { final NodeInfo startNode = findNode("CLASS_DEF"); - + try (FollowingIterator iterator = new FollowingIterator(startNode)) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/PrecedingIteratorTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/PrecedingIteratorTest.java @@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f import net.sf.saxon.om.NodeInfo; import org.junit.jupiter.api.Test; - + -public class PrecedingIteratorTest { +final class PrecedingIteratorTest { - + @Test - public void testPrecedingNodes() { + void precedingNodes() { final NodeInfo startNode = findNode("SLIST"); - + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { @@ -47,7 +47,7 @@ public class PrecedingIteratorTest { } - + @Test - public void testNoParent() { + void noParent() { final NodeInfo startNode = findNode("ROOT"); - + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { @@ -56,7 +56,7 @@ public class PrecedingIteratorTest { } - + @Test - public void testReverseOrderOfDescendants() { + void reverseOrderOfDescendants() { final NodeInfo startNode = findNode("RCURLY"); - + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { @@ -75,7 +75,7 @@ public class PrecedingIteratorTest { } - + @Test - public void testNoSibling() { + void noSibling() { final NodeInfo startNode = findNode("ANNOTATIONS"); - + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseDescendantIteratorTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseDescendantIteratorTest.java @@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f import net.sf.saxon.om.NodeInfo; import org.junit.jupiter.api.Test; - + -public class ReverseDescendantIteratorTest { +final class ReverseDescendantIteratorTest { - + @Test - public void testCorrectOrder() { + void correctOrder() { final NodeInfo startNode = findNode("CLASS_DEF"); - + try (ReverseDescendantIterator iterator = new ReverseDescendantIterator(startNode)) { --- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseListIteratorTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseListIteratorTest.java @@ -31,10 +31,10 @@ import net.sf.saxon.om.NodeInfo; import net.sf.saxon.om.TreeInfo; import org.junit.jupiter.api.Test; - + -public class ReverseListIteratorTest { +final class ReverseListIteratorTest { - + @Test - public void testCorrectOrder() { + void correctOrder() { final List nodes = Arrays.asList(new TestNode(), new TestNode(), new TestNode()); - + try (ReverseListIterator iterator = new ReverseListIterator(nodes)) { @@ -46,7 +46,7 @@ public class ReverseListIteratorTest { } - + @Test - public void testNullList() { + void nullList() { @@ -57603,14 +57603,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck.MSG_KEY import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ArrayTypeStyleCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ArrayTypeStyleCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/arraytypestyle"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -57619,7 +57619,7 @@ }; @@ -40,7 +40,7 @@ public class ArrayTypeStyleCheckExamplesTest extends AbstractExamplesModuleTestS } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -57631,7 +57631,7 @@ @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharacte import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AvoidEscapedUnicodeCharactersCheckExamplesTest +final class AvoidEscapedUnicodeCharactersCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -57639,7 +57639,7 @@ protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -57648,7 +57648,7 @@ "18:24: " + getCheckMessage(MSG_KEY), @@ -45,7 +45,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -57657,7 +57657,7 @@ "20:24: " + getCheckMessage(MSG_KEY), @@ -57,7 +57,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -57666,7 +57666,7 @@ "20:24: " + getCheckMessage(MSG_KEY), @@ -69,7 +69,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -57675,7 +57675,7 @@ "22:24: " + getCheckMessage(MSG_KEY), @@ -80,7 +80,7 @@ public class AvoidEscapedUnicodeCharactersCheckExamplesTest } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -57686,7 +57686,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckExamplesTest.java @@ -24,119 +24,119 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class DescendantTokenCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class DescendantTokenCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -57694,138 +57694,138 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/descendanttoken"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), expected); } - + @Test - public void testExample12() throws Exception { + void example12() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example12.txt"), expected); } - + @Test - public void testExample13() throws Exception { + void example13() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example13.txt"), expected); } - + @Test - public void testExample14() throws Exception { + void example14() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example14.txt"), expected); } - + @Test - public void testExample15() throws Exception { + void example15() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example15.txt"), expected); } - + @Test - public void testExample16() throws Exception { + void example16() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example16.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class FinalParametersCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class FinalParametersCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -57833,50 +57833,50 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/finalparameters"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckExamplesTest.java @@ -26,21 +26,21 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/newlineatendoffile"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("Example1.java"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -57885,7 +57885,7 @@ }; @@ -49,7 +49,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -57894,7 +57894,7 @@ }; @@ -58,7 +58,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -57903,7 +57903,7 @@ }; @@ -67,7 +67,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -57912,18 +57912,18 @@ }; @@ -76,7 +76,7 @@ public class NewlineAtEndOfFileCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NoCodeInFileCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoCodeInFileCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -57931,26 +57931,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/nocodeinfile"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class OrderedPropertiesCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class OrderedPropertiesCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -57958,18 +57958,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/orderedproperties"; } - + @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/OuterTypeFilenameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckExamplesTest.java @@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class OuterTypeFilenameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class OuterTypeFilenameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -57977,50 +57977,50 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/outertypefilename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class TodoCommentCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class TodoCommentCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -58028,26 +58028,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/todocomment"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; 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 { @@ -58055,42 +58055,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/trailingcomment"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class TranslationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class TranslationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -58098,34 +58098,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/translation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UncommentedMainCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UncommentedMainCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -58133,26 +58133,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/uncommentedmain"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UniquePropertiesCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UniquePropertiesCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -58160,42 +58160,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/uniqueproperties"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.MSG_KEY; import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class UpperEllCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UpperEllCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/upperell"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58207,14 +58207,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocati import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSupport { +final class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/annotationlocation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58223,15 +58223,15 @@ "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), @@ -42,14 +42,14 @@ public class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.java"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58240,7 +58240,7 @@ "26:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Override"), @@ -61,7 +61,7 @@ public class AnnotationLocationExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -58252,14 +58252,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationOnSame import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AnnotationOnSameLineCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AnnotationOnSameLineCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/annotationonsameline"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58268,7 +58268,7 @@ "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Override"), @@ -43,7 +43,7 @@ public class AnnotationOnSameLineCheckExamplesTest extends AbstractExamplesModul } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58280,14 +58280,14 @@ @@ -28,14 +28,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseSty import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AnnotationUseStyleCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AnnotationUseStyleCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/annotationusestyle"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58296,7 +58296,7 @@ "26:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_PRESENT), @@ -46,7 +46,7 @@ public class AnnotationUseStyleCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58305,7 +58305,7 @@ "19:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "EXPANDED"), @@ -58,7 +58,7 @@ public class AnnotationUseStyleCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58314,7 +58314,7 @@ "25:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT"), @@ -69,7 +69,7 @@ public class AnnotationUseStyleCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -58326,14 +58326,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MissingDeprecatedCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingDeprecatedCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/missingdeprecated"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58342,7 +58342,7 @@ }; @@ -41,7 +41,7 @@ public class MissingDeprecatedCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58354,15 +58354,15 @@ @@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.MissingOverrideC import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MissingOverrideCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingOverrideCheckExamplesTest extends AbstractExamplesModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class MissingOverrideCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58371,7 +58371,7 @@ "33:3: " + getCheckMessage(MSG_KEY_TAG_NOT_VALID_ON, "{@inheritDoc}"), @@ -43,7 +43,7 @@ public class MissingOverrideCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58383,14 +58383,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotatio import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class PackageAnnotationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class PackageAnnotationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/packageannotation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58399,34 +58399,34 @@ }; @@ -40,14 +40,14 @@ public class PackageAnnotationCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.java"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("example3/package-info.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarnings import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SuppressWarningsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressWarningsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/suppresswarnings"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58435,7 +58435,7 @@ "16:21: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, ""), @@ -41,7 +41,7 @@ public class SuppressWarningsCheckExamplesTest extends AbstractExamplesModuleTes } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58447,14 +58447,14 @@ @@ -27,14 +27,14 @@ import com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck; import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck; import org.junit.jupiter.api.Test; - + -public class SuppressWarningsHolderExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressWarningsHolderExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/annotation/suppresswarningsholder"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58463,7 +58463,7 @@ final String[] expected = { @@ -55,7 +55,7 @@ public class SuppressWarningsHolderExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58475,14 +58475,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksChe import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AvoidNestedBlocksCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidNestedBlocksCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/blocks/avoidnestedblocks"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58491,7 +58491,7 @@ "23:15: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), @@ -41,7 +41,7 @@ public class AvoidNestedBlocksCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58503,14 +58503,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck.MSG_ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58519,7 +58519,7 @@ "17:9: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "try"), @@ -42,7 +42,7 @@ public class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58528,7 +58528,7 @@ }; @@ -51,7 +51,7 @@ public class EmptyBlockCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58540,14 +58540,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/blocks/emptycatchblock"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58556,7 +58556,7 @@ "31:34: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), @@ -41,7 +41,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58565,7 +58565,7 @@ }; @@ -50,7 +50,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58574,7 +58574,7 @@ "25:39: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), @@ -61,7 +61,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -58583,7 +58583,7 @@ }; @@ -70,7 +70,7 @@ public class EmptyCatchBlockCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -58595,14 +58595,14 @@ @@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck.MSG_K import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class LeftCurlyCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LeftCurlyCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/blocks/leftcurly"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58611,7 +58611,7 @@ "15:3: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", "3"), @@ -43,7 +43,7 @@ public class LeftCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppor } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58620,7 +58620,7 @@ }; @@ -52,7 +52,7 @@ public class LeftCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppor } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58629,7 +58629,7 @@ "22:13: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", "13"), @@ -62,7 +62,7 @@ public class LeftCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppor } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -58641,14 +58641,14 @@ @@ -25,14 +25,14 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/blocks/needbraces"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58657,7 +58657,7 @@ "24:7: " + getCheckMessage(MSG_KEY_NEED_BRACES, "else"), @@ -47,7 +47,7 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58666,7 +58666,7 @@ "26:7: " + getCheckMessage(MSG_KEY_NEED_BRACES, "else"), @@ -57,7 +57,7 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58675,15 +58675,15 @@ "40:5: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), @@ -67,14 +67,14 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("Example4.java"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -58692,7 +58692,7 @@ }; @@ -83,7 +83,7 @@ public class NeedBracesCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { @@ -58704,14 +58704,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck.MSG_ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/blocks/rightcurly"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58720,7 +58720,7 @@ "32:23: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "23"), @@ -43,7 +43,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58729,7 +58729,7 @@ "43:47: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", "47"), @@ -53,7 +53,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -58738,7 +58738,7 @@ }; @@ -62,7 +62,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -58747,7 +58747,7 @@ }; @@ -71,7 +71,7 @@ public class RightCurlyCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -58759,14 +58759,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCh import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/arraytrailingcomma"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58775,7 +58775,7 @@ }; @@ -40,7 +40,7 @@ public class ArrayTrailingCommaCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -58786,7 +58786,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidDoubleBraceInitializationCheckExamplesTest +final class AvoidDoubleBraceInitializationCheckExamplesTest @@ -58795,26 +58795,26 @@ protected String getPackageLocation() { @@ -32,14 +32,14 @@ public class AvoidDoubleBraceInitializationCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; 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 { @@ -58822,18 +58822,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/avoidinlineconditionals"; } - + @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/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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AvoidNoArgumentSuperConstructorCallCheckExamplesTest +final class AvoidNoArgumentSuperConstructorCallCheckExamplesTest @@ -58842,18 +58842,18 @@ protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class AvoidNoArgumentSuperConstructorCallCheckExamplesTest } - + @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; 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 { @@ -58861,42 +58861,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/covariantequals"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), 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; 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 { @@ -58904,34 +58904,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/declarationorder"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- 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; 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 { @@ -58939,34 +58939,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/defaultcomeslast"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck. import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyStatementCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyStatementCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/emptystatement"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -58977,7 +58977,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class EqualsAvoidNullCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class EqualsAvoidNullCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -58985,26 +58985,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/equalsavoidnull"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -59012,18 +59012,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/equalshashcode"; } - + @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/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; 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 { @@ -59031,35 +59031,35 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/explicitinitialization"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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 import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class FallThroughCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class FallThroughCheckExamplesTest extends AbstractExamplesModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class FallThroughCheckExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -59068,7 +59068,7 @@ }; @@ -42,7 +42,7 @@ public class FallThroughCheckExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -59077,7 +59077,7 @@ "34:9: " + getCheckMessage(MSG_FALL_THROUGH), @@ -53,7 +53,7 @@ public class FallThroughCheckExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -59088,51 +59088,51 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; 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 } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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; 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 { @@ -59140,66 +59140,66 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/hiddenfield"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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/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; 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 { @@ -59207,26 +59207,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/illegalcatch"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; 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 { @@ -59234,34 +59234,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/illegalinstantiation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), 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; 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 { @@ -59269,42 +59269,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/illegalthrows"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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; 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 { @@ -59312,34 +59312,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/illegaltoken"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextChec import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/illegaltokentext"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -59348,7 +59348,7 @@ }; @@ -40,7 +40,7 @@ public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTes } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -59357,7 +59357,7 @@ "19:20: " + getCheckMessage(MSG_KEY, "a href"), @@ -50,7 +50,7 @@ public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTes } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -59366,7 +59366,7 @@ }; @@ -59,7 +59,7 @@ public class IllegalTokenTextCheckExamplesTest extends AbstractExamplesModuleTes } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -59377,7 +59377,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59385,74 +59385,74 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/illegaltype"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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/coding/InnerAssignmentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class InnerAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InnerAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/innerassignment"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -59463,7 +59463,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckExamplesTest.java @@ -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") -public class MagicNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MagicNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59471,58 +59471,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/magicnumber"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -59530,42 +59530,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/matchxpath"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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; 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 { @@ -59573,18 +59573,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/missingctor"; } - + @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/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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MissingSwitchDefaultCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingSwitchDefaultCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59592,34 +59592,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -59627,26 +59627,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/modifiedcontrolvariable"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MultipleStringLiteralsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MultipleStringLiteralsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59654,42 +59654,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/multiplestringliterals"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MultipleVariableDeclarationsCheckExamplesTest +final class MultipleVariableDeclarationsCheckExamplesTest @@ -59698,18 +59698,18 @@ protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class MultipleVariableDeclarationsCheckExamplesTest } - + @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/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; 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 { @@ -59717,26 +59717,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/nestedfordepth"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NestedIfDepthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NestedIfDepthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59744,42 +59744,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/nestedifdepth"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckExamplesTest.java @@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NestedTryDepthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class NestedTryDepthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59787,50 +59787,50 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/nestedtrydepth"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -59838,18 +59838,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/noarraytrailingcomma"; } - + @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/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; 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 { @@ -59857,18 +59857,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/noclone"; } - + @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/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; 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 { @@ -59876,18 +59876,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/noenumtrailingcomma"; } - + @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/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; 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 { @@ -59895,18 +59895,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/nofinalizer"; } - + @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/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; 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 { @@ -59914,26 +59914,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/onestatementperline"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class OverloadMethodsDeclarationOrderCheckExamplesTest +final class OverloadMethodsDeclarationOrderCheckExamplesTest @@ -59942,26 +59942,26 @@ protected String getPackageLocation() { @@ -32,14 +32,14 @@ public class OverloadMethodsDeclarationOrderCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class PackageDeclarationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class PackageDeclarationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -59969,34 +59969,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/packagedeclaration"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentC import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ParameterAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ParameterAssignmentCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/parameterassignment"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60007,7 +60007,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckExamplesTest.java @@ -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") -public class RequireThisCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RequireThisCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60015,58 +60015,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/requirethis"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -60074,50 +60074,50 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/returncount"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- 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; 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 { @@ -60125,18 +60125,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/simplifybooleanexpression"; } - + @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/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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SimplifyBooleanReturnCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SimplifyBooleanReturnCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60144,18 +60144,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/simplifybooleanreturn"; } - + @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/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; 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 { @@ -60163,27 +60163,27 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/stringliteralequality"; } - + @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/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 import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SuperCloneCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuperCloneCheckExamplesTest extends AbstractExamplesModuleTestSupport { - + @Override protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class SuperCloneCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60194,7 +60194,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; 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 { @@ -60202,18 +60202,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/superfinalize"; } - + @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/UnnecessaryParenthesesCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessaryParenthesesCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UnnecessaryParenthesesCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60221,26 +60221,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/unnecessaryparentheses"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest +final class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest @@ -60249,26 +60249,26 @@ protected String getPackageLocation() { @@ -33,14 +33,14 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest +final class UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest @@ -60277,18 +60277,18 @@ protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckExamplesTest } - + @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/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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonInEnumerationCheckExamplesTest +final class UnnecessarySemicolonInEnumerationCheckExamplesTest @@ -60297,26 +60297,26 @@ protected String getPackageLocation() { @@ -32,14 +32,14 @@ public class UnnecessarySemicolonInEnumerationCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest +final class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest @@ -60325,26 +60325,26 @@ protected String getPackageLocation() { @@ -33,14 +33,14 @@ public class UnnecessarySemicolonInTryWithResourcesCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; 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 { @@ -60352,18 +60352,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/coding/unusedlocalvariable"; } - + @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/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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class VariableDeclarationUsageDistanceCheckExamplesTest +final class VariableDeclarationUsageDistanceCheckExamplesTest @@ -60372,50 +60372,50 @@ protected String getPackageLocation() { @@ -32,35 +32,35 @@ public class VariableDeclarationUsageDistanceCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- 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; 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 { @@ -60423,50 +60423,50 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/designforextension"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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_ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class FinalClassCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class FinalClassCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/finalclass"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60477,7 +60477,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckExamplesTest.java @@ -24,15 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class HideUtilityClassConstructorCheckExamplesTest - extends AbstractExamplesModuleTestSupport { @@ -60486,18 +60486,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/hideutilityclassconstructor"; } - + @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/design/InnerTypeLastCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class InnerTypeLastCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InnerTypeLastCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60505,26 +60505,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/innertypelast"; } - + @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/design/InterfaceIsTypeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class InterfaceIsTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InterfaceIsTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/interfaceistype"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60533,7 +60533,7 @@ }; @@ -40,7 +40,7 @@ public class InterfaceIsTypeCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -60544,7 +60544,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; 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 { @@ -60552,34 +60552,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/mutableexception"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- 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; 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 { @@ -60587,26 +60587,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/onetoplevelclass"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ThrowsCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ThrowsCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60614,42 +60614,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/throwscount"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheckExamplesTest.java @@ -25,14 +25,14 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/design/visibilitymodifier"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60658,7 +60658,7 @@ "25:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -50,7 +50,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -60667,7 +60667,7 @@ "30:14: " + getCheckMessage(MSG_KEY, "field3"), @@ -65,7 +65,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -60676,7 +60676,7 @@ "30:14: " + getCheckMessage(MSG_KEY, "field3"), @@ -82,7 +82,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -60685,7 +60685,7 @@ "27:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -101,7 +101,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -60694,7 +60694,7 @@ "27:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -119,7 +119,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { @@ -60703,7 +60703,7 @@ "30:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -137,7 +137,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample7() throws Exception { + void example7() throws Exception { @@ -60712,7 +60712,7 @@ "30:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -155,7 +155,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { @@ -60721,7 +60721,7 @@ "28:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -172,7 +172,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { @@ -60730,7 +60730,7 @@ "25:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -190,7 +190,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { @@ -60739,7 +60739,7 @@ "27:20: " + getCheckMessage(MSG_KEY, "field2"), @@ -208,7 +208,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { @@ -60748,18 +60748,18 @@ "24:37: " + getCheckMessage(MSG_KEY, "includes"), @@ -221,7 +221,7 @@ public class VisibilityModifierCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample12() throws Exception { + void example12() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("Example12.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class HeaderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class HeaderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60767,34 +60767,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/header/header"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckExamplesTest.java @@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RegexpHeaderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RegexpHeaderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60802,58 +60802,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/header/regexpheader"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportChec import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/avoidstarimport"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60862,7 +60862,7 @@ "14:29: " + getCheckMessage(MSG_KEY, "java.lang.Math.*"), @@ -43,7 +43,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -60871,7 +60871,7 @@ }; @@ -52,7 +52,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -60880,7 +60880,7 @@ }; @@ -61,7 +61,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -60889,7 +60889,7 @@ "17:17: " + getCheckMessage(MSG_KEY, "java.util.*"), @@ -72,7 +72,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -60898,7 +60898,7 @@ }; @@ -81,7 +81,7 @@ public class AvoidStarImportCheckExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { @@ -60910,14 +60910,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCh import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AvoidStaticImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AvoidStaticImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/avoidstaticimport"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -60926,7 +60926,7 @@ "13:31: " + getCheckMessage(MSG_KEY, "java.lang.System.*"), @@ -41,7 +41,7 @@ public class AvoidStaticImportCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -60937,7 +60937,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckExamplesTest.java @@ -24,112 +24,112 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class CustomImportOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class CustomImportOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -60945,130 +60945,130 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/customimportorder"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), expected); } - + @Test - public void testExample12() throws Exception { + void example12() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example12.txt"), expected); } - + @Test - public void testExample13() throws Exception { + void example13() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example13.txt"), expected); } - + @Test - public void testExample14() throws Exception { + void example14() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example14.txt"), expected); } - + @Test - public void testExample15() throws Exception { + void example15() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example15.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheckExamplesTest.java @@ -24,70 +24,70 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61076,82 +61076,82 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/illegalimport"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckExamplesTest.java @@ -24,91 +24,91 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ImportOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ImportOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61159,114 +61159,114 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/importorder"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), expected); } - + @Test - public void testExample12() throws Exception { + void example12() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example12.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckExamplesTest.java @@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportChec import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class RedundantImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RedundantImportCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/redundantimport"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -61278,14 +61278,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck. import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/imports/unusedimports"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -61294,7 +61294,7 @@ "22:8: " + getCheckMessage(MSG_KEY, "java.util.Map"), @@ -41,7 +41,7 @@ public class UnusedImportsCheckExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -61305,7 +61305,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckExamplesTest.java @@ -24,77 +24,77 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class CommentsIndentationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class CommentsIndentationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61313,90 +61313,90 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/indentation/commentsindentation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckExamplesTest.java @@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IndentationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IndentationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61404,42 +61404,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/indentation/indentation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -61447,26 +61447,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder"; } - + @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/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 import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class InvalidJavadocPositionCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InvalidJavadocPositionCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/invalidjavadocposition"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -61478,49 +61478,49 @@ @@ -22,28 +22,28 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class JavadocBlockTagLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocBlockTagLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocblocktaglocation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.java"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.java"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckExamplesTest.java @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocContentLocat import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class JavadocContentLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocContentLocationCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadoccontentlocation"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -61529,7 +61529,7 @@ }; @@ -41,7 +41,7 @@ public class JavadocContentLocationCheckExamplesTest extends AbstractExamplesMod } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -61540,7 +61540,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocMethodCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocMethodCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61548,66 +61548,66 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocmethod"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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/javadoc/JavadocMissingLeadingAsteriskCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingLeadingAsteriskCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocMissingLeadingAsteriskCheckExamplesTest +final class JavadocMissingLeadingAsteriskCheckExamplesTest @@ -61616,18 +61616,18 @@ protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class JavadocMissingLeadingAsteriskCheckExamplesTest } - + @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/javadoc/JavadocMissingWhitespaceAfterAsteriskCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingWhitespaceAfterAsteriskCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocMissingWhitespaceAfterAsteriskCheckExamplesTest +final class JavadocMissingWhitespaceAfterAsteriskCheckExamplesTest @@ -61636,18 +61636,18 @@ protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckExamplesTest } - + @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/javadoc/JavadocPackageCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocPackageCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocPackageCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61655,18 +61655,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocpackage"; } - + @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/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; 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 { @@ -61674,26 +61674,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocparagraph"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocStyleCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocStyleCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61701,58 +61701,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocstyle"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocTagContinuationIndentationCheckExamplesTest +final class JavadocTagContinuationIndentationCheckExamplesTest @@ -61761,34 +61761,34 @@ protected String getPackageLocation() { @@ -32,21 +32,21 @@ public class JavadocTagContinuationIndentationCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckExamplesTest.java @@ -24,63 +24,63 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class JavadocTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class JavadocTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61796,74 +61796,74 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadoctype"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -61871,42 +61871,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocvariable"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MissingJavadocMethodCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingJavadocMethodCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61914,58 +61914,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/missingjavadocmethod"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MissingJavadocPackageCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingJavadocPackageCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61973,18 +61973,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/missingjavadocpackage"; } - + @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/javadoc/MissingJavadocTypeCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckExamplesTest.java @@ -24,42 +24,42 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MissingJavadocTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MissingJavadocTypeCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -61992,50 +61992,50 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/missingjavadoctype"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckExamplesTest.java @@ -24,22 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class NonEmptyAtclauseDescriptionCheckExamplesTest - extends AbstractExamplesModuleTestSupport { @@ -62044,26 +62044,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc" + "/nonemptyatclausedescription"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/RequireEmptyLineBeforeBlockTagGroupCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/RequireEmptyLineBeforeBlockTagGroupCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RequireEmptyLineBeforeBlockTagGroupCheckExamplesTest +final class RequireEmptyLineBeforeBlockTagGroupCheckExamplesTest @@ -62072,18 +62072,18 @@ protected String getPackageLocation() { @@ -32,7 +32,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckExamplesTest } - + @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/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; 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 { @@ -62091,42 +62091,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/singlelinejavadoc"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SummaryJavadocCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class SummaryJavadocCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62134,58 +62134,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/summaryjavadoc"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckExamplesTest.java @@ -24,35 +24,35 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class WriteTagCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class WriteTagCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62193,42 +62193,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/javadoc/writetag"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckExamplesTest.java @@ -24,29 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class BooleanExpressionComplexityCheckExamplesTest - extends AbstractExamplesModuleTestSupport { @@ -62237,34 +62237,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/metrics/booleanexpressioncomplexity"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ClassDataAbstractionCouplingCheckExamplesTest +final class ClassDataAbstractionCouplingCheckExamplesTest @@ -62273,98 +62273,98 @@ protected String getPackageLocation() { @@ -32,77 +32,77 @@ public class ClassDataAbstractionCouplingCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ClassFanOutComplexityCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ClassFanOutComplexityCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62372,98 +62372,98 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/metrics/classfanoutcomplexity"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class CyclomaticComplexityCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class CyclomaticComplexityCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62471,33 +62471,33 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/metrics/cyclomaticcomplexity"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckExamplesTest.java @@ -25,35 +25,35 @@ import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") // -@cs[AbbreviationAsWordInName] Test should be named as its main class. -public class JavaNCSSCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62506,41 +62506,41 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/metrics/javancss"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckExamplesTest.java @@ -25,21 +25,21 @@ import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") // -@cs[AbbreviationAsWordInName] Test should be named as its main class. -public class NPathComplexityCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62549,26 +62549,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/metrics/npathcomplexity"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/ClassMemberImpliedModifierCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/ClassMemberImpliedModifierCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ClassMemberImpliedModifierCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ClassMemberImpliedModifierCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62576,18 +62576,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/modifier/classmemberimpliedmodifier"; } - + @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/modifier/InterfaceMemberImpliedModifierCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/InterfaceMemberImpliedModifierCheckExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class InterfaceMemberImpliedModifierCheckExamplesTest +final class InterfaceMemberImpliedModifierCheckExamplesTest @@ -62596,26 +62596,26 @@ protected String getPackageLocation() { @@ -32,14 +32,14 @@ public class InterfaceMemberImpliedModifierCheckExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckExamplesTest.java @@ -24,14 +24,14 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ModifierOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ModifierOrderCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62623,18 +62623,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/modifier/modifierorder"; } - + @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/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; 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 { @@ -62642,35 +62642,35 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/modifier/redundantmodifier"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- 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; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModuleTestSupport { +final class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModuleTestSupport { private static final int DEFAULT_EXPECTED_CAPITAL_COUNT = 4; - + @Override @@ -34,7 +34,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62679,7 +62679,7 @@ "27:8: " + getCheckMessage(MSG_KEY, "incrementCOUNTER", DEFAULT_EXPECTED_CAPITAL_COUNT), @@ -45,7 +45,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62688,63 +62688,63 @@ "23:14: " + getCheckMessage(MSG_KEY, "GLOBAL_COUNTER", DEFAULT_EXPECTED_CAPITAL_COUNT), @@ -58,7 +58,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final int expectedCapitalCount = 1; - + final String[] expected = { @@ -70,7 +70,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final int expectedCapitalCount = 2; - + final String[] expected = { @@ -83,7 +83,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final int expectedCapitalCount = 1; - + final String[] expected = { @@ -96,7 +96,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final int expectedCapitalCount = 1; - + final String[] expected = { @@ -109,7 +109,7 @@ public class AbbreviationAsWordInNameExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample7() throws Exception { + void example7() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(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 import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class AbstractClassNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AbstractClassNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { private static final String DEFAULT_PATTERN = "^Abstract.+$"; - + @Override @@ -34,7 +34,7 @@ public class AbstractClassNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62753,7 +62753,7 @@ "17:3: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractThird", DEFAULT_PATTERN), @@ -46,7 +46,7 @@ public class AbstractClassNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62762,7 +62762,7 @@ "21:3: " @@ -57,7 +57,7 @@ public class AbstractClassNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -62771,27 +62771,27 @@ }; @@ -66,7 +66,7 @@ public class AbstractClassNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String pattern = "^Generator.+$"; - + final String[] expected = { --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckExamplesTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCh import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -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_2 = "^[a-z][a-zA-Z0-9]+$"; @@ -35,7 +35,7 @@ public class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62800,7 +62800,7 @@ "20:35: " + getCheckMessage(MSG_INVALID_PATTERN, "ab", CATCH_PARAM_NAME_PATTERN_1), @@ -48,7 +48,7 @@ public class CatchParameterNameCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62812,14 +62812,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameChe import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/classtypeparametername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62828,7 +62828,7 @@ "14:18: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "t", pattern), @@ -44,7 +44,7 @@ public class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesMod } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62837,7 +62837,7 @@ "15:18: " + getCheckMessage(MSG_ILLEGAL_ABSTRACT_CLASS_NAME, "T", pattern), @@ -57,7 +57,7 @@ public class ClassTypeParameterNameCheckExamplesTest extends AbstractExamplesMod } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -62849,15 +62849,15 @@ @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck.MS import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ConstantNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ConstantNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { private static final String DEFAULT_PATTERN = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + @Override @@ -33,7 +33,7 @@ public class ConstantNameCheckExamplesTest extends AbstractExamplesModuleTestSup } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62866,16 +62866,16 @@ "18:28: " + getCheckMessage(MSG_INVALID_PATTERN, "fourth_Const4", DEFAULT_PATTERN), @@ -47,7 +47,7 @@ public class ConstantNameCheckExamplesTest extends AbstractExamplesModuleTestSup } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String pattern = "^log(ger)?$|^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; - + final String[] expected = { @@ -61,7 +61,7 @@ public class ConstantNameCheckExamplesTest extends AbstractExamplesModuleTestSup } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -62886,7 +62886,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/IllegalIdentifierNameCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class IllegalIdentifierNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class IllegalIdentifierNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -62894,43 +62894,43 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/illegalidentifiername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckExamplesTest.java @@ -24,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; - + -public class InterfaceTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class InterfaceTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/interfacetypeparametername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { - + final String[] expected = { "14:29: " + getCheckMessage(MSG_INVALID_PATTERN, "t", "^[A-Z]$"), @@ -41,7 +41,7 @@ public class InterfaceTypeParameterNameCheckExamplesTest extends AbstractExample } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62942,14 +62942,14 @@ @@ -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; - + -public class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/lambdaparametername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62958,7 +62958,7 @@ }; @@ -40,7 +40,7 @@ public class LambdaParameterNameCheckExamplesTest extends AbstractExamplesModule } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62970,14 +62970,14 @@ @@ -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; - + -public class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/localfinalvariablename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -62986,7 +62986,7 @@ "20:17: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR2", "^[a-z][a-zA-Z0-9]*$"), @@ -41,7 +41,7 @@ public class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesMod } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -62995,7 +62995,7 @@ "21:17: " + getCheckMessage(MSG_INVALID_PATTERN, "var2", "^[A-Z][A-Z0-9]*$"), @@ -51,7 +51,7 @@ public class LocalFinalVariableNameCheckExamplesTest extends AbstractExamplesMod } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -63007,14 +63007,14 @@ @@ -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; - + -public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/localvariablename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63023,7 +63023,7 @@ "15:14: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR", pattern), @@ -42,7 +42,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63032,7 +63032,7 @@ "17:14: " + getCheckMessage(MSG_INVALID_PATTERN, "VAR", pattern), @@ -52,7 +52,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -63041,7 +63041,7 @@ "20:13: " + getCheckMessage(MSG_INVALID_PATTERN, "K", pattern), @@ -63,7 +63,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -63050,7 +63050,7 @@ "21:9: " + getCheckMessage(MSG_INVALID_PATTERN, "g", pattern), @@ -77,7 +77,7 @@ public class LocalVariableNameCheckExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -63062,14 +63062,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck.MSG_ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MemberNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MemberNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/membername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63078,7 +63078,7 @@ "23:17: " + getCheckMessage(MSG_INVALID_PATTERN, "NUM2", "^[a-z][a-zA-Z0-9]*$"), @@ -43,7 +43,7 @@ public class MemberNameCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63087,7 +63087,7 @@ "20:15: " + getCheckMessage(MSG_INVALID_PATTERN, "num4", "^m[A-Z][a-zA-Z0-9]*$"), @@ -53,7 +53,7 @@ public class MemberNameCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -63099,14 +63099,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck.MSG_ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MethodNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MethodNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/methodname"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63115,7 +63115,7 @@ "16:15: " + getCheckMessage(MSG_INVALID_PATTERN, "Method4", "^[a-z][a-zA-Z0-9]*$"), @@ -42,7 +42,7 @@ public class MethodNameCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63124,15 +63124,15 @@ }; @@ -51,14 +51,14 @@ public class MethodNameCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.java"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -63141,7 +63141,7 @@ }; @@ -67,7 +67,7 @@ public class MethodNameCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -63153,14 +63153,14 @@ @@ -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; - + -public class MethodTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MethodTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/methodtypeparametername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63169,18 +63169,18 @@ "16:11: " + getCheckMessage(MSG_INVALID_PATTERN, "k", "^[A-Z]$"), @@ -41,7 +41,7 @@ public class MethodTypeParameterNameCheckExamplesTest extends AbstractExamplesMo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class PackageNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class PackageNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63188,34 +63188,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/packagename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckExamplesTest.java @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck.M import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/parametername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63224,7 +63224,7 @@ }; @@ -40,7 +40,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63233,7 +63233,7 @@ }; @@ -49,7 +49,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -63242,7 +63242,7 @@ }; @@ -58,7 +58,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -63251,7 +63251,7 @@ "17:20: " + getCheckMessage(MSG_INVALID_PATTERN, "V3", "^[a-z][a-zA-Z0-9]+$"), @@ -68,7 +68,7 @@ public class ParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -63262,7 +63262,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class PatternVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class PatternVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63270,34 +63270,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/patternvariablename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RecordComponentNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RecordComponentNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63305,26 +63305,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/recordcomponentname"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordTypeParameterNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordTypeParameterNameCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RecordTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RecordTypeParameterNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63332,35 +63332,35 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/recordtypeparametername"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckExamplesTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MS import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { - + public static final String STATIC_VAR_NAME_PATTERN_1 = "^[a-z][a-zA-Z0-9]*$"; public static final String STATIC_VAR_NAME_PATTERN_2 = "^[a-z](_?[a-zA-Z0-9]+)*$"; @@ -35,7 +35,7 @@ public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63369,7 +63369,7 @@ "20:24: " + getCheckMessage(MSG_INVALID_PATTERN, "ItStatic2", STATIC_VAR_NAME_PATTERN_1), @@ -50,7 +50,7 @@ public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63378,7 +63378,7 @@ "24:22: " + getCheckMessage(MSG_INVALID_PATTERN, "It_Static1", STATIC_VAR_NAME_PATTERN_1), @@ -61,7 +61,7 @@ public class StaticVariableNameCheckExamplesTest extends AbstractExamplesModuleT } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -63390,14 +63390,14 @@ @@ -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; - + -public class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/naming/typename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63406,7 +63406,7 @@ "16:17: " + getCheckMessage(MSG_INVALID_PATTERN, "FourthName_", "^[A-Z][a-zA-Z0-9]*$"), @@ -41,7 +41,7 @@ public class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63415,7 +63415,7 @@ "18:16: " + getCheckMessage(MSG_INVALID_PATTERN, "SecondName", "^[a-z](_?[a-zA-Z0-9]+)*$"), @@ -51,7 +51,7 @@ public class TypeNameCheckExamplesTest extends AbstractExamplesModuleTestSupport } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -63426,7 +63426,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckExamplesTest.java @@ -24,98 +24,98 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RegexpCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RegexpCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63434,114 +63434,114 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/regexp/regexp"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), expected); } - + @Test - public void testExample12() throws Exception { + void example12() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example12.txt"), expected); } - + @Test - public void testExample13() throws Exception { + void example13() throws Exception { final String[] expected = {}; - + 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RegexpMultilineCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RegexpMultilineCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63549,66 +63549,66 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RegexpOnFilenameCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RegexpOnFilenameCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63616,66 +63616,66 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/regexp/regexponfilename"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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/RegexpSinglelineCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RegexpSinglelineCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RegexpSinglelineCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63683,66 +63683,66 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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/RegexpSinglelineJavaCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckExamplesTest.java @@ -24,56 +24,56 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RegexpSinglelineJavaCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RegexpSinglelineJavaCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63750,66 +63750,66 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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/sizes/AnonInnerLengthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class AnonInnerLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class AnonInnerLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63817,26 +63817,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/anoninnerlength"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class ExecutableStatementCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class ExecutableStatementCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63844,42 +63844,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/executablestatementcount"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckExamplesTest.java @@ -24,21 +24,21 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck.MSG_K import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class FileLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class FileLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/filelength"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.java"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -63888,27 +63888,27 @@ }; @@ -47,7 +47,7 @@ public class FileLengthCheckExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.java"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthExamplesTest.java @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class LambdaBodyLengthExamplesTest extends AbstractExamplesModuleTestSupport { +final class LambdaBodyLengthExamplesTest extends AbstractExamplesModuleTestSupport { private static final int DEFAULT_MAX = 10; - + @Override @@ -33,7 +33,7 @@ public class LambdaBodyLengthExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -63917,18 +63917,18 @@ "36:20: " + getCheckMessage(MSG_KEY, 11, DEFAULT_MAX), @@ -43,7 +43,7 @@ public class LambdaBodyLengthExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final int max = 5; - + final String[] expected = { --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckExamplesTest.java @@ -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") -public class LineLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class LineLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63936,58 +63936,58 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/linelength"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example6.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MethodCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MethodCountCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -63995,34 +63995,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/methodcount"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckExamplesTest.java @@ -24,28 +24,28 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class MethodLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class MethodLengthCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64030,34 +64030,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/methodlength"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class OuterTypeNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class OuterTypeNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64065,26 +64065,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/outertypenumber"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -64092,34 +64092,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/parameternumber"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- 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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class RecordComponentNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class RecordComponentNumberCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64127,42 +64127,42 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/sizes/recordcomponentnumber"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadExamplesTest.java @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitiali import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyForInitializerPadExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyForInitializerPadExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/emptyforinitializerpad"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64171,7 +64171,7 @@ "20:11: " + getCheckMessage(MSG_PRECEDED, ";"), @@ -42,7 +42,7 @@ public class EmptyForInitializerPadExamplesTest extends AbstractExamplesModuleTe } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64183,14 +64183,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIterator import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyForIteratorPadExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyForIteratorPadExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/emptyforiteratorpad"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64199,7 +64199,7 @@ }; @@ -41,7 +41,7 @@ public class EmptyForIteratorPadExamplesTest extends AbstractExamplesModuleTestS } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64211,14 +64211,14 @@ @@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparat import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class EmptyLineSeparatorExamplesTest extends AbstractExamplesModuleTestSupport { +final class EmptyLineSeparatorExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/emptylineseparator"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64227,7 +64227,7 @@ "15:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), @@ -45,7 +45,7 @@ public class EmptyLineSeparatorExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64236,7 +64236,7 @@ "29:3: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "METHOD_DEF"), @@ -55,7 +55,7 @@ public class EmptyLineSeparatorExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -64245,7 +64245,7 @@ "17:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), @@ -66,7 +66,7 @@ public class EmptyLineSeparatorExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -64254,7 +64254,7 @@ "17:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), @@ -80,7 +80,7 @@ public class EmptyLineSeparatorExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -64266,14 +64266,14 @@ @@ -26,14 +26,14 @@ import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import com.puppycrawl.tools.checkstyle.utils.CommonUtil; import org.junit.jupiter.api.Test; - + -public class FileTabCharacterExamplesTest extends AbstractExamplesModuleTestSupport { +final class FileTabCharacterExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/filetabcharacter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64282,7 +64282,7 @@ }; @@ -42,7 +42,7 @@ public class FileTabCharacterExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64291,7 +64291,7 @@ }; @@ -51,7 +51,7 @@ public class FileTabCharacterExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -64300,7 +64300,7 @@ }; @@ -60,7 +60,7 @@ public class FileTabCharacterExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -64309,18 +64309,18 @@ }; @@ -69,7 +69,7 @@ public class FileTabCharacterExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; - + verifyWithInlineConfigParser(getPath("Example5.html"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckExamplesTest.java @@ -24,21 +24,21 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class GenericWhitespaceCheckExamplesTest extends AbstractExamplesModuleTestSupport { +final class GenericWhitespaceCheckExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64328,34 +64328,34 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/genericwhitespace"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadExamplesTest.java @@ -26,14 +26,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCh import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class MethodParamPadExamplesTest extends AbstractExamplesModuleTestSupport { +final class MethodParamPadExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/methodparampad"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64364,7 +64364,7 @@ "20:11: " + getCheckMessage(MSG_WS_PRECEDED, "("), @@ -44,7 +44,7 @@ public class MethodParamPadExamplesTest extends AbstractExamplesModuleTestSuppor } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64376,14 +64376,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck. import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoLineWrapExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoLineWrapExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/nolinewrap"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64392,7 +64392,7 @@ "15:1: " + getCheckMessage(MSG_KEY, "import"), @@ -42,7 +42,7 @@ public class NoLineWrapExamplesTest extends AbstractExamplesModuleTestSupport { } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64401,7 +64401,7 @@ "16:1: " + getCheckMessage(MSG_KEY, "import"), @@ -53,7 +53,7 @@ public class NoLineWrapExamplesTest extends AbstractExamplesModuleTestSupport { } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -64410,7 +64410,7 @@ }; @@ -62,7 +62,7 @@ public class NoLineWrapExamplesTest extends AbstractExamplesModuleTestSupport { } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -64419,7 +64419,7 @@ }; @@ -71,7 +71,7 @@ public class NoLineWrapExamplesTest extends AbstractExamplesModuleTestSupport { } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -64431,14 +64431,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfte import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoWhitespaceAfterExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoWhitespaceAfterExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/nowhitespaceafter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64447,7 +64447,7 @@ "28:9: " + getCheckMessage(MSG_KEY, "int"), @@ -42,7 +42,7 @@ public class NoWhitespaceAfterExamplesTest extends AbstractExamplesModuleTestSup } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64459,7 +64459,7 @@ @@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBefo import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoWhitespaceBeforeCaseDefaultColonExamplesTest +final class NoWhitespaceBeforeCaseDefaultColonExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64467,7 +64467,7 @@ protected String getPackageLocation() { @@ -33,7 +33,7 @@ public class NoWhitespaceBeforeCaseDefaultColonExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64479,14 +64479,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBefo import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class NoWhitespaceBeforeExamplesTest extends AbstractExamplesModuleTestSupport { +final class NoWhitespaceBeforeExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/nowhitespacebefore"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64495,7 +64495,7 @@ "21:20: " + getCheckMessage(MSG_KEY, ";"), @@ -44,7 +44,7 @@ public class NoWhitespaceBeforeExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64504,7 +64504,7 @@ }; @@ -53,7 +53,7 @@ public class NoWhitespaceBeforeExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -64513,7 +64513,7 @@ }; @@ -62,7 +62,7 @@ public class NoWhitespaceBeforeExamplesTest extends AbstractExamplesModuleTestSu } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -64525,14 +64525,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapChec import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class OperatorWrapExamplesTest extends AbstractExamplesModuleTestSupport { +final class OperatorWrapExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/operatorwrap"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64541,7 +64541,7 @@ "19:12: " + getCheckMessage(MSG_LINE_NEW, "=="), @@ -43,7 +43,7 @@ public class OperatorWrapExamplesTest extends AbstractExamplesModuleTestSupport } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64553,14 +64553,14 @@ @@ -27,14 +27,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPad import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class ParenPadExamplesTest extends AbstractExamplesModuleTestSupport { +final class ParenPadExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/parenpad"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64569,7 +64569,7 @@ "21:25: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -45,7 +45,7 @@ public class ParenPadExamplesTest extends AbstractExamplesModuleTestSupport { } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64581,14 +64581,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapChe import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SeparatorWrapExamplesTest extends AbstractExamplesModuleTestSupport { +final class SeparatorWrapExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/separatorwrap"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64597,7 +64597,7 @@ "26:11: " + getCheckMessage(MSG_LINE_PREVIOUS, "."), @@ -42,7 +42,7 @@ public class SeparatorWrapExamplesTest extends AbstractExamplesModuleTestSupport } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64606,7 +64606,7 @@ }; @@ -51,7 +51,7 @@ public class SeparatorWrapExamplesTest extends AbstractExamplesModuleTestSupport } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -64618,14 +64618,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSepar import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class SingleSpaceSeparatorExamplesTest extends AbstractExamplesModuleTestSupport { +final class SingleSpaceSeparatorExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/singlespaceseparator"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64634,7 +64634,7 @@ "16:13: " + getCheckMessage(MSG_KEY), @@ -42,7 +42,7 @@ public class SingleSpaceSeparatorExamplesTest extends AbstractExamplesModuleTest } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64646,14 +64646,14 @@ @@ -27,14 +27,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPad import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class TypecastParenPadExamplesTest extends AbstractExamplesModuleTestSupport { +final class TypecastParenPadExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/typecastparenpad"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64662,7 +64662,7 @@ "17:17: " + getCheckMessage(MSG_WS_PRECEDED, ")"), @@ -46,7 +46,7 @@ public class TypecastParenPadExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64674,14 +64674,14 @@ @@ -24,14 +24,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterC import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class WhitespaceAfterExamplesTest extends AbstractExamplesModuleTestSupport { +final class WhitespaceAfterExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/whitespaceafter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64690,7 +64690,7 @@ "23:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), @@ -50,7 +50,7 @@ public class WhitespaceAfterExamplesTest extends AbstractExamplesModuleTestSuppo } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64702,14 +64702,14 @@ @@ -25,14 +25,14 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAround import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport; import org.junit.jupiter.api.Test; - + -public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupport { +final class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupport { @Override protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/checks/whitespace/whitespacearound"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { @@ -64718,7 +64718,7 @@ "15:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), @@ -54,7 +54,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { @@ -64727,7 +64727,7 @@ "21:10: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "="), @@ -78,7 +78,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { @@ -64736,7 +64736,7 @@ }; @@ -87,7 +87,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { @@ -64745,7 +64745,7 @@ "18:8: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -97,7 +97,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { @@ -64754,7 +64754,7 @@ "18:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), @@ -107,7 +107,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { @@ -64763,7 +64763,7 @@ "20:10: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -117,7 +117,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample7() throws Exception { + void example7() throws Exception { @@ -64772,7 +64772,7 @@ "21:10: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -127,7 +127,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { @@ -64781,7 +64781,7 @@ "19:10: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -137,7 +137,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { @@ -64790,7 +64790,7 @@ "18:10: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), @@ -147,7 +147,7 @@ public class WhitespaceAroundExamplesTest extends AbstractExamplesModuleTestSupp } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { @@ -64801,7 +64801,7 @@ +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class BeforeExecutionExclusionFileFilterExamplesTest +final class BeforeExecutionExclusionFileFilterExamplesTest @@ -64810,34 +64810,34 @@ protected String getPackageLocation() { @@ -32,21 +32,21 @@ public class BeforeExecutionExclusionFileFilterExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + 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; 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 { @@ -64845,18 +64845,18 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/severitymatchfilter"; } - + @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/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; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressWarningsFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressWarningsFilterExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64864,26 +64864,26 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/suppresswarningsfilter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterExamplesTest.java @@ -24,63 +24,63 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressWithNearbyCommentFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressWithNearbyCommentFilterExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64891,74 +64891,74 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/suppresswithnearbycommentfilter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyTextFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyTextFilterExamplesTest.java @@ -24,70 +24,70 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressWithNearbyTextFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressWithNearbyTextFilterExamplesTest extends AbstractExamplesModuleTestSupport { @@ -64966,82 +64966,82 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/suppresswithnearbytextfilter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterExamplesTest.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressWithPlainTextCommentFilterExamplesTest +final class SuppressWithPlainTextCommentFilterExamplesTest @@ -65050,74 +65050,74 @@ protected String getPackageLocation() { @@ -32,56 +32,56 @@ public class SuppressWithPlainTextCommentFilterExamplesTest } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterExamplesTest.java @@ -24,63 +24,63 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressionCommentFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressionCommentFilterExamplesTest extends AbstractExamplesModuleTestSupport { @@ -65125,74 +65125,74 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/suppressioncommentfilter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterExamplesTest.java @@ -24,77 +24,77 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressionSingleFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressionSingleFilterExamplesTest extends AbstractExamplesModuleTestSupport { @@ -65200,90 +65200,90 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/suppressionsinglefilter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); --- a/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterExamplesTest.java +++ b/src/xdocs-examples/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterExamplesTest.java @@ -24,105 +24,105 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; - + @Disabled("until https://github.com/checkstyle/checkstyle/issues/13345") -public class SuppressionXpathSingleFilterExamplesTest extends AbstractExamplesModuleTestSupport { +final class SuppressionXpathSingleFilterExamplesTest extends AbstractExamplesModuleTestSupport { @@ -65291,114 +65291,114 @@ protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/filters/suppressionxpathsinglefilter"; } - + @Test - public void testExample1() throws Exception { + void example1() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example1.txt"), expected); } - + @Test - public void testExample2() throws Exception { + void example2() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example2.txt"), expected); } - + @Test - public void testExample3() throws Exception { + void example3() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example3.txt"), expected); } - + @Test - public void testExample4() throws Exception { + void example4() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example4.txt"), expected); } - + @Test - public void testExample5() throws Exception { + void example5() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example5.txt"), expected); } - + @Test - public void testExample6() throws Exception { + void example6() throws Exception { 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); } - + @Test - public void testExample8() throws Exception { + void example8() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example8.txt"), expected); } - + @Test - public void testExample9() throws Exception { + void example9() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example9.txt"), expected); } - + @Test - public void testExample10() throws Exception { + void example10() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example10.txt"), expected); } - + @Test - public void testExample11() throws Exception { + void example11() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example11.txt"), expected); } - + @Test - public void testExample12() throws Exception { + void example12() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example12.txt"), expected); } - + @Test - public void testExample13() throws Exception { + void example13() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example13.txt"), expected); } - + @Test - public void testExample14() throws Exception { + void example14() throws Exception { final String[] expected = {}; - + verifyWithInlineConfigParser(getPath("Example14.txt"), expected); diff --git a/integration-tests/checkstyle-expected-warnings.txt b/integration-tests/checkstyle-expected-warnings.txt index f3eda688eb..3ee09654f6 100644 --- a/integration-tests/checkstyle-expected-warnings.txt +++ b/integration-tests/checkstyle-expected-warnings.txt @@ -24,7 +24,7 @@ src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemi src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java:[595,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java:[58,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java:[49,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) -src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java:[42,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) +src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java:[41,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `toString` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java:[77,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/DescendantTokenCheckTest.java:[39,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckTest.java:[49,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) @@ -49,7 +49,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializati src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckTest.java:[38,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java:[105,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java:[36,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) -src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java:[49,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) +src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java:[48,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckTest.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/IllegalTokenCheckTest.java:[57,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `native` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckTest.java:[37,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) @@ -69,8 +69,8 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolon 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:[107,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:[87,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/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) src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckTest.java:[75,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `package` is not a valid identifier) @@ -125,7 +125,7 @@ src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPad src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java:[46,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/IntMatchFilterElementTest.java:[45,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/filters/SeverityMatchFilterTest.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/filters/SuppressFilterElementTest.java:[184,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `equals` is already defined in this class or a supertype) +src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressFilterElementTest.java:[185,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that a method named `equals` is already defined in this class or a supertype) src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java:[83,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java:[210,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier) src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java:[151,8] [JUnitMethodDeclaration] This method's name should not redundantly start with `test` (but note that `default` is not a valid identifier)