Skip to content

Commit

Permalink
Catch up checkstyle with JDK 17
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Apr 20, 2024
1 parent f7f508a commit 8ed1d15
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,9 @@ public synchronized String apply(final File file) {
final String fileName = Objects.requireNonNull(file).getMetaData().getFileName();
final Date now = new Date();

getMessageDigest().update(fileName.getBytes(StandardCharsets.US_ASCII));
getMessageDigest().update(now.toString().getBytes(StandardCharsets.US_ASCII));
messageDigest.update(fileName.getBytes(StandardCharsets.US_ASCII));
messageDigest.update(now.toString().getBytes(StandardCharsets.US_ASCII));

return new String(Base64.getEncoder().encode(getMessageDigest().digest()));
}

public MessageDigest getMessageDigest() {
return messageDigest;
return new String(Base64.getEncoder().encode(messageDigest.digest()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private StartHarness() throws InterruptedException {
* Start the test harness and track it for timeouts.
*
* @throws InterruptedException if the harness is interrupted
* @throws IllegalStateException if stopping the harness throws an error
*/
@SuppressWarnings("IllegalCatch")
public void startHarness() throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class FileStepDefinitions extends AbstractStepDefinitions {
@When("^a text file is uploaded$")
//CHECKSTYLE:OFF
public void uploadTextFile() throws URISyntaxException {
//CHECKSTYLE:ON
//CHECKSTYLE:ON
response = RestAssured.given()
.multiPart(
Paths.get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public GraphQLFactory(
* @return a resource file content
*
* @throws NullPointerException if {@code resourceName} is {@code null}
* @throws IllegalStateException if {@code resourceName} corresponds a non-existing file source
*/
@NotNull
public static String getGraphQLSchemaResourceAsString(@NotNull final String resourceName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public class LayeredFileSystemConfig implements SystemConfig {

/**
* Constructor.
*
* @throws IllegalStateException if loading an existing {@code userConfig.properties} file fails
*/
public LayeredFileSystemConfig() {
this.compositeConfiguration = new CompositeConfiguration();
Expand Down
9 changes: 0 additions & 9 deletions checkstyle-suppressions.xml

This file was deleted.

22 changes: 21 additions & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<module name="JavadocMethod">
<property name="allowedAnnotations" value="Override"/>
<property name="validateThrows" value="true"/>
<property name="scope" value="anoninner"/>
<property name="accessModifiers" value="public, protected, package, private"/>
<property name="allowMissingParamTags" value="false"/>
<property name="allowMissingReturnTag" value="false"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF"/>
Expand Down Expand Up @@ -169,6 +169,26 @@
<property name="tokens" value="ENUM_CONSTANT_DEF"/>
<property name="severity" value="error"/>
</module>


<module name="MissingJavadocMethod">
<property name="severity" value="error"/>
<property name="allowMissingPropertyJavadoc" value="false"/>
<property name="scope" value="anoninner"/>
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
</module>
<module name="MissingJavadocPackage">
<property name="severity" value="error"/>
</module>
<module name="MissingJavadocType">
<property name="scope" value="anoninner"/>
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF"/>
<property name="severity" value="error"/>
</module>




<module name="NonEmptyAtclauseDescription">
<property name="javadocTokens" value=" PARAM_LITERAL, RETURN_LITERAL, THROWS_LITERAL, DEPRECATED_LITERAL"/>
<property name="severity" value="error"/>
Expand Down
20 changes: 6 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<checkstyle.skip>false</checkstyle.skip>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.athena>1.0-SNAPSHOT</version.athena>
<version.validation.api>3.0.1</version.validation.api>
Expand Down Expand Up @@ -73,14 +74,7 @@
<version.maven.surefire.plugin>3.0.0-M5</version.maven.surefire.plugin>
<version.maven.compiler.plugin>3.7.0</version.maven.compiler.plugin>
<version.maven.failsafe.plugin>3.0.0-M4</version.maven.failsafe.plugin>
<version.maven.checkstyle.plugin>3.1.2</version.maven.checkstyle.plugin>
<version.maven.surefire.report.plugin>${version.maven.surefire.plugin}</version.maven.surefire.report.plugin>

<checkstyle.skip>false</checkstyle.skip>
<checkstyle.config.location>checkstyle.xml</checkstyle.config.location>
<checkstyle.suppressions.location>checkstyle-suppressions.xml</checkstyle.suppressions.location>
<checkstyle.version>8.30</checkstyle.version>
<checkstyle.resourceIncludes>**/*.properties*</checkstyle.resourceIncludes>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -419,23 +413,21 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${version.maven.checkstyle.plugin}</version>
<version>3.3.1</version>
<dependencies>
<!-- override default checkstyle version -->
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
<version>10.14.2</version>
</dependency>
</dependencies>
<configuration>
<suppressionsLocation>${checkstyle.suppressions.location}</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<configLocation>${checkstyle.config.location}</configLocation>
<configLocation>checkstyle.xml</configLocation>
<includes>**\/*.java,**\/*.groovy</includes>
<resourceIncludes>**/*.properties,**/*.sample</resourceIncludes>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
</plugin>

Expand Down

0 comments on commit 8ed1d15

Please sign in to comment.