Program: 137798
Project: 137798
Buggy source:
/** 
 * @param outputFolder
 * @throws DataprofilerCoreException
 */
public void saveAnalysis() throws DataprofilerCoreException {
  for (  Domain domain : this.analysis.getParameters().getDataFilter()) {
    domain.setName(this.analysis.getName());
  }
  IRepositoryViewObject reposObject=null;
  Connection tdProvider=null;
  correlationAnalysisHandler.clearAnalysis();
  columnSetMultiIndicator.getAnalyzedColumns().clear();
  Analysis analysis=correlationAnalysisHandler.getAnalysis();
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.get(execLang));
  correlationAnalysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  List<RepositoryNode> repositoryNodeList=treeViewer.getColumnSetMultiValueList();
  if (repositoryNodeList != null && repositoryNodeList.size() != 0) {
    reposObject=repositoryNodeList.get(0).getObject();
    tdProvider=((ConnectionItem)reposObject.getProperty().getItem()).getConnection();
    analysis.getContext().setConnection(tdProvider);
    List<TdColumn> columnLst=new ArrayList<TdColumn>();
    for (    RepositoryNode repNode : repositoryNodeList) {
      columnLst.add((TdColumn)((MetadataColumnRepositoryObject)repNode.getObject()).getTdColumn());
    }
    columnSetMultiIndicator.getAnalyzedColumns().addAll(columnLst);
    correlationAnalysisHandler.addIndicator(columnLst,columnSetMultiIndicator);
  }
 else {
    deleteConnectionDependency(analysis);
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    ColumnSetMultiValueIndicator columnSetMultiValueIndicator=null;
    if (ColumnsetPackage.eINSTANCE.getCountAvgNullIndicator() == columnSetMultiIndicator.eClass()) {
      columnSetMultiValueIndicator=columnsetFactory.createCountAvgNullIndicator();
    }
    if (ColumnsetPackage.eINSTANCE.getMinMaxDateIndicator() == columnSetMultiIndicator.eClass()) {
      columnSetMultiValueIndicator=columnsetFactory.createMinMaxDateIndicator();
    }
    if (ColumnsetPackage.eINSTANCE.getWeakCorrelationIndicator() == columnSetMultiIndicator.eClass()) {
      columnSetMultiValueIndicator=columnsetFactory.createWeakCorrelationIndicator();
    }
    fillSimpleIndicators(columnSetMultiValueIndicator);
    analysis.getResults().getIndicators().add(columnSetMultiValueIndicator);
  }
  this.updateAnalysisClientDependency();
  this.saveNumberOfConnectionsPerAnalysis();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    tdqAnalysisItem.getProperty().setDisplayName(analysis.getName());
    tdqAnalysisItem.getProperty().setLabel(WorkspaceUtils.normalize(analysis.getName()));
    this.nameText.setText(analysis.getName());
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem,true);
  }
  logSaved(saved);
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}

Fixed version (ground truth):
/** 
 * @param outputFolder
 * @throws DataprofilerCoreException
 */
@Override public void saveAnalysis() throws DataprofilerCoreException {
  for (  Domain domain : this.analysis.getParameters().getDataFilter()) {
    domain.setName(this.analysis.getName());
  }
  IRepositoryViewObject reposObject=null;
  Connection tdProvider=null;
  correlationAnalysisHandler.clearAnalysis();
  columnSetMultiIndicator.getAnalyzedColumns().clear();
  Analysis analysis=correlationAnalysisHandler.getAnalysis();
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.get(execLang));
  correlationAnalysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  List<RepositoryNode> repositoryNodeList=treeViewer.getColumnSetMultiValueList();
  if (repositoryNodeList != null && repositoryNodeList.size() != 0) {
    reposObject=repositoryNodeList.get(0).getObject();
    tdProvider=((ConnectionItem)reposObject.getProperty().getItem()).getConnection();
    analysis.getContext().setConnection(tdProvider);
    List<TdColumn> columnLst=new ArrayList<TdColumn>();
    for (    RepositoryNode repNode : repositoryNodeList) {
      columnLst.add((TdColumn)((MetadataColumnRepositoryObject)repNode.getObject()).getTdColumn());
    }
    columnSetMultiIndicator.getAnalyzedColumns().addAll(columnLst);
    correlationAnalysisHandler.addIndicator(columnLst,columnSetMultiIndicator);
  }
 else {
    deleteConnectionDependency(analysis);
    ColumnsetFactory columnsetFactory=ColumnsetFactory.eINSTANCE;
    ColumnSetMultiValueIndicator columnSetMultiValueIndicator=null;
    if (ColumnsetPackage.eINSTANCE.getCountAvgNullIndicator() == columnSetMultiIndicator.eClass()) {
      columnSetMultiValueIndicator=columnsetFactory.createCountAvgNullIndicator();
    }
    if (ColumnsetPackage.eINSTANCE.getMinMaxDateIndicator() == columnSetMultiIndicator.eClass()) {
      columnSetMultiValueIndicator=columnsetFactory.createMinMaxDateIndicator();
    }
    if (ColumnsetPackage.eINSTANCE.getWeakCorrelationIndicator() == columnSetMultiIndicator.eClass()) {
      columnSetMultiValueIndicator=columnsetFactory.createWeakCorrelationIndicator();
    }
    fillSimpleIndicators(columnSetMultiValueIndicator);
    analysis.getResults().getIndicators().add(columnSetMultiValueIndicator);
  }
  this.updateAnalysisClientDependency();
  this.saveNumberOfConnectionsPerAnalysis();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    tdqAnalysisItem.getProperty().setDisplayName(analysis.getName());
    tdqAnalysisItem.getProperty().setLabel(WorkspaceUtils.normalize(analysis.getName()));
    this.nameText.setText(analysis.getName());
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem,true);
  }
  logSaved(saved);
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}