Program: 39175
Project: 39175
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView executeHql(@RequestParam(L_HQL) final String hql){
  if (!showReportDevelopment) {
    return new ModelAndView(new RedirectView("String_Node_Str"));
  }
  try {
    List<Entity> entities=dataDefinitionService.get("String_Node_Str","String_Node_Str").find(hql).list().getEntities();
    if (!entities.isEmpty()) {
      DataDefinition dataDefinition=entities.get(0).getDataDefinition();
      List<String> headers=new ArrayList<String>();
      if (!isDynamicDataDefinition(dataDefinition)) {
        headers.add("String_Node_Str");
      }
      headers.addAll(dataDefinition.getFields().keySet());
      List<List<String>> rows=new ArrayList<List<String>>();
      for (      Entity entity : entities) {
        List<String> row=new ArrayList<String>();
        if (!isDynamicDataDefinition(dataDefinition)) {
          row.add(String.valueOf(entity.getId()));
        }
        for (        String field : dataDefinition.getFields().keySet()) {
          if (entity.getField(field) == null) {
            row.add("String_Node_Str");
          }
 else           if (entity.getField(field) instanceof EntityList) {
            row.add("String_Node_Str");
          }
 else {
            row.add(String.valueOf(entity.getField(field)));
          }
        }
        rows.add(row);
      }
      return new ModelAndView(L_QCADOO_REPORT_HQL).addObject(L_HQL,hql).addObject("String_Node_Str",headers).addObject("String_Node_Str",rows).addObject("String_Node_Str",true);
    }
 else {
      return new ModelAndView(L_QCADOO_REPORT_HQL).addObject(L_HQL,hql).addObject("String_Node_Str",true);
    }
  }
 catch (  Exception e) {
    return showException(L_QCADOO_REPORT_HQL,e).addObject(L_HQL,hql);
  }
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) public ModelAndView executeHql(@RequestParam(L_HQL) final String hql){
  if (!showReportDevelopment) {
    return new ModelAndView(new RedirectView("String_Node_Str"));
  }
  try {
    List<Entity> entities=dataDefinitionService.get("String_Node_Str","String_Node_Str").find(hql).list().getEntities();
    if (entities.isEmpty()) {
      return new ModelAndView(L_QCADOO_REPORT_HQL).addObject(L_HQL,hql).addObject("String_Node_Str",true);
    }
 else {
      DataDefinition dataDefinition=entities.get(0).getDataDefinition();
      List<String> headers=new ArrayList<String>();
      if (!isDynamicDataDefinition(dataDefinition)) {
        headers.add("String_Node_Str");
      }
      headers.addAll(dataDefinition.getFields().keySet());
      List<List<String>> rows=new ArrayList<List<String>>();
      for (      Entity entity : entities) {
        List<String> row=new ArrayList<String>();
        if (!isDynamicDataDefinition(dataDefinition)) {
          row.add(String.valueOf(entity.getId()));
        }
        for (        String field : dataDefinition.getFields().keySet()) {
          if (entity.getField(field) == null) {
            row.add("String_Node_Str");
          }
 else           if (entity.getField(field) instanceof EntityList) {
            row.add("String_Node_Str");
          }
 else {
            row.add(String.valueOf(entity.getField(field)));
          }
        }
        rows.add(row);
      }
      return new ModelAndView(L_QCADOO_REPORT_HQL).addObject(L_HQL,hql).addObject("String_Node_Str",headers).addObject("String_Node_Str",rows).addObject("String_Node_Str",true);
    }
  }
 catch (  Exception e) {
    return showException(L_QCADOO_REPORT_HQL,e).addObject(L_HQL,hql);
  }
}