code: public synchronized static void setDefault(Authenticator a) {
          SecurityManager sm = System.getSecurityManager();
          if (sm != null) {
              NetPermission setDefaultPermission
                  = new NetPermission("setDefaultAuthenticator");
              sm.checkPermission(setDefaultPermission);
          }
  
          theAuthenticator = a;
      }
docs: Sets the authenticator that will be used by the networking code
  when a proxy or an HTTP server asks for authentication.
  <p>
  First, if there is a security manager, its {@code checkPermission}
  method is called with a
  {@code NetPermission("setDefaultAuthenticator")} permission.
  This may result in a java.lang.SecurityException.
  
  @param   a       The authenticator to be set. If a is {@code null} then
  any previously set authenticator is removed.
  
  @throws SecurityException
  if a security manager exists and its
  {@code checkPermission} method doesn't allow
  setting the default authenticator.
  
  @see SecurityManager#checkPermission
  @see java.net.NetPermission