/[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.35.2.4 by gnu_andrew, Sun Jan 16 02:14:48 2005 UTC revision 1.35.2.5 by gnu_andrew, Sun Jan 16 15:15:12 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();
# Line 901  public final class URL implements Serial Line 900  public final class URL implements Serial
900                  Class c = Class.forName(clsName, true, systemClassLoader);                  Class c = Class.forName(clsName, true, systemClassLoader);
901                  ph = (URLStreamHandler) c.newInstance();                  ph = (URLStreamHandler) c.newInstance();
902                }                }
903                catch (ThreadDeath death)
904                  {
905                    throw death;
906                  }
907              catch (Throwable t) { /* ignored */ }              catch (Throwable t) { /* ignored */ }
908            }            }
909           while (ph == null && pkgPrefix.hasMoreTokens());           while (ph == null && pkgPrefix.hasMoreTokens());

Legend:
Removed from v.1.35.2.4  
changed lines
  Added in v.1.35.2.5

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