Program: 138581
Project: 138581
Buggy source:
/** 
 * @param outputFolder
 * @throws DataprofilerCoreException
 */
public void saveAnalysis() throws DataprofilerCoreException {
  IRepositoryViewObject reposObject=null;
  columnSetAnalysisHandler.clearAnalysis();
  simpleStatIndicator.getAnalyzedColumns().clear();
  allMatchIndicator.getAnalyzedColumns().clear();
  Analysis analysis=columnSetAnalysisHandler.getAnalysis();
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.JAVA);
  columnSetAnalysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  List<IRepositoryNode> repositoryNodes=treeViewer.getColumnSetMultiValueList();
  Connection tdProvider=null;
  if (repositoryNodes != null && repositoryNodes.size() != 0) {
    ConnectionItem item=(ConnectionItem)repositoryNodes.get(0).getObject().getProperty().getItem();
    tdProvider=item.getConnection();
    if (tdProvider.eIsProxy()) {
      tdProvider=(Connection)EObjectHelper.resolveObject(tdProvider);
    }
    analysis.getContext().setConnection(tdProvider);
    List<TdColumn> columnList=new ArrayList<TdColumn>();
    for (    IRepositoryNode rd : repositoryNodes) {
      reposObject=rd.getObject();
      columnList.add((TdColumn)((MetadataColumnRepositoryObject)reposObject).getTdColumn());
    }
    simpleStatIndicator.getAnalyzedColumns().addAll(columnList);
    columnSetAnalysisHandler.addIndicator(columnList,simpleStatIndicator);
    allMatchIndicator.getCompositeRegexMatchingIndicators().clear();
    ModelElementIndicator[] modelElementIndicator=treeViewer.getModelElementIndicator();
    if (modelElementIndicator != null) {
      for (      ModelElementIndicator modelElementInd : modelElementIndicator) {
        Indicator[] inds=modelElementInd.getPatternIndicators();
        for (        Indicator ind : inds) {
          if (ind instanceof RegexpMatchingIndicator) {
            ind.setAnalyzedElement(((MetadataColumnRepositoryObject)modelElementInd.getModelElementRepositoryNode().getObject()).getTdColumn());
            allMatchIndicator.getCompositeRegexMatchingIndicators().add((RegexpMatchingIndicator)ind);
          }
        }
      }
    }
    if (allMatchIndicator.getCompositeRegexMatchingIndicators().size() > 0) {
      allMatchIndicator.getAnalyzedColumns().addAll(columnList);
      columnSetAnalysisHandler.addIndicator(columnList,allMatchIndicator);
    }
  }
 else {
    analysis.getContext().setConnection(null);
    analysis.getClientDependency().clear();
  }
  String urlString=analysis.eResource() != null ? analysis.eResource().getURI().toFileString() : PluginConstant.EMPTY_STRING;
  this.updateAnalysisClientDependency();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem);
  }
  if (saved.isOk()) {
    if (tdProvider != null) {
      ElementWriterFactory.getInstance().createDataProviderWriter().save(reposObject.getProperty().getItem());
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + urlString + "String_Node_Str");
    }
  }
 else {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",analysis.getName(),urlString,saved.getMessage()));
  }
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}

Fixed version (ground truth):
/** 
 * @param outputFolder
 * @throws DataprofilerCoreException
 */
public void saveAnalysis() throws DataprofilerCoreException {
  IRepositoryViewObject reposObject=null;
  columnSetAnalysisHandler.clearAnalysis();
  simpleStatIndicator.getAnalyzedColumns().clear();
  allMatchIndicator.getAnalyzedColumns().clear();
  Analysis analysis=columnSetAnalysisHandler.getAnalysis();
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.JAVA);
  columnSetAnalysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  List<IRepositoryNode> repositoryNodes=treeViewer.getColumnSetMultiValueList();
  Connection tdProvider=null;
  if (repositoryNodes != null && repositoryNodes.size() != 0) {
    ConnectionItem item=(ConnectionItem)repositoryNodes.get(0).getObject().getProperty().getItem();
    tdProvider=item.getConnection();
    if (tdProvider.eIsProxy()) {
      tdProvider=(Connection)EObjectHelper.resolveObject(tdProvider);
    }
    analysis.getContext().setConnection(tdProvider);
    List<TdColumn> columnList=new ArrayList<TdColumn>();
    for (    IRepositoryNode rd : repositoryNodes) {
      reposObject=rd.getObject();
      columnList.add((TdColumn)((MetadataColumnRepositoryObject)reposObject).getTdColumn());
    }
    simpleStatIndicator.getAnalyzedColumns().addAll(columnList);
    columnSetAnalysisHandler.addIndicator(columnList,simpleStatIndicator);
    allMatchIndicator.getCompositeRegexMatchingIndicators().clear();
    ModelElementIndicator[] modelElementIndicator=treeViewer.getModelElementIndicator();
    if (modelElementIndicator != null) {
      for (      ModelElementIndicator modelElementInd : modelElementIndicator) {
        Indicator[] inds=modelElementInd.getPatternIndicators();
        for (        Indicator ind : inds) {
          if (ind instanceof RegexpMatchingIndicator) {
            ind.setAnalyzedElement(((MetadataColumnRepositoryObject)modelElementInd.getModelElementRepositoryNode().getObject()).getTdColumn());
            allMatchIndicator.getCompositeRegexMatchingIndicators().add((RegexpMatchingIndicator)ind);
          }
        }
      }
    }
    if (allMatchIndicator.getCompositeRegexMatchingIndicators().size() > 0) {
      allMatchIndicator.getAnalyzedColumns().addAll(columnList);
      columnSetAnalysisHandler.addIndicator(columnList,allMatchIndicator);
    }
  }
 else {
    tdProvider=(Connection)analysis.getContext().getConnection();
    tdProvider.getSupplierDependency().get(0).getClient().remove(analysis);
    analysis.getContext().setConnection(null);
    analysis.getClientDependency().clear();
  }
  String urlString=analysis.eResource() != null ? analysis.eResource().getURI().toFileString() : PluginConstant.EMPTY_STRING;
  this.updateAnalysisClientDependency();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem);
  }
  if (saved.isOk()) {
    reposObject=RepositoryNodeHelper.recursiveFind(tdProvider).getObject();
    if (tdProvider != null) {
      ElementWriterFactory.getInstance().createDataProviderWriter().save(reposObject.getProperty().getItem());
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + urlString + "String_Node_Str");
    }
  }
 else {
    throw new DataprofilerCoreException(DefaultMessagesImpl.getString("String_Node_Str",analysis.getName(),urlString,saved.getMessage()));
  }
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}