Program: 52590
Project: 52590
Buggy source:
/** 
 * process input from edit-metadata-1.jsp
 * @param context   current DSpace context
 * @param request   current servlet request object
 * @param response  current servlet response object
 * @param subInfo   submission info object
 */
private void processEditMetadataOne(Context context,HttpServletRequest request,HttpServletResponse response,SubmissionInfo subInfo) throws ServletException, IOException, SQLException, AuthorizeException {
  String buttonPressed=UIUtil.getSubmitButton(request,"String_Node_Str");
  if (buttonPressed.equals("String_Node_Str")) {
    doCancellation(request,response,subInfo,EDIT_METADATA_1,EDIT_METADATA_1);
    return;
  }
  Item item=subInfo.submission.getItem();
  readNames(request,item,"String_Node_Str","String_Node_Str",true);
  readText(request,item,"String_Node_Str",null,false,"String_Node_Str");
  if (subInfo.submission.hasMultipleTitles()) {
    readText(request,item,"String_Node_Str","String_Node_Str",true,"String_Node_Str");
  }
  readSeriesNumbers(request,item,"String_Node_Str","String_Node_Str",true);
  item.clearDC("String_Node_Str",null,Item.ANY);
  String[] types=request.getParameterValues("String_Node_Str");
  for (int i=0; i < types.length; i++) {
    item.addDC("String_Node_Str",null,"String_Node_Str",types[i]);
  }
  readText(request,item,"String_Node_Str","String_Node_Str",false,null);
  subInfo.submission.getItem().clearDC("String_Node_Str",Item.ANY,Item.ANY);
  List quals=getRepeatedParameter(request,"String_Node_Str");
  List vals=getRepeatedParameter(request,"String_Node_Str");
  for (int i=0; i < vals.size(); i++) {
    String thisQual=(String)quals.get(i);
    String thisVal=(String)vals.get(i);
    if (!buttonPressed.equals("String_Node_Str" + i) && !thisVal.equals("String_Node_Str")) {
      item.addDC("String_Node_Str",thisQual,null,thisVal);
    }
  }
  if (subInfo.submission.isPublishedBefore()) {
    readDate(request,item,"String_Node_Str","String_Node_Str");
    readText(request,item,"String_Node_Str","String_Node_Str",false,"String_Node_Str");
    readText(request,item,"String_Node_Str",null,false,"String_Node_Str");
  }
  int nextStep=-1;
  if (buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (subInfo.submission.hasMultipleTitles() && buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    nextStep=INITIAL_QUESTIONS;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    userHasReached(subInfo,EDIT_METADATA_2);
    nextStep=EDIT_METADATA_2;
  }
 else   if (buttonPressed.indexOf("String_Node_Str") > -1) {
    nextStep=EDIT_METADATA_1;
  }
  subInfo.submission.update();
  if (nextStep != -1) {
    doStep(context,request,response,subInfo,nextStep);
  }
 else {
    doStepJump(context,request,response,subInfo);
  }
  context.complete();
}

Fixed version (ground truth):
/** 
 * process input from edit-metadata-1.jsp
 * @param context   current DSpace context
 * @param request   current servlet request object
 * @param response  current servlet response object
 * @param subInfo   submission info object
 */
private void processEditMetadataOne(Context context,HttpServletRequest request,HttpServletResponse response,SubmissionInfo subInfo) throws ServletException, IOException, SQLException, AuthorizeException {
  String buttonPressed=UIUtil.getSubmitButton(request,"String_Node_Str");
  if (buttonPressed.equals("String_Node_Str")) {
    doCancellation(request,response,subInfo,EDIT_METADATA_1,EDIT_METADATA_1);
    return;
  }
  Item item=subInfo.submission.getItem();
  readNames(request,item,"String_Node_Str","String_Node_Str",true);
  readText(request,item,"String_Node_Str",null,false,"String_Node_Str");
  if (subInfo.submission.hasMultipleTitles()) {
    readText(request,item,"String_Node_Str","String_Node_Str",true,"String_Node_Str");
  }
  readSeriesNumbers(request,item,"String_Node_Str","String_Node_Str",true);
  item.clearDC("String_Node_Str",null,Item.ANY);
  String[] types=request.getParameterValues("String_Node_Str");
  if (types != null) {
    for (int i=0; i < types.length; i++) {
      item.addDC("String_Node_Str",null,"String_Node_Str",types[i]);
    }
  }
  readText(request,item,"String_Node_Str","String_Node_Str",false,null);
  subInfo.submission.getItem().clearDC("String_Node_Str",Item.ANY,Item.ANY);
  List quals=getRepeatedParameter(request,"String_Node_Str");
  List vals=getRepeatedParameter(request,"String_Node_Str");
  for (int i=0; i < vals.size(); i++) {
    String thisQual=(String)quals.get(i);
    String thisVal=(String)vals.get(i);
    if (!buttonPressed.equals("String_Node_Str" + i) && !thisVal.equals("String_Node_Str")) {
      item.addDC("String_Node_Str",thisQual,null,thisVal);
    }
  }
  if (subInfo.submission.isPublishedBefore()) {
    readDate(request,item,"String_Node_Str","String_Node_Str");
    readText(request,item,"String_Node_Str","String_Node_Str",false,"String_Node_Str");
    readText(request,item,"String_Node_Str",null,false,"String_Node_Str");
  }
  int nextStep=-1;
  if (buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (subInfo.submission.hasMultipleTitles() && buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    subInfo.moreBoxesFor="String_Node_Str";
    subInfo.jumpToField="String_Node_Str";
    nextStep=EDIT_METADATA_1;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    nextStep=INITIAL_QUESTIONS;
  }
 else   if (buttonPressed.equals("String_Node_Str")) {
    userHasReached(subInfo,EDIT_METADATA_2);
    nextStep=EDIT_METADATA_2;
  }
 else   if (buttonPressed.indexOf("String_Node_Str") > -1) {
    nextStep=EDIT_METADATA_1;
  }
  subInfo.submission.update();
  if (nextStep != -1) {
    doStep(context,request,response,subInfo,nextStep);
  }
 else {
    doStepJump(context,request,response,subInfo);
  }
  context.complete();
}