Program: 129747
Project: 129747
Buggy source:
protected void fillMenu(Menu menu){
  IRepositoryView repositoryView=RepositoryManagerHelper.findRepositoryView();
  if (repositoryView == null) {
    return;
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.PROCESS)) {
    IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
    addToMenu(menu,service.getCreateProcessAction(true),-1);
    addSeparator(menu);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.BUSINESS_PROCESS)) {
    IDiagramModelService service=(IDiagramModelService)GlobalServiceRegister.getDefault().getService(IDiagramModelService.class);
    addToMenu(menu,service.getCreateDiagramAction(true),-1);
    addSeparator(menu);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_CONNECTIONS)) {
    final CreateConnectionAction createConnectionAction=new CreateConnectionAction(true);
    createConnectionAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createConnectionAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_DELIMITED)) {
    final CreateFileDelimitedAction createFileDelimitedAction=new CreateFileDelimitedAction(true);
    createFileDelimitedAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileDelimitedAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_POSITIONAL)) {
    final CreateFilePositionalAction createFilePositionalAction=new CreateFilePositionalAction(true);
    createFilePositionalAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFilePositionalAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_REGEXP)) {
    final CreateFileRegexpAction createFileRegexpAction=new CreateFileRegexpAction(true);
    createFileRegexpAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileRegexpAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_XML)) {
    final CreateFileXmlAction createFileXmlAction=new CreateFileXmlAction(true);
    createFileXmlAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileXmlAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_EXCEL)) {
    final CreateFileExcelAction createFileExcelAction=new CreateFileExcelAction(true);
    createFileExcelAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileExcelAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_LDIF)) {
    final CreateFileLdifAction createFileLdifAction=new CreateFileLdifAction(true);
    createFileLdifAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileLdifAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_LDAP_SCHEMA)) {
    final CreateLDAPSchemaAction createLDAPSchemaAction=new CreateLDAPSchemaAction(true);
    createLDAPSchemaAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createLDAPSchemaAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA)) {
    final CreateSalesforceSchemaAction createSalesforceModulesAction=new CreateSalesforceSchemaAction(true);
    createSalesforceModulesAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createSalesforceModulesAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_GENERIC_SCHEMA)) {
    final CreateGenericSchemaAction createGenericSchemaAction=new CreateGenericSchemaAction(true);
    createGenericSchemaAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createGenericSchemaAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_WSDL_SCHEMA)) {
    final CreateWSDLSchemaAction createWSDLSchemaAction=new CreateWSDLSchemaAction(true);
    createWSDLSchemaAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createWSDLSchemaAction,-1);
  }
  addSeparator(menu);
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.ROUTINES)) {
    final AContextualAction createRoutineAction=null;
    addToMenu(menu,createRoutineAction,-1);
  }
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  for (int i=0; i < configurationElements.length; i++) {
    IConfigurationElement element=configurationElements[i];
    try {
      AContextualAction action=(AContextualAction)element.createExecutableExtension("String_Node_Str");
      action.setToolbar(true);
      action.setWorkbenchPart(repositoryView);
      addToMenu(menu,action,-1);
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
}

Fixed version (ground truth):
protected void fillMenu(Menu menu){
  IRepositoryView repositoryView=RepositoryManagerHelper.findRepositoryView();
  if (repositoryView == null) {
    return;
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.PROCESS)) {
    IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
    addToMenu(menu,service.getCreateProcessAction(true),-1);
    addSeparator(menu);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.BUSINESS_PROCESS)) {
    IDiagramModelService service=(IDiagramModelService)GlobalServiceRegister.getDefault().getService(IDiagramModelService.class);
    addToMenu(menu,service.getCreateDiagramAction(true),-1);
    addSeparator(menu);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_CONNECTIONS)) {
    final CreateConnectionAction createConnectionAction=new CreateConnectionAction(true);
    createConnectionAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createConnectionAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_DELIMITED)) {
    final CreateFileDelimitedAction createFileDelimitedAction=new CreateFileDelimitedAction(true);
    createFileDelimitedAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileDelimitedAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_POSITIONAL)) {
    final CreateFilePositionalAction createFilePositionalAction=new CreateFilePositionalAction(true);
    createFilePositionalAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFilePositionalAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_REGEXP)) {
    final CreateFileRegexpAction createFileRegexpAction=new CreateFileRegexpAction(true);
    createFileRegexpAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileRegexpAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_XML)) {
    final CreateFileXmlAction createFileXmlAction=new CreateFileXmlAction(true);
    createFileXmlAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileXmlAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_EXCEL)) {
    final CreateFileExcelAction createFileExcelAction=new CreateFileExcelAction(true);
    createFileExcelAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileExcelAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_FILE_LDIF)) {
    final CreateFileLdifAction createFileLdifAction=new CreateFileLdifAction(true);
    createFileLdifAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createFileLdifAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_LDAP_SCHEMA)) {
    final CreateLDAPSchemaAction createLDAPSchemaAction=new CreateLDAPSchemaAction(true);
    createLDAPSchemaAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createLDAPSchemaAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA)) {
    final CreateSalesforceSchemaAction createSalesforceModulesAction=new CreateSalesforceSchemaAction(true);
    createSalesforceModulesAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createSalesforceModulesAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_GENERIC_SCHEMA)) {
    final CreateGenericSchemaAction createGenericSchemaAction=new CreateGenericSchemaAction(true);
    createGenericSchemaAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createGenericSchemaAction,-1);
  }
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.METADATA_WSDL_SCHEMA)) {
    final CreateWSDLSchemaAction createWSDLSchemaAction=new CreateWSDLSchemaAction(true);
    createWSDLSchemaAction.setWorkbenchPart(repositoryView);
    addToMenu(menu,createWSDLSchemaAction,-1);
  }
  addSeparator(menu);
  if (repositoryView.containsRepositoryType(ERepositoryObjectType.ROUTINES)) {
    IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
    addToMenu(menu,service.getCreateRoutineAction(repositoryView),-1);
  }
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  for (int i=0; i < configurationElements.length; i++) {
    IConfigurationElement element=configurationElements[i];
    try {
      AContextualAction action=(AContextualAction)element.createExecutableExtension("String_Node_Str");
      action.setToolbar(true);
      action.setWorkbenchPart(repositoryView);
      addToMenu(menu,action,-1);
    }
 catch (    CoreException e) {
      ExceptionHandler.process(e);
    }
  }
}