Program: 115114
Project: 115114
Buggy source:
protected DisplayItemWithGroupBean buildMatrixForRepeatingGroups(DisplayItemWithGroupBean diwgb,DisplayItemGroupBean itemGroup,EventCRFBean ecb,SectionBean sb,List<ItemBean> itBeans,HashMap<String,ItemDataBean> dataMap){
  int tempOrdinal=1;
  ItemDataDAO iddao=new ItemDataDAO(getDataSource(),locale);
  int maxOrdinal=iddao.getMaxOrdinalForGroup(ecb,sb,itemGroup.getItemGroupBean());
  if (maxOrdinal == 0)   maxOrdinal=1;
  ItemFormMetadataDAO ifmdao=new ItemFormMetadataDAO<String,ArrayList>(getDataSource());
  List<DisplayItemGroupBean> itemGroups=new ArrayList<DisplayItemGroupBean>();
  for (int i=1; i <= maxOrdinal; i++) {
    List<DisplayItemBean> displayItemBeans=new ArrayList<DisplayItemBean>();
    DisplayItemGroupBean dig=new DisplayItemGroupBean();
    for (    ItemBean itBean : itBeans) {
      DisplayItemBean displayItemBean=new DisplayItemBean();
      ItemFormMetadataBean ifm=ifmdao.findByItemIdAndCRFVersionId(itBean.getId(),ecb.getCRFVersionId());
      displayItemBean.setMetadata(ifm);
      displayItemBean.setItem(itBean);
      ItemDataBean itemData=dataMap.get(itBean.getId() + "String_Node_Str" + i);
      if (itemData != null) {
        logger.debug("String_Node_Str" + itemData);
      }
      if (itemData == null) {
        itemData=displayItemBean.getData();
        itemData.setValue("String_Node_Str");
        itemData.setOrdinal(i);
      }
      displayItemBean.setData(itemData);
      displayItemBean.loadDBValue();
      displayItemBeans.add(displayItemBean);
    }
    dig.setItems(displayItemBeans);
    itemGroups.add(dig);
  }
  diwgb.setItemGroups(itemGroups);
  return diwgb;
}

Fixed version (ground truth):
protected DisplayItemWithGroupBean buildMatrixForRepeatingGroups(DisplayItemWithGroupBean diwgb,DisplayItemGroupBean itemGroup,EventCRFBean ecb,SectionBean sb,List<ItemBean> itBeans,HashMap<String,ItemDataBean> dataMap){
  int tempOrdinal=1;
  ItemDataDAO iddao=new ItemDataDAO(getDataSource(),locale);
  int maxOrdinal=iddao.getMaxOrdinalForGroup(ecb,sb,itemGroup.getItemGroupBean());
  if (maxOrdinal == 0)   maxOrdinal=1;
  ItemFormMetadataDAO ifmdao=new ItemFormMetadataDAO<String,ArrayList>(getDataSource());
  List<DisplayItemGroupBean> itemGroups=new ArrayList<DisplayItemGroupBean>();
  for (int i=1; i <= maxOrdinal; i++) {
    List<DisplayItemBean> displayItemBeans=new ArrayList<DisplayItemBean>();
    DisplayItemGroupBean dig=new DisplayItemGroupBean();
    for (    ItemBean itBean : itBeans) {
      DisplayItemBean displayItemBean=new DisplayItemBean();
      ItemFormMetadataBean ifm=ifmdao.findByItemIdAndCRFVersionId(itBean.getId(),ecb.getCRFVersionId());
      displayItemBean.setMetadata(ifm);
      displayItemBean.setItem(itBean);
      ItemDataBean itemData=dataMap.get(itBean.getId() + "String_Node_Str" + i);
      if (itemData != null) {
        logger.debug("String_Node_Str" + itemData);
      }
      if (itemData == null) {
        itemData=displayItemBean.getData();
        itemData.setValue("String_Node_Str");
        itemData.setOrdinal(i);
      }
      displayItemBean.setData(itemData);
      displayItemBean.loadDBValue();
      displayItemBeans.add(displayItemBean);
    }
    dig.setItems(displayItemBeans);
    itemGroups.add(dig);
  }
  diwgb.setItemGroups(itemGroups);
  diwgb.setDbItemGroups(itemGroups);
  return diwgb;
}