# HG changeset patch # User mullan # Date 1470059916 14400 # Node ID bec759b9b909bcf8aa07381560a869caaa333e80 # Parent 8d74d858fe752596f4ed9ea65ff4229f852c911d 8161506: Deprecate pre-1.2 SecurityManager methods and fields with forRemoval=true Reviewed-by: coleenp, jnimeh, xuelei diff -r 8d74d858fe75 -r bec759b9b909 jdk/src/java.base/share/classes/java/lang/SecurityManager.java --- a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java Mon Aug 01 15:55:54 2016 +0900 +++ b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java Mon Aug 01 09:58:36 2016 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2016, 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 @@ -227,9 +227,10 @@ * * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This field is subject to removal in a + * future version of Java SE. */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected boolean inCheck; /* @@ -260,9 +261,10 @@ * @see java.lang.SecurityManager#inCheck * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This method is subject to removal in a + * future version of Java SE. */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) public boolean getInCheck() { return inCheck; } @@ -340,12 +342,13 @@ * * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This method is subject to removal in a + * future version of Java SE. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected ClassLoader currentClassLoader() { ClassLoader cl = currentClassLoader0(); if ((cl != null) && hasAllPermission()) @@ -386,12 +389,13 @@ * * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This method is subject to removal in a + * future version of Java SE. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected Class currentLoadedClass() { Class c = currentLoadedClass0(); if ((c != null) && hasAllPermission()) @@ -408,10 +412,10 @@ * -1 if such a frame cannot be found. * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. - * + * call be used instead. This method is subject to removal in a + * future version of Java SE. */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected native int classDepth(String name); /** @@ -444,12 +448,13 @@ * * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This method is subject to removal in a + * future version of Java SE. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected int classLoaderDepth() { int depth = classLoaderDepth0(); if (depth != -1) { @@ -472,9 +477,10 @@ * name is on the execution stack; false otherwise. * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This method is subject to removal in a + * future version of Java SE. */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected boolean inClass(String name) { return classDepth(name) >= 0; } @@ -488,10 +494,11 @@ * * @deprecated This type of security checking is not recommended. * It is recommended that the checkPermission - * call be used instead. + * call be used instead. This method is subject to removal in a + * future version of Java SE. * @see #currentClassLoader() currentClassLoader */ - @Deprecated(since="1.2") + @Deprecated(since="1.2", forRemoval=true) protected boolean inClassLoader() { return currentClassLoader() != null; }