ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: svn commit: r448049 - /ant/core/trunk/src/main/org/apache/tools/ant/types/resources/URLResource.java
Date Thu, 21 Sep 2006 19:02:01 GMT
On 9/20/06, Antoine Levy-Lambert <antoine@gmx.de> wrote:
>
> Hello,


Hello,

thanks for the patch, I have submitted parts of it.
>
> What I have submitted is closing the HttpURLConnection in close().
>
> The close method has become synchronised (not sure if it was necessary).


I think it's important to make the change to conn (conn=null) in a
synchronized block to avoid NPE in a multithreading environment.

When reading the contentlength, the connection is not closed after
> calling isExists(false).
>
> Calling close() after getContentLength() causes problems when running
> under JDK 1.5. Not under JDK 1.4.
> I did not look in the bugparade of Sun to try to understand why.


I should have a look at that, because I think it's a problem to keep the
connection opened. On resource intensive scripts using http urls there will
be failures due to that, at least that's what we've experimented with Ivy.
What are the tests to run? With which java version? I will try to see if I
can better figure out why it's failing, if you think it's worth my time :-)

Xavier

So the new version of URLResource does not call close after
> getContentLength() and after getLastModified().
> Nor after getOutputStream and getInputStream.
> Closing after getOutputStream made me fail a test where
> http://ant.apache.org is downloaded twice. I do not know why. This time
> the problem was under JDK 1.4
>
> Regards,
> Antoine
>
> Xavier Hanin wrote:
> > On 9/20/06, Matt Benson <gudnabrsam@yahoo.com> wrote:
> >>
> >> --- Antoine Levy-Lambert <antoine@gmx.de> wrote:
> >>
> >> > Hello Xavier,
> >> >
> >> > the patch is welcome, but I do not see the
> >> > attachment ? maybe it
> >> > comes from my email reader.
> >>
> >> Nor did I.  :)
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message