public void parseURL(URL u,String spec,int start,int limit){
  String protocol=u.getProtocol();
  String host="";
  int port=u.getPort();
  String file="";
  if (start < limit) {
    file=spec.substring(start,limit);
  }
  boolean nogood=false;
  if (file == null || file.equals(""))   nogood=true;
 else {
    boolean allwhites=true;
    for (int i=0; i < file.length(); i++)     if (!Character.isWhitespace(file.charAt(i)))     allwhites=false;
    if (allwhites)     nogood=true;
  }
  if (nogood)   throw new RuntimeException("No email address");
  setURLHandler(u,protocol,host,port,file,null);
}

public void parseURL ( URL u , String spec , int start , int limit ) { String protocol = u . getProtocol ( ) ; String host = "" ; int port = u . getPort ( ) ; String file = "" ; if ( start < limit ) { file = spec . substring ( start , limit ) ; } boolean nogood = false ; if ( file == null || file . equals ( "" ) ) nogood = true ; else { boolean allwhites = true ; for ( int i = 0 ; i < file . length ( ) ; i ++ ) if ( ! Character . isWhitespace ( file . charAt ( i ) ) ) allwhites = false ; if ( allwhites ) nogood = true ; } if ( nogood ) throw new RuntimeException ( "No email address" ) ; setURLHandler ( u , protocol , host , port , file , null ) ; }
this method is called to parse the string spec into url u for a mailto protocol .
