diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2018-08-13 07:12:38 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2018-08-13 07:12:39 +0200 |
commit | f31cac1a4005fd502c95858b71c60900ee9f10bd (patch) | |
tree | ff877890840f0a7c47718f867f81fea9442c4b8e | |
parent | 446de16ff5c8df1914039b826adbbd0ec5ac2adc (diff) |
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 <mgradzki@cisco.com>
2 files changed, 6 insertions, 0 deletions
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()); |