mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8343981: Remove usage of security manager from Thread and related classes
Reviewed-by: rriggs, yzheng
This commit is contained in:
parent
dbf23466af
commit
5e01c40b19
10 changed files with 54 additions and 282 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,8 +25,6 @@
|
|||
|
||||
package com.sun.jndi.ldap;
|
||||
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
@ -109,14 +107,8 @@ public final class VersionHelper {
|
|||
return Class.forName(className, true, getContextClassLoader());
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
Thread createThread(Runnable r) {
|
||||
AccessControlContext acc = AccessController.getContext();
|
||||
// 4290486: doPrivileged is needed to create a thread in
|
||||
// an environment that restricts "modifyThreadGroup".
|
||||
PrivilegedAction<Thread> act =
|
||||
() -> SharedSecrets.getJavaLangAccess().newThreadWithAcc(r, acc);
|
||||
return AccessController.doPrivileged(act);
|
||||
return new Thread(r);
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue