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.