Skip to content

Commit 323bc72

Browse files
committed
Declare private constructors in AsyncUtils and ExecutorUtils
1 parent 310af72 commit 323bc72

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/main/java/com/iexec/worker/utils/AsyncUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,16 +16,17 @@
1616

1717
package com.iexec.worker.utils;
1818

19+
import lombok.AccessLevel;
20+
import lombok.NoArgsConstructor;
1921
import lombok.extern.slf4j.Slf4j;
2022

2123
import java.util.concurrent.CompletableFuture;
2224
import java.util.concurrent.Executor;
2325

2426
@Slf4j
27+
@NoArgsConstructor(access = AccessLevel.PRIVATE)
2528
public class AsyncUtils {
2629

27-
private AsyncUtils() {}
28-
2930
/**
3031
* The default {@link CompletableFuture#runAsync(Runnable)} fails silently when an exception
3132
* is thrown in the running thread. This wrapper method adds an exception handler that logs

src/main/java/com/iexec/worker/utils/ExecutorUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,15 +16,16 @@
1616

1717
package com.iexec.worker.utils;
1818

19+
import lombok.AccessLevel;
20+
import lombok.NoArgsConstructor;
1921
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
2022

2123
import java.util.concurrent.Executor;
2224
import java.util.concurrent.ThreadPoolExecutor.DiscardPolicy;
2325

26+
@NoArgsConstructor(access = AccessLevel.PRIVATE)
2427
public class ExecutorUtils {
2528

26-
private ExecutorUtils() {}
27-
2829
public static Executor
2930
newSingleThreadExecutorWithFixedSizeQueue(int queueSize, String threadNamePrefix) {
3031
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();

0 commit comments

Comments
 (0)