Program: 152120
Project: 152120
Buggy source:
/** 
 * Program starter method
 * @param args the command line arguments
 */
public static void main(String[] args){
  LogSupport.init();
  LogSupport.storeRecords(true);
  Thread.setDefaultUncaughtExceptionHandler(ExceptionDialog.getExceptionHandler());
  if (!RuntimeUtils.isSupportedJava()) {
    logger.severe(l10n.getString("String_Node_Str"));
  }
  CommandLineParser clp=new CommandLineParser();
  if (!clp.parseArgs(args)) {
    System.exit(1);
  }
  logger.fine("String_Node_Str" + Config.getLatestVersion() + "String_Node_Str");
  logger.finer("String_Node_Str" + RuntimeUtils.getSystemInfo());
  configPath=clp.getConfigPath();
  if (clp.isPortable() && configPath == null) {
    logger.fine("String_Node_Str");
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          }
 catch (          Exception ex) {
            logger.log(Level.WARNING,"String_Node_Str",ex);
          }
          JFileChooser chooser=new JFileChooser();
          chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          chooser.setApproveButtonText(l10n.getString("String_Node_Str"));
          chooser.setDialogTitle(l10n.getString("String_Node_Str"));
          chooser.setFileHidingEnabled(false);
          chooser.setMultiSelectionEnabled(false);
          int result=chooser.showOpenDialog(null);
          if (result == JFileChooser.APPROVE_OPTION) {
            configPath=chooser.getSelectedFile().getPath();
            logger.config("String_Node_Str" + configPath);
          }
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  PersistenceManager pm=null;
  try {
    if (configPath != null) {
      PersistenceManager.setCustomDirs(configPath,configPath);
    }
    PersistenceManager.instantiate();
    pm=Context.persistenceManager;
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          JOptionPane.showMessageDialog(null,new JLabel(MessageFormat.format(l10n.getString("String_Node_Str"),PersistenceManager.getConfigDir().getAbsolutePath(),PersistenceManager.getDataDir().getAbsolutePath())),null,JOptionPane.ERROR_MESSAGE);
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
 finally {
      System.exit(5);
    }
  }
  try {
    pm.backupConfigFiles();
  }
 catch (  IOException ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  File logFile=pm.getLogFile();
  try {
    LogSupport.initFileHandler(logFile);
  }
 catch (  IOException ex) {
    logger.log(Level.WARNING,"String_Node_Str" + logFile.getAbsolutePath(),ex);
  }
 finally {
    LogSupport.storeRecords(false);
  }
  try {
    pm.loadConfig();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadOperators();
  }
 catch (  IntrospectionException ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          JOptionPane.showMessageDialog(null,l10n.getString("String_Node_Str"),null,JOptionPane.ERROR_MESSAGE);
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
    System.exit(2);
  }
catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
  try {
    pm.loadContacts();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadQueue();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadHistory();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadKeyring();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  if (Config.getInstance().isDebugMode()) {
    LogSupport.enableHttpClientLogging();
    LogSupport.getEsmskaLogger().setLevel(Level.ALL);
  }
  if (!pm.isFirstInstance()) {
    logger.warning("String_Node_Str");
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          String runOption=l10n.getString("String_Node_Str");
          String quitOption=l10n.getString("String_Node_Str");
          String[] options=new String[]{runOption,quitOption};
          options=RuntimeUtils.sortDialogOptions(options);
          int result=JOptionPane.showOptionDialog(null,l10n.getString("String_Node_Str"),null,JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,options,quitOption);
          if (result != ArrayUtils.indexOf(options,runOption)) {
            System.exit(0);
          }
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  Config config=Config.getInstance();
  final String dataVersion=config.getVersion();
  final String programVersion=Config.getLatestVersion();
  if (Config.compareProgramVersions(dataVersion,programVersion) > 0) {
    logger.warning("String_Node_Str" + dataVersion + "String_Node_Str"+ programVersion+ "String_Node_Str"+ "String_Node_Str");
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          String runOption=l10n.getString("String_Node_Str");
          String quitOption=l10n.getString("String_Node_Str");
          String[] options=new String[]{runOption,quitOption};
          options=RuntimeUtils.sortDialogOptions(options);
          int result=JOptionPane.showOptionDialog(null,new JLabel(MessageFormat.format(l10n.getString("String_Node_Str"),dataVersion,programVersion)),null,JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,options,quitOption);
          if (result != ArrayUtils.indexOf(options,runOption)) {
            System.exit(0);
          }
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  if (config.isFirstRun()) {
    logger.fine("String_Node_Str");
    config.setCountryPrefix(CountryPrefix.getCountryPrefix(Locale.getDefault().getCountry()));
    config.setLookAndFeel(ThemeManager.suggestBestLAF());
    if (Config.isRunAsWebStart()) {
      config.setCheckUpdatePolicy(Config.CheckUpdatePolicy.CHECK_NONE);
    }
  }
  if (!config.isFirstRun()) {
    LegacyUpdater.update();
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        try {
          ThemeManager.setLaF();
        }
 catch (        Throwable ex) {
          logger.log(Level.WARNING,"String_Node_Str",ex);
        }
      }
    }
);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
  if (config.isUseProxy()) {
    ProxyManager.setProxy(config.getHttpProxy(),config.getHttpsProxy(),config.getSocksProxy());
  }
  if (!Config.isStableVersion()) {
    config.setCheckForUnstableUpdates(true);
  }
  EventQueue.invokeLater(new Runnable(){
    @Override public void run(){
      MainFrame.instantiate();
      Context.mainFrame.startAndShow();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Program starter method
 * @param args the command line arguments
 */
public static void main(String[] args){
  LogSupport.init();
  LogSupport.storeRecords(true);
  Thread.setDefaultUncaughtExceptionHandler(ExceptionDialog.getExceptionHandler());
  if (!RuntimeUtils.isSupportedJava()) {
    logger.severe(l10n.getString("String_Node_Str"));
  }
  CommandLineParser clp=new CommandLineParser();
  if (!clp.parseArgs(args)) {
    System.exit(1);
  }
  logger.fine("String_Node_Str" + Config.getLatestVersion() + "String_Node_Str");
  logger.finer("String_Node_Str" + RuntimeUtils.getSystemInfo());
  configPath=clp.getConfigPath();
  if (clp.isPortable() && configPath == null) {
    logger.fine("String_Node_Str");
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          }
 catch (          Exception ex) {
            logger.log(Level.WARNING,"String_Node_Str",ex);
          }
          JFileChooser chooser=new JFileChooser();
          chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
          chooser.setApproveButtonText(l10n.getString("String_Node_Str"));
          chooser.setDialogTitle(l10n.getString("String_Node_Str"));
          chooser.setFileHidingEnabled(false);
          chooser.setMultiSelectionEnabled(false);
          int result=chooser.showOpenDialog(null);
          if (result == JFileChooser.APPROVE_OPTION) {
            configPath=chooser.getSelectedFile().getPath();
            logger.config("String_Node_Str" + configPath);
          }
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  PersistenceManager pm=null;
  try {
    if (configPath != null) {
      PersistenceManager.setCustomDirs(configPath,configPath);
    }
    PersistenceManager.instantiate();
    pm=Context.persistenceManager;
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          JOptionPane.showMessageDialog(null,new JLabel(MessageFormat.format(l10n.getString("String_Node_Str"),PersistenceManager.getConfigDir().getAbsolutePath(),PersistenceManager.getDataDir().getAbsolutePath())),null,JOptionPane.ERROR_MESSAGE);
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
 finally {
      System.exit(5);
    }
  }
  try {
    pm.backupConfigFiles();
  }
 catch (  IOException ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  File logFile=pm.getLogFile();
  try {
    LogSupport.initFileHandler(logFile);
  }
 catch (  IOException ex) {
    logger.log(Level.WARNING,"String_Node_Str" + logFile.getAbsolutePath(),ex);
  }
 finally {
    LogSupport.storeRecords(false);
  }
  try {
    pm.loadConfig();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadOperators();
  }
 catch (  IntrospectionException ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          JOptionPane.showMessageDialog(null,l10n.getString("String_Node_Str"),null,JOptionPane.ERROR_MESSAGE);
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
    System.exit(2);
  }
catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
  try {
    pm.loadContacts();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadQueue();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadHistory();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  try {
    pm.loadKeyring();
  }
 catch (  Exception ex) {
    logger.log(Level.WARNING,"String_Node_Str",ex);
  }
  if (Config.getInstance().isDebugMode()) {
    LogSupport.enableHttpClientLogging();
    LogSupport.getEsmskaLogger().setLevel(Level.ALL);
  }
  if (!pm.isFirstInstance()) {
    logger.warning("String_Node_Str");
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          String runOption=l10n.getString("String_Node_Str");
          String quitOption=l10n.getString("String_Node_Str");
          String[] options=new String[]{runOption,quitOption};
          options=RuntimeUtils.sortDialogOptions(options);
          int result=JOptionPane.showOptionDialog(null,l10n.getString("String_Node_Str"),null,JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,options,quitOption);
          if (result != ArrayUtils.indexOf(options,runOption)) {
            System.exit(0);
          }
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  Config config=Config.getInstance();
  final String dataVersion=config.getVersion();
  final String programVersion=Config.getLatestVersion();
  if (Config.compareProgramVersions(dataVersion,programVersion) > 0) {
    logger.warning("String_Node_Str" + dataVersion + "String_Node_Str"+ programVersion+ "String_Node_Str"+ "String_Node_Str");
    try {
      SwingUtilities.invokeAndWait(new Runnable(){
        @Override public void run(){
          String runOption=l10n.getString("String_Node_Str");
          String quitOption=l10n.getString("String_Node_Str");
          String[] options=new String[]{runOption,quitOption};
          options=RuntimeUtils.sortDialogOptions(options);
          int result=JOptionPane.showOptionDialog(null,new JLabel(MessageFormat.format(l10n.getString("String_Node_Str"),dataVersion,programVersion)),null,JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,options,quitOption);
          if (result != ArrayUtils.indexOf(options,runOption)) {
            System.exit(0);
          }
        }
      }
);
    }
 catch (    Exception e) {
      logger.log(Level.SEVERE,"String_Node_Str",e);
    }
  }
  if (config.isFirstRun()) {
    logger.fine("String_Node_Str");
    config.setCountryPrefix(CountryPrefix.getCountryPrefix(Locale.getDefault().getCountry()));
    config.setLookAndFeel(ThemeManager.suggestBestLAF());
    if (Config.isRunAsWebStart()) {
      config.setCheckUpdatePolicy(Config.CheckUpdatePolicy.CHECK_NONE);
    }
    InitWizardDialog dialog=new InitWizardDialog(null,true);
    dialog.setVisible(true);
  }
  if (!config.isFirstRun()) {
    LegacyUpdater.update();
  }
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        try {
          ThemeManager.setLaF();
        }
 catch (        Throwable ex) {
          logger.log(Level.WARNING,"String_Node_Str",ex);
        }
      }
    }
);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
  }
  if (config.isUseProxy()) {
    ProxyManager.setProxy(config.getHttpProxy(),config.getHttpsProxy(),config.getSocksProxy());
  }
  if (!Config.isStableVersion()) {
    config.setCheckForUnstableUpdates(true);
  }
  EventQueue.invokeLater(new Runnable(){
    @Override public void run(){
      MainFrame.instantiate();
      Context.mainFrame.startAndShow();
    }
  }
);
}