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

Diff of /classpath/java/net/URL.java

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

revision 1.41 by jfrijters, Thu Dec 2 13:17:21 2004 UTC revision 1.42 by mkoch, Tue Jan 11 20:42:29 2005 UTC
# Line 392  public final class URL implements Serial Line 392  public final class URL implements Serial
392      // right after the "://".  The second colon is for an optional port value      // right after the "://".  The second colon is for an optional port value
393      // and implies that the host from the context is used if available.      // and implies that the host from the context is used if available.
394      int colon;      int colon;
395        int slash = spec.indexOf('/');
396      if ((colon = spec.indexOf("://", 1)) > 0      if ((colon = spec.indexOf("://", 1)) > 0
397            && ((colon < slash || slash < 0))
398          && ! spec.regionMatches(colon, "://:", 0, 4))          && ! spec.regionMatches(colon, "://:", 0, 4))
399        context = null;        context = null;
400    
     int slash;  
401      if ((colon = spec.indexOf(':')) > 0      if ((colon = spec.indexOf(':')) > 0
402          && (colon < (slash = spec.indexOf('/')) || slash < 0))          && (colon < slash || slash < 0))
403        {        {
404          // Protocol specified in spec string.          // Protocol specified in spec string.
405          protocol = spec.substring(0, colon).toLowerCase();          protocol = spec.substring(0, colon).toLowerCase();
# Line 429  public final class URL implements Serial Line 430  public final class URL implements Serial
430          authority = context.authority;          authority = context.authority;
431        }        }
432      else // Protocol NOT specified in spec. and no context available.      else // Protocol NOT specified in spec. and no context available.
   
   
433        throw new MalformedURLException("Absolute URL required with null context");        throw new MalformedURLException("Absolute URL required with null context");
434    
435      protocol = protocol.trim();      protocol = protocol.trim();

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

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