This patch removes unused variables. If any of them have to stay because they are accessed through reflection (possibly by legacy code), there really ought to be a comment reflecting that.

The last hunk removes a NullPointerException, I think.

--
Florian Weimer / Red Hat Product Security Team
# HG changeset patch
# User Florian Weimer <[email protected]>
# Date 1353607245 -3600
# Node ID 9b9a751461efb879fcc08f5d0e09274c72409b07
# Parent  7a28782e9e7aae4bd820603fa88c0d2fd5e2d23d
Unused variable removal in package sun.security.ssl

diff --git a/src/share/classes/sun/security/ssl/HandshakeMessage.java b/src/share/classes/sun/security/ssl/HandshakeMessage.java
--- a/src/share/classes/sun/security/ssl/HandshakeMessage.java
+++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java
@@ -394,8 +394,6 @@
             s.print("RandomCookie:  ");
             svr_random.print(s);
 
-            int i;
-
             s.print("Session ID:  ");
             s.println(sessionId);
 
diff --git a/src/share/classes/sun/security/ssl/JsseJce.java b/src/share/classes/sun/security/ssl/JsseJce.java
--- a/src/share/classes/sun/security/ssl/JsseJce.java
+++ b/src/share/classes/sun/security/ssl/JsseJce.java
@@ -54,8 +54,6 @@
  */
 final class JsseJce {
 
-    private final static Debug debug = Debug.getInstance("ssl");
-
     private final static ProviderList fipsProviderList;
 
     // Flag indicating whether EC crypto is available.
diff --git a/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java b/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java
--- a/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java
+++ b/src/share/classes/sun/security/ssl/SSLServerSocketImpl.java
@@ -82,9 +82,6 @@
     /* which protocol to use by default */
     private ProtocolList        enabledProtocols = null;
 
-    /* could enabledCipherSuites ever complete handshaking? */
-    private boolean             checkedEnabled = false;
-
     // the endpoint identification protocol to use by default
     private String              identificationProtocol = null;
 
@@ -195,7 +192,6 @@
     @Override
     synchronized public void setEnabledCipherSuites(String[] suites) {
         enabledCipherSuites = new CipherSuiteList(suites);
-        checkedEnabled = false;
     }
 
     @Override
diff --git a/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java b/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java
--- a/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java
+++ b/src/share/classes/sun/security/ssl/SSLSessionContextImpl.java
@@ -44,8 +44,6 @@
     private int cacheLimit;             // the max cache size
     private int timeout;                // timeout in seconds
 
-    private static final Debug debug = Debug.getInstance("ssl");
-
     // package private
     SSLSessionContextImpl() {
         cacheLimit = getDefaultCacheLimit();    // default cache size
diff --git a/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java b/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java
--- a/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java
+++ b/src/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java
@@ -43,7 +43,6 @@
  */
 final public class SSLSocketFactoryImpl extends SSLSocketFactory {
 
-    private static SSLContextImpl defaultContext;
     private SSLContextImpl context;
 
     /**
diff --git a/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java b/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java
--- a/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java
+++ b/src/share/classes/sun/security/ssl/X509TrustManagerImpl.java
@@ -346,7 +346,6 @@
                 } catch (IllegalArgumentException iae) {
                     // unlikely to happen, just in case ...
                     if ((debug != null) && Debug.isOn("trustmanager")) {
-                        byte[] encoded = hostname.getEncoded();
                         System.out.println("Illegal server name: " + sniName);
                     }
                 }

Reply via email to