Skip to content
Permalink
Browse files

[JENKINS-19465] - Fix FindBugs warnings

  • Loading branch information
oleg-nenashev committed Nov 21, 2017
1 parent cd25d13 commit 7051b60b3052a11e16d6669d3dc822656e192d1d
Showing with 6 additions and 2 deletions.
  1. +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 {

0 comments on commit 7051b60

Please sign in to comment.