From fcfd51da09388a670bb86ee79e3b94632af8af2d Mon Sep 17 00:00:00 2001 From: Vyacheslav Karpukhin Date: Tue, 18 Nov 2025 14:44:02 +0100 Subject: [PATCH] IJPL-218996 IDE does not save passwords - ClassCastException RemotePasswordSafeImpl to PasswordSafeImpl GitOrigin-RevId: b2cf87d36c9fb2d0aee760044395d631f9475a38 --- .../credential-store-ui/src/PasswordSafeConfigurable.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/credential-store-ui/src/PasswordSafeConfigurable.kt b/platform/credential-store-ui/src/PasswordSafeConfigurable.kt index 81b3c76950dd..0e9e03b0f0f5 100644 --- a/platform/credential-store-ui/src/PasswordSafeConfigurable.kt +++ b/platform/credential-store-ui/src/PasswordSafeConfigurable.kt @@ -7,7 +7,7 @@ import com.intellij.credentialStore.kdbx.IncorrectMainPasswordException import com.intellij.credentialStore.keePass.* import com.intellij.ide.IdeBundle import com.intellij.ide.passwordSafe.PasswordSafe -import com.intellij.ide.passwordSafe.impl.PasswordSafeImpl +import com.intellij.ide.passwordSafe.impl.BasePasswordSafe import com.intellij.ide.passwordSafe.impl.createPersistentCredentialStore import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent @@ -102,11 +102,11 @@ class PasswordSafeConfigurableUi(private val settings: PasswordSafeSettings) : C panel.apply() val providerType = this.settings.providerType + val passwordSafe = PasswordSafe.instance as BasePasswordSafe // close if any, it is more reliable just close current store and later it will be recreated lazily with a new settings - (PasswordSafe.instance as PasswordSafeImpl).closeCurrentStore(isSave = false, isEvenMemoryOnly = providerType != ProviderType.MEMORY_ONLY) + passwordSafe.closeCurrentStore(isSave = false, isEvenMemoryOnly = providerType != ProviderType.MEMORY_ONLY) - val passwordSafe = PasswordSafe.instance as PasswordSafeImpl if (oldProviderType != providerType) { when (providerType) { ProviderType.MEMORY_ONLY -> { @@ -338,5 +338,5 @@ class PasswordSafeConfigurableUi(private val settings: PasswordSafeSettings) : C // we must save and close opened KeePass database before any action that can modify KeePass database files private fun closeCurrentStore() { - (PasswordSafe.instance as PasswordSafeImpl).closeCurrentStore(isSave = true, isEvenMemoryOnly = false) + (PasswordSafe.instance as BasePasswordSafe).closeCurrentStore(isSave = true, isEvenMemoryOnly = false) }