void (@NotNull Element e, boolean isAddToInit) { myRemovedMappingTracker.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 = myPendingAssociations.findAssociatedFileType(matcher); if (pendingFileTypeBean != null) { instantiateFileTypeBean(pendingFileTypeBean); } if (type == null) { myUnresolvedMappings.put(matcher, fileTypeName); } else { if (PlainTextFileType.INSTANCE.equals(type)) { FileTypeWithDescriptor textFtd = myPatternsTable.findAssociatedFileType(matcher); FileType newFileType = textFtd==null?null:textFtd.fileType; if (newFileType != null && newFileType != PlainTextFileType.INSTANCE && newFileType != UnknownFileType.INSTANCE) { myRemovedMappingTracker.add(matcher, newFileType.getName(), false); } } associate(ftd, matcher, false); if (isAddToInit) { myInitialAssociations.addAssociation(matcher, type); } } } Map<String, String> hashBangs = readHashBangs(e); registerHashBangs(hashBangs, isAddToInit); for (RemovedMappingTracker.RemovedMapping mapping : myRemovedMappingTracker.getRemovedMappings()) { FileTypeWithDescriptor ftd = getFileTypeWithDescriptorByName(mapping.getFileTypeName()); if (ftd != null) { removeAssociation(ftd, mapping.getFileNameMatcher(), false); } } }