style format

pull/607/head
lijianxin 3 years ago
parent 101099066e
commit dafcfc05fd

@ -62,10 +62,10 @@ public class ThreadPoolTaskExecutorAdapter implements DynamicThreadPoolAdapter {
if (unwrap instanceof DynamicThreadPoolExecutor) { if (unwrap instanceof DynamicThreadPoolExecutor) {
return (DynamicThreadPoolExecutor) unwrap; return (DynamicThreadPoolExecutor) unwrap;
} }
boolean waitForTasksToCompleteOnShutdown = (boolean)ReflectUtil.getFieldValue(executor, WAIT_FOR_TASKS_TO_COMPLETE_ON_SHUTDOWN); boolean waitForTasksToCompleteOnShutdown = (boolean) ReflectUtil.getFieldValue(executor, WAIT_FOR_TASKS_TO_COMPLETE_ON_SHUTDOWN);
long awaitTerminationMillis = (long)ReflectUtil.getFieldValue(executor, AWAIT_TERMINATION_MILLIS); long awaitTerminationMillis = (long) ReflectUtil.getFieldValue(executor, AWAIT_TERMINATION_MILLIS);
String beanName = (String)ReflectUtil.getFieldValue(executor, BEAN_NAME); String beanName = (String) ReflectUtil.getFieldValue(executor, BEAN_NAME);
int queueCapacity = (int)ReflectUtil.getFieldValue(executor, QUEUE_CAPACITY); int queueCapacity = (int) ReflectUtil.getFieldValue(executor, QUEUE_CAPACITY);
ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) unwrap; ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) unwrap;
ThreadPoolTaskExecutor threadPoolTaskExecutor = (ThreadPoolTaskExecutor) executor; ThreadPoolTaskExecutor threadPoolTaskExecutor = (ThreadPoolTaskExecutor) executor;
@ -81,11 +81,10 @@ public class ThreadPoolTaskExecutorAdapter implements DynamicThreadPoolAdapter {
.waitForTasksToCompleteOnShutdown(waitForTasksToCompleteOnShutdown) .waitForTasksToCompleteOnShutdown(waitForTasksToCompleteOnShutdown)
.awaitTerminationMillis(awaitTerminationMillis) .awaitTerminationMillis(awaitTerminationMillis)
.threadFactory(threadPoolExecutor.getThreadFactory()) .threadFactory(threadPoolExecutor.getThreadFactory())
//threadPoolId default beanName // threadPoolId default beanName
.threadPoolId(beanName) .threadPoolId(beanName)
.rejected(threadPoolExecutor.getRejectedExecutionHandler()) .rejected(threadPoolExecutor.getRejectedExecutionHandler());
; // use new Queue
//use new Queue
threadPoolBuilder.capacity(queueCapacity); threadPoolBuilder.capacity(queueCapacity);
// .workQueue(threadPoolExecutor.getQueue()) // .workQueue(threadPoolExecutor.getQueue())

Loading…
Cancel
Save