Skip to content

Commit

Permalink
ThreadUtil.newExecutor等方法变更方法签名,返回值变更为ThreadPoolExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Jun 30, 2024
1 parent a8e959c commit db5806f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* 【cache 】 Cache.put变更策略,对于替换的键值对,不清理队列(issue#3618@Github)
* 【core 】 添加 Windows 资源管理器风格字符串比较器(pr#3620@Github)
* 【core 】 Week.of支持中文名称(issue#3637@Github)
* 【core 】 ThreadUtil.newExecutor等方法变更方法签名,返回值变更为ThreadPoolExecutor(pr#1230@Gitee)

### 🐞Bug修复
* 【core 】 修复AnnotationUtil可能的空指针错误
Expand Down
10 changes: 5 additions & 5 deletions hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static ThreadPoolExecutor newExecutor(int corePoolSize) {
*
* @return ExecutorService
*/
public static ExecutorService newExecutor() {
public static ThreadPoolExecutor newExecutor() {
return ExecutorBuilder.create().useSynchronousQueue().build();
}

Expand Down Expand Up @@ -102,7 +102,7 @@ public static ThreadPoolExecutor newExecutor(int corePoolSize, int maximumPoolSi
* @return {@link ThreadPoolExecutor}
* @since 5.4.1
*/
public static ExecutorService newExecutor(int corePoolSize, int maximumPoolSize, int maximumQueueSize) {
public static ThreadPoolExecutor newExecutor(int corePoolSize, int maximumPoolSize, int maximumQueueSize) {
return ExecutorBuilder.create()
.setCorePoolSize(corePoolSize)
.setMaxPoolSize(maximumPoolSize)
Expand Down Expand Up @@ -147,7 +147,7 @@ public static ThreadPoolExecutor newExecutorByBlockingCoefficient(float blocking
* @author luozongle
* @since 5.8.0
*/
public static ExecutorService newFixedExecutor(int nThreads, String threadNamePrefix, boolean isBlocked) {
public static ThreadPoolExecutor newFixedExecutor(int nThreads, String threadNamePrefix, boolean isBlocked) {
return newFixedExecutor(nThreads, 1024, threadNamePrefix, isBlocked);
}

Expand All @@ -167,7 +167,7 @@ public static ExecutorService newFixedExecutor(int nThreads, String threadNamePr
* @author luozongle
* @since 5.8.0
*/
public static ExecutorService newFixedExecutor(int nThreads, int maximumQueueSize, String threadNamePrefix, boolean isBlocked) {
public static ThreadPoolExecutor newFixedExecutor(int nThreads, int maximumQueueSize, String threadNamePrefix, boolean isBlocked) {
return newFixedExecutor(nThreads, maximumQueueSize, threadNamePrefix,
(isBlocked ? RejectPolicy.BLOCK : RejectPolicy.ABORT).getValue());
}
Expand All @@ -187,7 +187,7 @@ public static ExecutorService newFixedExecutor(int nThreads, int maximumQueueSiz
* @author luozongle
* @since 5.8.0
*/
public static ExecutorService newFixedExecutor(int nThreads,
public static ThreadPoolExecutor newFixedExecutor(int nThreads,
int maximumQueueSize,
String threadNamePrefix,
RejectedExecutionHandler handler) {
Expand Down

0 comments on commit db5806f

Please sign in to comment.