[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 <john.p.harvey@btinternet.com>
This commit is contained in:
jpharvey
2022-01-02 15:20:32 +00:00
committed by GitHub
parent e8df66f1d0
commit 8eda5551d1

View 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