Program: 161955
Project: 161955
Buggy source:
public void actionPerformed(ActionEvent e){
  if (e.getSource() == resolution) {
    height.setEditable(resolution.getSelectedIndex() == 4);
    width.setEditable(resolution.getSelectedIndex() == 4);
    return;
  }
  if (e.getSource() == framerate) {
    fps.setEditable(framerate.getSelectedIndex() == 7);
    return;
  }
  if (e.getSource() == deletemovies) {
    FilenameFilter filter=new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str");
      }
    }
;
    String[] moviefiles=new File(moviedir).list(filter);
    for (int i=0; i < moviefiles.length; ++i) {
      File tgafile=new File(moviedir + "String_Node_Str" + moviefiles[i]);
      tgafile.setWritable(true);
      if (!tgafile.delete())       throw new IllegalArgumentException("String_Node_Str" + moviefiles[i] + "String_Node_Str");
    }
  }
  if (e.getSource() == save) {
    setSettings();
    try {
      settings.save();
      settings.saveToCfg();
    }
 catch (    Exception e1) {
      log.warning("String_Node_Str" + e1);
    }
  }
  if (e.getSource() == browsedemos) {
    int returnVal=choosedemo.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      currentdemo=choosedemo.getSelectedFile().getName();
      selecteddemo.setText(currentdemo);
    }
  }
  if (e.getSource() == addticks) {
    if (!Files.exists(Paths.get(tfdir,selecteddemo.getText()))) {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return;
    }
 else     currentdemo=selecteddemo.getText();
    if (!checkIfNumber(tick1.getText()) || !checkIfNumber(tick2.getText()) || Integer.parseInt(tick1.getText()) >= Integer.parseInt(tick2.getText())) {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return;
    }
    Object[] row={currentdemo,tick1.getText(),tick2.getText()};
    model.insertRow(ticks.getRowCount(),row);
  }
  if (e.getSource() == createvdm) {
    ticklist=generateTickList(0);
    vdmgenerator=new VDMGenerator(ticklist,tfdir);
    try {
      vdmgenerator.generate();
    }
 catch (    IOException e1) {
      log.warning("String_Node_Str" + e1);
    }
  }
  if (e.getSource() == clearticks) {
    while (model.getRowCount() > 0) {
      model.removeRow(0);
    }
  }
  if (e.getSource() == clearvdm) {
    FilenameFilter filter=new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.endsWith("String_Node_Str");
      }
    }
;
    String[] vdmfiles=new File(tfdir).list(filter);
    System.gc();
    for (int i=0; i < vdmfiles.length; ++i) {
      File vdmfile=new File(tfdir + "String_Node_Str" + vdmfiles[i]);
      if (!vdmfile.delete())       throw new IllegalArgumentException("String_Node_Str" + vdmfiles[i] + "String_Node_Str");
    }
  }
  if (e.getSource() == skyboxpreview) {
    if (previewwindow != null && previewwindow.isShowing())     previewwindow.destroy();
    if (skybox.getSelectedIndex() == 0)     return;
    previewwindow=new PreviewWindow("String_Node_Str" + (String)skybox.getSelectedItem() + "String_Node_Str");
    previewwindow.show();
  }
  if (e.getSource() == start) {
    if (!setSettings())     return;
    try {
      settings.saveToCfg();
    }
 catch (    Exception e1) {
      log.warning("String_Node_Str" + e1);
    }
    setEnabled(false);
    setTitle("String_Node_Str");
    try {
      movies.createMovienameCfgs();
      movies.movieOffset();
    }
 catch (    IOException e1) {
      log.warning("String_Node_Str" + e1);
    }
    files.setReplaceVo(!settings.getAnnouncer());
    if (skybox.getSelectedIndex() != 0) {
      files.setSkyboxFilename((String)skybox.getSelectedItem());
    }
    files.setReplaceAnnouncer(!settings.getAnnouncer());
    files.setReplaceDomination(!settings.getDomination());
    files.setHudName(settings.getHud());
    files.replaceAll();
    setTitle("String_Node_Str");
    cl.startTf(settings.getWidth(),settings.getHeight(),steampath,settings.getDxlevel());
    int timeout=0;
    while (!cl.isRunning("String_Node_Str") && timeout < 40) {
      try {
        Thread.sleep(3000);
        ++timeout;
      }
 catch (      Exception e1) {
        log.warning("String_Node_Str" + e1);
      }
    }
    setTitle("String_Node_Str");
    while (cl.isRunning("String_Node_Str")) {
      try {
        Thread.sleep(3000);
      }
 catch (      Exception e1) {
        log.warning("String_Node_Str" + e1);
      }
    }
    setTitle("String_Node_Str");
    files.restoreAll();
    cl.regedit("String_Node_Str","String_Node_Str",oDxlevel);
    setEnabled(true);
    setTitle("String_Node_Str" + version);
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == resolution) {
    height.setEditable(resolution.getSelectedIndex() == 4);
    width.setEditable(resolution.getSelectedIndex() == 4);
    return;
  }
  if (e.getSource() == framerate) {
    fps.setEditable(framerate.getSelectedIndex() == 7);
    return;
  }
  if (e.getSource() == deletemovies) {
    FilenameFilter filter=new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.endsWith("String_Node_Str") || name.endsWith("String_Node_Str");
      }
    }
