Program: 137709
Project: 137709
Buggy source:
/** 
 * get the ItemEditorInput according to the reposViewObj, if there no ItemEditorInput return null.
 * @param isOpenItemEditorAction
 * @return
 */
public IEditorInput computeEditorInput(boolean isOpenItemEditorAction) throws BusinessException {
  IEditorInput result=null;
  if (repViewObj != null) {
    String key=repViewObj.getRepositoryObjectType().getKey();
    Item item=repViewObj.getProperty().getItem();
    if (item instanceof TDQItem && !(item instanceof TDQFileItem)) {
      ModelElement modelElement=PropertyHelper.getModelElement(repViewObj.getProperty());
      if (modelElement == null || modelElement.eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(((TDQItem)item).getFilename());
        throw createBusinessException;
      }
    }
    if (ERepositoryObjectType.METADATA_CONNECTIONS.getKey().equals(key) || ERepositoryObjectType.METADATA_MDMCONNECTION.getKey().equals(key)) {
      result=new ConnectionItemEditorInput(item);
      editorID=ConnectionEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_ANALYSIS_ELEMENT.getKey().equals(key)) {
      result=new AnalysisItemEditorInput(item);
      Analysis analysis=((TDQAnalysisItem)item).getAnalysis();
      if (analysis == null || analysis.getContext() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(repViewObj);
        throw createBusinessException;
      }
      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.caseTdView((TdView)modelElement);
          connection=ConnectionHelper.getConnection(tdView);
        }
 else         if (modelElement instanceof TdColumn) {
          TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.caseTdColumn((TdColumn)modelElement);
          connection=ConnectionHelper.getConnection(tdColumn);
        }
 else         if (modelElement instanceof MetadataColumn) {
          MetadataColumn mColumn=SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(modelElement);
          connection=ConnectionHelper.getTdDataProvider(mColumn);
        }
 else         if (modelElement instanceof TdXmlElementType) {
          TdXmlElementType tdXmlElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(modelElement);
          TdXmlSchema ownedDocument=tdXmlElement.getOwnedDocument();
          connection=SwitchHelpers.MDMCONNECTION_SWITCH.doSwitch(ownedDocument.getDataManager().get(0));
        }
        connectionRepositoryNode=RepositoryNodeHelper.recursiveFind(connection);
      }
      ((AnalysisItemEditorInput)result).setConnectionNode(connectionRepositoryNode);
      editorID=AnalysisEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_INDICATOR_ELEMENT.getKey().equals(key)) {
      result=new IndicatorDefinitionItemEditorInput(item);
      TDQIndicatorDefinitionItem definitionItem=(TDQIndicatorDefinitionItem)item;
      if (definitionItem.getIndicatorDefinition().eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(definitionItem.getFilename());
        throw createBusinessException;
      }
      if (UDIHelper.getUDICategory(definitionItem.getIndicatorDefinition()) == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(definitionItem.getFilename());
        throw createBusinessException;
      }
      editorID=IndicatorEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_RULES_SQL.getKey().equals(key)) {
      result=new BusinessRuleItemEditorInput(item);
      editorID=DQRuleEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_RULES_PARSER.getKey().equals(key)) {
      result=new ParserRuleItemEditorInput(item);
      editorID=DQRuleEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_PATTERN_ELEMENT.getKey().equals(key)) {
      result=new PatternItemEditorInput(item);
      TDQPatternItem patternItem=(TDQPatternItem)item;
      if (patternItem.getPattern() == null || patternItem.getPattern().eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(patternItem.getFilename());
        throw createBusinessException;
      }
      editorID=PatternEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_REPORT_ELEMENT.getKey().equals(key)) {
      result=new ReportItemEditorInput(item);
      TDQReportItem reportItem=(TDQReportItem)item;
      if (!(reportItem.getReport() instanceof TdReport)) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(reportItem.getFilename());
        throw createBusinessException;
      }
      for (      AnalysisMap anaMap : ((TdReport)reportItem.getReport()).getAnalysisMap()) {
        Analysis analysis=anaMap.getAnalysis();
        if (analysis.eResource() == null) {
          BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(reportItem.getFilename());
          throw createBusinessException;
        }
      }
      editorID="String_Node_Str";
    }
    if (!isOpenItemEditorAction) {
      if (ERepositoryObjectType.TDQ_JRAXML_ELEMENT.getKey().equals(key) || ERepositoryObjectType.TDQ_SOURCE_FILE_ELEMENT.getKey().equals(key)) {
        IPath append=WorkbenchUtils.getFilePath(repViewObj.getRepositoryNode());
        result=new FileEditorInput(ResourceManager.getRootProject().getFile(append));
        editorID=FileEditorInput.class.getName();
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * get the ItemEditorInput according to the reposViewObj, if there no ItemEditorInput return null.
 * @param isOpenItemEditorAction
 * @return
 */
public IEditorInput computeEditorInput(boolean isOpenItemEditorAction) throws BusinessException {
  IEditorInput result=null;
  if (repViewObj != null) {
    String key=repViewObj.getRepositoryObjectType().getKey();
    Item item=repViewObj.getProperty().getItem();
    if (item instanceof TDQItem && !(item instanceof TDQFileItem)) {
      ModelElement modelElement=PropertyHelper.getModelElement(repViewObj.getProperty());
      if (modelElement == null || modelElement.eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(((TDQItem)item).getFilename());
        throw createBusinessException;
      }
    }
    if (ERepositoryObjectType.METADATA_CONNECTIONS.getKey().equals(key) || ERepositoryObjectType.METADATA_MDMCONNECTION.getKey().equals(key)) {
      result=new ConnectionItemEditorInput(item);
      editorID=ConnectionEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_ANALYSIS_ELEMENT.getKey().equals(key)) {
      result=new AnalysisItemEditorInput(item);
      Analysis analysis=((TDQAnalysisItem)item).getAnalysis();
      if (analysis == null || analysis.getContext() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(repViewObj);
        throw createBusinessException;
      }
      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.caseTdView((TdView)modelElement);
          connection=ConnectionHelper.getConnection(tdView);
        }
 else         if (modelElement instanceof TdColumn) {
          TdColumn tdColumn=SwitchHelpers.COLUMN_SWITCH.caseTdColumn((TdColumn)modelElement);
          connection=ConnectionHelper.getConnection(tdColumn);
        }
 else         if (modelElement instanceof MetadataColumn) {
          MetadataColumn mColumn=SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(modelElement);
          connection=ConnectionHelper.getTdDataProvider(mColumn);
        }
 else         if (modelElement instanceof TdXmlElementType) {
          TdXmlElementType tdXmlElement=SwitchHelpers.XMLELEMENTTYPE_SWITCH.doSwitch(modelElement);
          TdXmlSchema ownedDocument=tdXmlElement.getOwnedDocument();
          connection=SwitchHelpers.MDMCONNECTION_SWITCH.doSwitch(ownedDocument.getDataManager().get(0));
        }
        connectionRepositoryNode=RepositoryNodeHelper.recursiveFind(connection);
      }
      ((AnalysisItemEditorInput)result).setConnectionNode(connectionRepositoryNode);
      editorID=AnalysisEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_INDICATOR_ELEMENT.getKey().equals(key)) {
      result=new IndicatorDefinitionItemEditorInput(item);
      TDQIndicatorDefinitionItem definitionItem=(TDQIndicatorDefinitionItem)item;
      if (definitionItem.getIndicatorDefinition().eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(definitionItem.getFilename());
        throw createBusinessException;
      }
      if (UDIHelper.getUDICategory(definitionItem.getIndicatorDefinition()) == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(definitionItem.getFilename());
        throw createBusinessException;
      }
      editorID=IndicatorEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_RULES_SQL.getKey().equals(key)) {
      result=new BusinessRuleItemEditorInput(item);
      editorID=DQRuleEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_RULES_PARSER.getKey().equals(key)) {
      result=new ParserRuleItemEditorInput(item);
      editorID=DQRuleEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_PATTERN_ELEMENT.getKey().equals(key)) {
      result=new PatternItemEditorInput(item);
      TDQPatternItem patternItem=(TDQPatternItem)item;
      if (patternItem.getPattern() == null || patternItem.getPattern().eResource() == null) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(patternItem.getFilename());
        throw createBusinessException;
      }
      editorID=PatternEditor.class.getName();
    }
 else     if (ERepositoryObjectType.TDQ_REPORT_ELEMENT.getKey().equals(key)) {
      result=new ReportItemEditorInput(item);
      TDQReportItem reportItem=(TDQReportItem)item;
      if (!(reportItem.getReport() instanceof TdReport)) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(reportItem.getFilename());
        throw createBusinessException;
      }
      for (      AnalysisMap anaMap : ((TdReport)reportItem.getReport()).getAnalysisMap()) {
        Analysis analysis=anaMap.getAnalysis();
        if (analysis.eResource() == null) {
          BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(reportItem.getFilename());
          throw createBusinessException;
        }
      }
      editorID="String_Node_Str";
    }
 else     if (ERepositoryObjectType.TDQ_SOURCE_FILE_ELEMENT.getKey().equals(key)) {
      IPath append=WorkbenchUtils.getFilePath(repViewObj.getRepositoryNode());
      file=ResourceManager.getRootProject().getFile(append);
      if (!file.exists()) {
        BusinessException createBusinessException=ExceptionFactory.getInstance().createBusinessException(repViewObj);
        throw createBusinessException;
      }
      editorID=SQLEditor.EDITOR_ID;
      result=new FileEditorInput(ResourceManager.getRootProject().getFile(append));
    }
    if (!isOpenItemEditorAction) {
      if (ERepositoryObjectType.TDQ_JRAXML_ELEMENT.getKey().equals(key) || ERepositoryObjectType.TDQ_SOURCE_FILE_ELEMENT.getKey().equals(key)) {
        IPath append=WorkbenchUtils.getFilePath(repViewObj.getRepositoryNode());
        result=new FileEditorInput(ResourceManager.getRootProject().getFile(append));
        editorID=FileEditorInput.class.getName();
      }
    }
  }
  return result;
}