jvpp-benchmark: ignore unclosed resources reported by Sonar 58/14158/1
authorMarek Gradzki <[email protected]>
Mon, 13 Aug 2018 05:12:38 +0000 (07:12 +0200)
committerMarek Gradzki <[email protected]>
Mon, 13 Aug 2018 05:12:39 +0000 (07:12 +0200)
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 <[email protected]>
it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/acl/AclUpdateBenchmark.java
it/jvpp-benchmark/src/main/java/io/fd/hc2vpp/it/jvpp/benchmark/classify/ClassifyTableBenchmark.java

index ac3032c..b1f5982 100644 (file)
@@ -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());
index fba7110..c37fa07 100644 (file)
@@ -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());