@Override
  @ReviseWhenPortedToJDK("21")
  public @NotNull String getCanonicallyCasedName(@NotNull VirtualFile file) {
    var parent = file.getParent();
    if (parent == null || parent.isCaseSensitive()) {
      return super.getCanonicallyCasedName(file);
    }

    var originalFileName = file.getName();
    var t = LOG.isTraceEnabled() ? System.nanoTime() : 0;
    try {
      var nioFile = convertToNioFileAndCheck(file, false);
      if (SystemInfo.isWindows || JavaVersion.current().isAtLeast(21)) {
        return nioFile.toRealPath(LinkOption.NOFOLLOW_LINKS).getFileName().toString();
      }
      var parentFile = nioFile.getParent();
      if (parentFile != null) {
        var canonicalFileNames = parentFile.toFile().list();
        if (canonicalFileNames != null) {
          for (var name : canonicalFileNames) {
            if (name.compareToIgnoreCase(originalFileName) == 0) {
              return name;
            }
          }
        }
      }
      return originalFileName;
    }
    catch (IOException | InvalidPathException e) {
      LOG.trace(e);
      return originalFileName;
    }
    finally {
      if (t != 0) {
        t = (System.nanoTime() - t) / 1000;
        LOG.trace("getCanonicallyCasedName(" + file + "): " + t + " mks");
      }
    }
  }
@Override
  @ReviseWhenPortedToJDK("21")
  public @NotNull String getCanonicallyCasedName(@NotNull VirtualFile file)