Program: 17697
Project: 17697
Buggy source:
public static File performExternal2Bin(File sourceFile,File targetFile,TaskComplete done){
  File binaryFile=targetFile;
  DialogExternal2Binary dialog=new DialogExternal2Binary(EncogWorkBench.getInstance().getMainWindow());
  if (binaryFile != null) {
    dialog.getBinaryFile().setValue(binaryFile.toString());
  }
  if (sourceFile != null) {
    dialog.getExternalFile().setValue(sourceFile.toString());
  }
  if (dialog.process()) {
    binaryFile=new File(dialog.getBinaryFile().getValue());
    File externFile=new File(dialog.getExternalFile().getValue());
    int fileType=dialog.getFileType().getSelectedIndex();
    int inputCount=dialog.getInputCount().getValue();
    int idealCount=dialog.getIdealCount().getValue();
    if (ExtensionFilter.getExtension(binaryFile) == null) {
      binaryFile=new File(binaryFile.getPath() + "String_Node_Str");
    }
    DataSetCODEC codec;
    BinaryDataLoader loader;
    if (fileType == 0) {
      DialogCSV dialog2=new DialogCSV(EncogWorkBench.getInstance().getMainWindow());
      if (dialog2.process()) {
        boolean headers=dialog2.getHeaders().getValue();
        CSVFormat format;
        if (dialog2.getDecimalComma().getValue())         format=CSVFormat.DECIMAL_COMMA;
 else         format=CSVFormat.DECIMAL_POINT;
        codec=new CSVDataCODEC(externFile,format,headers,inputCount,idealCount);
        loader=new BinaryDataLoader(codec);
        ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,true);
        dlg.process(done);
      }
    }
 else     if (fileType == 1) {
      codec=new ExcelCODEC(externFile,inputCount,idealCount);
      loader=new BinaryDataLoader(codec);
      ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,true);
      dlg.process(done);
    }
    return binaryFile;
  }
 else   return null;
}

Fixed version (ground truth):
public static File performExternal2Bin(File sourceFile,File targetFile,TaskComplete done){
  File binaryFile=targetFile;
  DialogExternal2Binary dialog=new DialogExternal2Binary(EncogWorkBench.getInstance().getMainWindow());
  if (binaryFile != null) {
    dialog.getBinaryFile().setValue(binaryFile.toString());
  }
  if (sourceFile != null) {
    dialog.getExternalFile().setValue(sourceFile.toString());
  }
  if (dialog.process()) {
    binaryFile=new File(dialog.getBinaryFile().getValue());
    File externFile=new File(dialog.getExternalFile().getValue());
    int fileType=dialog.getFileType().getSelectedIndex();
    int inputCount=dialog.getInputCount().getValue();
    int idealCount=dialog.getIdealCount().getValue();
    if (ExtensionFilter.getExtension(binaryFile) == null) {
      binaryFile=new File(binaryFile.getPath() + "String_Node_Str");
    }
    DataSetCODEC codec;
    BinaryDataLoader loader;
    if (fileType == 0) {
      DialogCSV dialog2=new DialogCSV(EncogWorkBench.getInstance().getMainWindow());
      if (dialog2.process()) {
        boolean headers=dialog2.getHeaders().getValue();
        CSVFormat format;
        if (dialog2.getDecimalComma().getValue())         format=CSVFormat.DECIMAL_COMMA;
 else         format=CSVFormat.DECIMAL_POINT;
        codec=new CSVDataCODEC(externFile,format,headers,inputCount,idealCount,dialog.getContainsSignificance().getValue());
        loader=new BinaryDataLoader(codec);
        ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,true);
        dlg.process(done);
      }
    }
 else     if (fileType == 1) {
      codec=new ExcelCODEC(externFile,inputCount,idealCount);
      loader=new BinaryDataLoader(codec);
      ImportExportDialog dlg=new ImportExportDialog(loader,binaryFile,true);
      dlg.process(done);
    }
    return binaryFile;
  }
 else   return null;
}