Program: 81509
Project: 81509
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected BufferedDataTable[] execute(final BufferedDataTable[] inData,final ExecutionContext exec) throws Exception {
  String xml_file=null;
  if (getModelSetting(CFG_FILE_URL) != null) {
    xml_file=((SettingsModelString)getModelSetting(CFG_FILE_URL)).getStringValue();
  }
  if (getModelSetting(CFG_FILE_URL) == null) {
    throw new InvalidSettingsException("String_Node_Str");
  }
  if (xml_file.isEmpty() || xml_file.length() == 0) {
    throw new InvalidSettingsException("String_Node_Str");
  }
  DefaultHandler handler=new ParseXML();
  SAXParserFactory factory=SAXParserFactory.newInstance();
  factory.setValidating(false);
  SAXParser parser=factory.newSAXParser();
  parser.parse(xml_file,handler);
  int nrColumns=0;
  if (((SettingsModelBoolean)getModelSetting(CFG_splitSourceCol)).getBooleanValue() && ((SettingsModelBoolean)getModelSetting(CFG_splitDestinationCol)).getBooleanValue() == true) {
    nrColumns=17;
  }
 else   if (((SettingsModelBoolean)getModelSetting(CFG_splitSourceCol)).getBooleanValue() == true) {
    nrColumns=15;
  }
 else   if (((SettingsModelBoolean)getModelSetting(CFG_splitDestinationCol)).getBooleanValue() == true) {
    nrColumns=15;
  }
 else {
    nrColumns=13;
  }
  List<Attribute> colAttributes=getEchoColumnModel();
  BufferedDataContainer buf=exec.createDataContainer(AttributeUtils.compileTableSpecs(colAttributes));
  DataCell[] cells=new DataCell[nrColumns];
  setWarningMessage("String_Node_Str" + EchoReportRecords.records.size());
  int counter=0;
  for (  EchoReportRecords r : EchoReportRecords.records) {
    cells[0]=new StringCell(r.getSrcPlateName());
    cells[1]=new StringCell(r.getSrcPlateBarcode());
    cells[2]=new StringCell(r.getSrcWell());
    cells[3]=new StringCell(r.getDestPlateName());
    cells[4]=new StringCell(r.getDestPlateBarcode());
    cells[5]=new StringCell(r.getDestWell());
    cells[6]=new StringCell(r.getXferVol());
    cells[7]=new StringCell(r.getActualVol());
    cells[8]=new StringCell(r.getCurrentFluidVolume());
    cells[9]=new StringCell(r.getFluidComposition());
    cells[10]=new StringCell(r.getFluidUnits());
    cells[11]=new StringCell(r.getFluidType());
    cells[12]=new StringCell(r.getXferStatus());
    int index=12;
    if (((SettingsModelBoolean)getModelSetting(CFG_splitSourceCol)).getBooleanValue() == true) {
      String[] parts=splitPosition(r.getSrcWell());
      cells[index + 1]=new StringCell(parts[0]);
      cells[index + 2]=new StringCell(parts[1]);
      index=index + 2;
    }
    if (((SettingsModelBoolean)getModelSetting(CFG_splitDestinationCol)).getBooleanValue() == true) {
      String[] parts=splitPosition(r.getDestWell());
      cells[index + 1]=new StringCell(parts[0]);
      cells[index + 2]=new StringCell(parts[1]);
    }
    DataRow row=new DefaultRow("String_Node_Str" + counter,cells);
    buf.addRowToTable(row);
    counter++;
  }
  buf.close();
  BufferedDataTable table=buf.getTable();
  int meta_nrColumns=10;
  List<Attribute> colAttributes1=getMetaDataColumnModel();
  BufferedDataContainer buf1=exec.createDataContainer(AttributeUtils.compileTableSpecs(colAttributes1));
  DataCell[] cells1=new DataCell[meta_nrColumns];
  setWarningMessage("String_Node_Str" + EchoReportHeader.headers.size());
  int counter1=0;
  for (  EchoReportHeader rh : EchoReportHeader.headers) {
    cells1[0]=new StringCell(rh.getRunID());
    cells1[1]=new StringCell(rh.getRunDateTime());
    cells1[2]=new StringCell(rh.getAppName());
    cells1[3]=new StringCell(rh.getAppVersion());
    cells1[4]=new StringCell(rh.getProtocolName());
    cells1[5]=new StringCell(rh.getUserName());
  }
  for (  EchoReportFooter rf : EchoReportFooter.footers) {
    cells1[6]=new StringCell(rf.getInstrName());
    cells1[7]=new StringCell(rf.getInstrModel());
    cells1[8]=new StringCell(rf.getInstrSN());
    cells1[9]=new StringCell(rf.getInstrSWVersion());
    DataRow row=new DefaultRow("String_Node_Str" + counter1,cells1);
    buf1.addRowToTable(row);
    counter1++;
  }
  buf1.close();
  BufferedDataTable table1=buf1.getTable();
  return new BufferedDataTable[]{table,table1};
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected BufferedDataTable[] execute(final BufferedDataTable[] inData,final ExecutionContext exec) throws Exception {
  String xml_file=null;
  if (getModelSetting(CFG_FILE_URL) != null) {
    xml_file=((SettingsModelString)getModelSetting(CFG_FILE_URL)).getStringValue();
  }
  if (getModelSetting(CFG_FILE_URL) == null) {
    throw new InvalidSettingsException("String_Node_Str");
  }
  if (xml_file.isEmpty() || xml_file.length() == 0) {
    throw new InvalidSettingsException("String_Node_Str");
  }
  ParseXML handler=new ParseXML();
  SAXParserFactory factory=SAXParserFactory.newInstance();
  factory.setValidating(false);
  SAXParser parser=factory.newSAXParser();
  parser.parse(xml_file,handler);
  int nrColumns=0;
  if (((SettingsModelBoolean)getModelSetting(CFG_splitSourceCol)).getBooleanValue() && ((SettingsModelBoolean)getModelSetting(CFG_splitDestinationCol)).getBooleanValue() == true) {
    nrColumns=17;
  }
 else   if (((SettingsModelBoolean)getModelSetting(CFG_splitSourceCol)).getBooleanValue() == true) {
    nrColumns=15;
  }
 else   if (((SettingsModelBoolean)getModelSetting(CFG_splitDestinationCol)).getBooleanValue() == true) {
    nrColumns=15;
  }
 else {
    nrColumns=13;
  }
  List<Attribute> colAttributes=getEchoColumnModel();
  BufferedDataContainer buf=exec.createDataContainer(AttributeUtils.compileTableSpecs(colAttributes));
  DataCell[] cells=new DataCell[nrColumns];
  int counter=0;
  for (  EchoRecord r : handler.getRecords()) {
    cells[0]=new StringCell(r.getSrcPlateName());
    cells[1]=new StringCell(r.getSrcPlateBarcode());
    cells[2]=new StringCell(r.getSrcWell());
    cells[3]=new StringCell(r.getDestPlateName());
    cells[4]=new StringCell(r.getDestPlateBarcode());
    cells[5]=new StringCell(r.getDestWell());
    cells[6]=new StringCell(r.getXferVol());
    cells[7]=new StringCell(r.getActualVol());
    cells[8]=new StringCell(r.getCurrentFluidVolume());
    cells[9]=new StringCell(r.getFluidComposition());
    cells[10]=new StringCell(r.getFluidUnits());
    cells[11]=new StringCell(r.getFluidType());
    cells[12]=new StringCell(r.getXferStatus());
    int index=12;
    if (((SettingsModelBoolean)getModelSetting(CFG_splitSourceCol)).getBooleanValue() == true) {
      String[] parts=splitPosition(r.getSrcWell());
      cells[index + 1]=new StringCell(parts[0]);
      cells[index + 2]=new StringCell(parts[1]);
      index=index + 2;
    }
    if (((SettingsModelBoolean)getModelSetting(CFG_splitDestinationCol)).getBooleanValue() == true) {
      String[] parts=splitPosition(r.getDestWell());
      cells[index + 1]=new StringCell(parts[0]);
      cells[index + 2]=new StringCell(parts[1]);
    }
    DataRow row=new DefaultRow("String_Node_Str" + counter,cells);
    buf.addRowToTable(row);
    counter++;
  }
  buf.close();
  BufferedDataTable table=buf.getTable();
  int meta_nrColumns=10;
  List<Attribute> colAttributes1=getMetaDataColumnModel();
  BufferedDataContainer buf1=exec.createDataContainer(AttributeUtils.compileTableSpecs(colAttributes1));
  DataCell[] cells1=new DataCell[meta_nrColumns];
  EchoReportHeader rh=handler.getReportHeader();
  EchoReportFooter rf=handler.getReportFooter();
  cells1[0]=new StringCell(rh.getRunID());
  cells1[1]=new StringCell(rh.getRunDateTime());
  cells1[2]=new StringCell(rh.getAppName());
  cells1[3]=new StringCell(rh.getAppVersion());
  cells1[4]=new StringCell(rh.getProtocolName());
  cells1[5]=new StringCell(rh.getUserName());
  cells1[6]=new StringCell(rf.getInstrName());
  cells1[7]=new StringCell(rf.getInstrModel());
  cells1[8]=new StringCell(rf.getInstrSN());
  cells1[9]=new StringCell(rf.getInstrSWVersion());
  DataRow row=new DefaultRow(RowKey.createRowKey((long)1),cells1);
  buf1.addRowToTable(row);
  buf1.close();
  BufferedDataTable table1=buf1.getTable();
  return new BufferedDataTable[]{table,table1};
}