/[classpath]/classpath/java/net/URLStreamHandler.java
ViewVC logotype

Diff of /classpath/java/net/URLStreamHandler.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30.2.4 by gnu_andrew, Tue Sep 20 18:46:29 2005 UTC revision 1.30.2.5 by gnu_andrew, Wed Nov 2 00:43:35 2005 UTC
# Line 411  public abstract class URLStreamHandler Line 411  public abstract class URLStreamHandler
411     * @param url2 The second URL.     * @param url2 The second URL.
412     *     *
413     * @return True if both URLs contain the same host.     * @return True if both URLs contain the same host.
    *  
    * @exception UnknownHostException If an unknown host is found  
414     */     */
415    protected boolean hostsEqual(URL url1, URL url2)    protected boolean hostsEqual(URL url1, URL url2)
416    {    {
# Line 517  public abstract class URLStreamHandler Line 515  public abstract class URLStreamHandler
515          sb.append(":");          sb.append(":");
516        }        }
517            
518      if (authority.length() != 0)      // If we have superfluous leading slashes (that means, at least 2)
519        {      // we always add the authority component ("//" + host) to
520          sb.append("//").append(authority);      // avoid ambiguity. Otherwise we would generate an URL like
521        }      // proto://home/foo
522        // where we meant:
523      sb.append(file);      // host: <empty> - file: //home/foo
524        // but URL spec says it is:
525        // host: home - file: /foo
526        if (authority.length() != 0 || file.startsWith("//") )
527          sb.append("//").append(authority).append(file);
528        else
529          sb.append(file);
530    
531      if (ref != null)      if (ref != null)
532        sb.append('#').append(ref);        sb.append('#').append(ref);

Legend:
Removed from v.1.30.2.4  
changed lines
  Added in v.1.30.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26