Program: 137301
Project: 137301
Buggy source:
/** 
 * @param outputFolder
 * @throws DataprofilerCoreException
 */
@Override public void saveAnalysis() throws DataprofilerCoreException {
  IRepositoryViewObject reposObject=null;
  analysisHandler.clearAnalysis();
  ModelElementIndicator[] modelElementIndicators=this.getCurrentModelElementIndicators();
  Connection tdProvider=null;
  Analysis analysis=analysisHandler.getAnalysis();
  for (  Domain domain : this.analysis.getParameters().getDataFilter()) {
    domain.setName(this.analysis.getName());
  }
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.get(execLang));
  try {
    Integer.valueOf(numberOfConnectionsPerAnalysisText.getText());
  }
 catch (  NumberFormatException nfe) {
    MessageDialogWithToggle.openError(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
    String originalValue=TaggedValueHelper.getTaggedValue(TdqAnalysisConnectionPool.NUMBER_OF_CONNECTIONS_PER_ANALYSIS,this.analysis.getTaggedValue()).getValue();
    numberOfConnectionsPerAnalysisText.setText(originalValue);
  }
  this.saveNumberOfConnectionsPerAnalysis();
  try {
    analysis.getParameters().setMaxNumberRows(Integer.parseInt(maxNumText.getText()));
  }
 catch (  NumberFormatException nfe) {
    MessageDialogWithToggle.openError(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
    maxNumText.setText(String.valueOf(analysis.getParameters().getMaxNumberRows()));
  }
  analysis.getParameters().setMaxNumberRows(analysis.getParameters().getMaxNumberRows());
  analysis.getParameters().setStoreData(drillDownCheck.getSelection());
  if (modelElementIndicators != null && modelElementIndicators.length != 0) {
    tdProvider=ModelElementIndicatorHelper.getTdDataProvider(modelElementIndicators[0]);
    if (tdProvider.eIsProxy()) {
      tdProvider=(Connection)EObjectHelper.resolveObject(tdProvider);
    }
    analysis.getContext().setConnection(tdProvider);
    for (    ModelElementIndicator modelElementIndicator : modelElementIndicators) {
      reposObject=modelElementIndicator.getModelElementRepositoryNode().getObject();
      ModelElement modelEle=null;
      if (reposObject instanceof MetadataColumnRepositoryObject) {
        modelEle=((MetadataColumnRepositoryObject)reposObject).getTdColumn();
      }
 else       if (reposObject instanceof MetadataXmlElementTypeRepositoryObject) {
        modelEle=((MetadataXmlElementTypeRepositoryObject)reposObject).getTdXmlElementType();
      }
      analysisHandler.addIndicator(modelEle,modelElementIndicator.getIndicators());
      DataminingType type=MetadataHelper.getDataminingType(modelEle);
      if (type == null) {
        type=MetadataHelper.getDefaultDataminingType(modelElementIndicator.getJavaType());
      }
      analysisHandler.setDatamingType(type.getLiteral(),modelEle);
    }
  }
 else {
    deleteConnectionDependency(analysis);
  }
  analysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  this.updateAnalysisClientDependency();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    tdqAnalysisItem.getProperty().setDisplayName(analysisHandler.getName());
    tdqAnalysisItem.getProperty().setLabel(WorkspaceUtils.normalize(analysisHandler.getName()));
    this.nameText.setText(analysisHandler.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 {
  IRepositoryViewObject reposObject=null;
  analysisHandler.clearAnalysis();
  ModelElementIndicator[] modelElementIndicators=this.getCurrentModelElementIndicators();
  Connection tdProvider=null;
  Analysis analysis=analysisHandler.getAnalysis();
  for (  Domain domain : this.analysis.getParameters().getDataFilter()) {
    domain.setName(this.analysis.getName());
  }
  analysis.getParameters().setExecutionLanguage(ExecutionLanguage.get(execLang));
  try {
    Integer.valueOf(numberOfConnectionsPerAnalysisText.getText());
  }
 catch (  NumberFormatException nfe) {
    MessageDialogWithToggle.openError(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
    String originalValue=TaggedValueHelper.getTaggedValue(TdqAnalysisConnectionPool.NUMBER_OF_CONNECTIONS_PER_ANALYSIS,this.analysis.getTaggedValue()).getValue();
    numberOfConnectionsPerAnalysisText.setText(originalValue);
  }
  this.saveNumberOfConnectionsPerAnalysis();
  try {
    analysis.getParameters().setMaxNumberRows(Integer.parseInt(maxNumText.getText()));
  }
 catch (  NumberFormatException nfe) {
    MessageDialogWithToggle.openError(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str",DefaultMessagesImpl.getString("String_Node_Str")));
    maxNumText.setText(String.valueOf(analysis.getParameters().getMaxNumberRows()));
  }
  analysis.getParameters().setMaxNumberRows(analysis.getParameters().getMaxNumberRows());
  analysis.getParameters().setStoreData(drillDownCheck.getSelection());
  if (modelElementIndicators != null && modelElementIndicators.length != 0) {
    tdProvider=ModelElementIndicatorHelper.getTdDataProvider(modelElementIndicators[0]);
    if (tdProvider.eIsProxy()) {
      tdProvider=(Connection)EObjectHelper.resolveObject(tdProvider);
    }
    analysis.getContext().setConnection(tdProvider);
    for (    ModelElementIndicator modelElementIndicator : modelElementIndicators) {
      reposObject=modelElementIndicator.getModelElementRepositoryNode().getObject();
      ModelElement modelEle=null;
      if (reposObject instanceof MetadataColumnRepositoryObject) {
        modelEle=((MetadataColumnRepositoryObject)reposObject).getTdColumn();
      }
 else       if (reposObject instanceof MetadataXmlElementTypeRepositoryObject) {
        modelEle=((MetadataXmlElementTypeRepositoryObject)reposObject).getTdXmlElementType();
      }
      analysisHandler.addIndicator(modelEle,modelElementIndicator.getIndicators());
      DataminingType type=MetadataHelper.getDataminingType(modelEle);
      if (type == null) {
        type=MetadataHelper.getDefaultDataminingType(modelElementIndicator.getJavaType());
      }
      analysisHandler.setDatamingType(type.getLiteral(),modelEle);
    }
  }
 else {
    analysis.getContext().setConnection(null);
  }
  analysisHandler.setStringDataFilter(dataFilterComp.getDataFilterString());
  this.updateAnalysisClientDependency();
  ReturnCode saved=new ReturnCode(false);
  IEditorInput editorInput=this.getEditorInput();
  if (editorInput instanceof AnalysisItemEditorInput) {
    AnalysisItemEditorInput analysisInput=(AnalysisItemEditorInput)editorInput;
    TDQAnalysisItem tdqAnalysisItem=analysisInput.getTDQAnalysisItem();
    tdqAnalysisItem.getProperty().setDisplayName(analysisHandler.getName());
    tdqAnalysisItem.getProperty().setLabel(WorkspaceUtils.normalize(analysisHandler.getName()));
    this.nameText.setText(analysisHandler.getName());
    saved=ElementWriterFactory.getInstance().createAnalysisWrite().save(tdqAnalysisItem,true);
  }
  logSaved(saved);
  treeViewer.setDirty(false);
  dataFilterComp.setDirty(false);
}