Clean up `JnlpSlaveRestarterInstaller`
@@ -52,7 +52,6 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
install(c, listener);
return null;
}
- }
private static void install(Computer c, TaskListener listener) {
try {
@@ -68,6 +67,7 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
Functions.printStackTrace(e, listener.error("Failed to install restarter"));
}
}
+ }
private static class FindEffectiveRestarters extends MasterToSlaveCallable<List<SlaveRestarter>, IOException> {
private final List<SlaveRestarter> restarters;
@@ -81,12 +81,6 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
Engine e = Engine.current();
if (e == null) return null; // not running under Engine
- try {
- Engine.class.getMethod("addListener", EngineListener.class);
- } catch (NoSuchMethodException ignored) {
- return null; // running with older version of remoting that doesn't support adding listener
- }
-
// filter out ones that doesn't apply
restarters.removeIf(r -> !r.canWork());
