Source:
<code>public ICommandResult executeCommand(final ICommandInput command, final IProgressMonitor aMonitor) throws ExecutionException { if (fConnection.isOpen()) { FutureTask<CommandResult> future = new FutureTask<>(new Callable<CommandResult>() { @Override public CommandResult call() throws IOException, InterruptedException { IProgressMonitor monitor = aMonitor; if (monitor == null) { monitor = new NullProgressMonitor(); } if (!monitor.isCanceled()) { IRemoteProcess process = <START> checkNotNull(fConnection.getService(IRemoteProcessService.class)).getProcessBuilder(command.getInput()).start(); <END> InputReader stdout = new InputReader(checkNotNull(process.getInputStream())); InputReader stderr = new InputReader(checkNotNull(process.getErrorStream())); try { stdout.waitFor(monitor); stderr.waitFor(monitor); if (!monitor.isCanceled()) { return createResult(process.waitFor(), stdout.toString(), stderr.toString()); } } catch (OperationCanceledException e) { } catch (InterruptedException e) { return new CommandResult(1, new String[0], new String[] {e.getMessage()}); } finally { stdout.stop(); stderr.stop(); process.destroy(); } } return new CommandResult(1, new String[0], new String[] {"cancelled"}); } }); fExecutor.execute(future); try { return checkNotNull(future.get(TmfRemotePreferences.getCommandTimeout(), TimeUnit.SECONDS)); } catch (InterruptedException ex) { throw new ExecutionException(Messages.RemoteConnection_ExecutionCancelled, ex); } catch (TimeoutException ex) { throw new ExecutionException(Messages.RemoteConnection_ExecutionTimeout, ex); } catch (Exception ex) { throw new ExecutionException(Messages.RemoteConnection_ExecutionFailure, ex); } finally { future.cancel(true); } } throw new ExecutionException(Messages.RemoteConnection_ShellNotConnected, null); }</code><technical_language>I this needs a null check a hasService check</technical_language>

Target:
public ICommandResult executeCommand(final ICommandInput command, final IProgressMonitor aMonitor) throws ExecutionException { if (fConnection.isOpen()) { FutureTask<CommandResult> future = new FutureTask<>(new Callable<CommandResult>() { @Override public CommandResult call() throws IOException, InterruptedException { IProgressMonitor monitor = aMonitor; if (monitor == null) { monitor = new NullProgressMonitor(); } if (!monitor.isCanceled()) { IRemoteProcess process = checkNotNull(fConnection.getService(IRemoteProcessService.class)).getProcessBuilder(command.getInput()).start(); if (process == null) { return new CommandResult(1, new @NonNull String[0], new @NonNull String[] { nullToEmptyString(Messages.RemoteConnection_ServiceNotDefined) }); } InputReader stdout = new InputReader(checkNotNull(process.getInputStream())); InputReader stderr = new InputReader(checkNotNull(process.getErrorStream())); try { stdout.waitFor(monitor); stderr.waitFor(monitor); if (!monitor.isCanceled()) { return createResult(process.waitFor(), stdout.toString(), stderr.toString()); } } catch (OperationCanceledException e) { } catch (InterruptedException e) { return new CommandResult(1, new String[0], new String[] {e.getMessage()}); } finally { stdout.stop(); stderr.stop(); process.destroy(); } } return new CommandResult(1, new String[0], new String[] {"cancelled"}); } }); fExecutor.execute(future); try { return checkNotNull(future.get(TmfRemotePreferences.getCommandTimeout(), TimeUnit.SECONDS)); } catch (InterruptedException ex) { throw new ExecutionException(Messages.RemoteConnection_ExecutionCancelled, ex); } catch (TimeoutException ex) { throw new ExecutionException(Messages.RemoteConnection_ExecutionTimeout, ex); } catch (Exception ex) { throw new ExecutionException(Messages.RemoteConnection_ExecutionFailure, ex); } finally { future.cancel(true); } } throw new ExecutionException(Messages.RemoteConnection_ShellNotConnected, null); }