private void readGlobalMappings(@NotNull Element e, boolean isAddToInit) {
    removedMappingTracker.load(e);

    for (Pair<FileNameMatcher, String> association : AbstractFileType.readAssociations(e)) {
      String fileTypeName = association.getSecond();
      FileNameMatcher matcher = association.getFirst();
      FileTypeWithDescriptor ftd = getFileTypeWithDescriptorByName(fileTypeName);
      FileType type = ftd == null ? null : ftd.fileType();
      FileTypeBean pendingFileTypeBean = pendingAssociations.findAssociatedFileType(matcher);
      if (pendingFileTypeBean != null) {
        instantiateFileTypeBean(pendingFileTypeBean);
      }

      if (type == null) {
        unresolvedMappings.put(matcher, fileTypeName);
      }
      else {
        if (PlainTextFileType.INSTANCE.equals(type)) {
          FileTypeWithDescriptor textFtd = patternsTable.findAssociatedFileType(matcher);
          FileType newFileType = textFtd==null? null: textFtd.fileType();
          if (newFileType != null && newFileType != PlainTextFileType.INSTANCE && newFileType != UnknownFileType.INSTANCE) {
            removedMappingTracker.add(matcher, newFileType.getName(), false);
          }
        }
        associate(ftd, matcher, false);
        if (isAddToInit) {
          initialAssociations.addAssociation(matcher, type);
        }
      }
    }

    Map<String, String> hashBangs = readHashBangs(e);
    registerHashBangs(hashBangs, isAddToInit);

    for (RemovedMappingTracker.RemovedMapping mapping : removedMappingTracker.getRemovedMappings()) {
      FileTypeWithDescriptor ftd = getFileTypeWithDescriptorByName(mapping.getFileTypeName());
      if (ftd != null) {
        removeAssociation(ftd, mapping.getFileNameMatcher(), false);
      }
    }
  }
private void readGlobalMappings(@NotNull Element e, boolean isAddToInit)