tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r982589 - in /tomcat/trunk/java/org/apache/tomcat/util/net/jsse: JSSEFactory.java JSSEImplementation.java JSSEKeyManager.java JSSESupport.java NioX509KeyManager.java
Date Thu, 05 Aug 2010 12:55:15 GMT
Author: markt
Date: Thu Aug  5 12:55:15 2010
New Revision: 982589

URL: http://svn.apache.org/viewvc?rev=982589&view=rev
Log:
Code clean up in o.a.t.until.net.jsse
 - @Override
 - import order
 - unused code
 - unnecessary code

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEFactory.java
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java
    tomcat/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEFactory.java?rev=982589&r1=982588&r2=982589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEFactory.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEFactory.java Thu Aug  5 12:55:15
2010
@@ -19,11 +19,11 @@ package org.apache.tomcat.util.net.jsse;
 
 import java.net.Socket;
 
+import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocket;
 
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.ServerSocketFactory;
-import javax.net.ssl.SSLSession;
 
 /** 
  * Factory interface to construct components based on the JSSE version

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java?rev=982589&r1=982588&r2=982589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEImplementation.java Thu Aug  5 12:55:15
2010
@@ -19,10 +19,11 @@ package org.apache.tomcat.util.net.jsse;
 
 import java.net.Socket;
 
+import javax.net.ssl.SSLSession;
+
 import org.apache.tomcat.util.net.SSLImplementation;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.ServerSocketFactory;
-import javax.net.ssl.SSLSession;
 
 /* JSSEImplementation:
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java?rev=982589&r1=982588&r2=982589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSEKeyManager.java Thu Aug  5 12:55:15
2010
@@ -21,6 +21,7 @@ import java.net.Socket;
 import java.security.Principal;
 import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
+
 import javax.net.ssl.X509KeyManager;
 
 /**
@@ -63,6 +64,7 @@ public final class JSSEKeyManager implem
      * @return The alias name for the desired key, or null if there are no
      * matches
      */
