Program: 136996
Project: 136996
Buggy source:
/** 
 * create column header for columnSet analysis.
 * @param simpInd
 * @param columnElementList
 */
private List<String> columnHeaderForColumnSet(SimpleStatIndicator simpInd){
  List<String> columnElementList=new ArrayList<String>();
  if (simpInd.getAnalyzedColumns().size() == 0) {
    return columnElementList;
  }
  TdXmlElementType tdXmeElement=null;
  if (DrillDownEditorInput.judgeMenuType(this.getMenuType(),DrillDownEditorInput.MENU_VALUE_TYPE)) {
    for (    ModelElement mod : simpInd.getAnalyzedColumns()) {
      tdXmeElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(mod);
      if (tdXmeElement != null) {
        columnElementList.add(tdXmeElement.getName());
      }
 else {
        columnElementList.add(ModelElementHelper.getName(mod));
      }
    }
  }
 else {
    boolean isDelimitedFile=false;
    boolean isMDM=false;
    for (    ModelElement mColumn : simpInd.getAnalyzedColumns()) {
      tdXmeElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(mColumn);
      TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(mColumn);
      if (tdXmeElement != null) {
        isMDM=true;
      }
 else       if (tdColumn == null) {
        isDelimitedFile=true;
      }
      break;
    }
    if (isMDM) {
      TdXmlElementType parentElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(XmlElementHelper.getParentElement(SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(tdXmeElement)));
      List<TdXmlElementType> columnList=org.talend.cwm.db.connection.ConnectionUtils.getXMLElements(parentElement);
      for (      TdXmlElementType tdXmlElement : columnList) {
        columnElementList.add(tdXmlElement.getName());
      }
    }
 else     if (isDelimitedFile) {
      List<MetadataColumn> columnList=ColumnHelper.getColumnOwnerAsMetadataTable(simpInd.getAnalyzedColumns().get(0)).getColumns();
      for (      MetadataColumn mdColumn : columnList) {
        columnElementList.add(mdColumn.getLabel());
      }
    }
 else {
      List<TdColumn> columnList=TableHelper.getColumns(SwitchHelpers.TABLE_SWITCH.doSwitch((simpInd.getAnalyzedColumns().get(0).eContainer())));
      for (      TdColumn tdColumn : columnList) {
        columnElementList.add(tdColumn.getLabel());
      }
    }
  }
  return columnElementList;
}

Fixed version (ground truth):
/** 
 * create column header for columnSet analysis.
 * @param simpInd
 * @param columnElementList
 */
private List<String> columnHeaderForColumnSet(SimpleStatIndicator simpInd){
  List<String> columnElementList=new ArrayList<String>();
  if (simpInd.getAnalyzedColumns().size() == 0) {
    return columnElementList;
  }
  TdXmlElementType tdXmeElement=null;
  if (DrillDownUtils.judgeMenuType(this.getMenuType(),DrillDownUtils.MENU_VALUE_TYPE)) {
    for (    ModelElement mod : simpInd.getAnalyzedColumns()) {
      tdXmeElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(mod);
      if (tdXmeElement != null) {
        columnElementList.add(tdXmeElement.getName());
      }
 else {
        columnElementList.add(ModelElementHelper.getName(mod));
      }
    }
  }
 else {
    boolean isDelimitedFile=false;
    boolean isMDM=false;
    for (    ModelElement mColumn : simpInd.getAnalyzedColumns()) {
      tdXmeElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(mColumn);
      TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.doSwitch(mColumn);
      if (tdXmeElement != null) {
        isMDM=true;
      }
 else       if (tdColumn == null) {
        isDelimitedFile=true;
      }
      break;
    }
    if (isMDM) {
      TdXmlElementType parentElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(XmlElementHelper.getParentElement(SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(tdXmeElement)));
      List<TdXmlElementType> columnList=org.talend.cwm.db.connection.ConnectionUtils.getXMLElements(parentElement);
      for (      TdXmlElementType tdXmlElement : columnList) {
        columnElementList.add(tdXmlElement.getName());
      }
    }
 else     if (isDelimitedFile) {
      List<MetadataColumn> columnList=ColumnHelper.getColumnOwnerAsMetadataTable(simpInd.getAnalyzedColumns().get(0)).getColumns();
      for (      MetadataColumn mdColumn : columnList) {
        columnElementList.add(mdColumn.getLabel());
      }
    }
 else {
      List<TdColumn> columnList=TableHelper.getColumns(SwitchHelpers.TABLE_SWITCH.doSwitch((simpInd.getAnalyzedColumns().get(0).eContainer())));
      for (      TdColumn tdColumn : columnList) {
        columnElementList.add(tdColumn.getLabel());
      }
    }
  }
  return columnElementList;
}