Skip to content

Commit

Permalink
[cbus] fix exception from threadpool at startup (openhab#11846)
Browse files Browse the repository at this point in the history
* 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>
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
  • Loading branch information
jpharvey authored and NickWaterton committed Apr 27, 2022
1 parent b1cee41 commit f1b3104
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

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;
Expand Down Expand Up @@ -45,10 +45,10 @@ protected synchronized CGateThreadPoolExecutor CreateExecutor(@Nullable String n
}

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
Expand Down

0 comments on commit f1b3104

Please sign in to comment.