From 7d7c3e18976d22bd2dd81fa33d4fc5bd81cca43c Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Mon, 13 Aug 2018 07:12:38 +0200 Subject: jvpp-benchmark: ignore unclosed resources reported by Sonar Sonar reports unclosed resources, but jvpp connections are closed in JVppBenchmark.tearDown. It is only a benchmark, so if JMH would crash and not call tearDown, then we don't really care. Change-Id: I60ae60c78610b8c07076c7d2a94917e8316d03dd Signed-off-by: Marek Gradzki --- .../java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclUpdateBenchmark.java | 3 +++ .../fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableBenchmark.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclUpdateBenchmark.java b/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclUpdateBenchmark.java index ac3032ccd..b1f598253 100644 --- a/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclUpdateBenchmark.java +++ b/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclUpdateBenchmark.java @@ -134,6 +134,9 @@ public class AclUpdateBenchmark extends JVppBenchmark { return aclId; } + // Sonar reports unclosed resources, but jvpp connections are closed in JVppBenchmark.tearDown. + // It is only a benchmark, so if JMH would crash and not call tearDown, then we don't really care. + @SuppressWarnings("squid:S2095") @Override protected void connect(final JVppRegistry registry) throws IOException { jvppCore = new FutureJVppCoreFacade(registry, new JVppCoreImpl()); diff --git a/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableBenchmark.java b/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableBenchmark.java index fba7110d1..c37fa0765 100644 --- a/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableBenchmark.java +++ b/it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableBenchmark.java @@ -48,6 +48,9 @@ public class ClassifyTableBenchmark extends JVppBenchmark { classifyTableProvider = new ClassifyTableProviderImpl(tableSetSize); } + // Sonar reports unclosed resources, but jvpp connection is closed in JVppBenchmark.tearDown. + // It is only a benchmark, so if JMH would crash and not call tearDown, then we don't really care. + @SuppressWarnings("squid:S2095") @Override protected void connect(final JVppRegistry registry) throws IOException { jvppCore = new FutureJVppCoreFacade(registry, new JVppCoreImpl()); -- cgit 1.2.3-korg