Program: 52318
Project: 52318
Buggy source:
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  if (this.editFile != null) {
    editFile.addBody(body);
    return;
  }
  Item item=submission.getItem();
  Collection collection=submission.getCollection();
  String actionURL=contextPath + "String_Node_Str" + collection.getHandle()+ "String_Node_Str";
  boolean workflow=submission instanceof WorkflowItem;
  Bundle[] bundles=item.getBundles("String_Node_Str");
  Bitstream[] bitstreams=new Bitstream[0];
  if (bundles.length > 0) {
    bitstreams=bundles[0].getBitstreams();
  }
  Division div=body.addInteractiveDivision("String_Node_Str",actionURL,Division.METHOD_MULTIPART,"String_Node_Str");
  div.setHead(T_submission_head);
  addSubmissionProgressList(div);
  List upload=null;
  if (!workflow) {
    upload=div.addList("String_Node_Str",List.TYPE_FORM);
    upload.setHead(T_head);
    File file=upload.addItem().addFile("String_Node_Str");
    file.setLabel(T_file);
    file.setHelp(T_file_help);
    file.setRequired();
    if (this.errorFlag == org.dspace.submit.step.UploadStep.STATUS_NO_FILES_ERROR)     file.addError(T_file_error);
    Text description=upload.addItem().addText("String_Node_Str");
    description.setLabel(T_description);
    description.setHelp(T_description_help);
    Button uploadSubmit=upload.addItem().addButton("String_Node_Str");
    uploadSubmit.setValue(T_submit_upload);
  }
  if (bitstreams.length > 0 || workflow) {
    Table summary=div.addTable("String_Node_Str",(bitstreams.length * 2) + 2,7);
    summary.setHead(T_head2);
    Row header=summary.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
    header.addCellContent(T_column5);
    header.addCellContent(T_column6);
    for (    Bitstream bitstream : bitstreams) {
      int id=bitstream.getID();
      String name=bitstream.getName();
      String url=contextPath + "String_Node_Str" + item.getID()+ "String_Node_Str"+ name;
      long bytes=bitstream.getSize();
      String desc=bitstream.getDescription();
      String algorithm=bitstream.getChecksumAlgorithm();
      String checksum=bitstream.getChecksum();
      BitstreamFormat format=bitstream.getFormat();
      int support=format.getSupportLevel();
      Row row=summary.addRow();
      if (!workflow) {
        CheckBox remove=row.addCell().addCheckBox("String_Node_Str");
        remove.setLabel("String_Node_Str");
        remove.addOption(id);
      }
 else {
        row.addCell();
      }
      row.addCell().addXref(url,name);
      row.addCellContent(bytes + "String_Node_Str");
      if (desc == null || desc.length() == 0)       row.addCellContent(T_unknown_name);
 else       row.addCellContent(desc);
      if (format == null) {
        row.addCellContent(T_unknown_format);
      }
 else {
        Cell cell=row.addCell();
        cell.addContent(format.getMIMEType());
        cell.addContent("String_Node_Str");
switch (support) {
case 1:
          cell.addContent(T_supported);
        break;
case 2:
      cell.addContent(T_known);
    break;
case 3:
  cell.addContent(T_unsupported);
break;
}
}
Button edit=row.addCell().addButton("String_Node_Str" + id);
edit.setValue(T_submit_edit);
Row checksumRow=summary.addRow();
checksumRow.addCell();
Cell checksumCell=checksumRow.addCell(null,null,0,6,null);
checksumCell.addHighlight("String_Node_Str").addContent(T_checksum);
checksumCell.addContent("String_Node_Str");
checksumCell.addContent(algorithm + "String_Node_Str" + checksum);
}
if (!workflow) {
Row actionRow=summary.addRow();
actionRow.addCell();
Button removeSeleceted=actionRow.addCell(null,null,0,6,null).addButton("String_Node_Str");
removeSeleceted.setValue(T_submit_remove);
}
upload=div.addList("String_Node_Str",List.TYPE_FORM);
}
addControlButtons(upload);
div.addHidden("String_Node_Str").setValue(knot.getId());
}

