void (@NotNull Sdk sdk, @NotNull final List<VirtualFile> sdkPaths, boolean forceCommit) { final List<VirtualFile> currentSdkPaths = Arrays.asList(sdk.getRootProvider().getFiles(OrderRootType.CLASSES)); if (forceCommit || !Sets.newHashSet(sdkPaths).equals(Sets.newHashSet(currentSdkPaths))) { changeSdkModificator(sdk, effectiveModificator -> { effectiveModificator.removeAllRoots(); for (VirtualFile sdkPath : sdkPaths) { effectiveModificator.addRoot(PythonSdkType.getSdkRootVirtualFile(sdkPath), OrderRootType.CLASSES); } return true; }); } }