8233958: Memory retention due to HttpsURLConnection finalizer that serves no purpose

Reviewed-by: dfuchs, rriggs
This commit is contained in:
Michael McMahon 2019-11-13 09:09:41 +00:00
parent 7ba4fc4722
commit 9f91b8dde2
2 changed files with 0 additions and 19 deletions

View file

@ -72,13 +72,4 @@ public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnecti
protected javax.net.ssl.HostnameVerifier getHostnameVerifier() {
return httpsURLConnection.getHostnameVerifier();
}
/*
* Called by layered delegator's finalize() method to handle closing
* the underlying object.
*/
@SuppressWarnings("deprecation")
protected void dispose() throws Throwable {
super.finalize();
}
}

View file

@ -461,16 +461,6 @@ public class HttpsURLConnectionImpl
delegate.setDefaultUseCaches(defaultusecaches);
}
/*
* finalize (dispose) the delegated object. Otherwise
* sun.net.www.protocol.http.HttpURLConnection's finalize()
* would have to be made public.
*/
@SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
delegate.dispose();
}
public boolean equals(Object obj) {
return this == obj || ((obj instanceof HttpsURLConnectionImpl) &&
delegate.equals(((HttpsURLConnectionImpl)obj).delegate));