From dbd0a6a745eaa1345aed8b1383e97eb88ac90e5f Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 10 Dec 2024 17:28:13 +0100 Subject: Remove use of deprecated java.security.AccessController It's deprecated and marked for removal since Java 17. Change-Id: I6d0d4ac08f10cc73a409f202628a23faed4e5b36 --- .../internal/transport/sshd/auth/BasicAuthentication.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'org.eclipse.jgit.ssh.apache') 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 */ protected void askCredentials() { clearPassword(); - PasswordAuthentication auth = AccessController.doPrivileged( - (PrivilegedAction) () -> 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( -- cgit v1.2.3