code: public static void checkProxyPackageAccess(ClassLoader ccl,
                                                 Class<?>... interfaces)
      {
          SecurityManager sm = System.getSecurityManager();
          if (sm != null) {
              for (Class<?> intf : interfaces) {
                  ClassLoader cl = intf.getClassLoader();
                  if (needsPackageAccessCheck(ccl, cl)) {
                      checkPackageAccess(intf);
                  }
              }
          }
      }
docs: Access check on the interfaces that a proxy class implements and throw
  {@code SecurityException} if it accesses a restricted package from
  the caller's class loader.
  
  @param ccl the caller's class loader
  @param interfaces the list of interfaces that a proxy class implements