Source:
<code>protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.generateMap.title", version, String.valueOf(seed))); Path workingDirectory = preferencesService.getPreferences().getForgedAlliance().getCustomMapsDirectory(); ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.directory(workingDirectory.toFile()); processBuilder.command("java", "-jar", generatorExecutableFile.toAbsolutePath().toString(), ".", String.valueOf(seed), version, mapFilename); processBuilder.environment().put("LOG_DIR", preferencesService.getFafLogDirectory().toAbsolutePath().toString()); <START> log.info("Starting map generator in directory: with command: {}", processBuilder.directory(), processBuilder.command().stream().reduce((l, r) -> l + " " + r).get()); <END> try { Process process = processBuilder.start(); OsUtils.gobbleLines(process.getInputStream(), logger::info); OsUtils.gobbleLines(process.getErrorStream(), logger::error); process.waitFor(MapGeneratorService.GENERATION_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (process.isAlive()) { log.warn("Map generation timed out, killing process..."); process.destroyForcibly(); notificationService.addNotification(new ImmediateNotification(i18n.get("game.mapGeneration.failed.title"), i18n.get("game.mapGeneration.failed.message"), Severity.ERROR)); } else { eventBus.post(new MapGeneratedEvent(mapFilename)); } } catch (IOException | InterruptedException e) { log.error("Could not start map generator.", e); throw new RuntimeException(e); } return null; }</code><technical_language>Some linebreaks improve readability</technical_language>

Target:
protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.generateMap.title", version, String.valueOf(seed))); Path workingDirectory = preferencesService.getPreferences().getForgedAlliance().getCustomMapsDirectory(); ProcessBuilder processBuilder = new ProcessBuilder(); processBuilder.directory(workingDirectory.toFile()); processBuilder.command("java", "-jar", generatorExecutableFile.toAbsolutePath().toString(), ".", String.valueOf(seed), version, mapFilename); processBuilder.environment().put("LOG_DIR", preferencesService.getFafLogDirectory().toAbsolutePath().toString()); log.info("Starting map generator in directory: with command: {}", processBuilder.directory(), processBuilder.command().stream().reduce((l, r) -> l + " " + r).get()); try { Process process = processBuilder.start(); OsUtils.gobbleLines(process.getInputStream(), generatorLogger::info); OsUtils.gobbleLines(process.getErrorStream(), generatorLogger::error); process.waitFor(MapGeneratorService.GENERATION_TIMEOUT_SECONDS, TimeUnit.SECONDS); if (process.isAlive()) { log.warn("Map generation timed out, killing process..."); process.destroyForcibly(); notificationService.addNotification(new ImmediateNotification(i18n.get("game.mapGeneration.failed.title"), i18n.get("game.mapGeneration.failed.message"), Severity.ERROR)); } else { eventBus.post(new MapGeneratedEvent(mapFilename)); } } catch (IOException | InterruptedException e) { log.error("Could not start map generator.", e); throw new RuntimeException(e); } return null; }