code: public static void checkPackageAccess(Class<?> clazz) {
          checkPackageAccess(clazz.getName());
          if (isNonPublicProxyClass(clazz)) {
              checkProxyPackageAccess(clazz);
          }
      }
docs: Checks package access on the given class.
  
  If it is a {@link Proxy#isProxyClass(java.lang.Class)} that implements
  a non-public interface (i.e. may be in a non-restricted package),
  also check the package access on the proxy interfaces.