mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8068184: Fix for JDK-8032832 caused a deadlock
Reviewed-by: dfuchs, chegar
This commit is contained in:
parent
6a7f775347
commit
09cc9f2b18
1 changed files with 1 additions and 28 deletions
|
@ -31,7 +31,6 @@ import java.net.Authenticator.RequestorType;
|
|||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import sun.net.www.HeaderParser;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
import static sun.net.www.protocol.http.AuthScheme.NEGOTIATE;
|
||||
import static sun.net.www.protocol.http.AuthScheme.KERBEROS;
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
@ -47,7 +46,6 @@ class NegotiateAuthentication extends AuthenticationInfo {
|
|||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 100L;
|
||||
private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
|
||||
|
||||
@SuppressWarnings("serial") // Not statically typed as Serializable
|
||||
private final HttpCallerInfo hci;
|
||||
|
@ -92,31 +90,6 @@ class NegotiateAuthentication extends AuthenticationInfo {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out if the HttpCallerInfo supports Negotiate protocol.
|
||||
* @return true if supported
|
||||
*/
|
||||
public static boolean isSupported(HttpCallerInfo hci) {
|
||||
ClassLoader loader = null;
|
||||
try {
|
||||
loader = Thread.currentThread().getContextClassLoader();
|
||||
} catch (SecurityException se) {
|
||||
if (logger.isLoggable(PlatformLogger.Level.FINER)) {
|
||||
logger.finer("NegotiateAuthentication: " +
|
||||
"Attempt to get the context class loader failed - " + se);
|
||||
}
|
||||
}
|
||||
|
||||
if (loader != null) {
|
||||
// Lock on the class loader instance to avoid the deadlock engaging
|
||||
// the lock in "ClassLoader.loadClass(String, boolean)" method.
|
||||
synchronized (loader) {
|
||||
return isSupportedImpl(hci);
|
||||
}
|
||||
}
|
||||
return isSupportedImpl(hci);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out if the HttpCallerInfo supports Negotiate protocol. In order to
|
||||
* find out yes or no, an initialization of a Negotiator object against it
|
||||
|
@ -128,7 +101,7 @@ class NegotiateAuthentication extends AuthenticationInfo {
|
|||
*
|
||||
* @return true if supported
|
||||
*/
|
||||
private static synchronized boolean isSupportedImpl(HttpCallerInfo hci) {
|
||||
synchronized public static boolean isSupported(HttpCallerInfo hci) {
|
||||
if (supported == null) {
|
||||
supported = new HashMap<>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue