Hi Matt and Antoine,

While looking at your patch Antoine I had a look at the URLResource source code, and I think it would need some improvement about connection closing:
* your patch only takes care of closing the connection when calling getSize(), but I think it should be closed whenever it is opened.
* there is another type of URLConnection which needs to be closed: HttpURLConnection. We had problems with non closed HttpURLConnection in first versions of Ivy, and a user contributed a simple patch very similar to the one you have for closing a JarConnection.

Please find attached a patch solving these issues. Feel free to modify whatever you want or keep only a small part, I don't know Antinternals very well, so maybe what I've done is not very well designed. I've tried to compensate with some comments.

BTW this is my first patch to ant, feel free to tell me if I should use another channel to send it.

Regards,
  Xavier

On 9/19/06, Antoine Levy-Lambert <[EMAIL PROTECTED]> wrote:
Hi Matt,

I found this while trying to find out why some testcases leave stuff behind.
Google + the work of our velocity colleagues brought me a solution.
Maybe whe should close this close method also on isExists()

Regards,

Antoine

[EMAIL PROTECTED] wrote:
> Author: antoine
> Date: Tue Sep 19 20:51:10 2006
> New Revision: 448049
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=448049
> Log:
> add a close method for JarURLConnection, idea found in
> http://svn.apache.org/repos/asf/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java
>
> Modified:
>     ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to