diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2024-12-10 17:28:13 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2024-12-10 17:28:13 +0100 |
commit | dbd0a6a745eaa1345aed8b1383e97eb88ac90e5f (patch) | |
tree | 696e5378dcd922e296c9032e8062623252c6b3a2 | |
parent | 6caf5c8693282a88adf32fbff278e2cd08d1d2a4 (diff) | |
download | jgit-dbd0a6a745eaa1345aed8b1383e97eb88ac90e5f.tar.gz jgit-dbd0a6a745eaa1345aed8b1383e97eb88ac90e5f.zip |
Remove use of deprecated java.security.AccessController
It's deprecated and marked for removal since Java 17.
Change-Id: I6d0d4ac08f10cc73a409f202628a23faed4e5b36
-rw-r--r-- | org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/auth/BasicAuthentication.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/auth/BasicAuthentication.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/auth/BasicAuthentication.java index 8866976c89..3e1fab34d9 100644 --- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/auth/BasicAuthentication.java +++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/auth/BasicAuthentication.java @@ -17,8 +17,6 @@ import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.nio.ByteBuffer; import java.nio.CharBuffer; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.util.Arrays; import java.util.concurrent.CancellationException; @@ -113,13 +111,12 @@ public abstract class BasicAuthentication<ParameterType, TokenType> */ protected void askCredentials() { clearPassword(); - PasswordAuthentication auth = AccessController.doPrivileged( - (PrivilegedAction<PasswordAuthentication>) () -> Authenticator - .requestPasswordAuthentication(proxy.getHostString(), - proxy.getAddress(), proxy.getPort(), - SshConstants.SSH_SCHEME, - SshdText.get().proxyPasswordPrompt, "Basic", //$NON-NLS-1$ - null, RequestorType.PROXY)); + PasswordAuthentication auth = Authenticator + .requestPasswordAuthentication(proxy.getHostString(), + proxy.getAddress(), proxy.getPort(), + SshConstants.SSH_SCHEME, + SshdText.get().proxyPasswordPrompt, "Basic", //$NON-NLS-1$ + null, RequestorType.PROXY); if (auth == null) { user = ""; //$NON-NLS-1$ throw new CancellationException( |