]> git.basschouten.com Git - openhab-addons.git/commitdiff
[cbus] fix exception from threadpool at startup (#11846)
authorjpharvey <john.p.harvey@btinternet.com>
Sun, 2 Jan 2022 15:20:32 +0000 (15:20 +0000)
committerGitHub <noreply@github.com>
Sun, 2 Jan 2022 15:20:32 +0000 (16:20 +0100)
* update to use executorservice to fix crash caused by change in underlying threadpool implementation

* Remove explicit cast

Signed-off-by: John Harvey <john.p.harvey@btinternet.com>
bundles/org.openhab.binding.cbus/src/main/java/org/openhab/binding/cbus/internal/CBusThreadPool.java

index 2c6cd71c87371f80ae8ec7a20ace4c7f1240ae17..a0f43c44cbe82e66239c316af77f45efbcef38fc 100644 (file)
@@ -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