Program: 117758
Project: 117758
Buggy source:
@Override public void execute(final Wandora admin,Context context) throws TopicMapException {
  JDialog dialog=new JDialog(admin,"String_Node_Str",true);
  ApplyPatchToolConfigPanel configPanel=new ApplyPatchToolConfigPanel(admin,dialog);
  dialog.getContentPane().add(configPanel);
  dialog.setSize(440,240);
  GuiTools.centerWindow(dialog,admin);
  dialog.setVisible(true);
  if (configPanel.wasCancelled())   return;
  setDefaultLogger();
  String filename=null;
  try {
    TopicMap tm=null;
    int mode=configPanel.getMapMode();
    if (mode == ApplyPatchToolConfigPanel.MODE_FILE) {
      filename=configPanel.getMapValue();
      if (filename != null && !"String_Node_Str".equals(filename)) {
        log("String_Node_Str");
        tm=openFile(filename);
      }
 else {
        log("String_Node_Str");
        log("String_Node_Str");
        setState(WAIT);
        return;
      }
    }
 else     if (mode == ApplyPatchToolConfigPanel.MODE_LAYER) {
      Layer l=admin.getTopicMap().getLayer(configPanel.getMapValue());
      if (l == null) {
        log("String_Node_Str");
        log("String_Node_Str");
        setState(WAIT);
        return;
      }
      tm=l.getTopicMap();
    }
 else     if (mode == ApplyPatchToolConfigPanel.MODE_PROJECT) {
      tm=admin.getTopicMap();
    }
    filename=configPanel.getPatchFile();
    Reader reader=new InputStreamReader(new FileInputStream(filename),"String_Node_Str");
    ArrayList<DiffEntry> diff=null;
    try {
      PatchDiffParser parser=new PatchDiffParser(reader);
      log("String_Node_Str");
      diff=parser.parse();
    }
  finally {
      reader.close();
    }
    TopicMapDiff tmDiff=new TopicMapDiff();
    if (configPanel.getPatchReverse()) {
      log("String_Node_Str");
      diff=tmDiff.makeInverse(diff);
    }
    log("String_Node_Str");
    final ArrayList<PatchException> pes=new ArrayList<PatchException>();
    final Boolean[] yesToAll=new Boolean[]{false};
    final Boolean[] aborted=new Boolean[]{false};
    tmDiff.applyDiff(diff,tm,new PatchExceptionHandler(){
      public boolean handleException(      PatchException e){
        pes.add(e);
        if (yesToAll[0])         return true;
        int c=WandoraOptionPane.showConfirmDialog(admin,"String_Node_Str" + e.level + "String_Node_Str"+ e.message,"String_Node_Str",WandoraOptionPane.YES_TO_ALL_NO_OPTION);
        if (c == WandoraOptionPane.YES_TO_ALL_OPTION) {
          yesToAll[0]=true;
          return true;
        }
 else         if (c == WandoraOptionPane.YES_OPTION)         return true;
 else {
          aborted[0]=true;
          return false;
        }
      }
    }
);
    if (pes.size() > 0) {
      log("String_Node_Str");
      for (      PatchException pe : pes) {
        log(pe.level + "String_Node_Str" + pe.message);
      }
    }
    if (aborted[0])     log("String_Node_Str");
    if (mode == ApplyPatchToolConfigPanel.MODE_FILE) {
      filename=configPanel.getMapValue();
      int ind=filename.lastIndexOf("String_Node_Str");
      if (ind == -1)       filename+="String_Node_Str";
 else       filename=filename.substring(0,ind) + "String_Node_Str" + filename.substring(ind);
      File f=new File(filename);
      if (f.exists()) {
        int r=WandoraOptionPane.showConfirmDialog(admin,"String_Node_Str" + filename + "String_Node_Str");
        if (r != WandoraOptionPane.YES_OPTION) {
          log("String_Node_Str");
          setState(WAIT);
          return;
        }
      }
      log("String_Node_Str" + filename);
      tm.exportXTM(filename,getCurrentLogger());
      log("String_Node_Str" + filename);
    }
 else {
      log("String_Node_Str");
    }
  }
 catch (  FileNotFoundException fnfe) {
    log("String_Node_Str" + filename + "String_Node_Str");
  }
catch (  IOException ioe) {
    log(ioe);
  }
catch (  java.text.ParseException pe) {
    log("String_Node_Str" + pe.getErrorOffset() + "String_Node_Str"+ pe.getMessage());
  }
  setState(WAIT);
}

