Skip to content

Commit

Permalink
Enable strict compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Mar 12, 2024
1 parent 6f6cb03 commit c85e562
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions extension-manager-client-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<!-- Exclude warnings in generated code -->
<arg>-Xlint:all,-serial,-rawtypes,-deprecation</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
Expand Down
10 changes: 10 additions & 0 deletions extension-manager-integration-test-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>-Xlint:all,-path</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ public void assertRequestFails(final Executable executable, final Matcher<String
() -> assertThat("status code", error.getJsonNumber("code").intValue(), statusMatcher));
}

@SuppressWarnings("try") // auto-closeable resource Jsonb has a member method close() that could throw
// InterruptedException
JsonObject parseErrorMessageJson(final String errorMessage) throws MultipleFailuresError {
try (Jsonb jsonb = JsonbBuilder.create()) {
return jsonb.fromJson(errorMessage, JsonObject.class);
Expand Down

0 comments on commit c85e562

Please sign in to comment.