Program: 21013
Project: 21013
Buggy source:
public static void main(String args[]){
  try {
    log=new StringBuilder();
    FileHandler handler=new FileHandler("String_Node_Str",false);
    logger=Logger.getLogger("String_Node_Str");
    logger.addHandler(handler);
    boolean OSFilter=true;
    File cfg;
    if ((cfg=JDUtilities.getResourceFile("String_Node_Str")).exists()) {
      JDUtilities.getResourceFile("String_Node_Str").mkdirs();
      cfg.renameTo(JDUtilities.getResourceFile("String_Node_Str"));
    }
    for (int i=0; i < args.length; i++) {
      String p=args[i];
      if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        OSFilter=false;
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        OSFilter=false;
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        Browser.setVerbose(true);
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        RESTORE=true;
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        String br=args[++i];
        if (br.equalsIgnoreCase("String_Node_Str"))         br=null;
        WebUpdater.getConfig("String_Node_Str").setProperty(WebUpdater.PARAM_BRANCH,br);
        WebUpdater.getConfig("String_Node_Str").save();
        System.out.println("String_Node_Str" + br);
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        OSFilter=false;
        clone=true;
      }
 else       if (clone && clonePrefix.size() == 0) {
        clonePrefix.add(new Server(100,p.trim()));
      }
    }
    Browser.init();
    guiConfig=WebUpdater.getConfig("String_Node_Str");
    log.append("String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str") + "String_Node_Str");
    log.append(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    System.out.println(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    System.out.println(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    log.append(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    initGUI();
    try {
      Browser br=new Browser();
      TICKET_TIME=Integer.parseInt(br.getPage("String_Node_Str").trim());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (TICKET_TIME < 0) {
      warnings.setText("String_Node_Str");
      if (JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(frame,"String_Node_Str")) {
      }
 else {
        while (true) {
          Thread.sleep(10000000);
        }
      }
    }
 else {
      warnings.setText("String_Node_Str");
      while (TICKET_TIME > 0) {
        Thread.sleep(1000);
        warnings.setText("String_Node_Str" + Formatter.formatSeconds(TICKET_TIME / 1000) + "String_Node_Str");
        TICKET_TIME-=1000;
      }
      warnings.setText("String_Node_Str");
    }
    for (int i=0; i < args.length; i++) {
      Main.log(log,"String_Node_Str" + i + "String_Node_Str"+ args[i]+ "String_Node_Str"+ System.getProperty("String_Node_Str"));
      logWindow.setText(log.toString());
    }
    final WebUpdater updater=new WebUpdater();
    updater.setOSFilter(OSFilter);
    updater.getBroadcaster().addListener(new MessageListener(){
      private String msg0="String_Node_Str";
      private String msg1="String_Node_Str";
      private String msg2="String_Node_Str";
      public void onMessage(      MessageEvent event){
        if (updater.getErrors() > 0) {
          JOptionPane.showConfirmDialog(frame,"String_Node_Str","String_Node_Str",JOptionPane.YES_OPTION,JOptionPane.WARNING_MESSAGE);
          Main.log(log,"String_Node_Str");
          Main.log(log,"String_Node_Str" + new File("String_Node_Str").getAbsolutePath());
          Main.log(log,"String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath());
          JDUtilities.runCommand("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath(),0);
          logWindow.setText(log.toString());
          JDIO.writeLocalFile(JDUtilities.getResourceFile("String_Node_Str"),log.toString());
          System.exit(0);
          return;
        }
        if (event.getID() == WebUpdater.DO_UPDATE_FAILED || event.getID() == FileUpdate.ERROR) {
          msg2=msg1;
          msg1=msg0;
          msg0=event.getMessage();
          warnings.setText(msg2 + "String_Node_Str" + msg1+ "String_Node_Str"+ msg0+ "String_Node_Str");
        }
        if (event.getID() == WebUpdater.DO_UPDATE_SUCCESS) {
          warnings.setText("String_Node_Str");
        }
        Main.log(log,event.getMessage() + "String_Node_Str");
      }
    }
);
    Main.log(log,"String_Node_Str" + new Date() + "String_Node_Str");
    checkBackup();
    updater.ignorePlugins(false);
    checkUpdateMessage();
    updater.setLogger(log);
    updater.setDownloadProgress(progressload);
    Main.trace("String_Node_Str");
    if (RESTORE) {
      JDIO.removeByPattern(JDUtilities.getResourceFile("String_Node_Str").getParentFile(),Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE));
    }
    ArrayList<FileUpdate> files;
    try {
      files=updater.getAvailableFiles();
    }
 catch (    Exception e) {
      Main.trace("String_Node_Str");
      Main.log(log,"String_Node_Str");
      try {
        Thread.sleep(5000);
      }
 catch (      InterruptedException e1) {
      }
      files=new ArrayList<FileUpdate>();
    }
    if (files != null) {
      updater.filterAvailableUpdates(files);
      JDUpdateUtils.backupDataBase();
      updater.updateFiles(files,null);
    }
    Restarter.main(new String[]{});
    Main.trace(updater.getLogger().toString());
    Main.trace("String_Node_Str");
    logWindow.setText(log.toString());
    Main.trace(JDUtilities.getResourceFile("String_Node_Str").getAbsoluteFile());
    if (JDUtilities.getResourceFile("String_Node_Str").exists()) {
      JDUtilities.getResourceFile("String_Node_Str").delete();
    }
    Main.log(log,"String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath());
    Main.log(log,"String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath());
    JDUtilities.getDatabaseConnector().shutdownDatabase();
    JDUtilities.runCommand("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath(),0);
    logWindow.setText(log.toString());
    JDIO.writeLocalFile(JDUtilities.getResourceFile("String_Node_Str"),log.toString());
    Main.log(log,"String_Node_Str" + updater.getErrors());
    System.exit(0);
  }
 catch (  Exception e) {
    e.printStackTrace();
    Main.log(log,"String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  try {
    log=new StringBuilder();
    FileHandler handler=new FileHandler("String_Node_Str",false);
    logger=Logger.getLogger("String_Node_Str");
    logger.addHandler(handler);
    boolean OSFilter=true;
    File cfg;
    if ((cfg=JDUtilities.getResourceFile("String_Node_Str")).exists()) {
      JDUtilities.getResourceFile("String_Node_Str").mkdirs();
      cfg.renameTo(JDUtilities.getResourceFile("String_Node_Str"));
    }
    for (int i=0; i < args.length; i++) {
      String p=args[i];
      if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        OSFilter=false;
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        OSFilter=false;
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        Browser.setVerbose(true);
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        RESTORE=true;
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        String br=args[++i];
        if (br.equalsIgnoreCase("String_Node_Str"))         br=null;
        WebUpdater.getConfig("String_Node_Str").setProperty(WebUpdater.PARAM_BRANCH,new Branch(br));
        WebUpdater.getConfig("String_Node_Str").save();
        System.out.println("String_Node_Str" + br);
      }
 else       if (p.trim().equalsIgnoreCase("String_Node_Str")) {
        OSFilter=false;
        clone=true;
      }
 else       if (clone && clonePrefix.size() == 0) {
        clonePrefix.add(new Server(100,p.trim()));
      }
    }
    Browser.init();
    guiConfig=WebUpdater.getConfig("String_Node_Str");
    log.append("String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str") + "String_Node_Str");
    log.append(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    System.out.println(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    System.out.println(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    log.append(WebUpdater.getConfig("String_Node_Str").getProperties() + "String_Node_Str");
    initGUI();
    try {
      Browser br=new Browser();
      TICKET_TIME=Integer.parseInt(br.getPage("String_Node_Str").trim());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (TICKET_TIME < 0) {
      warnings.setText("String_Node_Str");
      if (JOptionPane.OK_OPTION == JOptionPane.showConfirmDialog(frame,"String_Node_Str")) {
      }
 else {
        while (true) {
          Thread.sleep(10000000);
        }
      }
    }
 else {
      warnings.setText("String_Node_Str");
      while (TICKET_TIME > 0) {
        Thread.sleep(1000);
        warnings.setText("String_Node_Str" + Formatter.formatSeconds(TICKET_TIME / 1000) + "String_Node_Str");
        TICKET_TIME-=1000;
      }
      warnings.setText("String_Node_Str");
    }
    for (int i=0; i < args.length; i++) {
      Main.log(log,"String_Node_Str" + i + "String_Node_Str"+ args[i]+ "String_Node_Str"+ System.getProperty("String_Node_Str"));
      logWindow.setText(log.toString());
    }
    final WebUpdater updater=new WebUpdater();
    updater.setOSFilter(OSFilter);
    updater.getBroadcaster().addListener(new MessageListener(){
      private String msg0="String_Node_Str";
      private String msg1="String_Node_Str";
      private String msg2="String_Node_Str";
      public void onMessage(      MessageEvent event){
        if (updater.getErrors() > 0) {
          JOptionPane.showConfirmDialog(frame,"String_Node_Str","String_Node_Str",JOptionPane.YES_OPTION,JOptionPane.WARNING_MESSAGE);
          Main.log(log,"String_Node_Str");
          Main.log(log,"String_Node_Str" + new File("String_Node_Str").getAbsolutePath());
          Main.log(log,"String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath());
          JDUtilities.runCommand("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath(),0);
          logWindow.setText(log.toString());
          JDIO.writeLocalFile(JDUtilities.getResourceFile("String_Node_Str"),log.toString());
          System.exit(0);
          return;
        }
        if (event.getID() == WebUpdater.DO_UPDATE_FAILED || event.getID() == FileUpdate.ERROR) {
          msg2=msg1;
          msg1=msg0;
          msg0=event.getMessage();
          warnings.setText(msg2 + "String_Node_Str" + msg1+ "String_Node_Str"+ msg0+ "String_Node_Str");
        }
        if (event.getID() == WebUpdater.DO_UPDATE_SUCCESS) {
          warnings.setText("String_Node_Str");
        }
        Main.log(log,event.getMessage() + "String_Node_Str");
      }
    }
);
    Main.log(log,"String_Node_Str" + new Date() + "String_Node_Str");
    checkBackup();
    updater.ignorePlugins(false);
    checkUpdateMessage();
    updater.setLogger(log);
    updater.setDownloadProgress(progressload);
    Main.trace("String_Node_Str");
    if (RESTORE) {
      JDIO.removeByPattern(JDUtilities.getResourceFile("String_Node_Str").getParentFile(),Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE));
    }
    ArrayList<FileUpdate> files;
    try {
      files=updater.getAvailableFiles();
    }
 catch (    Exception e) {
      Main.trace("String_Node_Str");
      Main.log(log,"String_Node_Str");
      try {
        Thread.sleep(5000);
      }
 catch (      InterruptedException e1) {
      }
      files=new ArrayList<FileUpdate>();
    }
    if (files != null) {
      updater.filterAvailableUpdates(files);
      JDUpdateUtils.backupDataBase();
      updater.updateFiles(files,null);
    }
    Restarter.main(new String[]{});
    Main.trace(updater.getLogger().toString());
    Main.trace("String_Node_Str");
    logWindow.setText(log.toString());
    Main.trace(JDUtilities.getResourceFile("String_Node_Str").getAbsoluteFile());
    if (JDUtilities.getResourceFile("String_Node_Str").exists()) {
      JDUtilities.getResourceFile("String_Node_Str").delete();
    }
    Main.log(log,"String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath());
    Main.log(log,"String_Node_Str" + JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath());
    JDUtilities.getDatabaseConnector().shutdownDatabase();
    JDUtilities.runCommand("String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},JDUtilities.getResourceFile("String_Node_Str").getAbsolutePath(),0);
    logWindow.setText(log.toString());
    JDIO.writeLocalFile(JDUtilities.getResourceFile("String_Node_Str"),log.toString());
    Main.log(log,"String_Node_Str" + updater.getErrors());
    System.exit(0);
  }
 catch (  Exception e) {
    e.printStackTrace();
    Main.log(log,"String_Node_Str" + e.getLocalizedMessage());
  }
}