harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r727683 [10/11] - in /harmony/enhanced/classlib/branches/java6: ./ doc/ make/ modules/accessibility/src/main/java/javax/accessibility/ modules/archive/src/main/java/java/util/jar/ modules/archive/src/main/java/java/util/zip/ modules/archive...
Date Thu, 18 Dec 2008 09:46:26 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.AlertException;
@@ -97,14 +92,6 @@
         this.sslParameters = sslParameters;
     }
 
-    @Override
-    public void setSSLParameters(javax.net.ssl.SSLParameters inputSSLParameters) {
-        setEnabledCipherSuites(inputSSLParameters.getCipherSuites());
-        setEnabledProtocols(inputSSLParameters.getProtocols());
-        setNeedClientAuth(inputSSLParameters.getNeedClientAuth());
-        setWantClientAuth(inputSSLParameters.getWantClientAuth());
-    }
-
     /**
      * Ctor
      * @param   host:   String
@@ -122,6 +109,7 @@
      * @see javax.net.ssl.SSLEngine#beginHandshake() method documentation
      * for more information
      */
+    @Override
     public void beginHandshake() throws SSLException {
         if (engine_was_closed) {
             throw new SSLException("Engine has already been closed.");
@@ -151,6 +139,7 @@
      * @see javax.net.ssl.SSLEngine#closeInbound() method documentation
      * for more information
      */
+    @Override
     public void closeInbound() throws SSLException {
         if (logger != null) {
             logger.println("closeInbound() "+isInboundDone);
@@ -181,6 +170,7 @@
      * @see javax.net.ssl.SSLEngine#closeOutbound() method documentation
      * for more information
      */
+    @Override
     public void closeOutbound() {
         if (logger != null) {
             logger.println("closeOutbound() "+isOutboundDone);
@@ -207,6 +197,7 @@
      * @see javax.net.ssl.SSLEngine#getDelegatedTask() method documentation
      * for more information
      */
+    @Override
     public Runnable getDelegatedTask() {
         return handshakeProtocol.getTask();
     }
@@ -217,6 +208,7 @@
      * @see javax.net.ssl.SSLEngine#getSupportedCipherSuites() method
      * documentation for more information
      */
+    @Override
     public String[] getSupportedCipherSuites() {
         return CipherSuite.getSupportedCipherSuiteNames();
     }
@@ -228,6 +220,7 @@
      * @see javax.net.ssl.SSLEngine#getEnabledCipherSuites() method
      * documentation for more information
      */
+    @Override
     public String[] getEnabledCipherSuites() {
         return sslParameters.getEnabledCipherSuites();
     }
@@ -237,6 +230,7 @@
      * @see javax.net.ssl.SSLEngine#setEnabledCipherSuites(String) method
      * documentation for more information
      */
+    @Override
     public void setEnabledCipherSuites(String[] suites) {
         sslParameters.setEnabledCipherSuites(suites);
     }
@@ -246,8 +240,9 @@
      * @see javax.net.ssl.SSLEngine#getSupportedProtocols() method
      * documentation for more information
      */
+    @Override
     public String[] getSupportedProtocols() {
-        return (String[]) ProtocolVersion.supportedProtocols.clone();
+        return ProtocolVersion.supportedProtocols.clone();
     }
 
     /**
@@ -255,6 +250,7 @@
      * @see javax.net.ssl.SSLEngine#getEnabledProtocols() method
      * documentation for more information
      */
+    @Override
     public String[] getEnabledProtocols() {
         return sslParameters.getEnabledProtocols();
     }
@@ -264,6 +260,7 @@
      * @see javax.net.ssl.SSLEngine#setEnabledProtocols(String) method
      * documentation for more information
      */
+    @Override
     public void setEnabledProtocols(String[] protocols) {
         sslParameters.setEnabledProtocols(protocols);
     }
@@ -273,6 +270,7 @@
      * @see javax.net.ssl.SSLEngine#setUseClientMode(boolean) method
      * documentation for more information
      */
+    @Override
     public void setUseClientMode(boolean mode) {
         if (handshake_started) {
             throw new IllegalArgumentException(
@@ -287,6 +285,7 @@
      * @see javax.net.ssl.SSLEngine#getUseClientMode() method
      * documentation for more information
      */
+    @Override
     public boolean getUseClientMode() {
         return sslParameters.getUseClientMode();
     }
@@ -296,6 +295,7 @@
      * @see javax.net.ssl.SSLEngine#setNeedClientAuth(boolean) method
      * documentation for more information
      */
+    @Override
     public void setNeedClientAuth(boolean need) {
         sslParameters.setNeedClientAuth(need);
     }
@@ -305,6 +305,7 @@
      * @see javax.net.ssl.SSLEngine#getNeedClientAuth() method
      * documentation for more information
      */
+    @Override
     public boolean getNeedClientAuth() {
         return sslParameters.getNeedClientAuth();
     }
@@ -314,6 +315,7 @@
      * @see javax.net.ssl.SSLEngine#setWantClientAuth(boolean) method
      * documentation for more information
      */
+    @Override
     public void setWantClientAuth(boolean want) {
         sslParameters.setWantClientAuth(want);
     }
@@ -323,6 +325,7 @@
      * @see javax.net.ssl.SSLEngine#getWantClientAuth() method
      * documentation for more information
      */
+    @Override
     public boolean getWantClientAuth() {
         return sslParameters.getWantClientAuth();
     }
@@ -332,6 +335,7 @@
      * @see javax.net.ssl.SSLEngine#setEnableSessionCreation(boolean) method
      * documentation for more information
      */
+    @Override
     public void setEnableSessionCreation(boolean flag) {
         sslParameters.setEnableSessionCreation(flag);
     }
@@ -341,6 +345,7 @@
      * @see javax.net.ssl.SSLEngine#getEnableSessionCreation() method
      * documentation for more information
      */
+    @Override
     public boolean getEnableSessionCreation() {
         return sslParameters.getEnableSessionCreation();
     }
@@ -352,6 +357,7 @@
      * @see javax.net.ssl.SSLEngine#getHandshakeStatus() method
      * documentation for more information
      */
+    @Override
     public SSLEngineResult.HandshakeStatus getHandshakeStatus() {
         if (!handshake_started || engine_was_shutteddown) {
             // initial handshake has not been started yet
@@ -373,12 +379,12 @@
      * @see javax.net.ssl.SSLEngine#getSession() method
      * documentation for more information
      */
+    @Override
     public SSLSession getSession() {
         if (session != null) {
             return session;
-        } else {
-            return SSLSessionImpl.NULL_SESSION;
         }
+        return SSLSessionImpl.NULL_SESSION;
     }
 
     /**
@@ -386,6 +392,7 @@
      * @see javax.net.ssl.SSLEngine#isInboundDone() method
      * documentation for more information
      */
+    @Override
     public boolean isInboundDone() {
         return isInboundDone || engine_was_closed;
     }
@@ -395,6 +402,7 @@
      * @see javax.net.ssl.SSLEngine#isOutboundDone() method
      * documentation for more information
      */
+    @Override
     public boolean isOutboundDone() {
         return isOutboundDone;
     }
@@ -410,6 +418,7 @@
      * @see javax.net.ssl.SSLEngine#unwrap(ByteBuffer,ByteBuffer[],int,int)
      * method documentation for more information
      */
+    @Override
     public SSLEngineResult unwrap(ByteBuffer src, ByteBuffer[] dsts,
                                 int offset, int length) throws SSLException {
         if (engine_was_shutteddown) {
@@ -574,6 +583,7 @@
      * @see javax.net.ssl.SSLEngine#wrap(ByteBuffer[],int,int,ByteBuffer) method
      * documentation for more information
      */
+    @Override
     public SSLEngineResult wrap(ByteBuffer[] srcs, int offset,
                             int len, ByteBuffer dst) throws SSLException {
         if (engine_was_shutteddown) {
@@ -755,15 +765,5 @@
             ? SSLEngineResult.Status.CLOSED
             : SSLEngineResult.Status.OK;
     }
-
-
-    @Override
-    public javax.net.ssl.SSLParameters getSSLParameters() {
-        javax.net.ssl.SSLParameters outputSSLParameters = new javax.net.ssl.SSLParameters();
-        outputSSLParameters.setCipherSuites(sslParameters.getEnabledCipherSuites());
-        outputSSLParameters.setProtocols(sslParameters.getEnabledProtocols());
-        outputSSLParameters.setNeedClientAuth(sslParameters.getNeedClientAuth());
-        outputSSLParameters.setWantClientAuth(sslParameters.getWantClientAuth());
-        return outputSSLParameters;
-    }
 }
+

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.io.IOException;
@@ -37,6 +32,7 @@
     /**
      * @see java.io.InputStream#available()
      */
+    @Override
     public abstract int available() throws IOException;
 
     /**
@@ -49,11 +45,13 @@
      * @see org.apache.harmony.xnet.provider.jsse.SSLBufferedInput#read()
      * @see org.apache.harmony.xnet.provider.jsse.HandshakeIODataStream#read()
      */
+    @Override
     public abstract int read() throws IOException;
 
     /**
      * @see java.io.InputStream#skip()
      */
+    @Override
     public long skip(long n) throws IOException {
         long skept = n;
         while (n > 0) {
@@ -119,6 +117,7 @@
     /**
      * @see java.io.InputStream#read(byte[],int,int)
      */
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         int read_b;
         int i = 0;

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.SSLSessionContextImpl;
@@ -241,7 +236,7 @@
                 enabledCipherSuiteNames[i] = enabledCipherSuites[i].getName();
             }
         }
-        return (String[]) enabledCipherSuiteNames.clone();
+        return enabledCipherSuiteNames.clone();
     }
 
     /**
@@ -269,7 +264,7 @@
      * @return the set of enabled protocols
      */
     protected String[] getEnabledProtocols() {
-        return (String[]) enabledProtocols.clone();
+        return enabledProtocols.clone();
     }
 
     /**
@@ -360,6 +355,7 @@
      * Returns the clone of this object.
      * @return the clone.
      */
+    @Override
     protected Object clone() {
         SSLParameters parameters = new SSLParameters();
 

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.AlertException;
@@ -33,7 +28,7 @@
  * This class performs functionality dedicated to SSL record layer.
  * It unpacks and routes income data to the appropriate
  * client protocol (handshake, alert, application data protocols)
- * and paketizes outcome data into SSL/TLS records.
+ * and packages outcome data into SSL/TLS records.
  * Initially created object has null connection state and does not
  * perform any cryptography computations over the income/outcome data.
  * After handshake protocol agreed upon security parameters they are placed
@@ -179,9 +174,8 @@
         }
         if (activeReadState == null) {
             return record_size;
-        } else {
-            return activeReadState.getContentSize(record_size);
         }
+        return activeReadState.getContentSize(record_size);
     }
 
     /**
@@ -374,7 +368,7 @@
                             type));
             }
         } else {
-            in.skip((long) 2); // just skip the version number
+            in.skip(2); // just skip the version number
         }
         int length = in.readUint16();
         if (logger != null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.SSLParameters;
@@ -65,6 +60,7 @@
     /**
      * @see javax.net.ssl.SSLServerSocketFactory#getDefaultCipherSuites()
      */
+    @Override
     public String[] getDefaultCipherSuites() {
         if (instantiationException != null) {
             return new String[0];
@@ -75,6 +71,7 @@
     /**
      * @see javax.net.ssl.SSLServerSocketFactory#getSupportedCipherSuites()
      */
+    @Override
     public String[] getSupportedCipherSuites() {
         if (instantiationException != null) {
             return new String[0];
@@ -85,6 +82,7 @@
     /**
      * @see javax.net.ServerSocketFactory#createServerSocket()
      */
+    @Override
     public ServerSocket createServerSocket() throws IOException {
         if (instantiationException != null) {
             throw instantiationException;
@@ -96,6 +94,7 @@
     /**
      * @see javax.net.ServerSocketFactory#createServerSocket(int)
      */
+    @Override
     public ServerSocket createServerSocket(int port) throws IOException {
         if (instantiationException != null) {
             throw instantiationException;
@@ -107,6 +106,7 @@
     /**
      * @see javax.net.ServerSocketFactory#createServerSocket(int,int)
      */
+    @Override
     public ServerSocket createServerSocket(int port, int backlog)
             throws IOException {
         if (instantiationException != null) {
@@ -119,6 +119,7 @@
     /**
      * @see javax.net.ServerSocketFactory#createServerSocket(int,int,InetAddress)
      */
+    @Override
     public ServerSocket createServerSocket(int port, int backlog,
             InetAddress iAddress) throws IOException {
         if (instantiationException != null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.SSLSocketImpl;
@@ -106,6 +101,7 @@
      * @see javax.net.ssl.SSLServerSocket#getSupportedCipherSuites()
      * method documentation for more information
      */
+    @Override
     public String[] getSupportedCipherSuites() {
         return CipherSuite.getSupportedCipherSuiteNames();
     }
@@ -115,6 +111,7 @@
      * @see javax.net.ssl.SSLServerSocket#getEnabledCipherSuites()
      * method documentation for more information
      */
+    @Override
     public String[] getEnabledCipherSuites() {
         return sslParameters.getEnabledCipherSuites();
     }
@@ -124,6 +121,7 @@
      * @see javax.net.ssl.SSLServerSocket#setEnabledCipherSuites(String[])
      * method documentation for more information
      */
+    @Override
     public void setEnabledCipherSuites(String[] suites) {
         sslParameters.setEnabledCipherSuites(suites);
     }
@@ -133,8 +131,9 @@
      * @see javax.net.ssl.SSLServerSocket#getSupportedProtocols()
      * method documentation for more information
      */
+    @Override
     public String[] getSupportedProtocols() {
-        return (String[]) ProtocolVersion.supportedProtocols.clone();
+        return ProtocolVersion.supportedProtocols.clone();
     }
 
     /**
@@ -142,6 +141,7 @@
      * @see javax.net.ssl.SSLServerSocket#getEnabledProtocols()
      * method documentation for more information
      */
+    @Override
     public String[] getEnabledProtocols() {
         return sslParameters.getEnabledProtocols();
     }
@@ -151,6 +151,7 @@
      * @see javax.net.ssl.SSLServerSocket#setEnabledProtocols(String[])
      * method documentation for more information
      */
+    @Override
     public void setEnabledProtocols(String[] protocols) {
         sslParameters.setEnabledProtocols(protocols);
     }
@@ -160,6 +161,7 @@
      * @see javax.net.ssl.SSLServerSocket#setUseClientMode(boolean)
      * method documentation for more information
      */
+    @Override
     public void setUseClientMode(boolean mode) {
         sslParameters.setUseClientMode(mode);
     }
@@ -169,6 +171,7 @@
      * @see javax.net.ssl.SSLServerSocket#getUseClientMode()
      * method documentation for more information
      */
+    @Override
     public boolean getUseClientMode() {
         return sslParameters.getUseClientMode();
     }
@@ -178,6 +181,7 @@
      * @see javax.net.ssl.SSLServerSocket#setNeedClientAuth(boolean)
      * method documentation for more information
      */
+    @Override
     public void setNeedClientAuth(boolean need) {
         sslParameters.setNeedClientAuth(need);
     }
@@ -187,6 +191,7 @@
      * @see javax.net.ssl.SSLServerSocket#getNeedClientAuth()
      * method documentation for more information
      */
+    @Override
     public boolean getNeedClientAuth() {
         return sslParameters.getNeedClientAuth();
     }
@@ -196,6 +201,7 @@
      * @see javax.net.ssl.SSLServerSocket#setWantClientAuth(boolean)
      * method documentation for more information
      */
+    @Override
     public void setWantClientAuth(boolean want) {
         sslParameters.setWantClientAuth(want);
     }
@@ -205,6 +211,7 @@
      * @see javax.net.ssl.SSLServerSocket#getWantClientAuth()
      * method documentation for more information
      */
+    @Override
     public boolean getWantClientAuth() {
         return sslParameters.getWantClientAuth();
     }
@@ -214,6 +221,7 @@
      * @see javax.net.ssl.SSLServerSocket#setEnableSessionCreation(boolean)
      * method documentation for more information
      */
+    @Override
     public void setEnableSessionCreation(boolean flag) {
         sslParameters.setEnableSessionCreation(flag);
     }
@@ -223,6 +231,7 @@
      * @see javax.net.ssl.SSLServerSocket#getEnableSessionCreation()
      * method documentation for more information
      */
+    @Override
     public boolean getEnableSessionCreation() {
         return sslParameters.getEnableSessionCreation();
     }
@@ -235,6 +244,7 @@
      * @see java.net.ServerSocket#accept()
      * method documentation for more information
      */
+    @Override
     public Socket accept() throws IOException {
         if (logger != null) {
             logger.println("SSLServerSocketImpl.accept ..");
@@ -263,6 +273,7 @@
     /**
      * Returns the string representation of the object.
      */
+    @Override
     public String toString() {
         return "[SSLServerSocketImpl]";
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionContextImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionContextImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionContextImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionContextImpl.java Thu Dec 18 01:46:12 2008
@@ -14,11 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
-/**
- * @author Boris Kuznetsov
- * @version $Revision$
- */
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.util.Arrays;
@@ -39,20 +34,17 @@
 
     private long timeout = 0;
 
-    private final Hashtable sessions = new Hashtable();
+    private final Hashtable<IdKey, SSLSessionImpl> sessions = new Hashtable<IdKey, SSLSessionImpl>();
 
-    /**
-     * 
-     * @see javax.net.ssl.SSLSessionContext.getIds()
-     */
+    @SuppressWarnings("unchecked")
     public Enumeration getIds() {
         return new Enumeration() {
-            Enumeration keys = sessions.keys();
+            Enumeration<IdKey> keys = sessions.keys();
             public boolean hasMoreElements() {
                 return keys.hasMoreElements();
             }
             public Object nextElement() {
-                return ((IdKey)keys.nextElement()).id;
+                return keys.nextElement().id;
             }
         };
     }
@@ -62,7 +54,7 @@
      * @see javax.net.ssl.SSLSessionContext.getSession(byte[] sessionId)
      */
     public SSLSession getSession(byte[] sessionId) {      
-        return (SSLSession) sessions.get(new IdKey(sessionId));
+        return sessions.get(new IdKey(sessionId));
     }
 
     /**
@@ -94,19 +86,16 @@
 
     }
 
-    /**
-     * @see javax.net.ssl.SSLSessionContext.setSessionTimeout(int seconds)
-     */
     public void setSessionTimeout(int seconds) throws IllegalArgumentException {
         if (seconds < 0) {
             throw new IllegalArgumentException("seconds < 0");
         }
         timeout = seconds * 1000;
 
-        // Check timeouts and remome expired sessions
+        // Check timeouts and remove expired sessions
         SSLSessionImpl ses;
-        for (Enumeration en = sessions.keys(); en.hasMoreElements();) {
-            ses = (SSLSessionImpl)(sessions.get(en.nextElement()));
+        for (Enumeration<IdKey> en = sessions.keys(); en.hasMoreElements();) {
+            ses = (sessions.get(en.nextElement()));
             if (!ses.isValid()) {
                 sessions.remove(ses.getId());
             }
@@ -114,7 +103,7 @@
     }
 
     /**
-     * Adds session to the session cach
+     * Adds session to the session cache
      * @param ses
      */
     void putSession(SSLSessionImpl ses) {
@@ -139,6 +128,7 @@
             this.id = id;
         }
         
+        @Override
         public boolean equals(Object o) {
             if (!(o instanceof IdKey)) {
                 return false;
@@ -146,14 +136,9 @@
             return Arrays.equals(id, ((IdKey)o).id);
         }
         
+        @Override
         public int hashCode() {
-            // TODO uncomment for 1.5
-            // return Arrays.hashCode(id);
-            int hash = 0;
-            for (int i = 0; i < id.length; i++) {
-                hash += id[i];
-            }
-            return hash;
+            return Arrays.hashCode(id);
         }
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris Kuznetsov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.security.AccessControlContext;
@@ -29,7 +24,8 @@
 import java.security.cert.Certificate;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
-import java.util.Iterator;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Vector;
 
 import javax.net.ssl.SSLPeerUnverifiedException;
@@ -39,26 +35,67 @@
 import javax.net.ssl.SSLSessionBindingListener;
 import javax.net.ssl.SSLSessionContext;
 
-import org.apache.harmony.luni.util.TwoKeyHashMap;
-import org.apache.harmony.xnet.provider.jsse.SSLSessionContextImpl;
-
 /**
  * 
  * SSLSession implementation
- *
+ * 
  * @see javax.net.ssl.SSLSession
  */
-public class SSLSessionImpl implements SSLSession {
+public class SSLSessionImpl implements SSLSession, Cloneable  {
 
     /**
-     * Session object reporting an invalid cipher suite of 
-     * "SSL_NULL_WITH_NULL_NULL"
+     * Session object reporting an invalid cipher suite of "SSL_NULL_WITH_NULL_NULL"
      */
     public static final SSLSessionImpl NULL_SESSION = new SSLSessionImpl(null);
 
+    /**
+     * Container class for the 'value' map's keys.
+     */
+    private static final class ValueKey {
+        final String name;
+        final AccessControlContext acc;
+
+        ValueKey(String name) {
+            super();
+            this.name = name;
+            this.acc = AccessController.getContext();
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((acc == null) ? 0 : acc.hashCode());
+            result = prime * result + ((name == null) ? 0 : name.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (!(obj instanceof ValueKey))
+                return false;
+            ValueKey other = (ValueKey) obj;
+            if (acc == null) {
+                if (other.acc != null)
+                    return false;
+            } else if (!acc.equals(other.acc))
+                return false;
+            if (name == null) {
+                if (other.name != null)
+                    return false;
+            } else if (!name.equals(other.name))
+                return false;
+            return true;
+        }
+    }
+
     private long creationTime;
     private boolean isValid = true;
-    private TwoKeyHashMap values = new TwoKeyHashMap();
+    private Map<ValueKey, Object> values = new HashMap<ValueKey, Object>();
 
     /**
      * ID of the session
@@ -66,7 +103,7 @@
     byte[] id;
 
     /**
-     * Last time the session was accessed 
+     * Last time the session was accessed
      */
     long lastAccessedTime;
 
@@ -85,9 +122,8 @@
      */
     SSLSessionContextImpl context;
 
-
     /**
-     * certificates were sent to the peer 
+     * certificates were sent to the peer
      */
     X509Certificate[] localCertificates;
 
@@ -97,21 +133,20 @@
     X509Certificate[] peerCertificates;
 
     /**
-     * Peer host name 
+     * Peer host name
      */
-    String peerHost;
+    private String peerHost;
 
     /**
      * Peer port number
      */
-    int peerPort = -1;
+    private int peerPort = -1;
 
     /**
      * Master secret
      */
     byte[] master_secret;
 
-
     /**
      * clientRandom
      */
@@ -125,10 +160,11 @@
     /**
      * True if this entity is considered the server
      */
-    boolean isServer = false;
+    final boolean isServer;
 
     /**
      * Creates SSLSession implementation
+     * 
      * @param cipher_suite
      * @param sr
      */
@@ -143,11 +179,11 @@
             this.cipherSuite = cipher_suite;
             id = new byte[32];
             sr.nextBytes(id);
-            long time = new java.util.Date().getTime() / 1000;
+            long time = creationTime / 1000;
             id[28] = (byte) ((time & 0xFF000000) >>> 24);
-            id[29] = (byte) ((time & 0xFF0000) >>> 16);
-            id[30] = (byte) ((time & 0xFF00) >>> 8);
-            id[31] = (byte) (time & 0xFF);
+            id[29] = (byte) ((time & 0x00FF0000) >>> 16);
+            id[30] = (byte) ((time & 0x0000FF00) >>> 8);
+            id[31] = (byte) ((time & 0x000000FF));
             isServer = true;
         }
 
@@ -155,78 +191,48 @@
 
     /**
      * Creates SSLSession implementation
+     * 
      * @param sr
      */
     public SSLSessionImpl(SecureRandom sr) {
         this(null, sr);
     }
 
-    private SSLSessionImpl() {
-    }
-
-    /**
-     * @see javax.net.ssl.SSLSession.getApplicationBufferSize()
-     */
     public int getApplicationBufferSize() {
         return SSLRecordProtocol.MAX_DATA_LENGTH;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getCipherSuite()
-     */
     public String getCipherSuite() {
         return cipherSuite.getName();
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getCreationTime()
-     */
     public long getCreationTime() {
         return creationTime;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getId()
-     */
     public byte[] getId() {
         return id;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getLastAccessedTime()
-     */
     public long getLastAccessedTime() {
         return lastAccessedTime;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getLocalCertificates()
-     */
     public Certificate[] getLocalCertificates() {
         return localCertificates;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getLocalPrincipal()
-     */
     public Principal getLocalPrincipal() {
         if (localCertificates != null && localCertificates.length > 0) {
             return localCertificates[0].getSubjectX500Principal();
-        } else {
-            return null;
         }
+        return null;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getPacketBufferSize()
-     */
     public int getPacketBufferSize() {
         return SSLRecordProtocol.MAX_SSL_PACKET_SIZE;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getPeerCertificateChain()
-     */
     public javax.security.cert.X509Certificate[] getPeerCertificateChain()
             throws SSLPeerUnverifiedException {
         if (peerCertificates == null) {
@@ -235,8 +241,8 @@
         javax.security.cert.X509Certificate[] certs = new javax.security.cert.X509Certificate[peerCertificates.length];
         for (int i = 0; i < certs.length; i++) {
             try {
-                certs[i] = javax.security.cert.X509Certificate
-                        .getInstance(peerCertificates[i].getEncoded());
+                certs[i] = javax.security.cert.X509Certificate.getInstance(peerCertificates[i]
+                        .getEncoded());
             } catch (javax.security.cert.CertificateException e) {
             } catch (CertificateEncodingException e) {
             }
@@ -244,34 +250,21 @@
         return certs;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getPeerCertificates()
-     */
-    public Certificate[] getPeerCertificates()
-            throws SSLPeerUnverifiedException {
+    public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
         if (peerCertificates == null) {
             throw new SSLPeerUnverifiedException("No peer certificate");
         }
         return peerCertificates;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getPeerHost()
-     */
     public String getPeerHost() {
         return peerHost;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getPeerPort()
-     */
     public int getPeerPort() {
         return peerPort;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getPeerPrincipal()
-     */
     public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
         if (peerCertificates == null) {
             throw new SSLPeerUnverifiedException("No peer certificate");
@@ -279,16 +272,10 @@
         return peerCertificates[0].getSubjectX500Principal();
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getProtocol()
-     */
     public String getProtocol() {
         return protocol.name;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getSessionContext()
-     */
     public SSLSessionContext getSessionContext() {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
@@ -297,109 +284,71 @@
         return context;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getValue(String name)
-     */
     public Object getValue(String name) {
         if (name == null) {
             throw new IllegalArgumentException("Parameter is null");
         }
-        return values.get(name, AccessController.getContext());
+        return values.get(new ValueKey(name));
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.getValueNames()
-     */
     public String[] getValueNames() {
-        Vector v = new Vector();
-        AccessControlContext current = AccessController.getContext();
-        AccessControlContext cont;
-        for (Iterator it = values.entrySet().iterator(); it.hasNext();) {
-            TwoKeyHashMap.Entry entry = (TwoKeyHashMap.Entry) it.next();
-            cont = (AccessControlContext) entry.getKey2();
-            if ((current == null && cont == null)
-                    || (current != null && current.equals(cont))) {
-                v.add(entry.getKey1());
+        final Vector<String> v = new Vector<String>();
+        final AccessControlContext currAcc = AccessController.getContext();
+        for (ValueKey key : values.keySet()) {
+            if ((currAcc == null && key.acc == null)
+                    || (currAcc != null && currAcc.equals(key.acc))) {
+                v.add(key.name);
             }
         }
-        return (String[]) v.toArray(new String[0]);
+        return v.toArray(new String[v.size()]);
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.invalidate()
-     */
     public void invalidate() {
         isValid = false;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.isValid()
-     */
     public boolean isValid() {
-        if (isValid
-                && context != null
-                && context.getSessionTimeout() != 0
-                && lastAccessedTime + context.getSessionTimeout() > System
-                        .currentTimeMillis()) {
+        if (isValid && context != null && context.getSessionTimeout() != 0
+                && lastAccessedTime + context.getSessionTimeout() > System.currentTimeMillis()) {
             isValid = false;
         }
         return isValid;
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.putValue(String name, Object value)
-     */
     public void putValue(String name, Object value) {
         if (name == null || value == null) {
             throw new IllegalArgumentException("Parameter is null");
         }
-        Object old = values.put(name, AccessController.getContext(), value);
+        Object old = values.put(new ValueKey(name), value);
         if (value instanceof SSLSessionBindingListener) {
-            ((SSLSessionBindingListener) value)
-                    .valueBound(new SSLSessionBindingEvent(this, name));
+            ((SSLSessionBindingListener) value).valueBound(new SSLSessionBindingEvent(this, name));
         }
         if (old != null && old instanceof SSLSessionBindingListener) {
-            ((SSLSessionBindingListener) old)
-                    .valueUnbound(new SSLSessionBindingEvent(this, name));
+            ((SSLSessionBindingListener) old).valueUnbound(new SSLSessionBindingEvent(this, name));
         }
 
     }
 
-    /**
-     * @see javax.net.ssl.SSLSession.removeValue(String name)
-     */
     public void removeValue(String name) {
         if (name == null) {
             throw new IllegalArgumentException("Parameter is null");
         }
-        values.remove(name, AccessController.getContext());
+        values.remove(new ValueKey(name));
 
     }
 
+    @Override
     public Object clone() {
-        SSLSessionImpl ses = new SSLSessionImpl();
-        ses.id = this.id;
-        ses.creationTime = this.creationTime;
-        ses.lastAccessedTime = this.lastAccessedTime;
-        ses.isValid = this.isValid;
-        ses.cipherSuite = this.cipherSuite;
-        ses.localCertificates = this.localCertificates;
-        ses.peerCertificates = this.peerCertificates;
-        ses.master_secret = this.master_secret;
-        ses.clientRandom = this.clientRandom;
-        ses.serverRandom = this.serverRandom;
-        ses.peerHost = this.peerHost;
-        ses.peerPort = this.peerPort;
-        ses.isServer = this.isServer;
-        ses.context = this.context;
-        ses.protocol = this.protocol;
-        ses.values = this.values;
-        return ses;
+        try {
+            return super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new AssertionError(e);
+        }
     }
 
-
     /**
      * Sets the address of the peer
+     * 
      * @param peerHost
      * @param peerPort
      */

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoryImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoryImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoryImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoryImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.SSLSocketWrapper;
@@ -65,6 +60,7 @@
     /**
      * @see javax.net.ssl.SSLSocketFactory#getDefaultCipherSuites()
      */
+    @Override
     public String[] getDefaultCipherSuites() {
         if (instantiationException != null) {
             return new String[0];
@@ -75,6 +71,7 @@
     /**
      * @see javax.net.ssl.SSLSocketFactory#getSupportedCipherSuites()
      */
+    @Override
     public String[] getSupportedCipherSuites() {
         if (instantiationException != null) {
             return new String[0];
@@ -85,6 +82,7 @@
     /**
      * @see javax.net.ssl.SSLSocketFactory#createSocket(Socket,String,int,boolean)
      */
+    @Override
     public Socket createSocket(Socket s, String host, int port,
             boolean autoClose) throws IOException {
         if (instantiationException != null) {
@@ -99,6 +97,7 @@
     /**
      * @see javax.net.SocketFactory#createSocket()
      */
+    @Override
     public Socket createSocket() throws IOException {
         if (instantiationException != null) {
             throw instantiationException;
@@ -109,6 +108,7 @@
     /**
      * @see javax.net.SocketFactory#createSocket(String,int)
      */
+    @Override
     public Socket createSocket(String host, int port)
             throws IOException, UnknownHostException {
         if (instantiationException != null) {
@@ -121,6 +121,7 @@
     /**
      * @see javax.net.SocketFactory#createSocket(String,int,InetAddress,int)
      */
+    @Override
     public Socket createSocket(String host, int port,
             InetAddress localHost, int localPort) throws IOException,
             UnknownHostException {
@@ -134,6 +135,7 @@
     /**
      * @see javax.net.SocketFactory#createSocket(InetAddress,int)
      */
+    @Override
     public Socket createSocket(InetAddress host, int port)
             throws IOException {
         if (instantiationException != null) {
@@ -146,6 +148,7 @@
     /**
      * @see javax.net.SocketFactory#createSocket(InetAddress,int,InetAddress,int)
      */
+    @Override
     public Socket createSocket(InetAddress address, int port,
             InetAddress localAddress, int localPort) throws IOException {
         if (instantiationException != null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.AlertException;
@@ -79,7 +74,7 @@
     protected InputStream input;
     protected OutputStream output;
     // handshake complete listeners
-    private ArrayList listeners;
+    private ArrayList<HandshakeCompletedListener> listeners;
     // logger
     private Logger.Stream logger = Logger.getStream("socket");
 
@@ -211,6 +206,7 @@
      * @see javax.net.ssl.SSLSocket#getSupportedCipherSuites()
      * method documentation for more information
      */
+    @Override
     public String[] getSupportedCipherSuites() {
         return CipherSuite.getSupportedCipherSuiteNames();
     }
@@ -220,6 +216,7 @@
      * @see javax.net.ssl.SSLSocket#getEnabledCipherSuites()
      * method documentation for more information
      */
+    @Override
     public String[] getEnabledCipherSuites() {
         return sslParameters.getEnabledCipherSuites();
     }
@@ -229,6 +226,7 @@
      * @see javax.net.ssl.SSLSocket#setEnabledCipherSuites(String[])
      * method documentation for more information
      */
+    @Override
     public void setEnabledCipherSuites(String[] suites) {
         sslParameters.setEnabledCipherSuites(suites);
     }
@@ -238,8 +236,9 @@
      * @see javax.net.ssl.SSLSocket#getSupportedProtocols()
      * method documentation for more information
      */
+    @Override
     public String[] getSupportedProtocols() {
-        return (String[]) ProtocolVersion.supportedProtocols.clone();
+        return ProtocolVersion.supportedProtocols.clone();
     }
 
     /**
@@ -247,6 +246,7 @@
      * @see javax.net.ssl.SSLSocket#getEnabledProtocols()
      * method documentation for more information
      */
+    @Override
     public String[] getEnabledProtocols() {
         return sslParameters.getEnabledProtocols();
     }
@@ -256,6 +256,7 @@
      * @see javax.net.ssl.SSLSocket#setEnabledProtocols(String[])
      * method documentation for more information
      */
+    @Override
     public void setEnabledProtocols(String[] protocols) {
         sslParameters.setEnabledProtocols(protocols);
     }
@@ -265,6 +266,7 @@
      * @see javax.net.ssl.SSLSocket#setUseClientMode(boolean)
      * method documentation for more information
      */
+    @Override
     public void setUseClientMode(boolean mode) {
         if (handshake_started) {
             throw new IllegalArgumentException(
@@ -278,6 +280,7 @@
      * @see javax.net.ssl.SSLSocket#getUseClientMode()
      * method documentation for more information
      */
+    @Override
     public boolean getUseClientMode() {
         return sslParameters.getUseClientMode();
     }
@@ -287,6 +290,7 @@
      * @see javax.net.ssl.SSLSocket#setNeedClientAuth(boolean)
      * method documentation for more information
      */
+    @Override
     public void setNeedClientAuth(boolean need) {
         sslParameters.setNeedClientAuth(need);
     }
@@ -296,6 +300,7 @@
      * @see javax.net.ssl.SSLSocket#getNeedClientAuth()
      * method documentation for more information
      */
+    @Override
     public boolean getNeedClientAuth() {
         return sslParameters.getNeedClientAuth();
     }
@@ -305,6 +310,7 @@
      * @see javax.net.ssl.SSLSocket#setWantClientAuth(boolean)
      * method documentation for more information
      */
+    @Override
     public void setWantClientAuth(boolean want) {
         sslParameters.setWantClientAuth(want);
     }
@@ -314,6 +320,7 @@
      * @see javax.net.ssl.SSLSocket#getWantClientAuth()
      * method documentation for more information
      */
+    @Override
     public boolean getWantClientAuth() {
         return sslParameters.getWantClientAuth();
     }
@@ -323,6 +330,7 @@
      * @see javax.net.ssl.SSLSocket#setEnableSessionCreation(boolean)
      * method documentation for more information
      */
+    @Override
     public void setEnableSessionCreation(boolean flag) {
         sslParameters.setEnableSessionCreation(flag);
     }
@@ -332,6 +340,7 @@
      * @see javax.net.ssl.SSLSocket#getEnableSessionCreation()
      * method documentation for more information
      */
+    @Override
     public boolean getEnableSessionCreation() {
         return sslParameters.getEnableSessionCreation();
     }
@@ -343,6 +352,7 @@
      * @see javax.net.ssl.SSLSocket#getSession()
      * method documentation for more information
      */
+    @Override
     public SSLSession getSession() {
         if (!handshake_started) {
             try {
@@ -361,13 +371,14 @@
      * @see javax.net.ssl.SSLSocket#addHandshakeCompletedListener(HandshakeCompletedListener)
      * method documentation for more information
      */
+    @Override
     public void addHandshakeCompletedListener(
             HandshakeCompletedListener listener) {
         if (listener == null) {
             throw new IllegalArgumentException("Provided listener is null");
         }
         if (listeners == null) {
-            listeners = new ArrayList();
+            listeners = new ArrayList<HandshakeCompletedListener>();
         }
         listeners.add(listener);
     }
@@ -377,6 +388,7 @@
      * @see javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(HandshakeCompletedListener)
      * method documentation for more information
      */
+    @Override
     public void removeHandshakeCompletedListener(
             HandshakeCompletedListener listener) {
         if (listener == null) {
@@ -401,6 +413,7 @@
      * @see javax.net.ssl.SSLSocket#startHandshake()
      * method documentation for more information
      */
+    @Override
     public void startHandshake() throws IOException {
         if (appDataIS == null) {
             throw new IOException("Socket is not connected.");
@@ -450,6 +463,7 @@
      * @see javax.net.ssl.SSLSocket#getInputStream()
      * method documentation for more information
      */
+    @Override
     public InputStream getInputStream() throws IOException {
         if (socket_was_closed) {
             throw new IOException("Socket has already been closed.");
@@ -462,6 +476,7 @@
      * @see javax.net.ssl.SSLSocket#getOutputStream()
      * method documentation for more information
      */
+    @Override
     public OutputStream getOutputStream() throws IOException {
         if (socket_was_closed) {
             throw new IOException("Socket has already been closed.");
@@ -474,6 +489,7 @@
      * @see java.net.Socket#connect(SocketAddress)
      * method documentation for more information
      */
+    @Override
     public void connect(SocketAddress endpoint) throws IOException {
         super.connect(endpoint);
         init();
@@ -484,6 +500,7 @@
      * @see java.net.Socket#connect(SocketAddress,int)
      * method documentation for more information
      */
+    @Override
     public void connect(SocketAddress endpoint, int timeout) 
             throws IOException {
         super.connect(endpoint, timeout);
@@ -495,6 +512,7 @@
      * @see javax.net.ssl.SSLSocket#close()
      * method documentation for more information
      */
+    @Override
     public void close() throws IOException {
         if (logger != null) {
             logger.println("SSLSocket.close "+socket_was_closed);
@@ -517,6 +535,7 @@
     /**
      * This method is not supported for SSLSocket implementation.
      */
+    @Override
     public void sendUrgentData(int data) throws IOException {
         throw new SocketException(
                 "Method sendUrgentData() is not supported.");
@@ -525,6 +544,7 @@
     /**
      * This method is not supported for SSLSocket implementation.
      */
+    @Override
     public void setOOBInline(boolean on) throws SocketException {
         throw new SocketException(
                 "Methods sendUrgentData, setOOBInline are not supported.");
@@ -533,6 +553,7 @@
     /**
      * This method is not supported for SSLSocket implementation.
      */
+    @Override
     public void shutdownOutput() {
         throw new UnsupportedOperationException(
                 "Method shutdownOutput() is not supported.");
@@ -541,6 +562,7 @@
     /**
      * This method is not supported for SSLSocket implementation.
      */
+    @Override
     public void shutdownInput() {
         throw new UnsupportedOperationException(
                 "Method shutdownInput() is not supported.");
@@ -549,6 +571,7 @@
     /**
      * Returns the string representation of the object.
      */
+    @Override
     public String toString() {
         return "[SSLSocketImpl]";
     }
@@ -770,7 +793,7 @@
                 new HandshakeCompletedEvent(this, session);
             int size = listeners.size();
             for (int i=0; i<size; i++) {
-                ((HandshakeCompletedListener)listeners.get(i))
+                listeners.get(i)
                     .handshakeCompleted(event);
             }
         }
@@ -789,21 +812,21 @@
                 + alertProtocol.getAlertDescription();
             shutdown();
             throw new SSLException(description);
-        } else {
-            if (logger != null) {
-                logger.println("Warning alert received: "
-                    + alertProtocol.getAlertDescription());
-            }
-            switch(alertProtocol.getDescriptionCode()) {
-                case AlertProtocol.CLOSE_NOTIFY:
-                    alertProtocol.setProcessed();
-                    appDataIS.setEnd();
-                    close();
-                    return;
-                default:
-                    alertProtocol.setProcessed();
-                // TODO: process other warning messages
-            }
+        }
+        
+        if (logger != null) {
+            logger.println("Warning alert received: "
+                + alertProtocol.getAlertDescription());
+        }
+        switch(alertProtocol.getDescriptionCode()) {
+            case AlertProtocol.CLOSE_NOTIFY:
+                alertProtocol.setProcessed();
+                appDataIS.setEnd();
+                close();
+                return;
+            default:
+                alertProtocol.setProcessed();
+            // TODO: process other warning messages
         }
     }
     
@@ -821,23 +844,5 @@
         shutdown();
         throw reason;
     }
-
-
-    @Override
-    public void setSSLParameters(javax.net.ssl.SSLParameters inputSSLParameters) {
-        setEnabledCipherSuites(inputSSLParameters.getCipherSuites());
-        setNeedClientAuth(inputSSLParameters.getNeedClientAuth());
-        setWantClientAuth(inputSSLParameters.getWantClientAuth());
-        setEnabledProtocols(inputSSLParameters.getProtocols());
-    }
-
-    @Override
-    public javax.net.ssl.SSLParameters getSSLParameters() {
-        javax.net.ssl.SSLParameters outputSSLParameters = new javax.net.ssl.SSLParameters();
-        outputSSLParameters.setCipherSuites(sslParameters.getEnabledCipherSuites());
-        outputSSLParameters.setProtocols(sslParameters.getEnabledProtocols());
-        outputSSLParameters.setNeedClientAuth(sslParameters.getNeedClientAuth());
-        outputSSLParameters.setWantClientAuth(sslParameters.getWantClientAuth());
-        return outputSSLParameters;
-    }
 }
+

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.AlertException;
@@ -85,6 +80,7 @@
      * @return the number of available bytes.
      * @throws  IOException
      */
+    @Override
     public int available() throws IOException {
         return end - pos;
     }
@@ -93,6 +89,7 @@
      * Closes the stream
      * @throws  IOException
      */
+    @Override
     public void close() throws IOException {
         buffer = null;
     }
@@ -104,6 +101,7 @@
      * @return read value.
      * @throws  IOException
      */
+    @Override
     public int read() throws IOException {
         if (buffer == null) {
             throw new IOException("Stream was closed.");
@@ -124,6 +122,7 @@
      * Method acts as described in spec for superclass.
      * @see java.io.InputStream#read(byte[])
      */
+    @Override
     public int read(byte[] b) throws IOException {
         return read(b, 0, b.length);
     }
@@ -132,6 +131,7 @@
      * Method acts as described in spec for superclass.
      * @see java.io.InputStream#read(byte[],int,int)
      */
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         int read_b;
         int i = 0;
@@ -149,6 +149,7 @@
      * Method acts as described in spec for superclass.
      * @see java.io.InputStream#skip(long)
      */
+    @Override
     public long skip(long n) throws IOException {
         long i = 0;
         int av = available();

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.io.IOException;
@@ -41,15 +36,18 @@
 
     private byte[] bytik = new byte[1];
 
+    @Override
     public void write(int b) throws IOException {
         bytik[0] = (byte) (b & 0xFF);
         owner.writeAppData(bytik, 0, 1);
     }
 
+    @Override
     public void write(byte[] b) throws IOException {
         owner.writeAppData(b, 0, b.length);
     }
 
+    @Override
     public void write(byte[] b, int off, int len) throws IOException {
         owner.writeAppData(b, off, len);
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketWrapper.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketWrapper.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketWrapper.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketWrapper.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.io.IOException;
@@ -46,11 +41,13 @@
         init();
     }
 
+    @Override
     protected void initTransportLayer() throws IOException {
         input = socket.getInputStream();
         output = socket.getOutputStream();
     }
 
+    @Override
     protected void closeTransportLayer() throws IOException {
         if (autoClose && (input != null)) {
             socket.close();
@@ -61,131 +58,163 @@
 
     // ------------------- Wrapping method implementations ---------------
 
+    @Override
     public void connect(SocketAddress sockaddr, int timeout)
         throws IOException {
         throw new IOException("Underlying socket is already connected.");
     }
 
+    @Override
     public void connect(SocketAddress sockaddr) throws IOException {
         throw new IOException("Underlying socket is already connected.");
     }
 
+    @Override
     public void bind(SocketAddress sockaddr) throws IOException {
         throw new IOException("Underlying socket is already connected.");
     }
 
+    @Override
     public SocketAddress getRemoteSocketAddress() {
         return socket.getRemoteSocketAddress();
     }
 
+    @Override
     public SocketAddress getLocalSocketAddress() {
         return socket.getLocalSocketAddress();
     }
 
+    @Override
     public InetAddress getLocalAddress() {
         return socket.getLocalAddress();
     }
 
+    @Override
     public InetAddress getInetAddress() {
         return socket.getInetAddress();
     }
 
+    @Override
     public String toString() {
         return "SSL socket over " + socket.toString();
     }
 
+    @Override
     public void setSoLinger(boolean on, int linger) throws SocketException {
         socket.setSoLinger(on, linger);
     }
 
+    @Override
     public void setTcpNoDelay(boolean on) throws SocketException {
         socket.setTcpNoDelay(on);
     }
 
+    @Override
     public void setReuseAddress(boolean on) throws SocketException {
         socket.setReuseAddress(on);
     }
 
+    @Override
     public void setKeepAlive(boolean on) throws SocketException {
         socket.setKeepAlive(on);
     }
 
+    @Override
     public void setTrafficClass(int tos) throws SocketException {
         socket.setTrafficClass(tos);
     }
 
+    @Override
     public void setSoTimeout(int to) throws SocketException {
         socket.setSoTimeout(to);
     }
 
+    @Override
     public void setSendBufferSize(int size) throws SocketException {
         socket.setSendBufferSize(size);
     }
 
+    @Override
     public void setReceiveBufferSize(int size) throws SocketException {
         socket.setReceiveBufferSize(size);
     }
 
+    @Override
     public boolean getTcpNoDelay() throws SocketException {
         return socket.getTcpNoDelay();
     }
 
+    @Override
     public boolean getReuseAddress() throws SocketException {
         return socket.getReuseAddress();
     }
 
+    @Override
     public boolean getOOBInline() throws SocketException {
         return socket.getOOBInline();
     }
 
+    @Override
     public boolean getKeepAlive() throws SocketException {
         return socket.getKeepAlive();
     }
 
+    @Override
     public int getTrafficClass() throws SocketException {
         return socket.getTrafficClass();
     }
 
+    @Override
     public int getSoTimeout() throws SocketException {
         return socket.getSoTimeout();
     }
 
+    @Override
     public int getSoLinger() throws SocketException {
         return socket.getSoLinger();
     }
 
+    @Override
     public int getSendBufferSize() throws SocketException {
         return socket.getSendBufferSize();
     }
 
+    @Override
     public int getReceiveBufferSize() throws SocketException {
         return socket.getReceiveBufferSize();
     }
 
+    @Override
     public boolean isConnected() {
         return socket.isConnected();
     }
 
+    @Override
     public boolean isClosed() {
         return socket.isClosed();
     }
 
+    @Override
     public boolean isBound() {
         return socket.isBound();
     }
 
+    @Override
     public boolean isOutputShutdown() {
         return socket.isOutputShutdown();
     }
 
+    @Override
     public boolean isInputShutdown() {
         return socket.isInputShutdown();
     }
 
+    @Override
     public int getPort() {
         return socket.getPort();
     }
 
+    @Override
     public int getLocalPort() {
         return socket.getLocalPort();
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.io.IOException;
@@ -37,6 +32,7 @@
         this.in = in;
     }
 
+    @Override
     public int available() throws IOException {
         return in.available();
     }
@@ -49,6 +45,7 @@
      * @throws org.apache.harmony.xnet.provider.jsse.EndOfSourceException if the end of the underlying
      * stream has been reached.
      */
+    @Override
     public int read() throws IOException {
         int res = in.read();
         if (res < 0) {

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLv3Constants.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLv3Constants.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLv3Constants.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLv3Constants.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris Kuznetsov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 /**

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris Kuznetsov
-* @version $Revision$
-*/
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.SSLv3Constants;
@@ -56,7 +51,7 @@
  * Handshake protocol operates on top of the Record Protocol.
  * It responsible for negotiating a session.
  * 
- * The implementation proceses inbound client handshake messages,
+ * The implementation processes inbound client handshake messages,
  * creates and sends respond messages. Outbound messages are supplied 
  * to Record Protocol. Detected errors are reported to the Alert protocol.
  * 
@@ -83,6 +78,7 @@
      * Start session negotiation
      * @param session
      */
+    @Override
     public void start() {
         if (session == null) { // initial handshake
             status = NEED_UNWRAP;
@@ -102,6 +98,7 @@
      * Proceses inbound handshake messages
      * @param bytes
      */
+    @Override
     public void unwrap(byte[] bytes) {
 
         io_stream.append(bytes);
@@ -129,15 +126,12 @@
                     needSendHelloRequest = false;
                     clientHello = new ClientHello(io_stream, length);
                     if (nonBlocking) {
-                        delegatedTasks.add(new DelegatedTask(
-                                new PrivilegedExceptionAction(){
-                            public Object run() throws Exception {
+                        delegatedTasks.add(new DelegatedTask(new PrivilegedExceptionAction<Void>() {
+                            public Void run() throws Exception {
                                 processClientHello();
                                 return null;
-                                }
-                            },
-                            this,
-                            AccessController.getContext()));
+                            }
+                        }, this, AccessController.getContext()));
                         return;
                     }
                     processClientHello();
@@ -322,6 +316,7 @@
      * @ see TLS 1.0 spec., E.1. Version 2 client hello
      * @param bytes
      */
+    @Override
     public void unwrapSSLv2(byte[] bytes) {
         io_stream.append(bytes);
         io_stream.mark();
@@ -333,8 +328,8 @@
         }
         if (nonBlocking) {
             delegatedTasks.add(new DelegatedTask(
-                    new PrivilegedExceptionAction() {
-                        public Object run() throws Exception {
+                    new PrivilegedExceptionAction<Void>() {
+                        public Void run() throws Exception {
                             processClientHello();
                             return null;
                         }
@@ -399,10 +394,9 @@
                         status = NOT_HANDSHAKING;
                         clearMessages();
                         return;
-                    } else {
-                        fatalAlert(AlertProtocol.HANDSHAKE_FAILURE,
-                                "SSL Session may not be created");
                     }
+                    // throw AlertException
+                    fatalAlert(AlertProtocol.HANDSHAKE_FAILURE, "SSL Session may not be created");
                 }
                 session = null;
             } else {
@@ -553,7 +547,7 @@
                     } catch (NoSuchAlgorithmException e) {
                             kf = KeyFactory.getInstance("DiffieHellman");
                     }
-                    dhkeySpec = (DHPublicKeySpec) kf.getKeySpec(dhkey,
+                    dhkeySpec = kf.getKeySpec(dhkey,
                             DHPublicKeySpec.class);
                 }
                 if (!cipher_suite.isAnonymous()) { // calculate signed_params
@@ -638,6 +632,7 @@
     /**
      * Creates and sends finished message
      */
+    @Override
     protected void makeFinished() {
         byte[] verify_data;
         boolean isTLS = (serverHello.server_version[1] == 1); // TLS 1.0 protocol
@@ -684,8 +679,9 @@
     }
 
     /**
-     * Proceses inbound ChangeCipherSpec message
+     * Processes inbound ChangeCipherSpec message
      */
+    @Override
     public void receiveChangeCipherSpec() {    
         if (isResuming) {
             if (serverFinished == null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris Kuznetsov
-* @version $Revision$
-*/
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.Message;
@@ -111,6 +106,7 @@
      * Sends message
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
         out.write(server_version);
         out.write(random);
@@ -133,6 +129,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.SERVER_HELLO;
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris Kuznetsov
-* @version $Revision$
-*/
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.Message;
@@ -59,6 +54,7 @@
      * Sends message
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
     }
     
@@ -66,6 +62,7 @@
      * Returns message length
      * @return
      */
+    @Override
     public int length() {
         return 0;
     }
@@ -74,6 +71,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.SERVER_HELLO_DONE;
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
-* @author Boris Kuznetsov
-* @version $Revision$
-*/
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import org.apache.harmony.xnet.provider.jsse.Message;
@@ -150,6 +145,7 @@
      * Sends message
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
         out.writeUint16(bytes1.length);
         out.write(bytes1);
@@ -189,6 +185,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.SERVER_KEY_EXCHANGE;
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris Kuznetsov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.io.File;
@@ -50,6 +45,7 @@
     /**
      * @see javax.net.ssl.TrustManagerFactorySpi#engineInit(KeyStore)
      */
+    @Override
     public void engineInit(KeyStore ks) throws KeyStoreException {
         if (ks != null) {
             keyStore = ks;
@@ -107,6 +103,7 @@
     /**
      * @see javax.net.ssl.engineInit(ManagerFactoryParameters)
      */
+    @Override
     public void engineInit(ManagerFactoryParameters spec)
             throws InvalidAlgorithmParameterException {
         throw new InvalidAlgorithmParameterException(
@@ -116,6 +113,7 @@
     /**
      * @see javax.net.ssl.engineGetTrustManagers()
      */
+    @Override
     public TrustManager[] engineGetTrustManagers() {
         if (keyStore == null) {
             throw new IllegalStateException(

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java Thu Dec 18 01:46:12 2008
@@ -15,11 +15,6 @@
  *  limitations under the License.
  */
 
-/**
- * @author Boris Kuznetsov
- * @version $Revision$
- */
-
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.security.InvalidAlgorithmParameterException;
@@ -66,13 +61,11 @@
         try {
             validator = CertPathValidator.getInstance("PKIX");
             factory = CertificateFactory.getInstance("X509");
-            String alias;
-            X509Certificate cert;
             byte[] nameConstrains = null;
-            Set trusted = new HashSet();
-            for (Enumeration en = ks.aliases(); en.hasMoreElements();) {
-                alias = (String) en.nextElement();
-                cert = (X509Certificate) ks.getCertificate(alias);
+            Set<TrustAnchor> trusted = new HashSet<TrustAnchor>();
+            for (Enumeration<String> en = ks.aliases(); en.hasMoreElements();) {
+                final String alias = en.nextElement();
+                final X509Certificate cert = (X509Certificate) ks.getCertificate(alias);
                 if (cert != null) {
                     trusted.add(new TrustAnchor(cert, nameConstrains));
                 }
@@ -137,11 +130,11 @@
         if (params == null) {
             return new X509Certificate[0];
         }
-        Set anchors = params.getTrustAnchors();
+        Set<TrustAnchor> anchors = params.getTrustAnchors();
         X509Certificate[] certs = new X509Certificate[anchors.size()];
         int i = 0;
-        for (Iterator it = anchors.iterator(); it.hasNext();) {
-            certs[i++] = ((TrustAnchor) it.next()).getTrustedCert();
+        for (Iterator<TrustAnchor> it = anchors.iterator(); it.hasNext();) {
+            certs[i++] = it.next().getTrustedCert();
         }
         return certs;
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java Thu Dec 18 01:46:12 2008
@@ -40,6 +40,7 @@
 }
 
 class MyCertPathParameters implements CertPathParameters {
+    @Override
     public Object clone() {
         return new MyCertPathParameters();
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java Thu Dec 18 01:46:12 2008
@@ -46,6 +46,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault();
@@ -68,6 +69,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         if (ss != null) {

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java Thu Dec 18 01:46:12 2008
@@ -112,6 +112,7 @@
     /*
      * @see javax.net.ssl.HttpsURLConnection#getCipherSuite()
      */
+    @Override
     public String getCipherSuite() {
         return null;
     }
@@ -119,6 +120,7 @@
     /*
      * @see javax.net.ssl.HttpsURLConnection#getLocalCertificates()
      */
+    @Override
     public Certificate[] getLocalCertificates() {
         return null;
     }
@@ -126,6 +128,7 @@
     /*
      * @see javax.net.ssl.HttpsURLConnection#getServerCertificates()
      */
+    @Override
     public Certificate[] getServerCertificates()
             throws SSLPeerUnverifiedException {
         return null;
@@ -134,12 +137,14 @@
     /*
      * @see java.net.HttpURLConnection#disconnect()
      */
+    @Override
     public void disconnect() {
     }
 
     /*
      * @see java.net.HttpURLConnection#usingProxy()
      */
+    @Override
     public boolean usingProxy() {
         return false;
     }
@@ -147,6 +152,7 @@
     /*
      * @see java.net.URLConnection#connect()
      */
+    @Override
     public void connect() throws IOException {
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory1Test.java Thu Dec 18 01:46:12 2008
@@ -31,7 +31,7 @@
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.KeyManagerFactorySpi;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MyKeyManagerFactorySpi;
 import junit.framework.TestCase;
 

Modified: harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java?rev=727683&r1=727682&r2=727683&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java Thu Dec 18 01:46:12 2008
@@ -29,7 +29,7 @@
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.ManagerFactoryParameters;
 
-import org.apache.harmony.security.tests.support.SpiEngUtils;
+import org.apache.harmony.xnet.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MyKeyManagerFactorySpi;
 import junit.framework.TestCase;
 
@@ -59,6 +59,7 @@
 
     Provider mProv;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         mProv = (new SpiEngUtils()).new MyProvider("MyKMFProvider",
@@ -70,6 +71,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         Security.removeProvider(mProv.getName());



Mime
View raw message