Skip to content
Permalink
Browse files
8233958: Memory retention due to HttpsURLConnection finalizer that se…
…rves no purpose

Backport-of: 9f91b8d
  • Loading branch information
Yuri Nesterenko committed Nov 30, 2020
1 parent dabaf4e commit 74991c9b33b87f11c19132388635da8860168d9c
@@ -72,13 +72,4 @@
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();
}
}
@@ -461,16 +461,6 @@ public void setDefaultUseCaches(boolean defaultusecaches) {
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));

1 comment on commit 74991c9

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 74991c9 Nov 30, 2020

Please sign in to comment.