< 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,237 **** * * @deprecated This type of security checking is not recommended. * It is recommended that the <code>checkPermission</code> * call be used instead. */ ! @Deprecated protected boolean inCheck; /* * Have we been initialized. Effective against finalizer attacks. */ --- 227,237 ---- * * @deprecated This type of security checking is not recommended. * It is recommended that the <code>checkPermission</code> * call be used instead. */ ! @Deprecated(since="1.2") protected boolean inCheck; /* * Have we been initialized. Effective against finalizer attacks. */
*** 260,270 **** * @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 public boolean getInCheck() { return inCheck; } /** --- 260,270 ---- * @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(since="1.2") public boolean getInCheck() { return inCheck; } /**
*** 343,353 **** * call be used instead. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated protected ClassLoader currentClassLoader() { ClassLoader cl = currentClassLoader0(); if ((cl != null) && hasAllPermission()) cl = null; return cl; --- 343,353 ---- * call be used instead. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated(since="1.2") protected ClassLoader currentClassLoader() { ClassLoader cl = currentClassLoader0(); if ((cl != null) && hasAllPermission()) cl = null; return cl;
*** 389,399 **** * call be used instead. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated protected Class<?> currentLoadedClass() { Class<?> c = currentLoadedClass0(); if ((c != null) && hasAllPermission()) c = null; return c; --- 389,399 ---- * call be used instead. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated(since="1.2") protected Class<?> currentLoadedClass() { Class<?> c = currentLoadedClass0(); if ((c != null) && hasAllPermission()) c = null; return c;
*** 409,419 **** * @deprecated This type of security checking is not recommended. * It is recommended that the <code>checkPermission</code> * call be used instead. * */ ! @Deprecated 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 --- 409,419 ---- * @deprecated This type of security checking is not recommended. * It is recommended that the <code>checkPermission</code> * call be used instead. * */ ! @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,457 **** * call be used instead. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated protected int classLoaderDepth() { int depth = classLoaderDepth0(); if (depth != -1) { if (hasAllPermission()) depth = -1; --- 447,457 ---- * call be used instead. * * @see java.lang.ClassLoader#getSystemClassLoader() getSystemClassLoader * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated(since="1.2") protected int classLoaderDepth() { int depth = classLoaderDepth0(); if (depth != -1) { if (hasAllPermission()) depth = -1;
*** 472,482 **** * 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 protected boolean inClass(String name) { return classDepth(name) >= 0; } /** --- 472,482 ---- * 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(since="1.2") protected boolean inClass(String name) { return classDepth(name) >= 0; } /**
*** 489,499 **** * @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 protected boolean inClassLoader() { return currentClassLoader() != null; } /** --- 489,499 ---- * @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(since="1.2") protected boolean inClassLoader() { return currentClassLoader() != null; } /**
*** 1215,1225 **** * <code>null</code>. * @since 1.1 * @deprecated Use #checkPermission(java.security.Permission) instead * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated public void checkMulticast(InetAddress maddr, byte ttl) { String host = maddr.getHostAddress(); if (!host.startsWith("[") && host.indexOf(':') != -1) { host = "[" + host + "]"; } --- 1215,1225 ---- * <code>null</code>. * @since 1.1 * @deprecated Use #checkPermission(java.security.Permission) instead * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated(since="1.4") public void checkMulticast(InetAddress maddr, byte ttl) { String host = maddr.getHostAddress(); if (!host.startsWith("[") && host.indexOf(':') != -1) { host = "[" + host + "]"; }
*** 1295,1307 **** * {@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")}. * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated public boolean checkTopLevelWindow(Object window) { if (window == null) { throw new NullPointerException("window can't be null"); } return hasAllPermission(); --- 1295,1308 ---- * {@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(since="1.8", forRemoval=true) public boolean checkTopLevelWindow(Object window) { if (window == null) { throw new NullPointerException("window can't be null"); } return hasAllPermission();
*** 1338,1350 **** * {@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")}. * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated public void checkSystemClipboardAccess() { checkPermission(SecurityConstants.ALL_PERMISSION); } /** --- 1339,1352 ---- * {@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(since="1.8", forRemoval=true) public void checkSystemClipboardAccess() { checkPermission(SecurityConstants.ALL_PERMISSION); } /**
*** 1356,1368 **** * {@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")}. * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated public void checkAwtEventQueueAccess() { checkPermission(SecurityConstants.ALL_PERMISSION); } /* --- 1358,1371 ---- * {@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(since="1.8", forRemoval=true) public void checkAwtEventQueueAccess() { checkPermission(SecurityConstants.ALL_PERMISSION); } /*
*** 1624,1639 **** * @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}. * * @see java.lang.reflect.Member * @since 1.1 * @see #checkPermission(java.security.Permission) checkPermission */ ! @Deprecated @CallerSensitive public void checkMemberAccess(Class<?> clazz, int which) { if (clazz == null) { throw new NullPointerException("class can't be null"); } --- 1627,1643 ---- * @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(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 >