/[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.20 by mark, Thu Nov 13 22:55:40 2003 UTC revision 1.21 by mkoch, Wed Nov 26 15:33:34 2003 UTC
# Line 422  public abstract class URLStreamHandler Line 422  public abstract class URLStreamHandler
422    {    {
423      String hostname = url.getHost ();      String hostname = url.getHost ();
424    
425      if (hostname == "")      if (hostname.equals(""))
426        return null;        return null;
427            
428      try      try
# Line 498  public abstract class URLStreamHandler Line 498  public abstract class URLStreamHandler
498          if (user != null && !"".equals(user))          if (user != null && !"".equals(user))
499            sb.append(user).append('@');            sb.append(user).append('@');
500          sb.append(host);          sb.append(host);
501        
502            // Append port if port was in URL spec.
503            if (port >= 0)
504              sb.append(':').append(port);
505        }        }
506    
     // Note that this produces different results from JDK 1.2 as JDK 1.2  
     // ignores a non-default port if host is null or "".  That is inconsistent  
     // with the spec since the result of this method is spec'ed so it can be  
     // used to construct a new URL that is equivalent to the original.  
     boolean port_needed = port > 0 && port != getDefaultPort();  
     if (port_needed)  
       sb.append(':').append(port);  
   
507      sb.append(file);      sb.append(file);
508    
509      if (ref != null)      if (ref != null)

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

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