Strengthen utils.concurrent deprecations
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Jul 2020 10:50:54 +0000 (12:50 +0200)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 7 Oct 2021 05:19:58 +0000 (15:19 +1000)
We will be removing deprecated API elements in the next release,
make sure all of them are deprecated.

Change-Id: Iad10e82fc91801cc185f9f73dd0fd6e03a64fb3e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
metrics/sample/impl/src/main/java/org/opendaylight/infrautils/metrics/sample/MetricsExample.java

index 728a8bf45091c306113e077cde3186f2e8dac1da..520fdcc849472f0f71c9b418c5d55fb9e4da1ba7 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.infrautils.metrics.sample;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.opendaylight.infrautils.utils.concurrent.JdkFutures.addErrorLogging;
+import static org.opendaylight.infrautils.utils.concurrent.LoggingFutures.addErrorLogging;
 
 import java.util.Random;
 import java.util.concurrent.ScheduledExecutorService;
@@ -49,7 +49,7 @@ public class MetricsExample implements Runnable {
     private final Meter meterWithTwoFixedLabels;
     private final Labeled<Meter> meterWithOneDynamicLabel;
 
-    private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor("cron", LOG);
+    private final ScheduledExecutorService executor = Executors.newListeningSingleThreadScheduledExecutor("cron", LOG);
     private final Random random = new Random();
 
     @Inject
@@ -79,6 +79,7 @@ public class MetricsExample implements Runnable {
     }
 
     @PostConstruct
+    @SuppressWarnings("FutureReturnValueIgnored")
     public void init() {
         addErrorLogging(executor.scheduleWithFixedDelay(this, 0, 500, MILLISECONDS), LOG, "schedule interrupted");
     }