Program: 170218
Project: 170218
Buggy source:
public File genSave(File file,DrawFBP.FileChooserParms fCP,Object contents){
  boolean saveAs=false;
  File newFile=null;
  String fileString=null;
  if (file == null)   saveAs=true;
  if (saveAs) {
    String suggestedFileName="String_Node_Str";
    String s=driver.properties.get(fCP.propertyName);
    if (s == null)     s=System.getProperty("String_Node_Str");
    File f=new File(s);
    if (!f.exists()) {
      MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + s + "String_Node_Str",MyOptionPane.ERROR_MESSAGE);
      f=new File(System.getProperty("String_Node_Str"));
    }
    String fn="String_Node_Str";
    suggestedFileName="String_Node_Str";
    File g=diagFile;
    MyFileChooser fc=null;
    if (g != null) {
      fn=g.getName();
      suggestedFileName=s + File.separator + fn;
      int i=suggestedFileName.lastIndexOf("String_Node_Str");
      suggestedFileName=suggestedFileName.substring(0,i) + fCP.fileExt;
      fc=new MyFileChooser(f,fCP);
      fc.setSuggestedName(suggestedFileName);
    }
 else     fc=new MyFileChooser(f,fCP);
    int returnVal=fc.showOpenDialog(saveAs);
    if (returnVal == MyFileChooser.APPROVE_OPTION) {
      newFile=new File(driver.getSelFile(fc));
      s=newFile.getAbsolutePath();
      if (s.endsWith("String_Node_Str")) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + newFile.getName(),MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      if (newFile.getParentFile() == null) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + newFile.getName(),MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      if (!(newFile.getParentFile().exists())) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + newFile.getAbsolutePath(),MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      if (s.toLowerCase().endsWith("String_Node_Str")) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + s,MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      File f2=new File(s);
      if (!(f2.exists()) || f2.isDirectory()) {
        String suff=getSuffix(s);
        if (suff == null)         newFile=new File(s + fCP.fileExt);
 else {
          if (!((driver.new ImageFilter()).accept(new File(s)))) {
            newFile=new File(s.substring(0,s.lastIndexOf(suff)) + fCP.fileExt.substring(1));
          }
        }
      }
    }
    if (newFile == null)     return null;
    if (fCP.fileExt.equals("String_Node_Str") && -1 != diagramIsOpen(newFile.getAbsolutePath()))     return null;
    if (newFile.exists()) {
      if (newFile.isDirectory()) {
        MyOptionPane.showMessageDialog(driver.frame,newFile.getName() + "String_Node_Str",MyOptionPane.WARNING_MESSAGE);
        return null;
      }
      if (!(MyOptionPane.YES_OPTION == MyOptionPane.showConfirmDialog(driver.frame,"String_Node_Str" + newFile.getAbsolutePath() + "String_Node_Str","String_Node_Str",MyOptionPane.YES_NO_OPTION)))       return null;
    }
 else {
      if (!(MyOptionPane.YES_OPTION == MyOptionPane.showConfirmDialog(driver.frame,"String_Node_Str" + newFile.getAbsolutePath() + "String_Node_Str","String_Node_Str",MyOptionPane.YES_NO_OPTION)))       return null;
    }
    file=newFile;
  }
  if (fCP == fCPArr[DrawFBP.IMAGE]) {
    Path path=file.toPath();
    try {
      Files.deleteIfExists(path);
      file=null;
      file=path.toFile();
      String suff=getSuffix(file.getAbsolutePath());
      BufferedImage bi=(BufferedImage)contents;
      ImageIO.write(bi,suff,file);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
 else {
    if (fCP.fileExt.equals("String_Node_Str")) {
      fileString=readFile(file);
      diagFile=file;
      if (fileString != null) {
        String s=file.getAbsolutePath();
        File oldFile=file;
        file=new File(s.substring(0,s.length() - 1) + "String_Node_Str");
        writeFile(file,fileString);
        file=oldFile;
      }
      fileString=buildFile();
    }
 else     fileString=(String)contents;
    writeFile(file,fileString);
  }
  MyOptionPane.showMessageDialog(driver.frame,fCP.name + "String_Node_Str" + file.getName());
  return file;
}

Fixed version (ground truth):
public File genSave(File file,DrawFBP.FileChooserParms fCP,Object contents){
  boolean saveAs=false;
  File newFile=null;
  String fileString=null;
  if (file == null)   saveAs=true;
  if (saveAs) {
    String suggestedFileName="String_Node_Str";
    String s=driver.properties.get(fCP.propertyName);
    if (s == null)     s=System.getProperty("String_Node_Str");
    File f=new File(s);
    if (!f.exists()) {
      MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + s + "String_Node_Str",MyOptionPane.ERROR_MESSAGE);
      f=new File(System.getProperty("String_Node_Str"));
    }
    String fn="String_Node_Str";
    suggestedFileName="String_Node_Str";
    File g=diagFile;
    MyFileChooser fc=null;
    if (g != null) {
      fn=g.getName();
      suggestedFileName=s + File.separator + fn;
      int i=suggestedFileName.lastIndexOf("String_Node_Str");
      suggestedFileName=suggestedFileName.substring(0,i) + fCP.fileExt;
      fc=new MyFileChooser(f,fCP);
      fc.setSuggestedName(suggestedFileName);
    }
 else     fc=new MyFileChooser(f,fCP);
    int returnVal=fc.showOpenDialog(saveAs);
    if (returnVal == MyFileChooser.APPROVE_OPTION) {
      newFile=new File(driver.getSelFile(fc));
      s=newFile.getAbsolutePath();
      if (s.endsWith("String_Node_Str")) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + newFile.getName(),MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      if (!s.endsWith(fCP.fileExt)) {
        s+=fCP.fileExt;
        newFile=new File(s);
      }
      if (newFile.getParentFile() == null) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + newFile.getName(),MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      if (!(newFile.getParentFile().exists())) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + newFile.getAbsolutePath(),MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      if (s.toLowerCase().endsWith("String_Node_Str")) {
        MyOptionPane.showMessageDialog(driver.frame,"String_Node_Str" + s,MyOptionPane.ERROR_MESSAGE);
        return null;
      }
      File f2=new File(s);
      if (!(f2.exists()) || f2.isDirectory()) {
        String suff=getSuffix(s);
        if (suff == null)         newFile=new File(s + fCP.fileExt);
 else {
          if (!((driver.new ImageFilter()).accept(new File(s)))) {
            newFile=new File(s.substring(0,s.lastIndexOf(suff)) + fCP.fileExt.substring(1));
          }
        }
      }
    }
    if (newFile == null)     return null;
    if (fCP.fileExt.equals("String_Node_Str") && -1 != diagramIsOpen(newFile.getAbsolutePath()))     return null;
    if (newFile.exists()) {
      if (newFile.isDirectory()) {
        MyOptionPane.showMessageDialog(driver.frame,newFile.getName() + "String_Node_Str",MyOptionPane.WARNING_MESSAGE);
        return null;
      }
      if (!(MyOptionPane.YES_OPTION == MyOptionPane.showConfirmDialog(driver.frame,"String_Node_Str" + newFile.getAbsolutePath() + "String_Node_Str","String_Node_Str",MyOptionPane.YES_NO_OPTION)))       return null;
    }
 else {
      if (!(MyOptionPane.YES_OPTION == MyOptionPane.showConfirmDialog(driver.frame,"String_Node_Str" + newFile.getAbsolutePath() + "String_Node_Str","String_Node_Str",MyOptionPane.YES_NO_OPTION)))       return null;
    }
    file=newFile;
  }
  if (fCP == fCPArr[DrawFBP.IMAGE]) {
    Path path=file.toPath();
    try {
      Files.deleteIfExists(path);
      file=null;
      file=path.toFile();
      String suff=getSuffix(file.getAbsolutePath());
      BufferedImage bi=(BufferedImage)contents;
      ImageIO.write(bi,suff,file);
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
 else {
    if (fCP.fileExt.equals("String_Node_Str")) {
      fileString=readFile(file);
      diagFile=file;
      if (fileString != null) {
        String s=file.getAbsolutePath();
        File oldFile=file;
        file=new File(s.substring(0,s.length() - 1) + "String_Node_Str");
        writeFile(file,fileString);
        file=oldFile;
      }
      fileString=buildFile();
    }
 else     fileString=(String)contents;
    writeFile(file,fileString);
  }
  MyOptionPane.showMessageDialog(driver.frame,fCP.name + "String_Node_Str" + file.getName());
  return file;
}