Program: 52131
Project: 52131
Buggy source:
/** 
 * Do any processing of the information input by the user, and/or perform step processing (if no user interaction required) <P> It is this method's job to save any data to the underlying database, as necessary, and return error messages (if any) which can then be processed by the appropriate user interface (JSP-UI or XML-UI) <P> NOTE: If this step is a non-interactive step (i.e. requires no UI), then it should perform *all* of its processing in this method!
 * @param context current DSpace context
 * @param request current servlet request object
 * @param response current servlet response object
 * @param subInfo submission info object
 * @return Status or error flag which will be processed bydoPostProcessing() below! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
 */
public int doProcessing(Context context,HttpServletRequest request,HttpServletResponse response,SubmissionInfo subInfo) throws ServletException, IOException, SQLException, AuthorizeException {
  int id=Util.getIntParameter(request,"String_Node_Str");
  String titolo=request.getParameter("String_Node_Str");
  String date=request.getParameter("String_Node_Str");
  String autori=request.getParameter("String_Node_Str");
  String uuidSubmission=request.getParameter("String_Node_Str");
  String uuidLookup=request.getParameter("String_Node_Str");
  if (StringUtils.isBlank(uuidSubmission)) {
    return STATUS_NO_SUUID;
  }
  SubmissionLookupDTO submissionDTO=slService.getSubmissionLookupDTO(request,uuidSubmission);
  if (submissionDTO == null) {
    return STATUS_SUBMISSION_EXPIRED;
  }
  ItemSubmissionLookupDTO itemLookup=null;
  if (StringUtils.isNotBlank(uuidLookup)) {
    itemLookup=submissionDTO.getLookupItem(uuidLookup);
    if (itemLookup == null) {
      return STATUS_SUBMISSION_EXPIRED;
    }
  }
  if (id < 0) {
    return STATUS_NO_COLLECTION;
  }
  Collection col=Collection.find(context,id);
  if (col == null) {
    return STATUS_INVALID_COLLECTION;
  }
 else {
    DCInputSet inputSet=null;
    try {
      inputSet=new DCInputsReader().getInputs(col.getHandle());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    ItemSubmissionLookupDTO dto=null;
    if (itemLookup != null) {
      dto=itemLookup;
    }
 else {
      SubmissionLookupPublication manualPub=new SubmissionLookupPublication(SubmissionLookupService.MANUAL_USER_INPUT);
      manualPub.add("String_Node_Str",titolo);
      manualPub.add("String_Node_Str",date);
      manualPub.add("String_Node_Str",autori);
      Enumeration e=request.getParameterNames();
      while (e.hasMoreElements()) {
        String parameterName=(String)e.nextElement();
        String parameterValue=request.getParameter(parameterName);
        if (parameterName.startsWith("String_Node_Str") && StringUtils.isNotBlank(parameterValue)) {
          manualPub.add(parameterName.substring("String_Node_Str".length()),parameterValue);
        }
      }
      List<Record> publications=new ArrayList<Record>();
      publications.add(manualPub);
      dto=new ItemSubmissionLookupDTO(publications);
    }
    List<WorkspaceItem> result=null;
    TransformationEngine transformationEngine=slService.getPhase2TransformationEngine();
    if (transformationEngine != null) {
      SubmissionItemDataLoader dataLoader=(SubmissionItemDataLoader)transformationEngine.getDataLoader();
      dataLoader.setDtoList(Arrays.asList(new ItemSubmissionLookupDTO[]{dto}));
      DSpaceWorkspaceItemOutputGenerator outputGenerator=(DSpaceWorkspaceItemOutputGenerator)transformationEngine.getOutputGenerator();
      result=outputGenerator.getWitems();
      try {
        transformationEngine.transform(new TransformationSpec());
      }
 catch (      BadTransformationSpec e1) {
        e1.printStackTrace();
      }
catch (      MalformedSourceException e1) {
        e1.printStackTrace();
      }
    }
    if (result != null && result.size() > 0) {
      subInfo.setSubmissionItem(result.iterator().next());
    }
    context.commit();
    subInfo.reloadSubmissionConfig(request);
  }
  slService.invalidateDTOs(request,uuidSubmission);
  return STATUS_COMPLETE;
}

Fixed version (ground truth):
/** 
 * Do any processing of the information input by the user, and/or perform step processing (if no user interaction required) <P> It is this method's job to save any data to the underlying database, as necessary, and return error messages (if any) which can then be processed by the appropriate user interface (JSP-UI or XML-UI) <P> NOTE: If this step is a non-interactive step (i.e. requires no UI), then it should perform *all* of its processing in this method!
 * @param context current DSpace context
 * @param request current servlet request object
 * @param response current servlet response object
 * @param subInfo submission info object
 * @return Status or error flag which will be processed bydoPostProcessing() below! (if STATUS_COMPLETE or 0 is returned, no errors occurred!)
 */
public int doProcessing(Context context,HttpServletRequest request,HttpServletResponse response,SubmissionInfo subInfo) throws ServletException, IOException, SQLException, AuthorizeException {
  int id=Util.getIntParameter(request,"String_Node_Str");
  String titolo=request.getParameter("String_Node_Str");
  String date=request.getParameter("String_Node_Str");
  String autori=request.getParameter("String_Node_Str");
  String uuidSubmission=request.getParameter("String_Node_Str");
  String uuidLookup=request.getParameter("String_Node_Str");
  if (StringUtils.isBlank(uuidSubmission)) {
    return STATUS_NO_SUUID;
  }
  SubmissionLookupDTO submissionDTO=slService.getSubmissionLookupDTO(request,uuidSubmission);
  if (submissionDTO == null) {
    return STATUS_SUBMISSION_EXPIRED;
  }
  ItemSubmissionLookupDTO itemLookup=null;
  if (StringUtils.isNotBlank(uuidLookup)) {
    itemLookup=submissionDTO.getLookupItem(uuidLookup);
    if (itemLookup == null) {
      return STATUS_SUBMISSION_EXPIRED;
    }
  }
  if (id < 0) {
    return STATUS_NO_COLLECTION;
  }
  Collection col=Collection.find(context,id);
  if (col == null) {
    return STATUS_INVALID_COLLECTION;
  }
 else {
    DCInputSet inputSet=null;
    try {
      inputSet=new DCInputsReader().getInputs(col.getHandle());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    ItemSubmissionLookupDTO dto=null;
    if (itemLookup != null) {
      dto=itemLookup;
    }
 else {
      SubmissionLookupPublication manualPub=new SubmissionLookupPublication(SubmissionLookupService.MANUAL_USER_INPUT);
      manualPub.add("String_Node_Str",titolo);
      manualPub.add("String_Node_Str",date);
      manualPub.add("String_Node_Str",autori);
      Enumeration e=request.getParameterNames();
      while (e.hasMoreElements()) {
        String parameterName=(String)e.nextElement();
        String parameterValue=request.getParameter(parameterName);
        if (parameterName.startsWith("String_Node_Str") && StringUtils.isNotBlank(parameterValue)) {
          manualPub.add(parameterName.substring("String_Node_Str".length()),parameterValue);
        }
      }
      List<Record> publications=new ArrayList<Record>();
      publications.add(manualPub);
      dto=new ItemSubmissionLookupDTO(publications);
    }
    List<WorkspaceItem> result=null;
    TransformationEngine transformationEngine=slService.getPhase2TransformationEngine();
    if (transformationEngine != null) {
      SubmissionItemDataLoader dataLoader=(SubmissionItemDataLoader)transformationEngine.getDataLoader();
      dataLoader.setDtoList(Arrays.asList(new ItemSubmissionLookupDTO[]{dto}));
      DSpaceWorkspaceItemOutputGenerator outputGenerator=(DSpaceWorkspaceItemOutputGenerator)transformationEngine.getOutputGenerator();
      outputGenerator.setCollection(col);
      outputGenerator.setContext(context);
      outputGenerator.setFormName(inputSet.getFormName());
      outputGenerator.setDto(dto);
      try {
        transformationEngine.transform(new TransformationSpec());
        result=outputGenerator.getWitems();
      }
 catch (      BadTransformationSpec e1) {
        e1.printStackTrace();
      }
catch (      MalformedSourceException e1) {
        e1.printStackTrace();
      }
    }
    if (result != null && result.size() > 0) {
      subInfo.setSubmissionItem(result.iterator().next());
    }
    context.commit();
    subInfo.reloadSubmissionConfig(request);
  }
  slService.invalidateDTOs(request,uuidSubmission);
  return STATUS_COMPLETE;
}