private void initStandardFileTypes() {
    instantiatePendingFileTypes();

    loadFileTypeBeans();

    //noinspection deprecation
    FileTypeFactory.FILE_TYPE_FACTORY_EP.processWithPluginDescriptor((factory, pluginDescriptor) -> {
      try {
        factory.createFileTypes(new PluginFileTypeConsumer(pluginDescriptor));
      }
      catch (ProcessCanceledException | StartupAbortedException e) {
        throw e;
      }
      catch (Throwable e) {
        throw new StartupAbortedException("Cannot create file types", new PluginException(e, pluginDescriptor.getPluginId()));
      }
      return Unit.INSTANCE;
    });

    PluginAdvertiserExtensionsStateService pluginAdvertiserExtensionsStateService =
      PluginAdvertiserExtensionsStateService.Companion.getInstance();
    for (StandardFileType pair : standardFileTypes.values()) {
      if (schemeManager.findSchemeByName(pair.fileType.getName()) == null) {
        registerFileTypeWithoutNotification(pair.fileType,
                                            pair.pluginDescriptor,
                                            pair.matchers,
                                            pluginAdvertiserExtensionsStateService,
                                            true);
      }
    }

    try {
      byte[] defaultFileTypeData = ResourceUtil.getResourceAsBytes("defaultFileTypes.xml", FileTypeManagerImpl.class.getClassLoader());
      if (defaultFileTypeData != null) {
        Element defaultFileTypesElement = JDOMUtil.load(defaultFileTypeData);
        IdeaPluginDescriptor coreIdeaPluginDescriptor = coreIdeaPluginDescriptor();
        for (Element e : defaultFileTypesElement.getChildren()) {
          if ("filetypes".equals(e.getName())) {
            for (Element element : e.getChildren(ELEMENT_FILETYPE)) {
              String fileTypeName = element.getAttributeValue(ATTRIBUTE_NAME);
              if (pendingFileTypes.get(fileTypeName) == null) {
                loadFileType("defaultFileTypes.xml", element, coreIdeaPluginDescriptor, pluginAdvertiserExtensionsStateService, true);
              }
            }
          }
          else if (ELEMENT_EXTENSION_MAP.equals(e.getName())) {
            readGlobalMappings(e, true);
          }
        }

        if (PlatformUtils.isIdeaCommunity()) {
          Element extensionMap = new Element(ELEMENT_EXTENSION_MAP);
          extensionMap.addContent(new Element(AbstractFileType.ELEMENT_MAPPING)
                                    .setAttribute(AbstractFileType.ATTRIBUTE_EXT, "jspx")
                                    .setAttribute(AbstractFileType.ATTRIBUTE_TYPE, "XML"));
          //noinspection SpellCheckingInspection
          extensionMap.addContent(new Element(AbstractFileType.ELEMENT_MAPPING)
                                    .setAttribute(AbstractFileType.ATTRIBUTE_EXT, "tagx")
                                    .setAttribute(AbstractFileType.ATTRIBUTE_TYPE, "XML"));
          readGlobalMappings(extensionMap, true);
        }
      }
    }
    catch (Exception e) {
      LOG.error(e);
    }
  }
private void initStandardFileTypes()