diff --git a/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java b/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java index 25bb91e6f5..94ac40c9a9 100644 --- a/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java +++ b/starters/threadpool/config/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java @@ -194,10 +194,9 @@ private void checkNotifyConsistencyAndReplace(ExecutorProperties executorPropert Boolean isAlarm = executorProperties.getAlarm(); Integer activeAlarm = executorProperties.getActiveAlarm(); Integer capacityAlarm = executorProperties.getCapacityAlarm(); - // FIXME Compare using Objects.equals - if ((isAlarm != null && isAlarm != threadPoolNotifyAlarm.getAlarm()) - || (activeAlarm != null && activeAlarm != threadPoolNotifyAlarm.getActiveAlarm()) - || (capacityAlarm != null && capacityAlarm != threadPoolNotifyAlarm.getCapacityAlarm())) { + if ((isAlarm != null && !Objects.equals(isAlarm,threadPoolNotifyAlarm.getAlarm())) + || (activeAlarm != null && !Objects.equals(activeAlarm,threadPoolNotifyAlarm.getActiveAlarm())) + || (capacityAlarm != null && !Objects.equals(capacityAlarm,threadPoolNotifyAlarm.getCapacityAlarm()))) { checkNotifyAlarm = true; threadPoolNotifyAlarm.setAlarm(Optional.ofNullable(isAlarm).orElse(threadPoolNotifyAlarm.getAlarm())); threadPoolNotifyAlarm.setActiveAlarm(Optional.ofNullable(activeAlarm).orElse(threadPoolNotifyAlarm.getActiveAlarm()));