/[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.10 by mark, Fri Nov 22 02:42:26 2002 UTC revision 1.11 by mark, Fri Nov 22 18:55:17 2002 UTC
# Line 241  getURLStreamHandler(String protocol) Line 241  getURLStreamHandler(String protocol)
241    if (factory != null)    if (factory != null)
242      {      {
243        ph = factory.createURLStreamHandler(protocol);        ph = factory.createURLStreamHandler(protocol);
244        if (ph == null)        if (ph != null)
245          return null;          {
246              if (cache_handlers)
247                ph_cache.put(protocol, ph.getClass());
248    
249        if (cache_handlers)            return(ph);
250          ph_cache.put(protocol, ph.getClass());          }
   
       return(ph);  
251      }      }
252    
253    // Finally loop through our search path looking for a match    // Finally loop through our search path looking for a match
# Line 587  getURLStreamHandler(String protocol) Line 587  getURLStreamHandler(String protocol)
587     */     */
588    public String getPath()    public String getPath()
589    {    {
590      int quest = file.indexOf('?');      int quest = (file == null) ? -1 : file.indexOf('?');
591      return quest < 0 ? file : file.substring(0, quest);      return quest < 0 ? getFile() : file.substring(0, quest);
592    }    }
593    
594    /**    /**
# Line 659  getURLStreamHandler(String protocol) Line 659  getURLStreamHandler(String protocol)
659     */     */
660    public String getUserInfo ()    public String getUserInfo ()
661    {    {
662      int at = host.indexOf('@');      int at = (host == null) ? -1 : host.indexOf('@');
663      return at < 0 ? null : host.substring(0, at);      return at < 0 ? null : host.substring(0, at);
664    }    }
665    
# Line 671  getURLStreamHandler(String protocol) Line 671  getURLStreamHandler(String protocol)
671     */     */
672    public String getQuery ()    public String getQuery ()
673    {    {
674      int quest = file.indexOf('?');      int quest = (file == null) ? -1 : file.indexOf('?');
675      return quest < 0 ? null : file.substring(quest + 1, file.length());      return quest < 0 ? null : file.substring(quest + 1, file.length());
676    }    }
677    

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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