From 78ba79b2a71165f98e3d93f0df514fef70e9bd8c Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Tue, 12 Apr 2022 19:39:25 +0800 Subject: [PATCH] Refactored hippo4j-core spring post processor logic. (#177) --- .../core/starter/support/DynamicThreadPoolPostProcessor.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java index 81de4f32..c8409e5a 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/support/DynamicThreadPoolPostProcessor.java @@ -124,7 +124,7 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { if (dynamicThreadPoolWrap.getExecutor() instanceof AbstractDynamicExecutorSupport) { // 设置动态线程池增强参数 - ThreadPoolNotifyAlarm notify = executorProperties.getNotify(); + ThreadPoolNotifyAlarm notify = Optional.ofNullable(executorProperties).map(ExecutorProperties::getNotify).orElse(null); boolean isAlarm = Optional.ofNullable(notify) .map(each -> each.getIsAlarm()) .orElseGet(() -> bootstrapCoreProperties.getAlarm() != null ? bootstrapCoreProperties.getAlarm() : true); @@ -194,5 +194,4 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { return executorProperties; } - }