-
Notifications
You must be signed in to change notification settings - Fork 11
feature: 添加springboot 2.3.x - 2.7.x 线程池适配:ThreadPoolTaskScheduler, ThreadPoolTaskScheduler #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gaosaroma
wants to merge
13
commits into
koupleless:main
Choose a base branch
from
gaosaroma:lipeng_dev_thread_with_classloader
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4d72f26
修改pom
b153a14
rename KouplelessScheduledExecutorService & KouplelessExecutorService
152cd6c
refactor
8952825
refactor
7e4ad11
refactor
gaosaroma 68090d5
add java.version for adapter-dubbo-3.1 & adapter-dubbo-3.2
gaosaroma 53f24a1
Merge branch 'main' into lipeng_dev_thread_with_classloader
lvjing2 2bff877
rename adapters
gaosaroma dc95038
Merge remote-tracking branch 'origin/lipeng_dev_thread_with_classload…
gaosaroma 7386fc5
fix pom
gaosaroma 2a1d32a
refactor
gaosaroma 831980d
Merge branch 'main' into lipeng_dev_thread_with_classloader
lvjing2 f6cfb3f
Merge branch 'main' into lipeng_dev_thread_with_classloader
lvjing2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>com.alipay.sofa.koupleless</groupId> | ||
| <artifactId>koupleless-adapter</artifactId> | ||
| <version>${revision}</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
| <artifactId>koupleless-adapter-executorservice-spring-2.3</artifactId> | ||
|
|
||
| <properties> | ||
| <spring.boot.version>2.3.5.RELEASE</spring.boot.version> | ||
| <java.version>1.8</java.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot</artifactId> | ||
| <version>${spring.boot.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-autoconfigure</artifactId> | ||
| <version>${spring.boot.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.alipay.sofa.koupleless</groupId> | ||
| <artifactId>koupleless-base-plugin</artifactId> | ||
| <version>${revision}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| </project> |
43 changes: 43 additions & 0 deletions
43
...2.3/src/main/java/com/alipay/sofa/koupleless/common/KouplelessThreadPoolTaskExecutor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.alipay.sofa.koupleless.common; | ||
|
|
||
| import com.alipay.sofa.koupleless.common.util.ReflectionUtils; | ||
| import com.alipay.sofa.koupleless.plugin.concurrent.KouplelessExecutorService; | ||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
|
||
| import java.util.concurrent.ExecutorService; | ||
| import java.util.concurrent.RejectedExecutionHandler; | ||
| import java.util.concurrent.ThreadFactory; | ||
|
|
||
| /** | ||
| * @author lianglipeng.llp@alibaba-inc.com | ||
| * @version $Id: KouplelessThreadPoolTaskExecutor.java, v 0.1 2024年05月13日 20:51 立蓬 Exp $ | ||
| */ | ||
| public class KouplelessThreadPoolTaskExecutor extends ThreadPoolTaskExecutor { | ||
|
|
||
| @Override | ||
| protected ExecutorService initializeExecutor(ThreadFactory threadFactory, | ||
| RejectedExecutionHandler rejectedExecutionHandler) { | ||
|
|
||
| ExecutorService executorService = super.initializeExecutor(threadFactory, | ||
| rejectedExecutionHandler); | ||
| KouplelessExecutorService executor = new KouplelessExecutorService(executorService); | ||
| ReflectionUtils.setField("threadPoolExecutor", this, executor); | ||
| return executor; | ||
| } | ||
| } | ||
83 changes: 83 additions & 0 deletions
83
...main/java/org/springframework/boot/autoconfigure/task/TaskExecutionAutoConfiguration.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.springframework.boot.autoconfigure.task; | ||
|
|
||
| import com.alipay.sofa.koupleless.common.KouplelessThreadPoolTaskExecutor; | ||
| import org.springframework.beans.factory.ObjectProvider; | ||
| import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
| import org.springframework.boot.autoconfigure.task.TaskExecutionProperties.Shutdown; | ||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| import org.springframework.boot.task.TaskExecutorBuilder; | ||
| import org.springframework.boot.task.TaskExecutorCustomizer; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.context.annotation.Lazy; | ||
| import org.springframework.core.task.TaskDecorator; | ||
| import org.springframework.core.task.TaskExecutor; | ||
| import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor; | ||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
|
||
| import java.util.concurrent.Executor; | ||
|
|
||
| /** | ||
| * {@link EnableAutoConfiguration Auto-configuration} for {@link TaskExecutor}. | ||
| * springboot 2.3.x~2.6.x 均可以用该类覆盖 | ||
| * @author Stephane Nicoll | ||
| * @author Camille Vienot | ||
| * @since 2.1.0 | ||
| */ | ||
| @ConditionalOnClass(ThreadPoolTaskExecutor.class) | ||
| @Configuration(proxyBeanMethods = false) | ||
| @EnableConfigurationProperties(TaskExecutionProperties.class) | ||
| public class TaskExecutionAutoConfiguration { | ||
|
|
||
| /** | ||
| * Bean name of the application {@link TaskExecutor}. | ||
| */ | ||
| public static final String APPLICATION_TASK_EXECUTOR_BEAN_NAME = "applicationTaskExecutor"; | ||
|
|
||
| @Bean | ||
| @ConditionalOnMissingBean | ||
| public TaskExecutorBuilder taskExecutorBuilder(TaskExecutionProperties properties, | ||
| ObjectProvider<TaskExecutorCustomizer> taskExecutorCustomizers, | ||
| ObjectProvider<TaskDecorator> taskDecorator) { | ||
| TaskExecutionProperties.Pool pool = properties.getPool(); | ||
| TaskExecutorBuilder builder = new TaskExecutorBuilder(); | ||
| builder = builder.queueCapacity(pool.getQueueCapacity()); | ||
| builder = builder.corePoolSize(pool.getCoreSize()); | ||
| builder = builder.maxPoolSize(pool.getMaxSize()); | ||
| builder = builder.allowCoreThreadTimeOut(pool.isAllowCoreThreadTimeout()); | ||
| builder = builder.keepAlive(pool.getKeepAlive()); | ||
| Shutdown shutdown = properties.getShutdown(); | ||
| builder = builder.awaitTermination(shutdown.isAwaitTermination()); | ||
| builder = builder.awaitTerminationPeriod(shutdown.getAwaitTerminationPeriod()); | ||
| builder = builder.threadNamePrefix(properties.getThreadNamePrefix()); | ||
| builder = builder.customizers(taskExecutorCustomizers.orderedStream()::iterator); | ||
| builder = builder.taskDecorator(taskDecorator.getIfUnique()); | ||
| return builder; | ||
| } | ||
|
|
||
| @Lazy | ||
| @Bean(name = { APPLICATION_TASK_EXECUTOR_BEAN_NAME, | ||
| AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME }) | ||
| @ConditionalOnMissingBean(Executor.class) | ||
| public ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) { | ||
| return builder.configure(new KouplelessThreadPoolTaskExecutor()); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>com.alipay.sofa.koupleless</groupId> | ||
| <artifactId>koupleless-adapter</artifactId> | ||
| <version>${revision}</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>koupleless-adapter-executorservice-spring-2.7</artifactId> | ||
| <version>${revision}</version> | ||
|
|
||
| <properties> | ||
| <spring.boot.version>2.7.0</spring.boot.version> | ||
| <java.version>1.8</java.version> | ||
| </properties> | ||
|
|
||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot</artifactId> | ||
| <version>${spring.boot.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-autoconfigure</artifactId> | ||
| <version>${spring.boot.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.alipay.sofa.koupleless</groupId> | ||
| <artifactId>koupleless-base-plugin</artifactId> | ||
| <version>${revision}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
43 changes: 43 additions & 0 deletions
43
...2.7/src/main/java/com/alipay/sofa/koupleless/common/KouplelessThreadPoolTaskExecutor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.alipay.sofa.koupleless.common; | ||
|
|
||
| import com.alipay.sofa.koupleless.common.util.ReflectionUtils; | ||
| import com.alipay.sofa.koupleless.plugin.concurrent.KouplelessExecutorService; | ||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
|
||
| import java.util.concurrent.ExecutorService; | ||
| import java.util.concurrent.RejectedExecutionHandler; | ||
| import java.util.concurrent.ThreadFactory; | ||
|
|
||
| /** | ||
| * @author lianglipeng.llp@alibaba-inc.com | ||
| * @version $Id: KouplelessThreadPoolTaskExecutor.java, v 0.1 2024年05月13日 20:51 立蓬 Exp $ | ||
| */ | ||
| public class KouplelessThreadPoolTaskExecutor extends ThreadPoolTaskExecutor { | ||
|
|
||
| @Override | ||
| protected ExecutorService initializeExecutor(ThreadFactory threadFactory, | ||
| RejectedExecutionHandler rejectedExecutionHandler) { | ||
|
|
||
| ExecutorService executorService = super.initializeExecutor(threadFactory, | ||
| rejectedExecutionHandler); | ||
| KouplelessExecutorService executor = new KouplelessExecutorService(executorService); | ||
| ReflectionUtils.setField("threadPoolExecutor", this, executor); | ||
| return executor; | ||
| } | ||
| } |
85 changes: 85 additions & 0 deletions
85
...main/java/org/springframework/boot/autoconfigure/task/TaskExecutionAutoConfiguration.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.springframework.boot.autoconfigure.task; | ||
|
|
||
| import com.alipay.sofa.koupleless.common.KouplelessThreadPoolTaskExecutor; | ||
| import org.springframework.beans.factory.ObjectProvider; | ||
| import org.springframework.boot.autoconfigure.AutoConfiguration; | ||
| import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
| import org.springframework.boot.autoconfigure.task.TaskExecutionProperties.Shutdown; | ||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| import org.springframework.boot.task.TaskExecutorBuilder; | ||
| import org.springframework.boot.task.TaskExecutorCustomizer; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Lazy; | ||
| import org.springframework.core.task.TaskDecorator; | ||
| import org.springframework.core.task.TaskExecutor; | ||
| import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor; | ||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
|
||
| import java.util.concurrent.Executor; | ||
|
|
||
| /** | ||
| * {@link EnableAutoConfiguration Auto-configuration} for {@link TaskExecutor}. | ||
| * springboot 2.7.x 均可以用该类覆盖 | ||
| * @author Stephane Nicoll | ||
| * @author Camille Vienot | ||
| * @since 2.1.0 | ||
| */ | ||
| @ConditionalOnClass(ThreadPoolTaskExecutor.class) | ||
| @AutoConfiguration | ||
| @EnableConfigurationProperties(TaskExecutionProperties.class) | ||
| public class TaskExecutionAutoConfiguration { | ||
|
|
||
| /** | ||
| * Bean name of the application {@link TaskExecutor}. | ||
| */ | ||
| public static final String APPLICATION_TASK_EXECUTOR_BEAN_NAME = "applicationTaskExecutor"; | ||
|
|
||
| @Bean | ||
| @ConditionalOnMissingBean | ||
| public TaskExecutorBuilder taskExecutorBuilder(TaskExecutionProperties properties, | ||
| ObjectProvider<TaskExecutorCustomizer> taskExecutorCustomizers, | ||
| ObjectProvider<TaskDecorator> taskDecorator) { | ||
| TaskExecutionProperties.Pool pool = properties.getPool(); | ||
| TaskExecutorBuilder builder = new TaskExecutorBuilder(); | ||
| builder = builder.queueCapacity(pool.getQueueCapacity()); | ||
| builder = builder.corePoolSize(pool.getCoreSize()); | ||
| builder = builder.maxPoolSize(pool.getMaxSize()); | ||
| builder = builder.allowCoreThreadTimeOut(pool.isAllowCoreThreadTimeout()); | ||
| builder = builder.keepAlive(pool.getKeepAlive()); | ||
| Shutdown shutdown = properties.getShutdown(); | ||
| builder = builder.awaitTermination(shutdown.isAwaitTermination()); | ||
| builder = builder.awaitTerminationPeriod(shutdown.getAwaitTerminationPeriod()); | ||
| builder = builder.threadNamePrefix(properties.getThreadNamePrefix()); | ||
| builder = builder.customizers(taskExecutorCustomizers.orderedStream()::iterator); | ||
| builder = builder.taskDecorator(taskDecorator.getIfUnique()); | ||
| return builder; | ||
| } | ||
|
|
||
| @Lazy | ||
| @Bean(name = { APPLICATION_TASK_EXECUTOR_BEAN_NAME, | ||
| AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME }) | ||
| @ConditionalOnMissingBean(Executor.class) | ||
| public ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) { | ||
| // 修改了此处 | ||
| return builder.configure(new KouplelessThreadPoolTaskExecutor()); | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>com.alipay.sofa.koupleless</groupId> | ||
| <artifactId>koupleless-adapter</artifactId> | ||
| <version>${revision}</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>koupleless-adapter-scheduler-spring-2.3</artifactId> | ||
|
|
||
| <properties> | ||
| <spring.boot.version>2.3.5.RELEASE</spring.boot.version> | ||
| <java.version>1.8</java.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot</artifactId> | ||
| <version>${spring.boot.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-autoconfigure</artifactId> | ||
| <version>${spring.boot.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> | ||
| <groupId>com.alipay.sofa.koupleless</groupId> | ||
| <artifactId>koupleless-base-plugin</artifactId> | ||
| <version>${revision}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reconsider the use of reflection for setting fields.
The use of
ReflectionUtils.setFieldto inject the custom executor service (KouplelessExecutorService) into thethreadPoolExecutorfield may lead to maintenance issues and is less type-safe. Consider alternatives such as constructor injection or a setter method, which could enhance type safety and maintainability.