< prev index next >
src/java.base/share/classes/java/lang/SecurityManager.java
Print this page
rev 14117 : 8145468: update java.lang APIs with new deprecations
Reviewed-by: XXX
@@ -227,11 +227,11 @@
*
* @deprecated This type of security checking is not recommended.
* It is recommended that the <code>checkPermission</code>
* call be used instead.
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected boolean inCheck;
/*
* Have we been initialized. Effective against finalizer attacks.
*/
@@ -260,11 +260,11 @@
* @see java.lang.SecurityManager#inCheck
* @deprecated This type of security checking is not recommended.
* It is recommended that the <code>checkPermission</code>
* call be used instead.
*/
- @Deprecated
+ @Deprecated(since="1.2")
public boolean getInCheck() {
return inCheck;
}
/**
@@ -343,11 +343,11 @@
* call be used instead.
*
* @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected ClassLoader currentClassLoader() {
ClassLoader cl = currentClassLoader0();
if ((cl != null) && hasAllPermission())
cl = null;
return cl;
@@ -389,11 +389,11 @@
* call be used instead.
*
* @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected Class<?> currentLoadedClass() {
Class<?> c = currentLoadedClass0();
if ((c != null) && hasAllPermission())
c = null;
return c;
@@ -409,11 +409,11 @@
* @deprecated This type of security checking is not recommended.
* It is recommended that the <code>checkPermission</code>
* call be used instead.
*
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected native int classDepth(String name);
/**
* Returns the stack depth of the most recently executing method
* from a class defined using a non-system class loader. A non-system
@@ -447,11 +447,11 @@
* call be used instead.
*
* @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected int classLoaderDepth() {
int depth = classLoaderDepth0();
if (depth != -1) {
if (hasAllPermission())
depth = -1;
@@ -472,11 +472,11 @@
* name is on the execution stack; <code>false</code> otherwise.
* @deprecated This type of security checking is not recommended.
* It is recommended that the <code>checkPermission</code>
* call be used instead.
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected boolean inClass(String name) {
return classDepth(name) >= 0;
}
/**
@@ -489,11 +489,11 @@
* @deprecated This type of security checking is not recommended.
* It is recommended that the <code>checkPermission</code>
* call be used instead.
* @see #currentClassLoader() currentClassLoader
*/
- @Deprecated
+ @Deprecated(since="1.2")
protected boolean inClassLoader() {
return currentClassLoader() != null;
}
/**
@@ -1215,11 +1215,11 @@
* <code>null</code>.
* @since 1.1
* @deprecated Use #checkPermission(java.security.Permission) instead
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.4")
public void checkMulticast(InetAddress maddr, byte ttl) {
String host = maddr.getHostAddress();
if (!host.startsWith("[") && host.indexOf(':') != -1) {
host = "[" + host + "]";
}
@@ -1295,13 +1295,14 @@
* {@code null}.
* @deprecated This method was originally used to check if the calling thread
* was trusted to bring up a top-level window. The method has been
* obsoleted and code should instead use {@link #checkPermission}
* to check {@code AWTPermission("showWindowWithoutWarningBanner")}.
+ * This method is subject to removal in a future version of Java SE.
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.8", forRemoval=true)
public boolean checkTopLevelWindow(Object window) {
if (window == null) {
throw new NullPointerException("window can't be null");
}
return hasAllPermission();
@@ -1338,13 +1339,14 @@
* {@code AllPermission}
* @deprecated This method was originally used to check if the calling
* thread could access the system clipboard. The method has been
* obsoleted and code should instead use {@link #checkPermission}
* to check {@code AWTPermission("accessClipboard")}.
+ * This method is subject to removal in a future version of Java SE.
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.8", forRemoval=true)
public void checkSystemClipboardAccess() {
checkPermission(SecurityConstants.ALL_PERMISSION);
}
/**
@@ -1356,13 +1358,14 @@
* {@code AllPermission}
* @deprecated This method was originally used to check if the calling
* thread could access the AWT event queue. The method has been
* obsoleted and code should instead use {@link #checkPermission}
* to check {@code AWTPermission("accessEventQueue")}.
+ * This method is subject to removal in a future version of Java SE.
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.8", forRemoval=true)
public void checkAwtEventQueueAccess() {
checkPermission(SecurityConstants.ALL_PERMISSION);
}
/*
@@ -1624,16 +1627,17 @@
* @deprecated This method relies on the caller being at a stack depth
* of 4 which is error-prone and cannot be enforced by the runtime.
* Users of this method should instead invoke {@link #checkPermission}
* directly. This method will be changed in a future release
* to check the permission {@code java.security.AllPermission}.
+ * This method is subject to removal in a future version of Java SE.
*
* @see java.lang.reflect.Member
* @since 1.1
* @see #checkPermission(java.security.Permission) checkPermission
*/
- @Deprecated
+ @Deprecated(since="1.8", forRemoval=true)
@CallerSensitive
public void checkMemberAccess(Class<?> clazz, int which) {
if (clazz == null) {
throw new NullPointerException("class can't be null");
}
< prev index next >