From: jpharvey Date: Sun, 2 Jan 2022 15:20:32 +0000 (+0000) Subject: [cbus] fix exception from threadpool at startup (#11846) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=8eda5551d1adfd028210a5f438d2ec1ff0443b8e;p=openhab-addons.git [cbus] fix exception from threadpool at startup (#11846) * update to use executorservice to fix crash caused by change in underlying threadpool implementation * Remove explicit cast Signed-off-by: John Harvey --- diff --git a/bundles/org.openhab.binding.cbus/src/main/java/org/openhab/binding/cbus/internal/CBusThreadPool.java b/bundles/org.openhab.binding.cbus/src/main/java/org/openhab/binding/cbus/internal/CBusThreadPool.java index 2c6cd71c87..a0f43c44cb 100644 --- a/bundles/org.openhab.binding.cbus/src/main/java/org/openhab/binding/cbus/internal/CBusThreadPool.java +++ b/bundles/org.openhab.binding.cbus/src/main/java/org/openhab/binding/cbus/internal/CBusThreadPool.java @@ -14,7 +14,7 @@ package org.openhab.binding.cbus.internal; import java.util.HashMap; import java.util.Map; -import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.ExecutorService; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -45,10 +45,10 @@ public class CBusThreadPool extends CGateThreadPool { } public class CBusThreadPoolExecutor extends CGateThreadPoolExecutor { - private final ThreadPoolExecutor threadPool; + private final ExecutorService threadPool; public CBusThreadPoolExecutor(@Nullable String poolName) { - threadPool = (ThreadPoolExecutor) ThreadPoolManager.getPool("binding.cbus-" + poolName); + threadPool = ThreadPoolManager.getPool("binding.cbus-" + poolName); } @Override