;
    String[] moviefiles=new File(moviedir).list(filter);
    for (int i=0; i < moviefiles.length; ++i) {
      File tgafile=new File(moviedir + "String_Node_Str" + moviefiles[i]);
      tgafile.setWritable(true);
      if (!tgafile.delete())       throw new IllegalArgumentException("String_Node_Str" + moviefiles[i] + "String_Node_Str");
    }
  }
  if (e.getSource() == save) {
    setSettings();
    try {
      settings.save();
      settings.saveToCfg();
    }
 catch (    Exception e1) {
      log.warning("String_Node_Str" + e1);
    }
  }
  if (e.getSource() == browsedemos) {
    int returnVal=choosedemo.showOpenDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
      currentdemo=choosedemo.getSelectedFile().getName();
      selecteddemo.setText(currentdemo);
    }
  }
  if (e.getSource() == addticks) {
    if (!Files.exists(Paths.get(tfdir,selecteddemo.getText()))) {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return;
    }
 else     currentdemo=selecteddemo.getText();
    if (!checkIfNumber(tick1.getText()) || !checkIfNumber(tick2.getText()) || Integer.parseInt(tick1.getText()) >= Integer.parseInt(tick2.getText())) {
      JOptionPane.showMessageDialog(this,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
      return;
    }
    Object[] row={currentdemo,tick1.getText(),tick2.getText()};
    model.insertRow(ticks.getRowCount(),row);
  }
  if (e.getSource() == createvdm) {
    ticklist=generateTickList(0);
    vdmgenerator=new VDMGenerator(ticklist,tfdir);
    try {
      vdmgenerator.generate();
    }
 catch (    IOException e1) {
      log.warning("String_Node_Str" + e1);
    }
  }
  if (e.getSource() == clearticks) {
    while (model.getRowCount() > 0) {
      model.removeRow(0);
    }
  }
  if (e.getSource() == clearvdm) {
    FilenameFilter filter=new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.endsWith("String_Node_Str");
      }
    }
;
    String[] vdmfiles=new File(tfdir).list(filter);
    System.gc();
    for (int i=0; i < vdmfiles.length; ++i) {
      File vdmfile=new File(tfdir + "String_Node_Str" + vdmfiles[i]);
      if (!vdmfile.delete())       throw new IllegalArgumentException("String_Node_Str" + vdmfiles[i] + "String_Node_Str");
    }
  }
  if (e.getSource() == skyboxpreview) {
    if (previewwindow != null && previewwindow.isShowing())     previewwindow.destroy();
    if (skybox.getSelectedIndex() == 0)     return;
    previewwindow=new PreviewWindow("String_Node_Str" + (String)skybox.getSelectedItem() + "String_Node_Str");
    previewwindow.show();
  }
  if (e.getSource() == start) {
    files.restoreAll();
    if (!setSettings())     return;
    try {
      settings.saveToCfg();
    }
 catch (    Exception e1) {
      log.warning("String_Node_Str" + e1);
    }
    setEnabled(false);
    setTitle("String_Node_Str");
    try {
      movies.createMovienameCfgs();
      movies.movieOffset();
    }
 catch (    IOException e1) {
      log.warning("String_Node_Str" + e1);
    }
    files.setReplaceVo(!settings.getAnnouncer());
    if (skybox.getSelectedIndex() != 0) {
      files.setSkyboxFilename((String)skybox.getSelectedItem());
    }
    files.setReplaceAnnouncer(!settings.getAnnouncer());
    files.setReplaceDomination(!settings.getDomination());
    files.setHudName(settings.getHud());
    files.replaceAll();
    setTitle("String_Node_Str");
    cl.startTf(settings.getWidth(),settings.getHeight(),steampath,settings.getDxlevel());
    int timeout=0;
    while (!cl.isRunning("String_Node_Str") && timeout < 40) {
      try {
        Thread.sleep(3000);
        ++timeout;
      }
 catch (      Exception e1) {
        log.warning("String_Node_Str" + e1);
      }
    }
    setTitle("String_Node_Str");
    while (cl.isRunning("String_Node_Str")) {
      try {
        Thread.sleep(3000);
      }
 catch (      Exception e1) {
        log.warning("String_Node_Str" + e1);
      }
    }
    setTitle("String_Node_Str");
    files.restoreAll();
    cl.regedit("String_Node_Str","String_Node_Str",oDxlevel);
    setEnabled(true);
    setTitle("String_Node_Str" + version);
  }
}