Fixed version (ground truth):
@Override public void execute(final Wandora admin,Context context) throws TopicMapException {
  JDialog dialog=new JDialog(admin,"String_Node_Str",true);
  ApplyPatchToolConfigPanel configPanel=new ApplyPatchToolConfigPanel(admin,dialog);
  dialog.getContentPane().add(configPanel);
  dialog.setSize(440,240);
  GuiTools.centerWindow(dialog,admin);
  dialog.setVisible(true);
  if (configPanel.wasCancelled())   return;
  setDefaultLogger();
  String filename=null;
  try {
    TopicMap tm=null;
    int mode=configPanel.getMapMode();
    if (mode == ApplyPatchToolConfigPanel.MODE_FILE) {
      filename=configPanel.getMapValue();
      if (filename != null && !"String_Node_Str".equals(filename)) {
        log("String_Node_Str");
        tm=openFile(filename);
      }
 else {
        log("String_Node_Str");
        log("String_Node_Str");
        setState(WAIT);
        return;
      }
    }
 else     if (mode == ApplyPatchToolConfigPanel.MODE_LAYER) {
      Layer l=admin.getTopicMap().getLayer(configPanel.getMapValue());
      if (l == null) {
        log("String_Node_Str");
        log("String_Node_Str");
        setState(WAIT);
        return;
      }
      tm=l.getTopicMap();
    }
 else     if (mode == ApplyPatchToolConfigPanel.MODE_PROJECT) {
      tm=admin.getTopicMap();
    }
    filename=configPanel.getPatchFile();
    Reader reader=new InputStreamReader(new FileInputStream(filename),"String_Node_Str");
    ArrayList<DiffEntry> diff=null;
    try {
      PatchDiffParser parser=new PatchDiffParser(reader);
      log("String_Node_Str");
      diff=parser.parse();
    }
  finally {
      reader.close();
    }
    TopicMapDiff tmDiff=new TopicMapDiff();
    if (configPanel.getPatchReverse()) {
      log("String_Node_Str");
      diff=tmDiff.makeInverse(diff);
    }
    log("String_Node_Str");
    final ArrayList<PatchException> pes=new ArrayList<PatchException>();
    final Boolean[] yesToAll=new Boolean[]{false};
    final Boolean[] aborted=new Boolean[]{false};
    tmDiff.applyDiff(diff,tm,new PatchExceptionHandler(){
      public boolean handleException(      PatchException e){
        pes.add(e);
        if (yesToAll[0])         return false;
        int c=WandoraOptionPane.showConfirmDialog(admin,"String_Node_Str" + e.level + "String_Node_Str"+ e.message,"String_Node_Str",WandoraOptionPane.YES_TO_ALL_NO_OPTION);
        if (c == WandoraOptionPane.YES_TO_ALL_OPTION) {
          yesToAll[0]=true;
          return false;
        }
 else         if (c == WandoraOptionPane.YES_OPTION)         return true;
 else {
          aborted[0]=true;
          return true;
        }
      }
    }
);
    if (pes.size() > 0) {
      log("String_Node_Str");
      for (      PatchException pe : pes) {
        log(pe.level + "String_Node_Str" + pe.message);
      }
    }
    if (aborted[0])     log("String_Node_Str");
    if (mode == ApplyPatchToolConfigPanel.MODE_FILE) {
      filename=configPanel.getMapValue();
      int ind=filename.lastIndexOf("String_Node_Str");
      if (ind == -1)       filename+="String_Node_Str";
 else       filename=filename.substring(0,ind) + "String_Node_Str" + filename.substring(ind);
      File f=new File(filename);
      if (f.exists()) {
        int r=WandoraOptionPane.showConfirmDialog(admin,"String_Node_Str" + filename + "String_Node_Str");
        if (r != WandoraOptionPane.YES_OPTION) {
          log("String_Node_Str");
          setState(WAIT);
          return;
        }
      }
      log("String_Node_Str" + filename);
      tm.exportXTM(filename,getCurrentLogger());
      log("String_Node_Str" + filename);
    }
 else {
      log("String_Node_Str");
    }
  }
 catch (  FileNotFoundException fnfe) {
    log("String_Node_Str" + filename + "String_Node_Str");
  }
catch (  IOException ioe) {
    log(ioe);
  }
catch (  java.text.ParseException pe) {
    log("String_Node_Str" + pe.getErrorOffset() + "String_Node_Str"+ pe.getMessage());
  }
  setState(WAIT);
}