Program: 52311
Project: 52311
Buggy source:
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  Collection collection=submission.getCollection();
  String actionURL=contextPath + "String_Node_Str" + collection.getHandle()+ "String_Node_Str";
  BitstreamFormat currentFormat=bitstream.getFormat();
  BitstreamFormat guessedFormat=FormatIdentifier.guessFormat(context,bitstream);
  BitstreamFormat[] bitstreamFormats=BitstreamFormat.findNonInternal(context);
  int itemID=submissionInfo.getSubmissionItem().getItem().getID();
  String fileUrl=contextPath + "String_Node_Str" + itemID+ "String_Node_Str"+ bitstream.getName();
  String fileName=bitstream.getName();
  Division div=body.addInteractiveDivision("String_Node_Str",actionURL,Division.METHOD_POST,"String_Node_Str");
  div.setHead(T_submission_head);
  addSubmissionProgressList(div);
  List edit=div.addList("String_Node_Str",List.TYPE_FORM);
  edit.setHead(T_head);
  edit.addLabel(T_file);
  edit.addItem().addXref(fileUrl,fileName);
  Text description=edit.addItem().addText("String_Node_Str");
  description.setLabel(T_description);
  description.setHelp(T_description_help);
  description.setValue(bitstream.getDescription());
  edit.addItem(T_info1);
  if (guessedFormat != null) {
    edit.addLabel(T_format_detected);
    edit.addItem(guessedFormat.getShortDescription());
  }
  Select format=edit.addItem().addSelect("String_Node_Str");
  format.setLabel(T_format_selected);
  format.addOption(-1,T_format_default);
  for (  BitstreamFormat bitstreamFormat : bitstreamFormats) {
    String supportLevel="String_Node_Str";
    if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)     supportLevel="String_Node_Str";
 else     if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)     supportLevel="String_Node_Str";
    String name=bitstreamFormat.getShortDescription() + "String_Node_Str" + supportLevel+ "String_Node_Str";
    int id=bitstreamFormat.getID();
    format.addOption(id,name);
  }
  if (currentFormat != null) {
    format.setOptionSelected(currentFormat.getID());
  }
 else   if (guessedFormat != null) {
    format.setOptionSelected(guessedFormat.getID());
  }
 else {
    format.setOptionSelected(-1);
  }
  edit.addItem(T_info2);
  Text userFormat=edit.addItem().addText("String_Node_Str");
  userFormat.setLabel(T_format_user);
  userFormat.setHelp(T_format_user_help);
  userFormat.setValue(bitstream.getUserFormatDescription());
  div.addHidden("String_Node_Str").setValue(bitstream.getID());
  org.dspace.app.xmlui.wing.element.Item actions=edit.addItem();
  actions.addButton("String_Node_Str").setValue(T_submit_save);
  actions.addButton("String_Node_Str").setValue(T_submit_cancel);
  div.addHidden("String_Node_Str").setValue(knot.getId());
}

Fixed version (ground truth):
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  Collection collection=submission.getCollection();
  String actionURL=contextPath + "String_Node_Str" + collection.getHandle()+ "String_Node_Str"+ knot.getId()+ "String_Node_Str";
  BitstreamFormat currentFormat=bitstream.getFormat();
  BitstreamFormat guessedFormat=FormatIdentifier.guessFormat(context,bitstream);
  BitstreamFormat[] bitstreamFormats=BitstreamFormat.findNonInternal(context);
  int itemID=submissionInfo.getSubmissionItem().getItem().getID();
  String fileUrl=contextPath + "String_Node_Str" + itemID+ "String_Node_Str"+ bitstream.getName();
  String fileName=bitstream.getName();
  Division div=body.addInteractiveDivision("String_Node_Str",actionURL,Division.METHOD_POST,"String_Node_Str");
  div.setHead(T_submission_head);
  addSubmissionProgressList(div);
  List edit=div.addList("String_Node_Str",List.TYPE_FORM);
  edit.setHead(T_head);
  edit.addLabel(T_file);
  edit.addItem().addXref(fileUrl,fileName);
  Text description=edit.addItem().addText("String_Node_Str");
  description.setLabel(T_description);
  description.setHelp(T_description_help);
  description.setValue(bitstream.getDescription());
  edit.addItem(T_info1);
  if (guessedFormat != null) {
    edit.addLabel(T_format_detected);
    edit.addItem(guessedFormat.getShortDescription());
  }
  Select format=edit.addItem().addSelect("String_Node_Str");
  format.setLabel(T_format_selected);
  format.addOption(-1,T_format_default);
  for (  BitstreamFormat bitstreamFormat : bitstreamFormats) {
    String supportLevel="String_Node_Str";
    if (bitstreamFormat.getSupportLevel() == BitstreamFormat.KNOWN)     supportLevel="String_Node_Str";
 else     if (bitstreamFormat.getSupportLevel() == BitstreamFormat.SUPPORTED)     supportLevel="String_Node_Str";
    String name=bitstreamFormat.getShortDescription() + "String_Node_Str" + supportLevel+ "String_Node_Str";
    int id=bitstreamFormat.getID();
    format.addOption(id,name);
  }
  if (currentFormat != null) {
    format.setOptionSelected(currentFormat.getID());
  }
 else   if (guessedFormat != null) {
    format.setOptionSelected(guessedFormat.getID());
  }
 else {
    format.setOptionSelected(-1);
  }
  edit.addItem(T_info2);
  Text userFormat=edit.addItem().addText("String_Node_Str");
  userFormat.setLabel(T_format_user);
  userFormat.setHelp(T_format_user_help);
  userFormat.setValue(bitstream.getUserFormatDescription());
  div.addHidden("String_Node_Str").setValue(bitstream.getID());
  org.dspace.app.xmlui.wing.element.Item actions=edit.addItem();
  actions.addButton("String_Node_Str").setValue(T_submit_save);
  actions.addButton("String_Node_Str").setValue(T_submit_cancel);
}