Fixed version (ground truth):
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  if (this.editFile != null) {
    editFile.addBody(body);
    return;
  }
  Item item=submission.getItem();
  Collection collection=submission.getCollection();
  String actionURL=contextPath + "String_Node_Str" + collection.getHandle()+ "String_Node_Str"+ knot.getId()+ "String_Node_Str";
  boolean workflow=submission instanceof WorkflowItem;
  Bundle[] bundles=item.getBundles("String_Node_Str");
  Bitstream[] bitstreams=new Bitstream[0];
  if (bundles.length > 0) {
    bitstreams=bundles[0].getBitstreams();
  }
  Division div=body.addInteractiveDivision("String_Node_Str",actionURL,Division.METHOD_MULTIPART,"String_Node_Str");
  div.setHead(T_submission_head);
  addSubmissionProgressList(div);
  List upload=null;
  if (!workflow) {
    upload=div.addList("String_Node_Str",List.TYPE_FORM);
    upload.setHead(T_head);
    File file=upload.addItem().addFile("String_Node_Str");
    file.setLabel(T_file);
    file.setHelp(T_file_help);
    file.setRequired();
    if (this.errorFlag == org.dspace.submit.step.UploadStep.STATUS_NO_FILES_ERROR)     file.addError(T_file_error);
    Text description=upload.addItem().addText("String_Node_Str");
    description.setLabel(T_description);
    description.setHelp(T_description_help);
    Button uploadSubmit=upload.addItem().addButton("String_Node_Str");
    uploadSubmit.setValue(T_submit_upload);
  }
  if (bitstreams.length > 0 || workflow) {
    Table summary=div.addTable("String_Node_Str",(bitstreams.length * 2) + 2,7);
    summary.setHead(T_head2);
    Row header=summary.addRow(Row.ROLE_HEADER);
    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
    header.addCellContent(T_column4);
    header.addCellContent(T_column5);
    header.addCellContent(T_column6);
    for (    Bitstream bitstream : bitstreams) {
      int id=bitstream.getID();
      String name=bitstream.getName();
      String url=contextPath + "String_Node_Str" + item.getID()+ "String_Node_Str"+ name;
      long bytes=bitstream.getSize();
      String desc=bitstream.getDescription();
      String algorithm=bitstream.getChecksumAlgorithm();
      String checksum=bitstream.getChecksum();
      BitstreamFormat format=bitstream.getFormat();
      int support=format.getSupportLevel();
      Row row=summary.addRow();
      if (!workflow) {
        CheckBox remove=row.addCell().addCheckBox("String_Node_Str");
        remove.setLabel("String_Node_Str");
        remove.addOption(id);
      }
 else {
        row.addCell();
      }
      row.addCell().addXref(url,name);
      row.addCellContent(bytes + "String_Node_Str");
      if (desc == null || desc.length() == 0)       row.addCellContent(T_unknown_name);
 else       row.addCellContent(desc);
      if (format == null) {
        row.addCellContent(T_unknown_format);
      }
 else {
        Cell cell=row.addCell();
        cell.addContent(format.getMIMEType());
        cell.addContent("String_Node_Str");
switch (support) {
case 1:
          cell.addContent(T_supported);
        break;
case 2:
      cell.addContent(T_known);
    break;
case 3:
  cell.addContent(T_unsupported);
break;
}
}
Button edit=row.addCell().addButton("String_Node_Str" + id);
edit.setValue(T_submit_edit);
Row checksumRow=summary.addRow();
checksumRow.addCell();
Cell checksumCell=checksumRow.addCell(null,null,0,6,null);
checksumCell.addHighlight("String_Node_Str").addContent(T_checksum);
checksumCell.addContent("String_Node_Str");
checksumCell.addContent(algorithm + "String_Node_Str" + checksum);
}
if (!workflow) {
Row actionRow=summary.addRow();
actionRow.addCell();
Button removeSeleceted=actionRow.addCell(null,null,0,6,null).addButton("String_Node_Str");
removeSeleceted.setValue(T_submit_remove);
}
upload=div.addList("String_Node_Str",List.TYPE_FORM);
}
addControlButtons(upload);
}