[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: r31993 - JavaHL Path.isUrl method

From: Mark Phippard <markphip_at_gmail.com>
Date: Thu, 3 Jul 2008 21:04:58 -0400

On Thu, Jul 3, 2008 at 9:01 PM, Talden <talden_at_gmail.com> wrote:
>> Not sure if you have any plans for this method, but it is generally
>> not a good idea to use the java.net.URL class any more than necessary.
>> When you construct the class doesn't it try to make a connection to
>> the URL? It can make things very slow to use it.
>
> It shouldn't do anything when creating the URL
>
> List<URL> list = new ArrayList<URL>();
> for(int i = 0 ; i < 1000; i++) list.add(new URL("http://some_domain/" + i));
>
> That should execute much quicker than if it were testing the URL
> validity for each create.

I think it depends on your JVM, possibly the supplier, definitely the
version. Just Google it. For example:

http://www.symphonious.net/2007/03/29/javaneturl-or-javaneturi/

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-07-04 03:05:43 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.