Re: java.net.URL
- From: Bob Smith <bobsmith1@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Jun 2005 13:14:55 +0200
Bjorn Borud wrote:
> [Bob Smith <bobsmith1@xxxxxxxxxxxxxxxxxx>]
> |
> | have a question, anyone a wiz on java.net.URL??
> | <code>
> | try{
> | SectionsHash = new HashMap();
> | SectionsHash.put("Background", new java.net.URL("...URL...") );
> | ...and many more rows...
> |
> | }catch( ... ){
> | ..something went wrong....
> | }
> | </code>
> |
> | creating URLs that way and putting them into a hash with key works
> | very well on windows, while on linux it hangs the program for a
> | minute sort of. Anyone experienced the same??What could be the
> | reason?? ( any help much appreciated )
>
> if for some reason the hashCode() of the URL gets called, that would
> trigger hostname resolution.
>
> -Bjørn
<code>
public void SetPage(){
String helpURL = G.GetSection( cmb.getSelectedItem().toString() );
if (helpURL != null) {
try {
Editor.setPage( new java.net.URL( "...url..." ) );
} catch (IOException ex) {
System.err.println("Attempted to read a bad URL: " +
helpURL);
}
} else {
System.err.println("Couldn't find URL:" + helpURL );
}
}
</code>
Hi again
tracked down the problem to this code snippet.
the linux box hangs for a minute in this function/method.
The reason is the URL constructor, what is time consuming there in htat
constructor?
help much appreciated.
G
--
http://www.kolumbus.fi/bob.smith
.
- Follow-Ups:
- Re: java.net.URL
- From: Andrew Thompson
- Re: java.net.URL
- From: Bjorn Borud
- Re: java.net.URL
- References:
- java.net.URL
- From: Bob Smith
- Re: java.net.URL
- From: Bjorn Borud
- java.net.URL
- Prev by Date: Re: equals and hashCode
- Next by Date: how should I use bean with Jsp & Servlets in an web-application?
- Previous by thread: Re: java.net.URL
- Next by thread: Re: java.net.URL
- Index(es):
Relevant Pages
|