commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <>
Subject [classscan] new URL(xxx) and it's problems
Date Wed, 06 Jun 2012 20:13:40 GMT

I've now looked through both impls and both share some very similar API classes obviously
(MetaClass, MetaField, etc). Details are different, but I think we can extract a common API.

One thing I figured while looking at the code is that some parts are full with URI handling
instead of URL.
The problem with this is that an URI#toURL() internally does a new URL(uri.toString()); 

Now the problem hereby is that on some systems a 

URL u = someResource.getURL();
URL u2 = new URL(u.toExternalForm());

doesn't work. Those methods are just not reflexive on some systems. 

This happens often if VFS are involved (e.g. on JBossAS4,5,6, WebLogic, etc) and even in general
on some OS (Solaris 10.5/Sparc). 

The only way I know to cope with it is to _not_ only store the String representation but the
URL itself. This sucks big times as well, because URL is a class which escaped from hell -
doing DNS lookup on equals() and other weird things *shudder* - but I don't know of any better
way :(

Any tip is welcome.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message