mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8266459: Implement JEP 411: Deprecate the Security Manager for Removal
Co-authored-by: Sean Mullan <mullan@openjdk.org> Co-authored-by: Lance Andersen <lancea@openjdk.org> Co-authored-by: Weijun Wang <weijun@openjdk.org> Reviewed-by: erikj, darcy, chegar, naoto, joehw, alanb, mchung, kcr, prr, lancea
This commit is contained in:
parent
19450b9951
commit
6765f90250
826 changed files with 2734 additions and 757 deletions
|
@ -228,6 +228,7 @@ public class MethodHandles {
|
|||
return new Lookup(targetClass);
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null) sm.checkPermission(ACCESS_PERMISSION);
|
||||
if (targetClass.isPrimitive())
|
||||
|
@ -440,6 +441,7 @@ public class MethodHandles {
|
|||
* @since 1.8
|
||||
*/
|
||||
public static <T extends Member> T reflectAs(Class<T> expected, MethodHandle target) {
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager smgr = System.getSecurityManager();
|
||||
if (smgr != null) smgr.checkPermission(ACCESS_PERMISSION);
|
||||
Lookup lookup = Lookup.IMPL_LOOKUP; // use maximally privileged lookup
|
||||
|
@ -1845,6 +1847,7 @@ public class MethodHandles {
|
|||
if (allowedModes == TRUSTED) return;
|
||||
|
||||
if (!hasFullPrivilegeAccess()) {
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
if (sm != null)
|
||||
sm.checkPermission(new RuntimePermission("defineClass"));
|
||||
|
@ -3740,6 +3743,7 @@ return mh1;
|
|||
void checkSecurityManager(Class<?> refc) {
|
||||
if (allowedModes == TRUSTED) return;
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager smgr = System.getSecurityManager();
|
||||
if (smgr == null) return;
|
||||
|
||||
|
@ -3771,6 +3775,7 @@ return mh1;
|
|||
|
||||
if (allowedModes == TRUSTED) return;
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
SecurityManager smgr = System.getSecurityManager();
|
||||
if (smgr == null) return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue