Skip to content

Commit

Permalink
Merge branch 'master' into ctor-14726
Browse files Browse the repository at this point in the history
  • Loading branch information
Zopsss committed Apr 4, 2024
2 parents ad5f0ef + f7e952b commit d7171b8
Show file tree
Hide file tree
Showing 107 changed files with 670 additions and 352 deletions.
36 changes: 0 additions & 36 deletions config/checkstyle-input-suppressions.xml
Expand Up @@ -431,40 +431,6 @@
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodScopeInnerInterfaces.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodScopeInnerInterfaces.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSetterGetter.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]javadoc[\\/]javadocmethod[\\/]InputJavadocMethodSurroundingAccessModifier.java"/>
<suppress id="UnnecessaryOkComment"
Expand Down Expand Up @@ -1369,8 +1335,6 @@
files="checks[\\/]sizes[\\/]executablestatementcount[\\/]InputExecutableStatementCountLambdas.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]sizes[\\/]executablestatementcount[\\/]InputExecutableStatementCountMaxZero.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]sizes[\\/]lambdabodylength[\\/]InputLambdaBodyLengthMax.java"/>
<suppress id="UnnecessaryOkComment"
files="checks[\\/]sizes[\\/]outertypenumber[\\/]InputOuterTypeNumberEmptyInner.java"/>
<suppress id="UnnecessaryOkComment"
Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle-resources-suppressions.xml
Expand Up @@ -85,7 +85,7 @@
<suppress checks="OuterTypeFilename"
files="[\\/]package-info\.java"/>
<suppress checks="OuterTypeFilename"
files="src[\\/]it[\\/]resources[\\/].*[\\/]SuppressionXpathRegressionOuterTypeFilename.*\.java"/>
files="src[\\/]it[\\/]resources[\\/].*[\\/]InputXpathOuterTypeFilename.*\.java"/>

<!-- intentional problem for testing -->
<suppress id="noTrailingWhitespace"
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -211,7 +211,7 @@
<maven.spotbugs.plugin.version>4.8.3.1</maven.spotbugs.plugin.version>
<maven.pmd.plugin.version>3.21.2</maven.pmd.plugin.version>
<pmd.version>6.55.0</pmd.version>
<maven.jacoco.plugin.version>0.8.11</maven.jacoco.plugin.version>
<maven.jacoco.plugin.version>0.8.12</maven.jacoco.plugin.version>
<mockito.version>5.2.0</mockito.version>
<saxon.version>12.4</saxon.version>
<maven.checkstyle.plugin.version>3.2.0</maven.checkstyle.plugin.version>
Expand Down Expand Up @@ -369,7 +369,7 @@
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.16</version>
<version>3.16.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Expand Up @@ -38,9 +38,9 @@ protected String getCheckName() {
}

