From 542db1df1e4e1ca7d00f5189722e66b333a892ca Mon Sep 17 00:00:00 2001 From: MANISH-K-07 Date: Mon, 8 Apr 2024 07:07:29 +0100 Subject: [PATCH] Issue #14715: Enforced naming convention in IT area Ten --- ...ressionClassMemberImpliedModifierTest.java | 20 +++++----- ...pathRegressionCommentsIndentationTest.java | 40 ++++++++----------- .../XpathRegressionConstantNameTest.java | 16 ++++---- .../XpathRegressionCovariantEqualsTest.java | 12 +++--- ...=> InputXpathCovariantEqualsInRecord.java} | 2 +- ...tXpathClassMemberImpliedModifierEnum.java} | 2 +- ...hClassMemberImpliedModifierInterface.java} | 2 +- ...> InputXpathCommentsIndentationBlock.java} | 2 +- ...mentsIndentationDistributedStatement.java} | 2 +- ...putXpathCommentsIndentationEmptyCase.java} | 2 +- ...XpathCommentsIndentationNonEmptyCase.java} | 2 +- ...putXpathCommentsIndentationSeparator.java} | 2 +- ...utXpathCommentsIndentationSingleLine.java} | 2 +- ...thCommentsIndentationSingleLineBlock.java} | 2 +- ...mentsIndentationWithinBlockStatement.java} | 2 +- ...a => InputXpathConstantNameCamelCase.java} | 2 +- ...a => InputXpathConstantNameLowercase.java} | 2 +- ...hConstantNameWithBeginningUnderscore.java} | 2 +- ...tXpathConstantNameWithTwoUnderscores.java} | 2 +- .../InputXpathCovariantEqualsInClass.java | 9 +++++ .../InputXpathCovariantEqualsInEnum.java | 11 +++++ ...XpathRegressionCovariantEqualsInClass.java | 9 ----- ...nXpathRegressionCovariantEqualsInEnum.java | 11 ----- .../internal/XpathRegressionTest.java | 4 -- 24 files changed, 75 insertions(+), 87 deletions(-) rename src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/{SuppressionXpathRegressionCovariantEqualsInRecord.java => InputXpathCovariantEqualsInRecord.java} (75%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/{SuppressionXpathRegressionClassMemberImpliedModifierTwo.java => InputXpathClassMemberImpliedModifierEnum.java} (66%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/{SuppressionXpathRegressionClassMemberImpliedModifierOne.java => InputXpathClassMemberImpliedModifierInterface.java} (62%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationBlock.java => InputXpathCommentsIndentationBlock.java} (69%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationDistributedStatement.java => InputXpathCommentsIndentationDistributedStatement.java} (74%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationEmptyCase.java => InputXpathCommentsIndentationEmptyCase.java} (74%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationNonEmptyCase.java => InputXpathCommentsIndentationNonEmptyCase.java} (77%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationSeparator.java => InputXpathCommentsIndentationSeparator.java} (75%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationSingleLine.java => InputXpathCommentsIndentationSingleLine.java} (60%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationSingleLineBlock.java => InputXpathCommentsIndentationSingleLineBlock.java} (64%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/{SuppressionXpathRegressionCommentsIndentationWithinBlockStatement.java => InputXpathCommentsIndentationWithinBlockStatement.java} (69%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/{SuppressionXpathRegressionConstantNameCamelCase.java => InputXpathConstantNameCamelCase.java} (64%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/{SuppressionXpathRegressionConstantNameLowercase.java => InputXpathConstantNameLowercase.java} (63%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/{SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java => InputXpathConstantNameWithBeginningUnderscore.java} (60%) rename src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/{SuppressionXpathRegressionConstantNameWithTwoUnderscores.java => InputXpathConstantNameWithTwoUnderscores.java} (61%) create mode 100644 src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInClass.java create mode 100644 src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInEnum.java delete mode 100644 src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInClass.java delete mode 100644 src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInEnum.java diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java index 259391f6cf3..a4885bac3ca 100644 --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java @@ -38,9 +38,9 @@ protected String getCheckName() { } @Test - public void testOne() throws Exception { + public void testInterface() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierOne.java")); + new File(getPath("InputXpathClassMemberImpliedModifierInterface.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ClassMemberImpliedModifierCheck.class); @@ -52,13 +52,13 @@ public void testOne() throws Exception { final List expectedXpathQueries = Arrays.asList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionClassMemberImpliedModifierOne']]" + + "@text='InputXpathClassMemberImpliedModifierInterface']]" + "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Foo']]", "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionClassMemberImpliedModifierOne']]" + + "@text='InputXpathClassMemberImpliedModifierInterface']]" + "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Foo']]/MODIFIERS", "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" - + "@text='SuppressionXpathRegressionClassMemberImpliedModifierOne']]" + + "@text='InputXpathClassMemberImpliedModifierInterface']]" + "/OBJBLOCK/INTERFACE_DEF[./IDENT[@text='Foo']]/MODIFIERS/LITERAL_PUBLIC" ); @@ -67,9 +67,9 @@ public void testOne() throws Exception { } @Test - public void testTwo() throws Exception { + public void testEnum() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierTwo.java")); + new File(getPath("InputXpathClassMemberImpliedModifierEnum.java")); final DefaultConfiguration moduleConfig = createModuleConfig(ClassMemberImpliedModifierCheck.class); @@ -81,13 +81,13 @@ public void testTwo() throws Exception { final List expectedXpathQueries = Arrays.asList( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionClassMemberImpliedModifierTwo']]" + + "[./IDENT[@text='InputXpathClassMemberImpliedModifierEnum']]" + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Count']]", "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionClassMemberImpliedModifierTwo']]" + + "[./IDENT[@text='InputXpathClassMemberImpliedModifierEnum']]" + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Count']]/MODIFIERS", "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionClassMemberImpliedModifierTwo']]" + + "[./IDENT[@text='InputXpathClassMemberImpliedModifierEnum']]" + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Count']]/MODIFIERS/LITERAL_PUBLIC" ); diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java index 074df39146a..8431f8641d5 100644 --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java @@ -40,8 +40,7 @@ protected String getCheckName() { @Test public void testSingleLine() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "SingleLine.java")); + new File(getPath("InputXpathCommentsIndentationSingleLine.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -53,7 +52,7 @@ public void testSingleLine() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationSingleLine']]" + + "[@text='InputXpathCommentsIndentationSingleLine']]" + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]" ); @@ -64,8 +63,7 @@ public void testSingleLine() throws Exception { @Test public void testBlock() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "Block.java")); + new File(getPath("InputXpathCommentsIndentationBlock.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -77,7 +75,7 @@ public void testBlock() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationBlock']]/OBJBLOCK/" + + "[@text='InputXpathCommentsIndentationBlock']]/OBJBLOCK/" + "VARIABLE_DEF[./IDENT[@text='f']]/TYPE/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" + "[@text=' // warn\\n * Javadoc comment\\n ']]" ); @@ -89,8 +87,7 @@ public void testBlock() throws Exception { @Test public void testSeparator() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "Separator.java")); + new File(getPath("InputXpathCommentsIndentationSeparator.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -102,7 +99,7 @@ public void testSeparator() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationSeparator']]" + + "[@text='InputXpathCommentsIndentationSeparator']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/MODIFIERS/SINGLE_LINE_COMMENT" + "[./COMMENT_CONTENT[@text='///////////// Comment separator // warn\\n']]" ); @@ -114,8 +111,7 @@ public void testSeparator() throws Exception { @Test public void testDistributedStatement() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "DistributedStatement.java")); + new File(getPath("InputXpathCommentsIndentationDistributedStatement.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -127,7 +123,7 @@ public void testDistributedStatement() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationDistributedStatement']]" + + "[@text='InputXpathCommentsIndentationDistributedStatement']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" + "[./COMMENT_CONTENT[@text=' Comment // warn\\n']]" ); @@ -139,8 +135,7 @@ public void testDistributedStatement() throws Exception { @Test public void testSingleLineBlock() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "SingleLineBlock.java")); + new File(getPath("InputXpathCommentsIndentationSingleLineBlock.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -152,7 +147,7 @@ public void testSingleLineBlock() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationSingleLineBlock']]" + + "[@text='InputXpathCommentsIndentationSingleLineBlock']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" + "[./COMMENT_CONTENT[@text=' block Comment // warn\\n']]" ); @@ -164,8 +159,7 @@ public void testSingleLineBlock() throws Exception { @Test public void testNonEmptyCase() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "NonEmptyCase.java")); + new File(getPath("InputXpathCommentsIndentationNonEmptyCase.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -177,7 +171,7 @@ public void testNonEmptyCase() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationNonEmptyCase']]" + + "[@text='InputXpathCommentsIndentationNonEmptyCase']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" + "CASE_GROUP/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]" ); @@ -189,8 +183,7 @@ public void testNonEmptyCase() throws Exception { @Test public void testEmptyCase() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "EmptyCase.java")); + new File(getPath("InputXpathCommentsIndentationEmptyCase.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -202,7 +195,7 @@ public void testEmptyCase() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationEmptyCase']]" + + "[@text='InputXpathCommentsIndentationEmptyCase']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" + "CASE_GROUP/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]" ); @@ -214,8 +207,7 @@ public void testEmptyCase() throws Exception { @Test public void testWithinBlockStatement() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCommentsIndentation" - + "WithinBlockStatement.java")); + new File(getPath("InputXpathCommentsIndentationWithinBlockStatement.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CommentsIndentationCheck.class); @@ -227,7 +219,7 @@ public void testWithinBlockStatement() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionCommentsIndentationWithinBlockStatement']]" + + "[@text='InputXpathCommentsIndentationWithinBlockStatement']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/VARIABLE_DEF" + "[./IDENT[@text='s']]/ASSIGN/EXPR/PLUS[./STRING_LITERAL[@text='O']]" + "/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]" diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java index 8bbe1301266..01db1dafd08 100644 --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java @@ -44,7 +44,7 @@ protected String getCheckName() { @Test public void testLowercase() throws Exception { final File fileToProcess = new File( - getPath("SuppressionXpathRegressionConstantNameLowercase.java")); + getPath("InputXpathConstantNameLowercase.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -54,7 +54,7 @@ public void testLowercase() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionConstantNameLowercase']]" + + "[@text='InputXpathConstantNameLowercase']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='number']" ); @@ -65,7 +65,7 @@ public void testLowercase() throws Exception { @Test public void testCamelCase() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionConstantNameCamelCase.java")); + new File(getPath("InputXpathConstantNameCamelCase.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -76,7 +76,7 @@ public void testCamelCase() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionConstantNameCamelCase']]" + + "[./IDENT[@text='InputXpathConstantNameCamelCase']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='badConstant']" ); @@ -87,7 +87,7 @@ public void testCamelCase() throws Exception { @Test public void testWithBeginningUnderscore() throws Exception { final File fileToProcess = new File( - getPath("SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java")); + getPath("InputXpathConstantNameWithBeginningUnderscore.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -97,7 +97,7 @@ public void testWithBeginningUnderscore() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionConstantNameWithBeginningUnderscore']]" + + "[@text='InputXpathConstantNameWithBeginningUnderscore']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='_CONSTANT']" ); @@ -108,7 +108,7 @@ public void testWithBeginningUnderscore() throws Exception { @Test public void testWithTwoUnderscores() throws Exception { final File fileToProcess = new File( - getPath("SuppressionXpathRegressionConstantNameWithTwoUnderscores.java")); + getPath("InputXpathConstantNameWithTwoUnderscores.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); @@ -118,7 +118,7 @@ public void testWithTwoUnderscores() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF[./IDENT" - + "[@text='SuppressionXpathRegressionConstantNameWithTwoUnderscores']]" + + "[@text='InputXpathConstantNameWithTwoUnderscores']]" + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='BAD__NAME']" ); diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java index cbdc53090b2..2029104a0b7 100644 --- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java +++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java @@ -40,7 +40,7 @@ protected String getCheckName() { @Test public void testCovariantEqualsInClass() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCovariantEqualsInClass.java")); + new File(getPath("InputXpathCovariantEqualsInClass.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CovariantEqualsCheck.class); @@ -52,7 +52,7 @@ public void testCovariantEqualsInClass() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/CLASS_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInClass']]" + + "[./IDENT[@text='InputXpathCovariantEqualsInClass']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']" ); @@ -63,7 +63,7 @@ public void testCovariantEqualsInClass() throws Exception { @Test public void testCovariantEqualsInEnum() throws Exception { final File fileToProcess = - new File(getPath("SuppressionXpathRegressionCovariantEqualsInEnum.java")); + new File(getPath("InputXpathCovariantEqualsInEnum.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CovariantEqualsCheck.class); @@ -75,7 +75,7 @@ public void testCovariantEqualsInEnum() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/ENUM_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInEnum']]" + + "[./IDENT[@text='InputXpathCovariantEqualsInEnum']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); runVerifications(moduleConfig, fileToProcess, expectedViolation, @@ -86,7 +86,7 @@ public void testCovariantEqualsInEnum() throws Exception { public void testCovariantEqualsInRecord() throws Exception { final File fileToProcess = new File(getNonCompilablePath( - "SuppressionXpathRegressionCovariantEqualsInRecord.java")); + "InputXpathCovariantEqualsInRecord.java")); final DefaultConfiguration moduleConfig = createModuleConfig(CovariantEqualsCheck.class); @@ -98,7 +98,7 @@ public void testCovariantEqualsInRecord() throws Exception { final List expectedXpathQueries = Collections.singletonList( "/COMPILATION_UNIT/RECORD_DEF" - + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInRecord']]" + + "[./IDENT[@text='InputXpathCovariantEqualsInRecord']]" + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); runVerifications(moduleConfig, fileToProcess, expectedViolation, diff --git a/src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInRecord.java b/src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInRecord.java similarity index 75% rename from src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInRecord.java rename to src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInRecord.java index 34171e75b51..4f6db3fcf07 100644 --- a/src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInRecord.java +++ b/src/it/resources-noncompilable/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInRecord.java @@ -2,7 +2,7 @@ package org.checkstyle.suppressionxpathfilter.covariantequals; -public record SuppressionXpathRegressionCovariantEqualsInRecord() { +public record InputXpathCovariantEqualsInRecord() { public boolean equals(String str) { // warn return str.equals(this); diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/SuppressionXpathRegressionClassMemberImpliedModifierTwo.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/InputXpathClassMemberImpliedModifierEnum.java similarity index 66% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/SuppressionXpathRegressionClassMemberImpliedModifierTwo.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/InputXpathClassMemberImpliedModifierEnum.java index dfbfb9d42fe..308f916cbe9 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/SuppressionXpathRegressionClassMemberImpliedModifierTwo.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/InputXpathClassMemberImpliedModifierEnum.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.classmemberimpliedmodifier; -public class SuppressionXpathRegressionClassMemberImpliedModifierTwo { +public class InputXpathClassMemberImpliedModifierEnum { public enum Count { //warn ONE, TWO, THREE; } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/SuppressionXpathRegressionClassMemberImpliedModifierOne.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/InputXpathClassMemberImpliedModifierInterface.java similarity index 62% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/SuppressionXpathRegressionClassMemberImpliedModifierOne.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/InputXpathClassMemberImpliedModifierInterface.java index 69ca9275850..52d9da03afc 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/SuppressionXpathRegressionClassMemberImpliedModifierOne.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/classmemberimpliedmodifier/InputXpathClassMemberImpliedModifierInterface.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.classmemberimpliedmodifier; -public class SuppressionXpathRegressionClassMemberImpliedModifierOne { +public class InputXpathClassMemberImpliedModifierInterface { public interface Foo { //warn } } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationBlock.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationBlock.java similarity index 69% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationBlock.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationBlock.java index f760b34bdf9..4fb16661a86 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationBlock.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationBlock.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationBlock { +public class InputXpathCommentsIndentationBlock { /* // warn * Javadoc comment */ diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationDistributedStatement.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationDistributedStatement.java similarity index 74% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationDistributedStatement.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationDistributedStatement.java index 40c84c8c6b9..98e9066a863 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationDistributedStatement.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationDistributedStatement.java @@ -2,7 +2,7 @@ import java.util.Arrays; -public class SuppressionXpathRegressionCommentsIndentationDistributedStatement { +public class InputXpathCommentsIndentationDistributedStatement { public void foo() { String s = ""; int n = s diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationEmptyCase.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationEmptyCase.java similarity index 74% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationEmptyCase.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationEmptyCase.java index 22effa12561..8f4dc0dfd1a 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationEmptyCase.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationEmptyCase.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationEmptyCase { +public class InputXpathCommentsIndentationEmptyCase { int n; public void foo() { diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationNonEmptyCase.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationNonEmptyCase.java similarity index 77% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationNonEmptyCase.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationNonEmptyCase.java index c3f4d8f77f7..b1ff3cbbf20 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationNonEmptyCase.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationNonEmptyCase.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationNonEmptyCase { +public class InputXpathCommentsIndentationNonEmptyCase { int n; public void foo() { diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSeparator.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSeparator.java similarity index 75% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSeparator.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSeparator.java index 7a573524a64..6fa183157ed 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSeparator.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSeparator.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationSeparator { +public class InputXpathCommentsIndentationSeparator { public void main(String[] args) { int n; } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSingleLine.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSingleLine.java similarity index 60% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSingleLine.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSingleLine.java index c689c15c6ad..227bd47d3fa 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSingleLine.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSingleLine.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationSingleLine { +public class InputXpathCommentsIndentationSingleLine { int n; // Comment // warn } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSingleLineBlock.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSingleLineBlock.java similarity index 64% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSingleLineBlock.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSingleLineBlock.java index 4c8f6feec52..b0a22166645 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationSingleLineBlock.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationSingleLineBlock.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationSingleLineBlock { +public class InputXpathCommentsIndentationSingleLineBlock { public void foo() { // Single Line // block Comment // warn diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationWithinBlockStatement.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationWithinBlockStatement.java similarity index 69% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationWithinBlockStatement.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationWithinBlockStatement.java index 3f6fade8191..70bb3990841 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/SuppressionXpathRegressionCommentsIndentationWithinBlockStatement.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/commentsindentation/InputXpathCommentsIndentationWithinBlockStatement.java @@ -1,6 +1,6 @@ package org.checkstyle.suppressionxpathfilter.commentsindentation; -public class SuppressionXpathRegressionCommentsIndentationWithinBlockStatement { +public class InputXpathCommentsIndentationWithinBlockStatement { public void foo() { String s = "F" // Comment // warn diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameCamelCase.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameCamelCase.java similarity index 64% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameCamelCase.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameCamelCase.java index 95b4b1c05da..a919a7c932f 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameCamelCase.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameCamelCase.java @@ -1,5 +1,5 @@ package org.checkstyle.suppressionxpathfilter.constantname; -public class SuppressionXpathRegressionConstantNameCamelCase { +public class InputXpathConstantNameCamelCase { public static final int badConstant = 2; // warn } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameLowercase.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameLowercase.java similarity index 63% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameLowercase.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameLowercase.java index bda9d2cf6d5..20cae75b8de 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameLowercase.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameLowercase.java @@ -1,5 +1,5 @@ package org.checkstyle.suppressionxpathfilter.constantname; -public class SuppressionXpathRegressionConstantNameLowercase { +public class InputXpathConstantNameLowercase { public static final int number = 7; // warn } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameWithBeginningUnderscore.java similarity index 60% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameWithBeginningUnderscore.java index 4bff90c149a..977b2d5b7e1 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameWithBeginningUnderscore.java @@ -1,5 +1,5 @@ package org.checkstyle.suppressionxpathfilter.constantname; -public class SuppressionXpathRegressionConstantNameWithBeginningUnderscore { +public class InputXpathConstantNameWithBeginningUnderscore { private static final String _CONSTANT = "a"; // warn } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameWithTwoUnderscores.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameWithTwoUnderscores.java similarity index 61% rename from src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameWithTwoUnderscores.java rename to src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameWithTwoUnderscores.java index b2c1a20ce9e..55c52f6af36 100644 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/SuppressionXpathRegressionConstantNameWithTwoUnderscores.java +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/constantname/InputXpathConstantNameWithTwoUnderscores.java @@ -1,5 +1,5 @@ package org.checkstyle.suppressionxpathfilter.constantname; -public class SuppressionXpathRegressionConstantNameWithTwoUnderscores { +public class InputXpathConstantNameWithTwoUnderscores { private static final int BAD__NAME = 3; // warn } diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInClass.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInClass.java new file mode 100644 index 00000000000..8a2c341fea2 --- /dev/null +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInClass.java @@ -0,0 +1,9 @@ +package org.checkstyle.suppressionxpathfilter.covariantequals; + +public class InputXpathCovariantEqualsInClass { + + public boolean equals(InputXpathCovariantEqualsInClass i) { // warn + return false; + } + +} diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInEnum.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInEnum.java new file mode 100644 index 00000000000..80eb5e7017a --- /dev/null +++ b/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/InputXpathCovariantEqualsInEnum.java @@ -0,0 +1,11 @@ +package org.checkstyle.suppressionxpathfilter.covariantequals; + +public enum InputXpathCovariantEqualsInEnum { + + EQUALS; + + public boolean equals(InputXpathCovariantEqualsInEnum i) { // warn + return false; + } + +} diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInClass.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInClass.java deleted file mode 100644 index 7b71091052a..00000000000 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInClass.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.checkstyle.suppressionxpathfilter.covariantequals; - -public class SuppressionXpathRegressionCovariantEqualsInClass { - - public boolean equals(SuppressionXpathRegressionCovariantEqualsInClass i) { // warn - return false; - } - -} diff --git a/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInEnum.java b/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInEnum.java deleted file mode 100644 index 28de41773da..00000000000 --- a/src/it/resources/org/checkstyle/suppressionxpathfilter/covariantequals/SuppressionXpathRegressionCovariantEqualsInEnum.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.checkstyle.suppressionxpathfilter.covariantequals; - -public enum SuppressionXpathRegressionCovariantEqualsInEnum { - - EQUALS; - - public boolean equals(SuppressionXpathRegressionCovariantEqualsInEnum i) { // warn - return false; - } - -} diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java index 23cb4b1c213..3c4c694f85c 100644 --- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java +++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java @@ -119,10 +119,6 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { // Checks whose files need to be renamed to new pattern "InputXpath{Check}Xxx.java" // until https://github.com/checkstyle/checkstyle/issues/14715 private static final Set RENAME_INPUT_XPATH = Set.of( - "ClassMemberImpliedModifier", - "CommentsIndentation", - "ConstantName", - "CovariantEquals", "CustomImportOrder", "CyclomaticComplexity", "FinalLocalVariable",