On 2010-09-27, <bode...@apache.org> wrote:

> according to the javadocs of JarURLConnection the separator is !/ not
> ! - this allows dealing with jars in directories that contain a ! in
> their name, as long as it is not at the end of the directory name.

This deals with splitting jar:file:somwhere/jar.file!/some/resource into
the jar's URL and the relative resource.  We used to split at
indexOf("!") and the code now splits at indexOf("!/") which is the
official separator.

Two things to note:

 (1) there is a disabled testcase for when "somewhere" in the URL above
   ends with a "!".  Classloader.getResources("something") happily
   returns an URL that JarURLConnection cannot deal with - it looks as
   if Sun's code was performing the same naive indexOf("!/") that our
   code now uses.

   I'm not conviced that we can fix that (we could try to figure out the
   file part in special cases like the <taskdef> test and perform
   %-escaping if that works) or that we even want to.

 (2) The new tests create JARs that will be loaded by a classloader -
   which means Ant cannot delete them because they remain locked until
   the JVM has exited.  This means the tests accumulate a lot of garbage
   in ${TEMP} over time.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to