mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rename setPassword to set
This commit is contained in:
@@ -82,7 +82,7 @@ class PasswordSafeImpl(/* public - backward compatibility */val settings: Passwo
|
||||
}
|
||||
}
|
||||
|
||||
override fun setPassword(attributes: CredentialAttributes, credentials: Credentials?, memoryOnly: Boolean) {
|
||||
override fun set(attributes: CredentialAttributes, credentials: Credentials?, memoryOnly: Boolean) {
|
||||
if (memoryOnly) {
|
||||
memoryHelperProvider.value.set(attributes, credentials)
|
||||
// remove to ensure that on getPassword we will not return some value from default provider
|
||||
|
||||
@@ -98,7 +98,7 @@ class OneTimeString @JvmOverloads constructor(value: CharArray, offset: Int = 0,
|
||||
}
|
||||
|
||||
if (!willBeCleared) {
|
||||
consumed.get()?.let { throw IllegalStateException("Already consumed at $it") }
|
||||
consumed.get()?.let { throw IllegalStateException("Already consumed: $it\n---\n") }
|
||||
}
|
||||
else if (!consumed.compareAndSet(null, ExceptionUtil.currentStackTrace())) {
|
||||
throw IllegalStateException("Already consumed at ${consumed.get()}")
|
||||
|
||||
@@ -27,7 +27,7 @@ public abstract class PasswordSafe implements PasswordStorage {
|
||||
return ServiceManager.getService(PasswordSafe.class);
|
||||
}
|
||||
|
||||
public abstract void setPassword(@NotNull CredentialAttributes attributes, @Nullable Credentials credentials, boolean memoryOnly);
|
||||
public abstract void set(@NotNull CredentialAttributes attributes, @Nullable Credentials credentials, boolean memoryOnly);
|
||||
|
||||
public abstract boolean isMemoryOnly();
|
||||
}
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ public class PasswordSafePromptDialog extends DialogWrapper {
|
||||
if (d.showAndGet()) {
|
||||
Credentials credentials = new Credentials(component.getUserName(), new OneTimeString(component.getPassword()));
|
||||
ref.set(credentials);
|
||||
ps.setPassword(CredentialAttributes(requestor, accountName), credentials, !component.isRememberSelected());
|
||||
ps.set(CredentialAttributes(requestor, accountName), credentials, !component.isRememberSelected());
|
||||
}
|
||||
}, ModalityState.any());
|
||||
Credentials credentials = ref.get();
|
||||
|
||||
@@ -173,7 +173,7 @@ class GitHttpGuiAuthenticator implements GitHttpAuthenticator {
|
||||
// save password
|
||||
if (myPasswordKey != null && myPassword != null) {
|
||||
Credentials credentials = new Credentials(myPasswordKey, new OneTimeString(myPassword));
|
||||
PasswordSafe.getInstance().setPassword(CredentialAttributes(PASS_REQUESTER, credentials.getUserName()), credentials, !mySaveOnDisk);
|
||||
PasswordSafe.getInstance().set(CredentialAttributes(PASS_REQUESTER, credentials.getUserName()), credentials, !mySaveOnDisk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ class HgCommandAuthenticator {
|
||||
ok = true;
|
||||
Credentials credentials = new Credentials(dialog.getUsername(), new OneTimeString(dialog.getPassword()));
|
||||
myCredentials = credentials;
|
||||
PasswordSafe.getInstance().setPassword(CredentialAttributes(HgCommandAuthenticator.class, keyForUrlAndLogin(url, credentials.getUserName())), credentials, !dialog.isRememberPassword());
|
||||
PasswordSafe.getInstance().set(CredentialAttributes(HgCommandAuthenticator.class, keyForUrlAndLogin(url, credentials.getUserName())), credentials, !dialog.isRememberPassword());
|
||||
hgGlobalSettings.addRememberedUrl(url, credentials.getUserName());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user