Program: 55886
Project: 55886
Buggy source:
/** 
 * Sets up the   {@link ResourceManager} by using a configuration file. <br>First it is checked, if the given argsMap contains a "configFile" parameter. If so, the path specified for this parameter is used to get the file. <br> If the parameter is not given, the defaultConfigFile is used.
 * @param argsMap
 * @param defaultConfigFileName
 * @throws FileNotFoundException
 * @throws IOException
 */
public static void setupResourceManagers(OptionableProperties options,String defaultConfigFileName) throws FileNotFoundException, IOException {
  ConfigurationPropertiesFile configFile=getConfigFile(options,defaultConfigFileName);
  SwingResourceLoader.setupResourcesManager(configFile);
  boolean firstRun=true;
  while (!configFile.isValidSettlersFolderSet() || !trySettingUpResources(configFile)) {
    if (!firstRun) {
      JOptionPane.showMessageDialog(null,Labels.getString("String_Node_Str"));
    }
    firstRun=false;
    final SelectSettlerFolderDialog folderChooser=new SelectSettlerFolderDialog();
    SwingUtilities.invokeLater(new Runnable(){
      @Override public void run(){
        folderChooser.setVisible(true);
      }
    }
);
    File selectedFolder=folderChooser.waitForUserInput();
    if (selectedFolder == null) {
      String noFolderSelctedMessage=Labels.getString("String_Node_Str");
      JOptionPane.showMessageDialog(null,noFolderSelctedMessage);
      System.err.println(noFolderSelctedMessage);
      System.exit(1);
    }
    System.out.println(selectedFolder);
    try {
      configFile.setSettlersFolder(selectedFolder);
    }
 catch (    IOException ex) {
      String errorSavingSettingsMessage=Labels.getString("String_Node_Str");
      System.err.println(errorSavingSettingsMessage);
      JOptionPane.showMessageDialog(null,errorSavingSettingsMessage);
      ex.printStackTrace();
    }
  }
  if (!firstRun) {
    SwingResourceLoader.setupResourcesManager(configFile);
  }
}

Fixed version (ground truth):
/** 
 * Sets up the   {@link ResourceManager} by using a configuration file. <br>First it is checked, if the given argsMap contains a "configFile" parameter. If so, the path specified for this parameter is used to get the file. <br> If the parameter is not given, the defaultConfigFile is used.
 * @param argsMap
 * @param defaultConfigFileName
 * @throws FileNotFoundException
 * @throws IOException
 */
public static void setupResourceManagers(OptionableProperties options,String defaultConfigFileName) throws FileNotFoundException, IOException {
  ConfigurationPropertiesFile configFile=getConfigFile(options,defaultConfigFileName);
  SwingResourceLoader.setupResourcesManager(configFile);
  boolean firstRun=true;
  while (!configFile.isValidSettlersFolderSet() || !trySettingUpResources(configFile)) {
    if (!firstRun) {
      JOptionPane.showMessageDialog(null,Labels.getString("String_Node_Str"));
    }
    firstRun=false;
    final SelectSettlersFolderDialog folderChooser=new SelectSettlersFolderDialog();
    SwingUtilities.invokeLater(new Runnable(){
      @Override public void run(){
        folderChooser.setVisible(true);
      }
    }
);
    File selectedFolder=folderChooser.waitForUserInput();
    if (selectedFolder == null) {
      String noFolderSelctedMessage=Labels.getString("String_Node_Str");
      JOptionPane.showMessageDialog(null,noFolderSelctedMessage);
      System.err.println(noFolderSelctedMessage);
      System.exit(1);
    }
    System.out.println(selectedFolder);
    try {
      configFile.setSettlersFolder(selectedFolder);
    }
 catch (    IOException ex) {
      String errorSavingSettingsMessage=Labels.getString("String_Node_Str");
      System.err.println(errorSavingSettingsMessage);
      JOptionPane.showMessageDialog(null,errorSavingSettingsMessage);
      ex.printStackTrace();
    }
  }
  if (!firstRun) {
    SwingResourceLoader.setupResourcesManager(configFile);
  }
}