Program: 73327
Project: 73327
Buggy source:
/** 
 * Query the user for a filename, save the model to that file, and open a new window to view the model.  This method uses java.awt.FileDialog and is usually used under Mac OS X.
 * @param extension If non-null, then the extension that isappended to the file name if there is no extension.
 * @return URL of the saved file if the save succeeds, null if save fails.
 */
private URL _saveAsHelperFileDialog(String extension){
  URL newURL=null;
  FileDialog fileDialog=_saveAsFileDialogComponent();
  if (_initialSaveAsFileName != null) {
    fileDialog.setFile(new File(fileDialog.getDirectory(),_initialSaveAsFileName).toString());
  }
  fileDialog.show();
  String selectedFile=fileDialog.getFile();
  if (selectedFile != null) {
    File file=null;
    if (selectedFile.startsWith("String_Node_Str")) {
      file=new File(selectedFile.replace(':','/'));
    }
 else {
      file=new File(_directory,selectedFile);
    }
    if (extension != null && file.getName().indexOf("String_Node_Str") == -1) {
      file=new File(file.getAbsolutePath() + extension);
    }
    try {
      if (!_confirmFile(null,file)) {
        return null;
      }
      newURL=file.toURI().toURL();
      String newKey=newURL.toExternalForm();
      _directory=new File(fileDialog.getDirectory());
      _writeFile(file);
      Tableau newTableau=getConfiguration().openModel(newURL,newURL,newKey);
      newTableau.getFrame().setTitle(StringUtilities.abbreviate(new File(_directory,file.getName()).toString()));
      Effigy effigy=getEffigy();
      if (effigy != null) {
        String id=effigy.identifier.getExpression();
        if (id.equals("String_Node_Str")) {
          effigy.setContainer(null);
        }
      }
      dispose();
      return newURL;
    }
 catch (    Exception ex) {
      report("String_Node_Str",ex);
      return null;
    }
  }
  return null;
}

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 method uses java.awt.FileDialog and is usually used under Mac OS X.
 * @param extension If non-null, then the extension that isappended to the file name if there is no extension.
 * @return URL of the saved file if the save succeeds, null if save fails.
 */
private URL _saveAsHelperFileDialog(String extension){
  FileDialog fileDialog=_saveAsFileDialogComponent();
  if (fileDialog == null) {
    return null;
  }
  if (_initialSaveAsFileName != null) {
    fileDialog.setFile(new File(fileDialog.getDirectory(),_initialSaveAsFileName).toString());
  }
  fileDialog.show();
  String selectedFile=fileDialog.getFile();
  if (selectedFile != null) {
    File file=null;
    if (selectedFile.startsWith("String_Node_Str")) {
      file=new File(selectedFile.replace(':','/'));
    }
 else {
      file=new File(_directory,selectedFile);
    }
    if (extension != null && file.getName().indexOf("String_Node_Str") == -1) {
      file=new File(file.getAbsolutePath() + extension);
    }
    try {
      if (!_confirmFile(null,file)) {
        return null;
      }
      URL newURL=file.toURI().toURL();
      String newKey=newURL.toExternalForm();
      _directory=new File(fileDialog.getDirectory());
      _writeFile(file);
      Tableau newTableau=getConfiguration().openModel(newURL,newURL,newKey);
      newTableau.getFrame().setTitle(StringUtilities.abbreviate(new File(_directory,file.getName()).toString()));
      Effigy effigy=getEffigy();
      if (effigy != null) {
        String id=effigy.identifier.getExpression();
        if (id.equals("String_Node_Str")) {
          effigy.setContainer(null);
        }
      }
      dispose();
      return newURL;
    }
 catch (    Exception ex) {
      report("String_Node_Str",ex);
      return null;
    }
  }
  return null;
}