Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-19465] - Fix FindBugs warnings
- Loading branch information
Showing
with
6 additions
and
2 deletions.
-
+6
−2
src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
|
@@ -269,10 +269,12 @@ public Object readResolve() { |
|
|
*/ |
|
|
public final Integer retryWaitTime; |
|
|
|
|
|
// TODO: It is a bad idea to create a new Executor service for each launcher. |
|
|
// Maybe a Remoting thread pool should be used, but it requires the logic rework to Futures |
|
|
/** |
|
|
* Keeps executor service for the async launch operation. |
|
|
*/ |
|
|
@javax.annotation.CheckForNull |
|
|
@CheckForNull |
|
|
private transient volatile ExecutorService launcherExecutorService; |
|
|
|
|
|
/** |
|
@@ -847,7 +849,9 @@ public Boolean call() throws InterruptedException { |
|
|
try { |
|
|
long time = System.currentTimeMillis(); |
|
|
List<Future<Boolean>> results; |
|
|
assert launcherExecutorService != null : "It should be always non-null here, because the task allocates and closes service on its own"; |
|
|
if (launcherExecutorService == null) { |
|
|
throw new IllegalStateException("Launcher Executor Service should be always non-null here, because the task allocates and closes service on its own"); |
|
|
} |
|
|
if (this.getLaunchTimeoutMillis() > 0) { |
|
|
results = launcherExecutorService.invokeAll(callables, this.getLaunchTimeoutMillis(), TimeUnit.MILLISECONDS); |
|
|
} else { |
|
|