private static @Nullable LanguageLevel specifiedFileLanguageLevel(@Nullable VirtualFile file) {
    if (file == null) return null;

    final LanguageLevel specified = KEY.getPersistentValue(file);
    if (file.isDirectory()) {
      // no need to check parent since UpdateRootTask pushes language level into all directories under roots
      return specified;
    }
    else {
      return specified == null ? specifiedFileLanguageLevel(file.getParent()) : specified;
    }
  }
private static @Nullable LanguageLevel specifiedFileLanguageLevel(@Nullable VirtualFile file)