+    @Override
     public String chooseClientAlias(String[] keyType, Principal[] issuers,
                                     Socket socket) {
         return delegate.chooseClientAlias(keyType, issuers, socket);
@@ -81,6 +83,7 @@ public final class JSSEKeyManager implem
      *
      * @return Alias name for the desired key
      */
+    @Override
     public String chooseServerAlias(String keyType, Principal[] issuers,
                                     Socket socket) {
         return serverKeyAlias;
@@ -95,6 +98,7 @@ public final class JSSEKeyManager implem
      * and the root certificate authority last), or null if the alias can't be
      * found
      */
+    @Override
     public X509Certificate[] getCertificateChain(String alias) {
         return delegate.getCertificateChain(alias); 
     }
@@ -111,6 +115,7 @@ public final class JSSEKeyManager implem
      * @return Array of the matching alias names, or null if there were no
      * matches
      */
+    @Override
     public String[] getClientAliases(String keyType, Principal[] issuers) {
         return delegate.getClientAliases(keyType, issuers);
     }
@@ -127,6 +132,7 @@ public final class JSSEKeyManager implem
      * @return Array of the matching alias names, or null if there were no
      * matches
      */
+    @Override
     public String[] getServerAliases(String keyType, Principal[] issuers) {
         return delegate.getServerAliases(keyType, issuers);
     }
@@ -138,6 +144,7 @@ public final class JSSEKeyManager implem
      *
      * @return The requested key, or null if the alias can't be found
      */
+    @Override
     public PrivateKey getPrivateKey(String alias) {
         return delegate.getPrivateKey(alias);
     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java?rev=982589&r1=982588&r2=982589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/JSSESupport.java Thu Aug  5 12:55:15
2010
@@ -74,6 +74,7 @@ class JSSESupport implements SSLSupport,
         this.session = session;
     }
 
+    @Override
     public String getCipherSuite() throws IOException {
         // Look up the current SSLSession
         if (session == null)
@@ -81,13 +82,14 @@ class JSSESupport implements SSLSupport,
         return session.getCipherSuite();
     }
 
+    @Override
     public Object[] getPeerCertificateChain() 
         throws IOException {
         return getPeerCertificateChain(false);
     }
 
-    protected java.security.cert.X509Certificate [] getX509Certificates(SSLSession session)

-        throws IOException {
+    protected java.security.cert.X509Certificate [] getX509Certificates(
+            SSLSession session) {
         Certificate [] certs=null;
         try {
             certs = session.getPeerCertificates();
@@ -110,7 +112,8 @@ class JSSESupport implements SSLSupport,
                         CertificateFactory.getInstance("X.509");
                     ByteArrayInputStream stream =
                         new ByteArrayInputStream(buffer);
-                    x509Certs[i] = (java.security.cert.X509Certificate) cf.generateCertificate(stream);
+                    x509Certs[i] = (java.security.cert.X509Certificate)
+                            cf.generateCertificate(stream);
                 } catch(Exception ex) { 
                     log.info("Error translating cert " + certs[i], ex);
                     return null;
@@ -124,6 +127,7 @@ class JSSESupport implements SSLSupport,
         return x509Certs;
     }
 
+    @Override
     public Object[] getPeerCertificateChain(boolean force)
         throws IOException {
         // Look up the current SSLSession
@@ -195,6 +199,7 @@ class JSSESupport implements SSLSupport,
     /**
      * Copied from <code>org.apache.catalina.valves.CertificateValve</code>
      */
+    @Override
     public Integer getKeySize() 
         throws IOException {
         // Look up the current SSLSession
@@ -224,6 +229,7 @@ class JSSESupport implements SSLSupport,
         return keySize;
     }
 
+    @Override
     public String getSessionId()
         throws IOException {
         // Look up the current SSLSession
@@ -246,6 +252,7 @@ class JSSESupport implements SSLSupport,
 
     private static class Listener implements HandshakeCompletedListener {
         volatile boolean completed = false;
+        @Override
         public void handshakeCompleted(HandshakeCompletedEvent event) {
             completed = true;
         }
@@ -257,6 +264,7 @@ class JSSESupport implements SSLSupport,
     /**
      * Invalidate the session this support object is associated with.
      */
+    @Override
     public void invalidateSession() {
         session.invalidate();
     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java?rev=982589&r1=982588&r2=982589&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/jsse/NioX509KeyManager.java Thu Aug  5 12:55:15
2010
@@ -43,44 +43,50 @@ public class NioX509KeyManager extends X
         this.serverKeyAlias = serverKeyAlias;
     }
 
-    public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
{
+    @Override
+    public String chooseClientAlias(String[] keyType, Principal[] issuers,
+            Socket socket) {
         return delegate.chooseClientAlias(keyType, issuers, socket);
     }
 
-    public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) {
-        if (serverKeyAlias!=null) {
+    @Override
+    public String chooseServerAlias(String keyType, Principal[] issuers,
+            Socket socket) {
+        if (serverKeyAlias != null) {
             return serverKeyAlias;
-        } else {
-            return delegate.chooseServerAlias(keyType, issuers, socket);
         }
+
+        return delegate.chooseServerAlias(keyType, issuers, socket);
     }
 
+    @Override
     public X509Certificate[] getCertificateChain(String alias) {
         return delegate.getCertificateChain(alias);
     }
 
+    @Override
     public String[] getClientAliases(String keyType, Principal[] issuers) {
         return delegate.getClientAliases(keyType, issuers);
     }
 
+    @Override
     public PrivateKey getPrivateKey(String alias) {
         return delegate.getPrivateKey(alias);
     }
 
+    @Override
     public String[] getServerAliases(String keyType, Principal[] issuers) {
         return delegate.getServerAliases(keyType, issuers);
     }
 
     @Override
-    public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine
engine) {
+    public String chooseEngineServerAlias(String keyType, Principal[] issuers,
+            SSLEngine engine) {
         if (serverKeyAlias!=null) {
             return serverKeyAlias;
-        } else {
-            return super.chooseEngineServerAlias(keyType, issuers, engine);
         }
-    }
 
-    
-    
+        return super.chooseEngineServerAlias(keyType, issuers, engine);
+    }
     
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message