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

@ -63,6 +63,7 @@ public final class VersionHelper {
// arbitrary URL code base
PrivilegedAction<String> act
= () -> System.getProperty("com.sun.jndi.ldap.object.trustURLCodebase", "false");
@SuppressWarnings("removal")
String trust = AccessController.doPrivileged(act);
TRUST_URL_CODE_BASE = "true".equalsIgnoreCase(trust);
}
@ -138,6 +139,7 @@ public final class VersionHelper {
* null if the property is not set, or if there is no permission
* to read it.
*/
@SuppressWarnings("removal")
String getJndiProperty(int i) {
PrivilegedAction<String> act = () -> {
try {
@ -163,6 +165,7 @@ public final class VersionHelper {
return null;
}
};
@SuppressWarnings("removal")
Properties sysProps = AccessController.doPrivileged(act);
if (sysProps == null) {
return null;
@ -196,6 +199,7 @@ public final class VersionHelper {
* Returns the resource of a given name associated with a particular
* class (never null), or null if none can be found.
*/
@SuppressWarnings("removal")
InputStream getResourceAsStream(Class<?> c, String name) {
PrivilegedAction<InputStream> act = () -> {
try {
@ -213,6 +217,7 @@ public final class VersionHelper {
*
* @param filename The file name, sans directory.
*/
@SuppressWarnings("removal")
InputStream getJavaHomeConfStream(String filename) {
PrivilegedAction<InputStream> act = () -> {
try {
@ -234,6 +239,7 @@ public final class VersionHelper {
* loader. Null represents the bootstrap class loader in some
* Java implementations.
*/
@SuppressWarnings("removal")
NamingEnumeration<InputStream> getResources(ClassLoader cl,
String name) throws IOException {
Enumeration<URL> urls;
@ -259,6 +265,7 @@ public final class VersionHelper {
* Please don't expose this method as public.
* @throws SecurityException if the class loader is not accessible
*/
@SuppressWarnings("removal")
ClassLoader getContextClassLoader() {
PrivilegedAction<ClassLoader> act = () -> {
@ -305,6 +312,7 @@ public final class VersionHelper {
* Returns the next InputStream, or null if there are no more.
* An InputStream that cannot be opened is skipped.
*/
@SuppressWarnings("removal")
private InputStream getNextElement() {
PrivilegedAction<InputStream> act = () -> {
while (urls.hasMoreElements()) {