Program: 3540
Project: 3540
Buggy source:
/** 
 * Forward processing to the specified step.
 * @param context DSpace context
 * @param request the request object
 * @param response the response object
 * @param subInfo SubmissionInfo pertaining to this submission
 * @param stepNumber The number of the step to perform
 */
private void doStep(Context context,HttpServletRequest request,HttpServletResponse response,SubmissionInfo subInfo,int stepNumber) throws ServletException, IOException, SQLException, AuthorizeException {
  if (subInfo.getSubmissionConfig() != null) {
    currentStepConfig=subInfo.getSubmissionConfig().getStep(stepNumber);
  }
 else {
    log.fatal(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + stepNumber + "String_Node_Str"));
    JSPManager.showInternalError(request,response);
  }
  if (!subInfo.isInWorkflow() && (currentStepConfig.getStepNumber() > getStepReached(subInfo))) {
    userHasReached(subInfo,currentStepConfig.getStepNumber());
    context.commit();
    setBeginningOfStep(request,true);
  }
  saveCurrentStepConfig(request,currentStepConfig);
  log.debug("String_Node_Str" + currentStepConfig.getProcessingClassName() + "String_Node_Str");
  try {
    JSPStepManager stepManager=JSPStepManager.loadStep(currentStepConfig.getProcessingClassName());
    boolean stepFinished=stepManager.processStep(context,request,response,subInfo);
    if (stepFinished) {
      subInfo=getSubmissionInfo(context,request);
      doNextStep(context,request,response,subInfo);
    }
 else {
      context.complete();
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + currentStepConfig.getProcessingClassName() + "String_Node_Str",e);
    JSPManager.showInternalError(request,response);
  }
}

Fixed version (ground truth):
/** 
 * Forward processing to the specified step.
 * @param context DSpace context
 * @param request the request object
 * @param response the response object
 * @param subInfo SubmissionInfo pertaining to this submission
 * @param stepNumber The number of the step to perform
 */
private void doStep(Context context,HttpServletRequest request,HttpServletResponse response,SubmissionInfo subInfo,int stepNumber) throws ServletException, IOException, SQLException, AuthorizeException {
  if (subInfo.getSubmissionConfig() != null) {
    currentStepConfig=subInfo.getSubmissionConfig().getStep(stepNumber);
  }
 else {
    log.fatal(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + stepNumber + "String_Node_Str"));
    JSPManager.showInternalError(request,response);
  }
  if (!subInfo.isInWorkflow() && (currentStepConfig.getStepNumber() > getStepReached(subInfo))) {
    userHasReached(subInfo,currentStepConfig.getStepNumber());
    context.commit();
    setBeginningOfStep(request,true);
  }
  saveCurrentStepConfig(request,currentStepConfig);
  log.debug("String_Node_Str" + currentStepConfig.getProcessingClassName() + "String_Node_Str");
  try {
    JSPStepManager stepManager=JSPStepManager.loadStep(currentStepConfig.getProcessingClassName());
    boolean stepFinished=stepManager.processStep(context,request,response,subInfo);
    if (stepFinished) {
      if (request instanceof FileUploadRequest) {
        request=((FileUploadRequest)request).getOriginalRequest();
      }
      subInfo=getSubmissionInfo(context,request);
      doNextStep(context,request,response,subInfo);
    }
 else {
      context.complete();
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str" + currentStepConfig.getProcessingClassName() + "String_Node_Str",e);
    JSPManager.showInternalError(request,response);
  }
}