Program: 75961
Project: 75961
Buggy source:
/** 
 * Query the user for a filename, save the model to that file, and open a new window to view the model. This overrides the base class to update the entry in the ModelDirectory.
 * @return True if the save succeeds.
 */
protected boolean _saveAs(){
  JFileChooser fileDialog=new JFileChooser();
  fileDialog.setDialogTitle("String_Node_Str");
  if (_directory != null) {
    fileDialog.setCurrentDirectory(_directory);
  }
 else {
    String cwd=System.getProperty("String_Node_Str");
    if (cwd != null) {
      fileDialog.setCurrentDirectory(new File(cwd));
    }
  }
  int returnVal=fileDialog.showSaveDialog(this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file=fileDialog.getSelectedFile();
    if (file.exists()) {
      String query="String_Node_Str" + file.getName() + "String_Node_Str";
      int selected=JOptionPane.showOptionDialog(this,query,"String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
      if (selected == 1) {
        return false;
      }
    }
    _directory=fileDialog.getCurrentDirectory();
    try {
      _writeFile(file);
      setModified(false);
    }
 catch (    IOException ex) {
      report("String_Node_Str",ex);
      return false;
    }
    try {
      URL newURL=file.toURL();
      String newKey=newURL.toExternalForm();
      getConfiguration().openModel(newURL,newURL,newKey);
      Effigy effigy=getEffigy();
      if (effigy != null) {
        String id=effigy.identifier.getExpression();
        if (id.equals("String_Node_Str")) {
          effigy.setContainer(null);
        }
      }
    }
 catch (    Exception ex) {
      MessageHandler.error("String_Node_Str",ex);
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Query the user for a filename, save the model to that file, and open a new window to view the model. This overrides the base class to update the entry in the ModelDirectory.
 * @return True if the save succeeds.
 */
protected boolean _saveAs(){
  JFileChooser fileDialog=new JFileChooser();
  fileDialog.setDialogTitle("String_Node_Str");
  if (_directory != null) {
    fileDialog.setCurrentDirectory(_directory);
  }
 else {
    String cwd=System.getProperty("String_Node_Str");
    if (cwd != null) {
      fileDialog.setCurrentDirectory(new File(cwd));
    }
  }
  int returnVal=fileDialog.showSaveDialog(this);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file=fileDialog.getSelectedFile();
    try {
      URL newURL=file.toURL();
      String newKey=newURL.toExternalForm();
      Effigy previousOpen=getDirectory().getEffigy(newKey);
      if (previousOpen != null) {
        if (previousOpen.isModified()) {
          previousOpen.showTableaux();
          String confirm="String_Node_Str" + file.getName() + "String_Node_Str";
          int selected=JOptionPane.showOptionDialog(this,confirm,"String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
          if (selected == 1) {
            return false;
          }
          previousOpen.setModified(false);
        }
        previousOpen.closeTableaux();
      }
      if (file.exists()) {
        String query="String_Node_Str" + file.getName() + "String_Node_Str";
        int selected=JOptionPane.showOptionDialog(this,query,"String_Node_Str",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
        if (selected == 1) {
          return false;
        }
      }
      _directory=fileDialog.getCurrentDirectory();
      _writeFile(file);
      getConfiguration().openModel(newURL,newURL,newKey);
      Effigy effigy=getEffigy();
      if (effigy != null) {
        String id=effigy.identifier.getExpression();
        if (id.equals("String_Node_Str")) {
          effigy.setContainer(null);
        }
      }
    }
 catch (    Exception ex) {
      report("String_Node_Str",ex);
      return false;
    }
  }
  return true;
}