diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8dcad3b..cb9b282 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -42,7 +42,7 @@ tasks.withType().configureEach } dependencies { - implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:5.1.4") // https://plugins.gradle.org/plugin/com.github.spotbugs + implementation("com.github.spotbugs.snom:spotbugs-gradle-plugin:5.2.1") // https://plugins.gradle.org/plugin/com.github.spotbugs implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0") // https://plugins.gradle.org/plugin/com.diffplug.spotless implementation("gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.2") // https://plugins.gradle.org/plugin/com.github.kt3k.coveralls implementation("org.javamodularity:moduleplugin:1.8.12") // https://plugins.gradle.org/plugin/org.javamodularity.moduleplugin diff --git a/config/spotbugs/suppressions.xml b/config/spotbugs/suppressions.xml index ecc0a4f..1d71dbb 100644 --- a/config/spotbugs/suppressions.xml +++ b/config/spotbugs/suppressions.xml @@ -14,4 +14,10 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/org/creekservice/kafka/test/perf/serde/ConfluentSerde.java b/src/main/java/org/creekservice/kafka/test/perf/serde/ConfluentSerde.java index 3cc7138..a9acd35 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/serde/ConfluentSerde.java +++ b/src/main/java/org/creekservice/kafka/test/perf/serde/ConfluentSerde.java @@ -77,4 +77,10 @@ public org.creekservice.kafka.test.perf.serde.Serializer serializer() { public org.creekservice.kafka.test.perf.serde.Deserializer deserializer() { return data -> deserializer.deserialize(TOPIC_NAME, data); } + + // Final, empty finalize method stops spotbugs CT_CONSTRUCTOR_THROW + // Can be moved to base type after https://github.com/spotbugs/spotbugs/issues/2665 + @Override + @SuppressWarnings({"deprecation", "Finalize"}) + protected final void finalize() {} } diff --git a/src/main/java/org/creekservice/kafka/test/perf/serde/JustifySerde.java b/src/main/java/org/creekservice/kafka/test/perf/serde/JustifySerde.java index 720a2ae..13aec2b 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/serde/JustifySerde.java +++ b/src/main/java/org/creekservice/kafka/test/perf/serde/JustifySerde.java @@ -45,7 +45,7 @@ public class JustifySerde extends SerdeImpl { private JsonValidationService service; private JsonSchema schema; private ProblemHandler handler; - public ObjectMapper mapper = JsonMapper.builder().build(); + private ObjectMapper mapper = JsonMapper.builder().build(); public JustifySerde() { service = JsonValidationService.newInstance(); @@ -160,4 +160,10 @@ private SpecVersion schemaVersion(final SchemaSpec spec) { } }; } + + // Final, empty finalize method stops spotbugs CT_CONSTRUCTOR_THROW + // Can be moved to base type after https://github.com/spotbugs/spotbugs/issues/2665 + @Override + @SuppressWarnings({"deprecation", "Finalize"}) + protected final void finalize() {} } diff --git a/src/main/java/org/creekservice/kafka/test/perf/serde/SchemaFriendSerde.java b/src/main/java/org/creekservice/kafka/test/perf/serde/SchemaFriendSerde.java index 55602af..32b6ca2 100644 --- a/src/main/java/org/creekservice/kafka/test/perf/serde/SchemaFriendSerde.java +++ b/src/main/java/org/creekservice/kafka/test/perf/serde/SchemaFriendSerde.java @@ -155,4 +155,10 @@ private Schema parseSchema( throw new RuntimeException(e); } } + + // Final, empty finalize method stops spotbugs CT_CONSTRUCTOR_THROW + // Can be moved to base type after https://github.com/spotbugs/spotbugs/issues/2665 + @Override + @SuppressWarnings({"deprecation", "Finalize"}) + protected final void finalize() {} }