private static void updateSdkPaths(@NotNull Sdk sdk, @NotNull List<String> paths, @Nullable Project project) {
    final var moduleRoots = getModuleRoots(project);
    final var excludedPaths = getExcludedPaths(sdk);
    final var sdkRoots = splitIntoLibraryAndSourceRoots(sdk, paths, moduleRoots, excludedPaths, it -> sdkPathToRoot(sdk, it));
    final var userAddedRoots = splitIntoLibraryAndSourceRoots(sdk, getUserAddedPaths(sdk), moduleRoots, excludedPaths, Function.identity());

    final boolean forceCommit = ensureBinarySkeletonsDirectoryExists(sdk);
    final List<VirtualFile> localSdkPaths = buildSdkPaths(sdk, sdkRoots.first, userAddedRoots.first);
    commitSdkPathsIfChanged(sdk, localSdkPaths, forceCommit);

    final var pathsToTransfer = new HashSet<VirtualFile>();
    pathsToTransfer.addAll(sdkRoots.second);
    pathsToTransfer.addAll(userAddedRoots.second);
    // Presumably source and content roots that were configured manually by user, not set up automatically as "transferred"
    HashSet<VirtualFile> nonTransferredModuleRoots = new HashSet<>(moduleRoots);
    nonTransferredModuleRoots.removeAll(PyTransferredSdkRootsKt.getPathsToTransfer(sdk));
    pathsToTransfer.removeAll(nonTransferredModuleRoots);

    /*
    PyTransferredSdkRootsKt#transferRoots and PyTransferredSdkRootsKt#removeTransferredRoots skip sdks
    that are not equal to module one (editable as well).

    That's why roots changes were not applied but paths to transfer were successfully set.

    When current method was executed for original sdk,
    roots changes were not applied since there were no changes in paths to transfer (they were shared with editable copy).
     */
    if (!pathsToTransfer.equals(PyTransferredSdkRootsKt.getPathsToTransfer(sdk))) {
      if (project != null) {
        PyTransferredSdkRootsKt.removeTransferredRootsFromModulesWithSdk(project, sdk);
      }
      PyTransferredSdkRootsKt.setPathsToTransfer(sdk, pathsToTransfer);
      if (project != null) {
        PyTransferredSdkRootsKt.transferRootsToModulesWithSdk(project, sdk);
      }
    }
  }
private static void updateSdkPaths(@NotNull Sdk sdk, @NotNull List<String> paths, @Nullable Project project)