FileTypeWithDescriptor (@NotNull String extension) { FileTypeBean pendingFileType = withReadLock(() -> myPendingAssociations.findByExtension(extension)); if (pendingFileType != null) { FileTypeWithDescriptor type = instantiateFileTypeBean(pendingFileType); return type == null ? coreDescriptorFor(UnknownFileType.INSTANCE) : type; } FileTypeWithDescriptor ftd = withReadLock(() -> myPatternsTable.findByExtension(extension)); return ftd == null ? coreDescriptorFor(UnknownFileType.INSTANCE) : ftd; }