changeset 56916:6c78185c99d7

8233958: Memory retention due to HttpsURLConnection finalizer that serves no purpose Reviewed-by: dfuchs, rriggs
author michaelm
date Wed, 13 Nov 2019 09:09:41 +0000
parents a8104278b4d0
children dc1899bb84c0
files src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java
diffstat 2 files changed, 0 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java	Wed Nov 13 08:43:35 2019 +0100
+++ b/src/java.base/share/classes/sun/net/www/protocol/https/DelegateHttpsURLConnection.java	Wed Nov 13 09:09:41 2019 +0000
@@ -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();
-    }
 }
--- a/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java	Wed Nov 13 08:43:35 2019 +0100
+++ b/src/java.base/share/classes/sun/net/www/protocol/https/HttpsURLConnectionImpl.java	Wed Nov 13 09:09:41 2019 +0000
@@ -461,16 +461,6 @@
         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));