src/share/classes/java/lang/SecurityManager.java

Print this page

        

*** 1673,1686 **** --- 1673,1694 ---- * * @exception SecurityException if the caller does not have * permission to access members. * @exception NullPointerException if the <code>clazz</code> argument is * <code>null</code>. + * + * @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. + * This method will be modified to throw {@code SecurityException} + * in a future release. Use the {@link #checkPermission} + * method instead to perform the appropriate permission check. + * * @see java.lang.reflect.Member * @since JDK1.1 * @see #checkPermission(java.security.Permission) checkPermission */ + @Deprecated public void checkMemberAccess(Class<?> clazz, int which) { if (clazz == null) { throw new NullPointerException("class can't be null"); } if (which != Member.PUBLIC) {