code: public static void checkPackageAccess(String name) {
          SecurityManager s = System.getSecurityManager();
          if (s != null) {
              String cname = name.replace('/', '.');
              if (cname.startsWith("[")) {
                  int b = cname.lastIndexOf('[') + 2;
                  if (b > 1 && b < cname.length()) {
                      cname = cname.substring(b);
                  }
              }
              int i = cname.lastIndexOf('.');
              if (i != -1) {
                  s.checkPackageAccess(cname.substring(0, i));
              }
          }
      }
docs: Checks package access on the given classname.
  This method is typically called when the Class instance is not
  available and the caller attempts to load a class on behalf
  the true caller (application).