void (final Sdk currentSdk) { final SdkModificator modificator = currentSdk.getSdkModificator(); final EditSdkDialog dialog = new EditSdkDialog(myProject, modificator, s -> { if (isDuplicateSdkName(s, currentSdk)) { return PyBundle.message("sdk.details.dialog.error.duplicate.name"); } return null; }); if (dialog.showAndGet()) { final boolean pathChanged = !Objects.equals(currentSdk.getHomePath(), dialog.getHomePath()); if (!modificator.getName().equals(dialog.getName()) || pathChanged || dialog.isAssociateChanged()) { modificator.setName(dialog.getName()); modificator.setHomePath(dialog.getHomePath()); if (dialog.isAssociateChanged()) { setSdkAssociated(modificator, dialog.associateWithProject()); } commitAndRefresh(modificator); if (pathChanged) { reloadSdk(currentSdk); } } } }