Re: java.net.URL



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
.



Relevant Pages

  • Re: async pages and redirect
    ... After got the code snippet you provided, ... async components and manually create a ... experience "hangs" when running the new thread model under load (using ... when i switch to my old implementation (i have a simple switch that runs ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cant modify instance of a class from within the class!
    ... I now think that the reason why the program is stopping is because ... Each test hangs the program! ... ds.WriteXmlSchema and see if I can make the datacolumn null tolerant. ... to providing this functionality in the class. ...
    (microsoft.public.dotnet.languages.vb)
  • static member scope.
    ... Any specific reason of not giving acces to the static ... members of a class, from the objects of the class. ... Code Snippet: ...
    (microsoft.public.dotnet.framework)
  • RE: IE Hags When Try to Access Doc housed in WSS Site Document Lib
    ... The reason IE hangs MIGHT be because the time to fetch the necessary data by that particular web part took longer than expected. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Launch After Reset
    ... > I have a problem with a program for some reason & it hangs, I have to push ... > the reset button to get my ppc back & running. ...
    (microsoft.public.pocketpc)