Program: 138471
Project: 138471
Buggy source:
public AbstractItemEditorInput computeEditorInput(){
  if (reposViewObj == null) {
    editorInput=null;
  }
 else {
    String key=reposViewObj.getRepositoryObjectType().getKey();
    Item item=reposViewObj.getProperty().getItem();
    if (ERepositoryObjectType.METADATA_CONNECTIONS.getKey().equals(key) || ERepositoryObjectType.METADATA_MDMCONNECTION.getKey().equals(key)) {
      editorInput=new ConnectionItemEditorInput(item);
      editorID=ConnectionEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_ANALYSIS_ELEMENT.getKey().equals(key)) {
      editorInput=new AnalysisItemEditorInput(item);
      Analysis analysis=((TDQAnalysisItem)item).getAnalysis();
      AnalysisParameters parameters=analysis.getParameters();
      AnalysisType analysisType=parameters.getAnalysisType();
      EList<ModelElement> analysedElements=analysis.getContext().getAnalysedElements();
      RepositoryNode connectionRepositoryNode=null;
      if (analysedElements.size() > 0) {
        ModelElement modelElement=analysedElements.get(0);
        if (modelElement instanceof Catalog) {
          Catalog catalog=SwitchHelpers.CATALOG_SWITCH.caseCatalog((Catalog)modelElement);
          connection=ConnectionHelper.getConnection(catalog);
        }
 else         if (modelElement instanceof Schema) {
          Schema schema=SwitchHelpers.SCHEMA_SWITCH.caseSchema((Schema)modelElement);
          if (schema != null) {
            connection=ConnectionHelper.getConnection(schema);
          }
        }
 else         if (modelElement instanceof TdTable) {
          TdTable tdTable=SwitchHelpers.TABLE_SWITCH.caseTdTable((TdTable)modelElement);
          connection=ConnectionHelper.getConnection(tdTable);
        }
 else         if (modelElement instanceof TdView) {
          TdView tdView=SwitchHelpers.VIEW_SWITCH.caseView((View)modelElement);
          connection=ConnectionHelper.getConnection(tdView);
        }
 else         if (modelElement instanceof TdColumn) {
          TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.caseTdColumn((TdColumn)modelElement);
          connection=ConnectionHelper.getConnection(tdColumn);
        }
        connectionRepositoryNode=RepositoryNodeHelper.recursiveFind(connection);
      }
      ((AnalysisItemEditorInput)editorInput).setConnectionNode((DBConnectionRepNode)connectionRepositoryNode);
      editorID=AnalysisEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_INDICATOR_ELEMENT.getKey().equals(key)) {
      editorInput=new IndicatorDefinitionItemEditorInput(item);
      editorID=IndicatorEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_BUSINESSRULE_ELEMENT.getKey().equals(key)) {
      editorInput=new BusinessRuleItemEditorInput(item);
      editorID=DQRuleEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_PATTERN_ELEMENT.getKey().equals(key)) {
      editorInput=new PatternItemEditorInput(item);
      editorID=PatternEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_REPORT_ELEMENT.getKey().equals(key)) {
      editorInput=new ReportItemEditorInput(item);
      editorID="String_Node_Str";
    }
  }
  return editorInput;
}

Fixed version (ground truth):
public AbstractItemEditorInput computeEditorInput(){
  if (reposViewObj == null) {
    editorInput=null;
  }
 else {
    String key=reposViewObj.getRepositoryObjectType().getKey();
    Item item=reposViewObj.getProperty().getItem();
    if (ERepositoryObjectType.METADATA_CONNECTIONS.getKey().equals(key) || ERepositoryObjectType.METADATA_MDMCONNECTION.getKey().equals(key)) {
      editorInput=new ConnectionItemEditorInput(item);
      editorID=ConnectionEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_ANALYSIS_ELEMENT.getKey().equals(key)) {
      editorInput=new AnalysisItemEditorInput(item);
      Analysis analysis=((TDQAnalysisItem)item).getAnalysis();
      AnalysisParameters parameters=analysis.getParameters();
      AnalysisType analysisType=parameters.getAnalysisType();
      EList<ModelElement> analysedElements=analysis.getContext().getAnalysedElements();
      RepositoryNode connectionRepositoryNode=null;
      if (analysedElements.size() > 0) {
        ModelElement modelElement=analysedElements.get(0);
        if (modelElement instanceof Connection) {
          connection=(Connection)modelElement;
        }
        if (modelElement instanceof Catalog) {
          Catalog catalog=SwitchHelpers.CATALOG_SWITCH.caseCatalog((Catalog)modelElement);
          connection=ConnectionHelper.getConnection(catalog);
        }
 else         if (modelElement instanceof Schema) {
          Schema schema=SwitchHelpers.SCHEMA_SWITCH.caseSchema((Schema)modelElement);
          if (schema != null) {
            connection=ConnectionHelper.getConnection(schema);
          }
        }
 else         if (modelElement instanceof TdTable) {
          TdTable tdTable=SwitchHelpers.TABLE_SWITCH.caseTdTable((TdTable)modelElement);
          connection=ConnectionHelper.getConnection(tdTable);
        }
 else         if (modelElement instanceof TdView) {
          TdView tdView=SwitchHelpers.VIEW_SWITCH.caseView((View)modelElement);
          connection=ConnectionHelper.getConnection(tdView);
        }
 else         if (modelElement instanceof TdColumn) {
          TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.caseTdColumn((TdColumn)modelElement);
          connection=ConnectionHelper.getConnection(tdColumn);
        }
        connectionRepositoryNode=RepositoryNodeHelper.recursiveFind(connection);
      }
      ((AnalysisItemEditorInput)editorInput).setConnectionNode((DBConnectionRepNode)connectionRepositoryNode);
      editorID=AnalysisEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_INDICATOR_ELEMENT.getKey().equals(key)) {
      editorInput=new IndicatorDefinitionItemEditorInput(item);
      editorID=IndicatorEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_BUSINESSRULE_ELEMENT.getKey().equals(key)) {
      editorInput=new BusinessRuleItemEditorInput(item);
      editorID=DQRuleEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_PATTERN_ELEMENT.getKey().equals(key)) {
      editorInput=new PatternItemEditorInput(item);
      editorID=PatternEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_REPORT_ELEMENT.getKey().equals(key)) {
      editorInput=new ReportItemEditorInput(item);
      editorID="String_Node_Str";
    }
  }
  return editorInput;
}