Program: 136977
Project: 136977
Buggy source:
/** 
 * DOC zshen Comment method "getDesignatedData".
 * @return make column mapping with data
 */
private List<Object[]> getDesignatedData(List<Object[]> dataList){
  ModelElement analysisElement=currIndicator.getAnalyzedElement();
  List<Object[]> returnDataList=new ArrayList<Object[]>();
  if (dataList == null || dataList.size() < 0) {
    return returnDataList;
  }
  if (DrillDownEditorInput.judgeMenuType(this.getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE)) {
    int offset=0;
    if (analysisElement == null && currIndicator.eContainer() instanceof SimpleStatIndicator) {
      returnDataList=dataList;
    }
 else {
      if (analysisElement instanceof MetadataColumn) {
        MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
        List<MetadataColumn> columnElementList=mTable.getColumns();
        offset=columnElementList.indexOf(analysisElement);
      }
 else       if (analysisElement instanceof TdXmlElementType) {
        TdXmlElementType parentElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(XmlElementHelper.getParentElement(SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(analysisElement)));
        List<TdXmlElementType> xmlElementListTmp=org.talend.cwm.db.connection.ConnectionUtils.getXMLElements(parentElement);
        List<TdXmlElementType> xmlElementList=new ArrayList<TdXmlElementType>();
        for (        TdXmlElementType tdXmlEle : xmlElementListTmp) {
          if (!DqRepositoryViewService.hasChildren(tdXmlEle)) {
            xmlElementList.add(tdXmlEle);
          }
        }
        offset=xmlElementList.indexOf(analysisElement);
      }
      if (currIndicator instanceof DuplicateCountIndicator) {
        for (        Object obj : ((DuplicateCountIndicator)currIndicator).getDuplicateValues()) {
          Object[] newObj=new Object[1];
          newObj[0]=obj;
          returnDataList.add(newObj);
        }
        return returnDataList;
      }
      for (      Object[] obj : dataList) {
        Object[] newObj=new Object[1];
        newObj[0]=obj[offset];
        returnDataList.add(newObj);
      }
    }
  }
 else {
    returnDataList=dataList;
  }
  return returnDataList;
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "getDesignatedData".
 * @return make column mapping with data
 */
private List<Object[]> getDesignatedData(List<Object[]> dataList){
  ModelElement analysisElement=currIndicator.getAnalyzedElement();
  List<Object[]> returnDataList=new ArrayList<Object[]>();
  if (dataList == null || dataList.size() < 0) {
    return returnDataList;
  }
  if (DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_VALUE_TYPE)) {
    int offset=0;
    if (analysisElement == null && currIndicator.eContainer() instanceof SimpleStatIndicator) {
      returnDataList=dataList;
    }
 else {
      if (analysisElement instanceof MetadataColumn) {
        MetadataTable mTable=ColumnHelper.getColumnOwnerAsMetadataTable((MetadataColumn)analysisElement);
        List<MetadataColumn> columnElementList=mTable.getColumns();
        offset=columnElementList.indexOf(analysisElement);
      }
 else       if (analysisElement instanceof TdXmlElementType) {
        TdXmlElementType parentElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(XmlElementHelper.getParentElement(SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(analysisElement)));
        List<TdXmlElementType> xmlElementListTmp=org.talend.cwm.db.connection.ConnectionUtils.getXMLElements(parentElement);
        List<TdXmlElementType> xmlElementList=new ArrayList<TdXmlElementType>();
        for (        TdXmlElementType tdXmlEle : xmlElementListTmp) {
          if (!DqRepositoryViewService.hasChildren(tdXmlEle)) {
            xmlElementList.add(tdXmlEle);
          }
        }
        offset=xmlElementList.indexOf(analysisElement);
      }
      if (currIndicator instanceof DuplicateCountIndicator) {
        for (        Object obj : ((DuplicateCountIndicator)currIndicator).getDuplicateValues()) {
          Object[] newObj=new Object[1];
          newObj[0]=obj;
          returnDataList.add(newObj);
        }
        return returnDataList;
      }
      for (      Object[] obj : dataList) {
        Object[] newObj=new Object[1];
        newObj[0]=obj[offset];
        returnDataList.add(newObj);
      }
    }
  }
 else {
    returnDataList=dataList;
  }
  return returnDataList;
}