Program: 52141
Project: 52141
Buggy source:
@Override public void doJSONRequest(Context context,HttpServletRequest req,HttpServletResponse resp) throws AuthorizeException, IOException {
  String suuid=req.getParameter("String_Node_Str");
  SubmissionLookupDTO subDTO=service.getSubmissionLookupDTO(req,suuid);
  if ("String_Node_Str".equalsIgnoreCase(req.getParameter("String_Node_Str"))) {
    Map<String,Set<String>> identifiers=new HashMap<String,Set<String>>();
    Enumeration e=req.getParameterNames();
    while (e.hasMoreElements()) {
      String parameterName=(String)e.nextElement();
      String parameterValue=req.getParameter(parameterName);
      if (parameterName.startsWith("String_Node_Str") && StringUtils.isNotBlank(parameterValue)) {
        Set<String> set=new HashSet<String>();
        set.add(parameterValue);
        identifiers.put(parameterName.substring("String_Node_Str".length()),set);
      }
    }
    List<ItemSubmissionLookupDTO> result=new ArrayList<ItemSubmissionLookupDTO>();
    TransformationEngine transformationEngine=service.getPhase1TransformationEngine();
    if (transformationEngine != null) {
      MultipleSubmissionLookupDataLoader dataLoader=(MultipleSubmissionLookupDataLoader)transformationEngine.getDataLoader();
      dataLoader.setIdentifiers(identifiers);
      try {
        transformationEngine.transform(new TransformationSpec());
        SubmissionLookupOutputGenerator outputGenerator=(SubmissionLookupOutputGenerator)transformationEngine.getOutputGenerator();
        result=outputGenerator.getDtoList();
      }
 catch (      BadTransformationSpec e1) {
        e1.printStackTrace();
      }
catch (      MalformedSourceException e1) {
        e1.printStackTrace();
      }
    }
    subDTO.setItems(result);
    service.storeDTOs(req,suuid,subDTO);
    List<Map<String,Object>> dto=getLightResultList(result);
    JSONSerializer serializer=new JSONSerializer();
    serializer.rootName("String_Node_Str");
    serializer.deepSerialize(dto,resp.getWriter());
  }
 else   if ("String_Node_Str".equalsIgnoreCase(req.getParameter("String_Node_Str"))) {
    String title=req.getParameter("String_Node_Str");
    String author=req.getParameter("String_Node_Str");
    int year=UIUtil.getIntParameter(req,"String_Node_Str");
    Map<String,Set<String>> searchTerms=new HashMap<String,Set<String>>();
    Set<String> tmp1=new HashSet<String>();
    tmp1.add(title);
    Set<String> tmp2=new HashSet<String>();
    tmp2.add(author);
    Set<String> tmp3=new HashSet<String>();
    tmp3.add(String.valueOf(year));
    searchTerms.put("String_Node_Str",tmp1);
    searchTerms.put("String_Node_Str",tmp2);
    searchTerms.put("String_Node_Str",tmp3);
    List<ItemSubmissionLookupDTO> result=new ArrayList<ItemSubmissionLookupDTO>();
    TransformationEngine transformationEngine=service.getPhase1TransformationEngine();
    if (transformationEngine != null) {
      MultipleSubmissionLookupDataLoader dataLoader=(MultipleSubmissionLookupDataLoader)transformationEngine.getDataLoader();
      dataLoader.setSearchTerms(searchTerms);
      SubmissionLookupOutputGenerator outputGenerator=(SubmissionLookupOutputGenerator)transformationEngine.getOutputGenerator();
      result=outputGenerator.getDtoList();
      try {
        transformationEngine.transform(new TransformationSpec());
      }
 catch (      BadTransformationSpec e1) {
        e1.printStackTrace();
      }
catch (      MalformedSourceException e1) {
        e1.printStackTrace();
      }
    }
    subDTO.setItems(result);
    service.storeDTOs(req,suuid,subDTO);
    List<Map<String,Object>> dto=getLightResultList(result);
    JSONSerializer serializer=new JSONSerializer();
    serializer.rootName("String_Node_Str");
    serializer.deepSerialize(dto,resp.getWriter());
  }
 else   if ("String_Node_Str".equalsIgnoreCase(req.getParameter("String_Node_Str"))) {
    String i_uuid=req.getParameter("String_Node_Str");
    JSONSerializer serializer=new JSONSerializer();
    serializer.rootName("String_Node_Str");
    Map<String,Object> dto=getDetails(subDTO.getLookupItem(i_uuid),context);
    serializer.deepSerialize(dto,resp.getWriter());
  }
}

