Program: 52615
Project: 52615
Buggy source:
/** 
 * process input from initial-questions.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 processInitialQuestions(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,INITIAL_QUESTIONS,INITIAL_QUESTIONS);
    return;
  }
  boolean multipleTitles=UIUtil.getBoolParameter(request,"String_Node_Str");
  boolean publishedBefore=UIUtil.getBoolParameter(request,"String_Node_Str");
  boolean multipleFiles=UIUtil.getBoolParameter(request,"String_Node_Str");
  boolean isThesis=UIUtil.getBoolParameter(request,"String_Node_Str");
  if (isWorkflow(subInfo)) {
    isThesis=false;
  }
  if (isThesis) {
    WorkspaceItem wi=(WorkspaceItem)subInfo.submission;
    wi.deleteAll();
    request.getSession().setAttribute("String_Node_Str",new Boolean(true));
    JSPManager.showJSP(request,response,"String_Node_Str");
    context.complete();
    return;
  }
  boolean willRemoveTitles=false;
  boolean willRemoveDate=false;
  boolean willRemoveFiles=false;
  if (multipleTitles == false) {
    DCValue[] altTitles=subInfo.submission.getItem().getDC("String_Node_Str","String_Node_Str",Item.ANY);
    willRemoveTitles=altTitles.length > 0;
  }
  if (publishedBefore == false) {
    DCValue[] dateIssued=subInfo.submission.getItem().getDC("String_Node_Str","String_Node_Str",Item.ANY);
    willRemoveDate=dateIssued.length > 0;
  }
  if (multipleFiles == false) {
    Bundle[] bundles=subInfo.submission.getItem().getBundles();
    willRemoveFiles=bundles.length > 1;
  }
  if (willRemoveTitles || willRemoveDate || willRemoveFiles) {
    request.setAttribute("String_Node_Str",subInfo);
    request.setAttribute("String_Node_Str",new Boolean(multipleTitles));
    request.setAttribute("String_Node_Str",new Boolean(publishedBefore));
    request.setAttribute("String_Node_Str",new Boolean(multipleFiles));
    request.setAttribute("String_Node_Str",new Boolean(willRemoveTitles));
    request.setAttribute("String_Node_Str",new Boolean(willRemoveDate));
    request.setAttribute("String_Node_Str",new Boolean(willRemoveFiles));
    request.setAttribute("String_Node_Str",UIUtil.getSubmitButton(request,"String_Node_Str"));
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else {
    subInfo.submission.setMultipleTitles(multipleTitles);
    subInfo.submission.setPublishedBefore(publishedBefore);
    if (!isWorkflow(subInfo)) {
      subInfo.submission.setMultipleFiles(multipleFiles);
    }
    subInfo.submission.update();
    if (buttonPressed.equals("String_Node_Str")) {
      userHasReached(subInfo,EDIT_METADATA_1);
      doStep(context,request,response,subInfo,EDIT_METADATA_1);
    }
 else {
      doStepJump(context,request,response,subInfo);
    }
    context.complete();
  }
}

Fixed version (ground truth):
/** 
 * process input from initial-questions.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 processInitialQuestions(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,INITIAL_QUESTIONS,INITIAL_QUESTIONS);
    return;
  }
  boolean multipleTitles=UIUtil.getBoolParameter(request,"String_Node_Str");
  boolean publishedBefore=UIUtil.getBoolParameter(request,"String_Node_Str");
  boolean multipleFiles=UIUtil.getBoolParameter(request,"String_Node_Str");
  boolean isThesis=UIUtil.getBoolParameter(request,"String_Node_Str");
  if (isWorkflow(subInfo)) {
    isThesis=false;
    multipleFiles=true;
  }
  if (isThesis) {
    WorkspaceItem wi=(WorkspaceItem)subInfo.submission;
    wi.deleteAll();
    request.getSession().setAttribute("String_Node_Str",new Boolean(true));
    JSPManager.showJSP(request,response,"String_Node_Str");
    context.complete();
    return;
  }
  boolean willRemoveTitles=false;
  boolean willRemoveDate=false;
  boolean willRemoveFiles=false;
  if (multipleTitles == false) {
    DCValue[] altTitles=subInfo.submission.getItem().getDC("String_Node_Str","String_Node_Str",Item.ANY);
    willRemoveTitles=altTitles.length > 0;
  }
  if (publishedBefore == false) {
    DCValue[] dateIssued=subInfo.submission.getItem().getDC("String_Node_Str","String_Node_Str",Item.ANY);
    willRemoveDate=dateIssued.length > 0;
  }
  if (multipleFiles == false) {
    Bundle[] bundles=subInfo.submission.getItem().getBundles();
    willRemoveFiles=bundles.length > 1;
  }
  if (willRemoveTitles || willRemoveDate || willRemoveFiles) {
    request.setAttribute("String_Node_Str",subInfo);
    request.setAttribute("String_Node_Str",new Boolean(multipleTitles));
    request.setAttribute("String_Node_Str",new Boolean(publishedBefore));
    request.setAttribute("String_Node_Str",new Boolean(multipleFiles));
    request.setAttribute("String_Node_Str",new Boolean(willRemoveTitles));
    request.setAttribute("String_Node_Str",new Boolean(willRemoveDate));
    request.setAttribute("String_Node_Str",new Boolean(willRemoveFiles));
    request.setAttribute("String_Node_Str",UIUtil.getSubmitButton(request,"String_Node_Str"));
    JSPManager.showJSP(request,response,"String_Node_Str");
  }
 else {
    subInfo.submission.setMultipleTitles(multipleTitles);
    subInfo.submission.setPublishedBefore(publishedBefore);
    if (!isWorkflow(subInfo)) {
      subInfo.submission.setMultipleFiles(multipleFiles);
    }
    subInfo.submission.update();
    if (buttonPressed.equals("String_Node_Str")) {
      userHasReached(subInfo,EDIT_METADATA_1);
      doStep(context,request,response,subInfo,EDIT_METADATA_1);
    }
 else {
      doStepJump(context,request,response,subInfo);
    }
    context.complete();
  }
}