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:
Weijun Wang 2021-06-02 11:57:31 +00:00
parent 19450b9951
commit 6765f90250
826 changed files with 2734 additions and 757 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -353,6 +353,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* <P>
* @throws SQLException if an error occurs
*/
@SuppressWarnings("removal")
public CachedRowSetImpl() throws SQLException {
try {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2021, 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
@ -195,7 +195,7 @@ public class RowSetProvider {
}
try {
ReflectUtil.checkPackageAccess(factoryClassName);
} catch (java.security.AccessControlException e) {
} catch (@SuppressWarnings("removal") java.security.AccessControlException e) {
throw new SQLException("Access Exception",e);
}
@ -225,6 +225,7 @@ public class RowSetProvider {
* @return The ClassLoader to use.
*
*/
@SuppressWarnings("removal")
static private ClassLoader getContextClassLoader() throws SecurityException {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@ -308,6 +309,7 @@ public class RowSetProvider {
* @return The System property value or NULL if the property does not exist
* or a {@code SecurityException} occurs.
*/
@SuppressWarnings("removal")
static private String getSystemProperty(final String propName) {
String property = null;
try {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -136,6 +136,7 @@ public class SerialJavaObject implements Serializable, Cloneable {
public Field[] getFields() throws SerialException {
if (fields != null) {
Class<?> c = this.obj.getClass();
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
/*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
@ -328,6 +328,7 @@ public class SyncFactory {
private static String colon = ":";
private static String strFileSep = "/";
@SuppressWarnings("removal")
private static synchronized void initMapIfNecessary() throws SyncFactoryException {
// Local implementation class names and keys from Properties
@ -564,7 +565,7 @@ public class SyncFactory {
try {
ReflectUtil.checkPackageAccess(providerID);
} catch (java.security.AccessControlException e) {
} catch (@SuppressWarnings("removal") java.security.AccessControlException e) {
SyncFactoryException sfe = new SyncFactoryException();
sfe.initCause(e);
throw sfe;
@ -636,6 +637,7 @@ public class SyncFactory {
*/
public static void setLogger(Logger logger) {
@SuppressWarnings("removal")
SecurityManager sec = System.getSecurityManager();
if (sec != null) {
sec.checkPermission(SET_SYNCFACTORY_PERMISSION);
@ -673,6 +675,7 @@ public class SyncFactory {
*/
public static void setLogger(Logger logger, Level level) {
// singleton
@SuppressWarnings("removal")
SecurityManager sec = System.getSecurityManager();
if (sec != null) {
sec.checkPermission(SET_SYNCFACTORY_PERMISSION);
@ -723,6 +726,7 @@ public class SyncFactory {
*/
public static synchronized void setJNDIContext(javax.naming.Context ctx)
throws SyncFactoryException {
@SuppressWarnings("removal")
SecurityManager sec = System.getSecurityManager();
if (sec != null) {
sec.checkPermission(SET_SYNCFACTORY_PERMISSION);