Fixed version (ground truth):
@Override public void doJSONRequest(Context context,HttpServletRequest req,HttpServletResponse resp) throws AuthorizeException, IOException {
  String suuid=req.getParameter("String_Node_Str");
  SubmissionLookupDTO subDTO=service.getSubmissionLookupDTO(req,suuid);
  if ("String_Node_Str".equalsIgnoreCase(req.getParameter("String_Node_Str"))) {
    Map<String,Set<String>> identifiers=new HashMap<String,Set<String>>();
    Enumeration e=req.getParameterNames();
    while (e.hasMoreElements()) {
      String parameterName=(String)e.nextElement();
      String parameterValue=req.getParameter(parameterName);
      if (parameterName.startsWith("String_Node_Str") && StringUtils.isNotBlank(parameterValue)) {
        Set<String> set=new HashSet<String>();
        set.add(parameterValue);
        identifiers.put(parameterName.substring("String_Node_Str".length()),set);
      }
    }
    List<ItemSubmissionLookupDTO> result=new ArrayList<ItemSubmissionLookupDTO>();
    TransformationEngine transformationEngine=service.getPhase1TransformationEngine();
    if (transformationEngine != null) {
      MultipleSubmissionLookupDataLoader dataLoader=(MultipleSubmissionLookupDataLoader)transformationEngine.getDataLoader();
      dataLoader.setIdentifiers(identifiers);
      try {
        log.debug("String_Node_Str");
        transformationEngine.transform(new TransformationSpec());
        log.debug("String_Node_Str");
        SubmissionLookupOutputGenerator outputGenerator=(SubmissionLookupOutputGenerator)transformationEngine.getOutputGenerator();
        result=outputGenerator.getDtoList();
      }
 catch (      BadTransformationSpec e1) {
        e1.printStackTrace();
      }
catch (      MalformedSourceException e1) {
        e1.printStackTrace();
      }
    }
    subDTO.setItems(result);
    service.storeDTOs(req,suuid,subDTO);
    List<Map<String,Object>> dto=getLightResultList(result);
    JSONSerializer serializer=new JSONSerializer();
    serializer.rootName("String_Node_Str");
    serializer.deepSerialize(dto,resp.getWriter());
  }
 else   if ("String_Node_Str".equalsIgnoreCase(req.getParameter("String_Node_Str"))) {
    String title=req.getParameter("String_Node_Str");
    String author=req.getParameter("String_Node_Str");
    int year=UIUtil.getIntParameter(req,"String_Node_Str");
    Map<String,Set<String>> searchTerms=new HashMap<String,Set<String>>();
    Set<String> tmp1=new HashSet<String>();
    tmp1.add(title);
    Set<String> tmp2=new HashSet<String>();
    tmp2.add(author);
    Set<String> tmp3=new HashSet<String>();
    tmp3.add(String.valueOf(year));
    searchTerms.put("String_Node_Str",tmp1);
    searchTerms.put("String_Node_Str",tmp2);
    searchTerms.put("String_Node_Str",tmp3);
    List<ItemSubmissionLookupDTO> result=new ArrayList<ItemSubmissionLookupDTO>();
    TransformationEngine transformationEngine=service.getPhase1TransformationEngine();
    if (transformationEngine != null) {
      MultipleSubmissionLookupDataLoader dataLoader=(MultipleSubmissionLookupDataLoader)transformationEngine.getDataLoader();
      dataLoader.setSearchTerms(searchTerms);
      SubmissionLookupOutputGenerator outputGenerator=(SubmissionLookupOutputGenerator)transformationEngine.getOutputGenerator();
      result=outputGenerator.getDtoList();
      try {
        transformationEngine.transform(new TransformationSpec());
      }
 catch (      BadTransformationSpec e1) {
        e1.printStackTrace();
      }
catch (      MalformedSourceException e1) {
        e1.printStackTrace();
      }
    }
    subDTO.setItems(result);
    service.storeDTOs(req,suuid,subDTO);
    List<Map<String,Object>> dto=getLightResultList(result);
    JSONSerializer serializer=new JSONSerializer();
    serializer.rootName("String_Node_Str");
    serializer.deepSerialize(dto,resp.getWriter());
  }
 else   if ("String_Node_Str".equalsIgnoreCase(req.getParameter("String_Node_Str"))) {
    String i_uuid=req.getParameter("String_Node_Str");
    JSONSerializer serializer=new JSONSerializer();
    serializer.rootName("String_Node_Str");
    Map<String,Object> dto=getDetails(subDTO.getLookupItem(i_uuid),context);
    serializer.deepSerialize(dto,resp.getWriter());
  }
}