classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [PATCH] Fix PR classpath/24086, PR classpath/24091, PR


From: David Daney
Subject: Re: [cp-patches] [PATCH] Fix PR classpath/24086, PR classpath/24091, PR classpath/24104 et al. ...
Date: Wed, 12 Oct 2005 10:08:51 -0700
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)

Jeroen Frijters wrote:
David Daney wrote:

Jeroen Frijters wrote:

David Daney wrote:

LimitedLengthInputStream shouldn't have a finalize().

Let's consider the case where a client program did not read the entire body of the response:

As implemented in the patch, the finalize is indeed needed to clean up the mess and return the connection to the connection
pool.


I understand that was the motivation, but I just don't agree with it.
Even *if* you wanted to do this, you should use a PhantomReference to
keep track of the lifetime of the LimitedLengthInputStream instead of a
finalize method.


The LimitedLengthInputStream *is* the class that needs to do the cleanup. Once a PhontomReference is enqueued the object is gone. A finalizer is simple and gets the job done.

But this is all moot as I am going to kill it anyhow.

David Daney.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]