From 39ef71f7390f1f28c03b91e7f8ac449895e963ed Mon Sep 17 00:00:00 2001 From: DDDreame Date: Thu, 11 May 2023 00:42:39 +0800 Subject: [PATCH] fix checkType errors about module hippo4j-adapter-alibaba-dubbo. --- .../adapter/dubbo/DubboThreadPoolAdapter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java b/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java index a3257f19..ffc61831 100644 --- a/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java +++ b/hippo4j-adapter/hippo4j-adapter-dubbo/src/main/java/cn/hippo4j/adapter/dubbo/DubboThreadPoolAdapter.java @@ -46,7 +46,7 @@ import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_DELIMI @Slf4j public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationListener { - private final Map DUBBO_PROTOCOL_EXECUTOR = new HashMap<>(); + private final Map dubboProtocolExecutor = new HashMap<>(); @Override public String mark() { @@ -56,7 +56,7 @@ public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationLis @Override public ThreadPoolAdapterState getThreadPoolState(String identify) { ThreadPoolAdapterState threadPoolAdapterState = new ThreadPoolAdapterState(); - ThreadPoolExecutor executor = DUBBO_PROTOCOL_EXECUTOR.get(identify); + ThreadPoolExecutor executor = dubboProtocolExecutor.get(identify); if (executor == null) { log.warn("[{}] Dubbo consuming thread pool not found.", identify); return threadPoolAdapterState; @@ -70,14 +70,14 @@ public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationLis @Override public List getThreadPoolStates() { List threadPoolAdapterStates = new ArrayList<>(); - DUBBO_PROTOCOL_EXECUTOR.forEach((key, val) -> threadPoolAdapterStates.add(getThreadPoolState(String.valueOf(key)))); + dubboProtocolExecutor.forEach((key, val) -> threadPoolAdapterStates.add(getThreadPoolState(String.valueOf(key)))); return threadPoolAdapterStates; } @Override public boolean updateThreadPool(ThreadPoolAdapterParameter threadPoolAdapterParameter) { String threadPoolKey = threadPoolAdapterParameter.getThreadPoolKey(); - ThreadPoolExecutor executor = DUBBO_PROTOCOL_EXECUTOR.get(threadPoolAdapterParameter.getThreadPoolKey()); + ThreadPoolExecutor executor = dubboProtocolExecutor.get(threadPoolAdapterParameter.getThreadPoolKey()); if (executor == null) { log.warn("[{}] Dubbo consuming thread pool not found.", threadPoolKey); return false; @@ -105,14 +105,14 @@ public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationLis if (isLegacyVersion) { DataStore dataStore = ExtensionLoader.getExtensionLoader(DataStore.class).getDefaultExtension(); Map executors = dataStore.get(poolKey); - executors.forEach((key, value) -> DUBBO_PROTOCOL_EXECUTOR.put(key, (ThreadPoolExecutor) value)); + executors.forEach((key, value) -> dubboProtocolExecutor.put(key, (ThreadPoolExecutor) value)); return; } ExecutorRepository executorRepository = ExtensionLoader.getExtensionLoader(ExecutorRepository.class).getDefaultExtension(); ConcurrentMap> data = (ConcurrentMap>) ReflectUtil.getFieldValue(executorRepository, "data"); ConcurrentMap executorServiceMap = data.get(poolKey); - executorServiceMap.forEach((key, value) -> DUBBO_PROTOCOL_EXECUTOR.put(String.valueOf(key), (ThreadPoolExecutor) value)); + executorServiceMap.forEach((key, value) -> dubboProtocolExecutor.put(String.valueOf(key), (ThreadPoolExecutor) value)); } catch (Exception ex) { log.error("Failed to get Dubbo {} protocol thread pool", Version.getVersion(), ex); }