@Test
public void testOne() throws Exception {
public void testNonStatic() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionDeclarationOrderOne.java"));
new File(getPath("InputXpathDeclarationOrderNonStatic.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(DeclarationOrderCheck.class);
Expand All @@ -52,13 +52,13 @@ public void testOne() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionDeclarationOrderOne']]"
+ "[./IDENT[@text='InputXpathDeclarationOrderNonStatic']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='name']]",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionDeclarationOrderOne']]"
+ "[./IDENT[@text='InputXpathDeclarationOrderNonStatic']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='name']]/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionDeclarationOrderOne']]"
+ "[./IDENT[@text='InputXpathDeclarationOrderNonStatic']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='name']]/MODIFIERS/LITERAL_PUBLIC"
);

Expand All @@ -67,9 +67,9 @@ public void testOne() throws Exception {
}

@Test
public void testTwo() throws Exception {
public void testStatic() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionDeclarationOrderTwo.java"));
new File(getPath("InputXpathDeclarationOrderStatic.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(DeclarationOrderCheck.class);
Expand All @@ -81,13 +81,13 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionDeclarationOrderTwo']]"
+ "[./IDENT[@text='InputXpathDeclarationOrderStatic']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='MAX']]",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionDeclarationOrderTwo']]"
+ "[./IDENT[@text='InputXpathDeclarationOrderStatic']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='MAX']]/MODIFIERS",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionDeclarationOrderTwo']]"
+ "[./IDENT[@text='InputXpathDeclarationOrderStatic']]"
+ "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='MAX']]/MODIFIERS/LITERAL_PUBLIC"
);

Expand Down
Expand Up @@ -39,9 +39,9 @@ protected String getCheckName() {
}

@Test
public void testOne() throws Exception {
public void testNonEmptyCase() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionDefaultComesLastOne.java"));
new File(getPath("InputXpathDefaultComesLastNonEmptyCase.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(DefaultComesLastCheck.class);
Expand All @@ -53,11 +53,11 @@ public void testOne() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionDefaultComesLastOne']]/OBJBLOCK"
+ "[@text='InputXpathDefaultComesLastNonEmptyCase']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/CASE_GROUP["
+ "./SLIST/EXPR/ASSIGN/IDENT[@text='id']]",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionDefaultComesLastOne']]/OBJBLOCK"
+ "[@text='InputXpathDefaultComesLastNonEmptyCase']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/CASE_GROUP"
+ "/LITERAL_DEFAULT"
);
Expand All @@ -67,9 +67,9 @@ public void testOne() throws Exception {
}

@Test
public void testTwo() throws Exception {
public void testEmptyCase() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionDefaultComesLastTwo.java"));
new File(getPath("InputXpathDefaultComesLastEmptyCase.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(DefaultComesLastCheck.class);
Expand All @@ -82,7 +82,7 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT"
+ "[@text='SuppressionXpathRegressionDefaultComesLastTwo']]/OBJBLOCK"
+ "[@text='InputXpathDefaultComesLastEmptyCase']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/CASE_GROUP"
+ "/LITERAL_DEFAULT"
);
Expand Down
Expand Up @@ -39,7 +39,7 @@ protected String getCheckName() {
@Test
public void testEmptyForLoopEmptyBlock() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionEmptyBlockEmpty.java"));
new File(getPath("InputXpathEmptyBlockEmpty.java"));
final DefaultConfiguration moduleConfig =
createModuleConfig(EmptyBlockCheck.class);
moduleConfig.addProperty("option", "TEXT");
Expand All @@ -49,7 +49,7 @@ public void testEmptyForLoopEmptyBlock() throws Exception {
};
final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT"
+ "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyBlockEmpty']]"
+ "/CLASS_DEF[./IDENT[@text='InputXpathEmptyBlockEmpty']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]"
+ "/SLIST/LITERAL_FOR/SLIST"
);
Expand All @@ -60,7 +60,7 @@ public void testEmptyForLoopEmptyBlock() throws Exception {
@Test
public void testEmptyForLoopEmptyStatement() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionEmptyBlockEmpty.java"));
new File(getPath("InputXpathEmptyBlockEmpty.java"));
final DefaultConfiguration moduleConfig =
createModuleConfig(EmptyBlockCheck.class);
final String[] expectedViolation = {
Expand All @@ -69,7 +69,7 @@ public void testEmptyForLoopEmptyStatement() throws Exception {
};
final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT"
+ "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyBlockEmpty']]"
+ "/CLASS_DEF[./IDENT[@text='InputXpathEmptyBlockEmpty']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]"
+ "/SLIST/LITERAL_FOR/SLIST"
);
Expand Down
Expand Up @@ -41,7 +41,7 @@ protected String getCheckName() {
@Test
public void testOne() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionEmptyCatchBlock1.java"));
getPath("InputXpathEmptyCatchBlockOne.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(clazz);

Expand All @@ -51,7 +51,7 @@ public void testOne() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionEmptyCatchBlock1']]"
+ "[./IDENT[@text='InputXpathEmptyCatchBlockOne']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]"
+ "/SLIST/LITERAL_TRY/LITERAL_CATCH/SLIST"
);
Expand All @@ -62,7 +62,7 @@ public void testOne() throws Exception {
@Test
public void testTwo() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionEmptyCatchBlock2.java"));
getPath("InputXpathEmptyCatchBlockTwo.java"));

final DefaultConfiguration moduleConfig = createModuleConfig(clazz);

Expand All @@ -72,7 +72,7 @@ public void testTwo() throws Exception {

final List<String> expectedXpathQueries = Collections.singletonList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionEmptyCatchBlock2']]"
+ "[./IDENT[@text='InputXpathEmptyCatchBlockTwo']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]"
+ "/SLIST/LITERAL_TRY/LITERAL_CATCH/SLIST"
);
Expand Down
Expand Up @@ -41,7 +41,7 @@ protected String getCheckName() {
@Test
public void testPreceded() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionEmptyForInitializerPadPreceded.java"));
getPath("InputXpathEmptyForInitializerPadPreceded.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(EmptyForInitializerPadCheck.class);
Expand All @@ -53,10 +53,10 @@ public void testPreceded() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionEmptyForInitializerPadPreceded']]"
+ "[./IDENT[@text='InputXpathEmptyForInitializerPadPreceded']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/FOR_INIT",
"/COMPILATION_UNIT/CLASS_DEF"
+ "[./IDENT[@text='SuppressionXpathRegressionEmptyForInitializerPadPreceded']]"
+ "[./IDENT[@text='InputXpathEmptyForInitializerPadPreceded']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/SEMI[1]"
);

Expand All @@ -67,7 +67,7 @@ public void testPreceded() throws Exception {
@Test
public void testNotPreceded() throws Exception {
final File fileToProcess = new File(
getPath("SuppressionXpathRegressionEmptyForInitializerPadNotPreceded.java"));
getPath("InputXpathEmptyForInitializerPadNotPreceded.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(EmptyForInitializerPadCheck.class);
Expand All @@ -80,10 +80,10 @@ public void testNotPreceded() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionEmptyForInitializerPadNotPreceded']]"
+ "@text='InputXpathEmptyForInitializerPadNotPreceded']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/FOR_INIT",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionEmptyForInitializerPadNotPreceded']]"
+ "@text='InputXpathEmptyForInitializerPadNotPreceded']]"
+ "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/SEMI[1]"
);

Expand Down
Expand Up @@ -41,7 +41,7 @@ protected String getCheckName() {
@Test
public void testFollowed() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadFollowed.java"));
new File(getPath("InputXpathEmptyForIteratorPadFollowed.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(EmptyForIteratorPadCheck.class);
Expand All @@ -53,10 +53,10 @@ public void testFollowed() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionEmptyForIteratorPadFollowed']]/OBJBLOCK"
+ "@text='InputXpathEmptyForIteratorPadFollowed']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/FOR_ITERATOR",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionEmptyForIteratorPadFollowed']]/OBJBLOCK"
+ "@text='InputXpathEmptyForIteratorPadFollowed']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/RPAREN"
);

Expand All @@ -67,7 +67,7 @@ public void testFollowed() throws Exception {
@Test
public void testNotFollowed() throws Exception {
final File fileToProcess =
new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadNotFollowed.java"));
new File(getPath("InputXpathEmptyForIteratorPadNotFollowed.java"));

final DefaultConfiguration moduleConfig =
createModuleConfig(EmptyForIteratorPadCheck.class);
Expand All @@ -80,10 +80,10 @@ public void testNotFollowed() throws Exception {

final List<String> expectedXpathQueries = Arrays.asList(
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionEmptyForIteratorPadNotFollowed']]/OBJBLOCK"
+ "@text='InputXpathEmptyForIteratorPadNotFollowed']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/FOR_ITERATOR",
"/COMPILATION_UNIT/CLASS_DEF[./IDENT["
+ "@text='SuppressionXpathRegressionEmptyForIteratorPadNotFollowed']]/OBJBLOCK"
+ "@text='InputXpathEmptyForIteratorPadNotFollowed']]/OBJBLOCK"
+ "/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_FOR/RPAREN"
);

Expand Down

0 comments on commit d7171b8

Please sign in to comment.