Source:
<code>protected LauncherConfiguration call() { try { final Platform platform = getPlatform(); updateMessage(BundleUtils.getLabel("splash_initLauncherDirs")); final Path installationDirectory = LauncherDirectoryUtils.getInstallationDirectory(); final Path userDataDirectory = getLauncherDirectory(platform); final Path downloadDirectory = getDirectoryFor(LauncherManagedDirectory.DOWNLOAD, userDataDirectory); final Path tempDirectory = getDirectoryFor(LauncherManagedDirectory.TEMP, userDataDirectory); final Path cacheDirectory = getDirectoryFor(LauncherManagedDirectory.CACHE, userDataDirectory); final BaseLauncherSettings launcherSettings = getLauncherSettings(userDataDirectory); LauncherSettingsValidator.validate(launcherSettings); <START> final boolean serverAvailable = new JenkinsRepository().isAvailable(); <END> if (serverAvailable && launcherSettings.isSearchForLauncherUpdates()) { final boolean selfUpdaterStarted = checkForLauncherUpdates(downloadDirectory, tempDirectory, launcherSettings.isKeepDownloadedFiles()); if (selfUpdaterStarted) { logger.info("Exit old TerasologyLauncher: {}", TerasologyLauncherVersionInfo.getInstance()); return NullLauncherConfiguration.getInstance(); } } updateMessage(BundleUtils.getLabel("splash_initGameDirs")); final Path gameDirectory = getDirectoryFor(LauncherManagedDirectory.GAMES, installationDirectory); final Path gameDataDirectory = getGameDataDirectory(platform, launcherSettings.getGameDataDirectory()); logger.trace("Setting up Package Manager"); final PackageManager packageManager = new PackageManager(userDataDirectory, gameDirectory); if (!packageManager.validateSources()) { if (confirmSourcesOverwrite()) { packageManager.copyDefaultSources(); } else { throw new IllegalStateException("Error reading sources file"); } } packageManager.initDatabase(); packageManager.syncDatabase(); logger.trace("Change LauncherSettings..."); launcherSettings.setGameDirectory(gameDirectory); launcherSettings.setGameDataDirectory(gameDataDirectory); storeLauncherSettingsAfterInit(launcherSettings); logger.trace("Creating launcher frame..."); return new LauncherConfiguration(userDataDirectory, downloadDirectory, tempDirectory, cacheDirectory, launcherSettings, packageManager); } catch (LauncherStartFailedException e) { logger.warn("Could not configure launcher."); } return null; }</code><technical_language>end, server "is available" right subsequent calls succeed, need safeguard</technical_language>

Target:
protected LauncherConfiguration call() { try { final Platform platform = getPlatform(); updateMessage(BundleUtils.getLabel("splash_initLauncherDirs")); final Path installationDirectory = LauncherDirectoryUtils.getInstallationDirectory(); final Path userDataDirectory = getLauncherDirectory(platform); final Path downloadDirectory = getDirectoryFor(LauncherManagedDirectory.DOWNLOAD, userDataDirectory); final Path tempDirectory = getDirectoryFor(LauncherManagedDirectory.TEMP, userDataDirectory); final Path cacheDirectory = getDirectoryFor(LauncherManagedDirectory.CACHE, userDataDirectory); final BaseLauncherSettings launcherSettings = getLauncherSettings(userDataDirectory); LauncherSettingsValidator.validate(launcherSettings); if (launcherSettings.isSearchForLauncherUpdates()) { final boolean selfUpdaterStarted = checkForLauncherUpdates(downloadDirectory, tempDirectory, launcherSettings.isKeepDownloadedFiles()); if (selfUpdaterStarted) { logger.info("Exit old TerasologyLauncher: {}", TerasologyLauncherVersionInfo.getInstance()); return NullLauncherConfiguration.getInstance(); } } updateMessage(BundleUtils.getLabel("splash_initGameDirs")); final Path gameDirectory = getDirectoryFor(LauncherManagedDirectory.GAMES, installationDirectory); final Path gameDataDirectory = getGameDataDirectory(platform, launcherSettings.getGameDataDirectory()); logger.trace("Setting up Package Manager"); final PackageManager packageManager = new PackageManager(userDataDirectory, gameDirectory); if (!packageManager.validateSources()) { if (confirmSourcesOverwrite()) { packageManager.copyDefaultSources(); } else { throw new IllegalStateException("Error reading sources file"); } } packageManager.initDatabase(); packageManager.syncDatabase(); logger.trace("Change LauncherSettings..."); launcherSettings.setGameDirectory(gameDirectory); launcherSettings.setGameDataDirectory(gameDataDirectory); storeLauncherSettingsAfterInit(launcherSettings); logger.trace("Creating launcher frame..."); return new LauncherConfiguration(userDataDirectory, downloadDirectory, tempDirectory, cacheDirectory, launcherSettings, packageManager); } catch (LauncherStartFailedException e) { logger.warn("Could not configure launcher."); } return null; }