FileType (@NotNull String fileTypeName) { FileType type = getStdFileType(fileTypeName); // TODO: Abstract file types are not std one, so need to be restored specially, // currently there are 6 of them and restoration does not happen very often so just iteration is enough if (type != PlainTextFileType.INSTANCE || fileTypeName.equals(type.getName())) { return type; } for (FileTypeWithDescriptor ftd: getAllFileTypeWithDescriptors()) { if (fileTypeName.equals(ftd.fileType.getName())) { return ftd.fileType; } } return null; }