code: protected void setURL(URL u, String protocol, String host, int port,
                               String authority, String userInfo, String path,
                               String query, String ref) {
          try {
            if (this != u.getHandler()) {
                throw new SecurityException("handler for url different from " +
                                            "this handler");
            }
          } catch (MalformedURLException e) {
            // Ignore.
          }
          // ensure that no one can reset the protocol on a given URL.
          u.set(u.getProtocol(), host, port, authority, userInfo, path, query, ref);
      }
docs: Sets the fields of the {@code URL} argument to the indicated values.
  Only classes derived from URLStreamHandler are able
  to use this method to set the values of the URL fields.
  
  @param   u         the URL to modify.
  @param   protocol  the protocol name.
  @param   host      the remote host value for the URL.
  @param   port      the port on the remote machine.
  @param   authority the authority part for the URL.
  @param   userInfo the userInfo part of the URL.
  @param   path      the path component of the URL.
  @param   query     the query part for the URL.
  @param   ref       the reference.
  @exception       SecurityException       if the protocol handler of the URL is
  different from this one
  @see     java.net.URL#set(java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)
  @since 1.3