harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r726511 [1/3] - in /harmony/enhanced/classlib/trunk/modules/x-net/src: main/java/javax/net/ main/java/javax/net/ssl/ main/java/org/apache/harmony/xnet/provider/jsse/ test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/ test/api/java/o...
Date Sun, 14 Dec 2008 18:30:19 GMT
Author: ndbeyer
Date: Sun Dec 14 10:30:16 2008
New Revision: 726511

URL: http://svn.apache.org/viewvc?rev=726511&view=rev
Log:
cleanp - missing @Override, simplify code paths, etc

Modified:
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultServerSocketFactory.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultSocketFactory.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionContextImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoryImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketWrapper.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/CertPathTrustManagerParametersTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HandshakeCompletedEventTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/HttpsURLConnectionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyManagerFactory2Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/KeyStoreBuilderParametersTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLContext2Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLEngineTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLPermissionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLServerSocketTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/SSLSocketTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/TrustManagerFactory2Test.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/HandshakeCompletedEventTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/SSLExceptionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/SSLHandshakeExceptionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/SSLKeyExceptionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/SSLPeerUnverifiedExceptionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/SSLProtocolExceptionTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/api/java/org/apache/harmony/xnet/tests/javax/net/ssl/serialization/SSLSessionBindingEventTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ServerSocketFactoryTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/SocketFactoryTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/HttpsURLConnection_ImplTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/SSLServerSocketFactoryTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/javax/net/ssl/SSLSocketFactoryTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/DigitalSignatureTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLEngineImplTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImplTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLSocketFactoriesTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLSocketFunctionalTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLSocketImplTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImplTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/TrustManagerImplTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/impl/java/org/apache/harmony/xnet/tests/provider/jsse/DigitalSignatureTest.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MyKeyManagerFactorySpi.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MySSLContextSpi.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/java/javax/net/ssl/MyTrustManagerFactorySpi.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/MyKeyManagerFactorySpi.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/MySSLContextSpi.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/MyTrustManagerFactorySpi.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/test/support/common/java/org/apache/harmony/xnet/tests/support/SpiEngUtils.java

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultServerSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultServerSocketFactory.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultServerSocketFactory.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultServerSocketFactory.java Sun Dec 14 10:30:16 2008
@@ -32,17 +32,19 @@
  */
 class DefaultServerSocketFactory extends ServerSocketFactory {
 
+    @Override
     public ServerSocket createServerSocket(int port) throws IOException {
         return new ServerSocket(port);
     }
 
-    public ServerSocket createServerSocket(int port, int backlog)
-            throws IOException {
+    @Override
+    public ServerSocket createServerSocket(int port, int backlog) throws IOException {
         return new ServerSocket(port, backlog);
     }
 
-    public ServerSocket createServerSocket(int port, int backlog,
-            InetAddress iAddress) throws IOException {
+    @Override
+    public ServerSocket createServerSocket(int port, int backlog, InetAddress iAddress)
+            throws IOException {
         return new ServerSocket(port, backlog, iAddress);
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultSocketFactory.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultSocketFactory.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/DefaultSocketFactory.java Sun Dec 14 10:30:16 2008
@@ -33,26 +33,30 @@
  */
 class DefaultSocketFactory extends SocketFactory {
 
-	public Socket createSocket() throws IOException {
-		return new Socket();
-	}
+    @Override
+    public Socket createSocket() throws IOException {
+        return new Socket();
+    }
 
-    public Socket createSocket(String host, int port) throws IOException,
-            UnknownHostException {
+    @Override
+    public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
         return new Socket(host, port);
     }
 
-    public Socket createSocket(String host, int port, InetAddress localHost,
-            int localPort) throws IOException, UnknownHostException {
+    @Override
+    public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
+            throws IOException, UnknownHostException {
         return new Socket(host, port, localHost, localPort);
     }
 
+    @Override
     public Socket createSocket(InetAddress host, int port) throws IOException {
         return new Socket(host, port);
     }
 
-    public Socket createSocket(InetAddress address, int port,
-            InetAddress localAddress, int localPort) throws IOException {
+    @Override
+    public Socket createSocket(InetAddress address, int port, InetAddress localAddress,
+            int localPort) throws IOException {
         return new Socket(address, port, localAddress, localPort);
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java Sun Dec 14 10:30:16 2008
@@ -33,33 +33,36 @@
  */
 class DefaultSSLServerSocketFactory extends SSLServerSocketFactory {
 
-    private String errMessage;
-    
+    private final String errMessage;
+
+    DefaultSSLServerSocketFactory(String mes) {
+        errMessage = mes;
+    }
+
+    @Override
     public String[] getDefaultCipherSuites() {
         return new String[0];
     }
 
+    @Override
     public String[] getSupportedCipherSuites() {
         return new String[0];
     }
 
+    @Override
     public ServerSocket createServerSocket(int port) throws IOException {
         throw new SocketException(errMessage);
     }
 
-
-    public ServerSocket createServerSocket(int port, int backlog)
-            throws IOException {
+    @Override
+    public ServerSocket createServerSocket(int port, int backlog) throws IOException {
         throw new SocketException(errMessage);
     }
 
-    public ServerSocket createServerSocket(int port, int backlog,
-            InetAddress iAddress) throws IOException {
+    @Override
+    public ServerSocket createServerSocket(int port, int backlog, InetAddress iAddress)
+            throws IOException {
         throw new SocketException(errMessage);
     }
-    
-    DefaultSSLServerSocketFactory(String mes) {
-        errMessage = mes;
-    }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java Sun Dec 14 10:30:16 2008
@@ -33,58 +33,49 @@
  * 
  */
 class DefaultSSLSocketFactory extends SSLSocketFactory {
-	
-	private String errMessage;
-    
+
+    private final String errMessage;
+
+    DefaultSSLSocketFactory(String mes) {
+        errMessage = mes;
+    }
+
+    @Override
     public String[] getDefaultCipherSuites() {
         return new String[0];
     }
 
+    @Override
     public String[] getSupportedCipherSuites() {
         return new String[0];
     }
 
-    /**
-     * @see javax.net.ssl.SSLSocketFactory#createSocket(java.net.Socket, java.lang.String, int, boolean)
-     */
-    public Socket createSocket(Socket s, String host, int port,
-            boolean autoClose) throws IOException {
-    	throw new SocketException(errMessage);
-    }
-
-    /**
-     * @see javax.net.SocketFactory#createSocket(java.lang.String, int)
-     */
-    public Socket createSocket(String host, int port) throws IOException,
-            UnknownHostException {
-    	throw new SocketException(errMessage);
-    }
-
-    /**
-     * @see javax.net.SocketFactory#createSocket(java.lang.String, int, java.net.InetAddress, int)
-     */
-    public Socket createSocket(String host, int port, InetAddress localHost,
-            int localPort) throws IOException, UnknownHostException {
-    	throw new SocketException(errMessage);
-    }
-
-    /**
-     * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int)
-     */
-    public Socket createSocket(InetAddress host, int port) throws IOException {
-    	throw new SocketException(errMessage);
+    @Override
+    public Socket createSocket(Socket s, String host, int port, boolean autoClose)
+            throws IOException {
+        throw new SocketException(errMessage);
     }
 
-    /**
-     * @see javax.net.SocketFactory#createSocket(java.net.InetAddress, int, java.net.InetAddress, int)
-     */
-    public Socket createSocket(InetAddress address, int port,
-            InetAddress localAddress, int localPort) throws IOException {
-    	throw new SocketException(errMessage);
+    @Override
+    public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
+        throw new SocketException(errMessage);
     }
-    
-    DefaultSSLSocketFactory(String mes) {
-        errMessage = mes;
+
+    @Override
+    public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
+            throws IOException, UnknownHostException {
+        throw new SocketException(errMessage);
+    }
+
+    @Override
+    public Socket createSocket(InetAddress host, int port) throws IOException {
+        throw new SocketException(errMessage);
+    }
+
+    @Override
+    public Socket createSocket(InetAddress address, int port, InetAddress localAddress,
+            int localPort) throws IOException {
+        throw new SocketException(errMessage);
     }
 
 }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/SSLEngineResult.java Sun Dec 14 10:30:16 2008
@@ -22,12 +22,16 @@
 
 package javax.net.ssl;
 
-/**
- * @com.intel.drl.spec_ref
- * 
- */
 public class SSLEngineResult {
-    
+
+    public enum HandshakeStatus {
+        NOT_HANDSHAKING, FINISHED, NEED_TASK, NEED_WRAP, NEED_UNWRAP
+    }
+
+    public static enum Status {
+        BUFFER_OVERFLOW, BUFFER_UNDERFLOW, CLOSED, OK
+    }
+
     // Store Status object
     private final SSLEngineResult.Status status;
 
@@ -40,12 +44,8 @@
     // Store bytesProduced
     private final int bytesProduced;
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public SSLEngineResult(SSLEngineResult.Status status,
-            SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed,
-            int bytesProduced) {
+            SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced) {
         if (status == null) {
             throw new IllegalArgumentException("status is null");
         }
@@ -64,67 +64,26 @@
         this.bytesProduced = bytesProduced;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public final Status getStatus() {
         return status;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public final HandshakeStatus getHandshakeStatus() {
         return handshakeStatus;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public final int bytesConsumed() {
         return bytesConsumed;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
     public final int bytesProduced() {
         return bytesProduced;
     }
 
-    /**
-     * @com.intel.drl.spec_ref
-     */
+    @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer("SSLEngineReport: Status = ");
-        sb.append(status.toString());
-        sb.append("  HandshakeStatus = ");
-        sb.append(handshakeStatus.toString());
-        sb.append("\n                 bytesConsumed = ");
-        sb.append(Integer.toString(bytesConsumed));
-        sb.append(" bytesProduced = ");
-        sb.append(Integer.toString(bytesProduced));
-        return sb.toString();
-    }
-
-    /**
-     * @com.intel.drl.spec_ref 
-     */
-    public enum HandshakeStatus {
-        NOT_HANDSHAKING,
-        FINISHED,
-        NEED_TASK,
-        NEED_WRAP,
-        NEED_UNWRAP
-    }
-
-    /**
-     * @com.intel.drl.spec_ref 
-     */
-    public static enum Status {
-        BUFFER_OVERFLOW,
-        BUFFER_UNDERFLOW,
-        CLOSED,
-        OK
+        return "SSLEngineReport: Status = " + status + "  HandshakeStatus = " + handshakeStatus
+                + "\n                 bytesConsumed = " + bytesConsumed + " bytesProduced = "
+                + bytesProduced;
     }
-}
\ No newline at end of file
+}

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java Sun Dec 14 10:30:16 2008
@@ -25,11 +25,12 @@
 import javax.net.ssl.SSLException;
 
 /**
- * This exception is used to signalize the fatal alert
- * occured during the work of protocol.
+ * This exception is used to signal that a fatal alert has occurred while working through the
+ * protocol.
  */
 public class AlertException extends RuntimeException {
 
+    private static final long serialVersionUID = -4448327177165687581L;
     // SSLException to be thrown to application side
     private final SSLException reason;
     // alert description code
@@ -37,11 +38,11 @@
 
     /**
      * Constructs the instance.
-     * @param   description:    The alert description code.
-     * @see org.apache.harmony.xnet.provider.jsse.AlertProtocol
-     * @param   reason:  The SSLException to be thrown to application
-     * side after alert processing (sending the record with alert,
-     * shoutdown work, etc).
+     * 
+     * @param description The alert description code from {@link AlertProtocol}
+     * @param reason The SSLException to be thrown to application side after alert processing
+     *            (sending the record with alert, shutdown work, etc).
+     * @see AlertProtocol
      */
     protected AlertException(byte description, SSLException reason) {
         super(reason);
@@ -50,8 +51,8 @@
     }
 
     /**
-     * Returns the reason of alert. This reason should be rethrown
-     * after alert protcessin.
+     * Returns the reason of alert. This reason should be rethrown after alert processing.
+     * 
      * @return the reason of alert.
      */
     protected SSLException getReason() {
@@ -60,9 +61,9 @@
 
     /**
      * Returns alert's description code.
-     * @return byte value describing the occured alert.
-     * @see org.apache.harmony.xnet.provider.jsse.AlertProtocol for more information about possible
-     * reason codes.
+     * 
+     * @return alert description code from {@link AlertProtocol}
+     * @see AlertProtocol for more information about possible reason codes.
      */
     protected byte getDescriptionCode() {
         return description;

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java Sun Dec 14 10:30:16 2008
@@ -28,6 +28,7 @@
 import org.apache.harmony.xnet.provider.jsse.AlertProtocol;
 
 import java.io.IOException;
+import java.security.cert.Certificate;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
@@ -80,7 +81,7 @@
             fatalAlert(AlertProtocol.INTERNAL_ERROR, "INTERNAL ERROR", e);
             return;
         }
-        Vector certs_vector = new Vector();
+        Vector<Certificate> certs_vector = new Vector<Certificate>();
         int size = 0;
         int enc_size = 0;
         while (l > 0) {
@@ -141,6 +142,7 @@
      * 
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
 
         int total_length = 0;
@@ -172,6 +174,7 @@
      * 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.CERTIFICATE;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java Sun Dec 14 10:30:16 2008
@@ -110,7 +110,7 @@
         certificate_authorities = new X500Principal[size];
         int totalPrincipalsLength = 0;
         int principalLength = 0;
-        Vector principals = new Vector();
+        Vector<X500Principal> principals = new Vector<X500Principal>();
         while (totalPrincipalsLength < size) {            
             principalLength = in.readUint16(); // encoded X500Principal size
             principals.add(new X500Principal(in));
@@ -119,7 +119,7 @@
         }
         certificate_authorities = new X500Principal[principals.size()];
         for (int i = 0; i < certificate_authorities.length; i++) {
-            certificate_authorities[i] = (X500Principal) principals.elementAt(i);
+            certificate_authorities[i] = principals.elementAt(i);
         }
         this.length = 3 + certificate_types.length + totalPrincipalsLength;
         if (this.length != length) {
@@ -134,6 +134,7 @@
      * 
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
 
         out.writeUint8(certificate_types.length);
@@ -156,6 +157,7 @@
      * 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.CERTIFICATE_REQUEST;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java Sun Dec 14 10:30:16 2008
@@ -83,6 +83,7 @@
      * 
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
         if (signedHash.length != 0) {
             out.writeUint16(signedHash.length);
@@ -95,6 +96,7 @@
      * 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.CERTIFICATE_VERIFY;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java Sun Dec 14 10:30:16 2008
@@ -277,29 +277,29 @@
             };
 
     // hash for quick access to cipher suite by name 
-    private static Hashtable cuitesByName;
+    private static Hashtable<String, CipherSuite> cuitesByName;
 
     /**
-     * array of supported sipher suites.
+     * array of supported cipher suites.
      * Set of supported suites is defined at the moment provider's start 
      */
-//  TODO Dinamical supported suites: new providers may be dynamically 
-//  added/removed and the set of supportes suites may be changed
+//  TODO Dynamically supported suites: new providers may be dynamically 
+//  added/removed and the set of supported suites may be changed
     static CipherSuite[] supportedCipherSuites;
 
     /**
-     * array of supported sipher suites names
+     * array of supported cipher suites names
      */
     static String[] supportedCipherSuiteNames;
 
     /**
-     * default sipher suites
+     * default cipher suites
      */
     static CipherSuite[] defaultCipherSuites;
     
     static {
         int count = 0;
-        cuitesByName = new Hashtable();
+        cuitesByName = new Hashtable<String, CipherSuite>();
         for (int i = 0; i < cuitesByCode.length; i++) {
             cuitesByName.put(cuitesByCode[i].getName(), cuitesByCode[i]);
             if (cuitesByCode[i].supported) {
@@ -353,7 +353,7 @@
      * @return
      */
     public static CipherSuite getByName(String name) {
-        return (CipherSuite) cuitesByName.get(name);
+        return cuitesByName.get(name);
     }
 
     /**
@@ -365,7 +365,7 @@
      */
     public static CipherSuite getByCode(byte b1, byte b2) {
         if (b1 != 0 || (b2 & 0xFF) > cuitesByCode.length) {
-            // Unknoun
+            // Unknown
             return new CipherSuite("UNKNOUN_" + b1 + "_" + b2, false, 0, "",
                     "", new byte[] { b1, b2 });
         }
@@ -523,7 +523,7 @@
      * @return
      */
     public static String[] getSupportedCipherSuiteNames() {
-        return (String[]) supportedCipherSuiteNames.clone();
+        return supportedCipherSuiteNames.clone();
     }
 
     /**
@@ -545,6 +545,7 @@
     /**
      * Returns cipher suite description
      */
+    @Override
     public String toString() {
         return name + ": " + cipherSuiteCode[0] + " " + cipherSuiteCode[1];
     }
@@ -552,6 +553,7 @@
     /**
      * Compares this cipher suite to the specified object.
      */
+    @Override
     public boolean equals(Object obj) {
         if (obj instanceof CipherSuite
                 && this.cipherSuiteCode[0] == ((CipherSuite) obj).cipherSuiteCode[0]
@@ -610,3 +612,4 @@
     }
 
 }
+

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java Sun Dec 14 10:30:16 2008
@@ -52,7 +52,7 @@
  * Handshake protocol operates on top of the Record Protocol.
  * It is responsible for session negotiating.
  * 
- * The implementation proceses inbound server handshake messages,
+ * The implementation processes inbound server handshake messages,
  * creates and sends respond messages. Outbound messages are supplied 
  * to Record Protocol. Detected errors are reported to the Alert protocol.
  * 
@@ -75,6 +75,7 @@
      * Starts handshake
      *
      */  
+    @Override
     public void start() {
         if (session == null) { // initial handshake
             session = findSessionToResume();
@@ -137,9 +138,10 @@
     }
 
     /**
-     * Proceses inbound handshake messages
+     * Processes inbound handshake messages
      * @param bytes
      */
+    @Override
     public void unwrap(byte[] bytes) {
         if (this.delegatedTaskErr != null) {
             Exception e = this.delegatedTaskErr;
@@ -244,7 +246,7 @@
                     session.protocol = servProt;
                     recordProtocol.setVersion(session.protocol.version);
                     session.cipherSuite = serverHello.cipher_suite;
-                    session.id = (byte[]) serverHello.session_id.clone();
+                    session.id = serverHello.session_id.clone();
                     session.serverRandom = serverHello.random;
                     break;
                 case 11: // CERTIFICATE
@@ -281,15 +283,12 @@
                     }
                     serverHelloDone = new ServerHelloDone(io_stream, length);
                     if (this.nonBlocking) {
-                        delegatedTasks.add(new DelegatedTask(
-                                new PrivilegedExceptionAction(){ 
-                            public Object run() throws Exception {
+                        delegatedTasks.add(new DelegatedTask(new PrivilegedExceptionAction<Void>() {
+                            public Void run() throws Exception {
                                 processServerHelloDone();
                                 return null;
-                                } 
-                            },
-                            this,
-                            AccessController.getContext()));
+                            }
+                        }, this, AccessController.getContext()));
                         return;
                     }
                     processServerHelloDone();
@@ -331,6 +330,7 @@
      * @ see TLS 1.0 spec., E.1. Version 2 client hello
      * @param bytes
      */
+    @Override
     public void unwrapSSLv2(byte[] bytes) {
         unexpectedMessage();
     }
@@ -338,6 +338,7 @@
     /**
      * Creates and sends Finished message
      */
+    @Override
     protected void makeFinished() {
         byte[] verify_data;
         if (serverHello.server_version[1] == 1) {
@@ -584,8 +585,9 @@
     }
 
     /**
-     * Proceses ChangeCipherSpec message
+     * Processes ChangeCipherSpec message
      */
+    @Override
     public void receiveChangeCipherSpec() {
         if (isResuming) {
             if (serverHello == null) {
@@ -615,7 +617,7 @@
         byte[] id;
         SSLSession ses;
         SSLSessionContext context = parameters.getClientSessionContext();
-        for (Enumeration en = context.getIds(); en.hasMoreElements();) {
+        for (Enumeration<?> en = context.getIds(); en.hasMoreElements();) {
             id = (byte[])en.nextElement();
             ses = context.getSession(id);
             if (host.equals(ses.getPeerHost()) && port == ses.getPeerPort()) {
@@ -626,3 +628,4 @@
     }
 
 }
+

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java Sun Dec 14 10:30:16 2008
@@ -176,6 +176,7 @@
      * Sends message
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
         out.write(client_version);
         out.write(random);
@@ -204,6 +205,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.CLIENT_HELLO;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java Sun Dec 14 10:30:16 2008
@@ -129,6 +129,7 @@
      * Sends message
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
         if (exchange_keys.length != 0) {    
             if (!isRSA || isTLS) {// DH or TLSv1 RSA
@@ -142,6 +143,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.CLIENT_KEY_EXCHANGE;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java Sun Dec 14 10:30:16 2008
@@ -31,7 +31,7 @@
 import javax.net.ssl.SSLProtocolException;
 
 /**
- * This class incapsulates the operating environment of the SSL v3
+ * This class encapsulates the operating environment of the SSL v3
  * (http://wp.netscape.com/eng/ssl3) Record Protocol and provides 
  * relating encryption/decryption functionality. 
  * The work functionality is based on the security
@@ -218,8 +218,9 @@
     /**
      * Creates the GenericStreamCipher or GenericBlockCipher
      * data structure for specified data of specified type.
-     * @throws org.apache.harmony.xnet.provider.jsse.AlertException if alert was occured.
+     * @throws AlertException if alert was occurred.
      */
+    @Override
     protected byte[] encrypt(byte type, byte[] fragment, int offset, int len) {
         try {
             int content_mac_length = len + hash_size;
@@ -282,6 +283,7 @@
      * the specified type from the provided data.
      * @throws AlertException if alert was occured.
      */
+    @Override
     protected byte[] decrypt(byte type, byte[] fragment,
             int offset, int len) {
         // plain data of the Generic[Stream|Block]Cipher structure
@@ -344,9 +346,10 @@
     }
 
     /**
-     * Shutdownes the protocol. It will be impossiblke to use the instance
+     * Shutdown the protocol. It will be impossible to use the instance
      * after the calling of this method.
      */
+    @Override
     protected void shutdown() {
         Arrays.fill(mac_write_secret, (byte) 0);
         Arrays.fill(mac_read_secret, (byte) 0);

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java Sun Dec 14 10:30:16 2008
@@ -36,7 +36,7 @@
 import javax.net.ssl.SSLProtocolException;
 
 /**
- * This class incapsulates the operating environment of the TLS v1
+ * This class encapsulates the operating environment of the TLS v1
  * (http://www.ietf.org/rfc/rfc2246.txt) Record Protocol and provides 
  * relating encryption/decryption functionality. 
  * The work functionality is based on the security
@@ -44,7 +44,7 @@
  */
 public class ConnectionStateTLS extends ConnectionState {
 
-    // Precomputed prf label values:
+    // Pre-calculated prf label values:
     // "key expansion".getBytes()
     private static byte[] KEY_EXPANSION_LABEL = {
         (byte) 0x6B, (byte) 0x65, (byte) 0x79, (byte) 0x20, (byte) 0x65, 
@@ -235,8 +235,9 @@
     /**
      * Creates the GenericStreamCipher or GenericBlockCipher
      * data structure for specified data of specified type.
-     * @throws org.apache.harmony.xnet.provider.jsse.AlertException if alert was occured.
+     * @throws AlertException if alert was occurred.
      */
+    @Override
     protected byte[] encrypt(byte type, byte[] fragment, int offset, int len) {
         try {
             int content_mac_length = len + hash_size;
@@ -298,8 +299,9 @@
      * Retrieves the fragment of the Plaintext structure of
      * the specified type from the provided data representing
      * the Generic[Stream|Block]Cipher structure.
-     * @throws org.apache.harmony.xnet.provider.jsse.AlertException if alert was occured.
+     * @throws AlertException if alert was occurred.
      */
+    @Override
     protected byte[] decrypt(byte type, byte[] fragment,
             int offset, int len) {
         // plain data of the Generic[Stream|Block]Cipher structure

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java Sun Dec 14 10:30:16 2008
@@ -35,7 +35,7 @@
 public class DelegatedTask implements Runnable {
 
     private final HandshakeProtocol handshaker;
-    private final PrivilegedExceptionAction action;
+    private final PrivilegedExceptionAction<Void> action;
     private final AccessControlContext  context;
     
     /**
@@ -44,7 +44,7 @@
      * @param handshaker
      * @param context
      */
-    public DelegatedTask(PrivilegedExceptionAction action, HandshakeProtocol handshaker, AccessControlContext  context) {
+    public DelegatedTask(PrivilegedExceptionAction<Void> action, HandshakeProtocol handshaker, AccessControlContext  context) {
         this.action = action;
         this.handshaker = handshaker;
         this.context = context;

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java Sun Dec 14 10:30:16 2008
@@ -25,15 +25,13 @@
 import java.io.IOException;
 
 /**
- * This class represents the exception signalizing that
- * data could not be read from the stream because
- * underlying input stream reached its end.
+ * This exception indicates that data could not be read from the stream because the underlying input
+ * stream reached its end.
  */
 public class EndOfBufferException extends IOException {
 
-    /**
-     * Constructor
-     */
+    private static final long serialVersionUID = 1838636631255369519L;
+
     public EndOfBufferException() {
         super();
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java Sun Dec 14 10:30:16 2008
@@ -25,18 +25,15 @@
 import java.io.IOException;
 
 /**
- * This class represents the exception signalizing that
- * data could not be read from the buffered stream because
- * underlying data buffer was exhausted.
+ * This exception indicates that data could not be read from the buffered stream because underlying
+ * data buffer was exhausted.
  */
 public class EndOfSourceException extends IOException {
 
-    /**
-     * Constructor
-     */
+    private static final long serialVersionUID = -4673611435974054413L;
+
     public EndOfSourceException() {
         super();
     }
 
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java Sun Dec 14 10:30:16 2008
@@ -63,6 +63,7 @@
         }
     }
 
+    @Override
     public void send(HandshakeIODataStream out) {
         out.write(data);
     }
@@ -71,6 +72,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.FINISHED;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java Sun Dec 14 10:30:16 2008
@@ -101,14 +101,17 @@
     // position of the last byte to read + 1
     private int read_pos_end;
 
+    @Override
     public int available() {
         return read_pos_end - read_pos;
     }
 
+    @Override
     public boolean markSupported() {
         return true;
     }
 
+    @Override
     public void mark(int limit) {
         marked_pos = read_pos;
     }
@@ -117,6 +120,7 @@
         marked_pos = read_pos;
     }
 
+    @Override
     public void reset() {
         read_pos = marked_pos;
     }
@@ -138,6 +142,7 @@
      * @param   byte:   byte
      * @return
      */
+    @Override
     public int read() throws IOException {
         if (read_pos == read_pos_end) {
             //return -1;
@@ -151,6 +156,7 @@
      * @param   new:    long
      * @return
      */
+    @Override
     public byte[] read(int length) throws IOException {
         if (length > available()) {
             throw new EndOfBufferException();
@@ -161,6 +167,7 @@
         return res;
     }
 
+    @Override
     public int read(byte[] dest, int offset, int length) throws IOException {
         if (length > available()) {
             throw new EndOfBufferException();

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java Sun Dec 14 10:30:16 2008
@@ -89,7 +89,7 @@
     /**
      * Delegated tasks for this handshake implementation
      */
-    protected Vector delegatedTasks = new Vector();
+    protected Vector<DelegatedTask> delegatedTasks = new Vector<DelegatedTask>();
     
     /**
      * Indicates non-blocking handshake
@@ -167,11 +167,11 @@
         if (owner instanceof SSLEngineImpl) {
             engineOwner = (SSLEngineImpl) owner;
             nonBlocking = true;
-            this.parameters = (SSLParameters) engineOwner.sslParameters;
+            this.parameters = engineOwner.sslParameters;
         } else if (owner instanceof SSLSocketImpl) {
             socketOwner = (SSLSocketImpl) owner;
             nonBlocking = false;
-            this.parameters = (SSLParameters) socketOwner.sslParameters;
+            this.parameters = socketOwner.sslParameters;
         }
     }
 
@@ -477,11 +477,8 @@
     public Runnable getTask() {
         if (delegatedTasks.isEmpty()) {
             return null;
-        } else {
-            Runnable task = (Runnable)delegatedTasks.firstElement();
-            delegatedTasks.remove(0);
-            return task;
         }
+        return delegatedTasks.remove(0);
     }
     
     /**
@@ -518,7 +515,7 @@
             mod = ((RSAKey) pk).getModulus();
         } else {
             KeyFactory kf = KeyFactory.getInstance("RSA");
-            mod = ((RSAPublicKeySpec) kf.getKeySpec(pk, RSAPublicKeySpec.class))
+            mod = kf.getKeySpec(pk, RSAPublicKeySpec.class)
                     .getModulus();
         }
         return mod.bitLength();

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java Sun Dec 14 10:30:16 2008
@@ -60,9 +60,11 @@
      * Sends message
      * @param out
      */
+    @Override
     public void send(HandshakeIODataStream out) {
     }
 
+    @Override
     public int length() {
         return 0;
     } 
@@ -71,6 +73,7 @@
      * Returns message type 
      * @return
      */
+    @Override
     public int getType() {
         return Handshake.HELLO_REQUEST;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java Sun Dec 14 10:30:16 2008
@@ -23,6 +23,7 @@
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.security.Provider;
 
 /**
@@ -104,20 +105,18 @@
  */
 public final class JSSEProvider extends Provider {
 
+    private static final long serialVersionUID = 3075686092260669675L;
+
     public JSSEProvider() {
         super("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
-        AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
-                put("SSLContext.TLS",
-                        "org.apache.harmony.xnet.provider.jsse.SSLContextImpl");
+                put("SSLContext.TLS", SSLContextImpl.class.getName());
                 put("Alg.Alias.SSLContext.TLSv1", "TLS");
-                put("KeyManagerFactory.X509",
-                        "org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl");
-                put("TrustManagerFactory.X509",
-                        "org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl");
+                put("KeyManagerFactory.X509", KeyManagerFactoryImpl.class.getName());
+                put("TrustManagerFactory.X509", TrustManagerFactoryImpl.class.getName());
                 return null;
             }
         });
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java Sun Dec 14 10:30:16 2008
@@ -53,13 +53,14 @@
      * @see javax.net.ssl.KeyManagerFactorySpi.engineInit(KeyStore ks, char[]
      *      password)
      */
+    @Override
     public void engineInit(KeyStore ks, char[] password)
             throws KeyStoreException, NoSuchAlgorithmException,
             UnrecoverableKeyException {
         if (ks != null) {
             keyStore = ks;
             if (password != null) {
-                pwd = (char[]) password.clone();
+                pwd = password.clone();
             } else {
                 pwd = new char[0];
             }
@@ -115,6 +116,7 @@
      * @see javax.net.ssl.KeyManagerFactorySpi.engineInit(ManagerFactoryParameters
      *      spec)
      */
+    @Override
     public void engineInit(ManagerFactoryParameters spec)
             throws InvalidAlgorithmParameterException {
         throw new InvalidAlgorithmParameterException(
@@ -125,6 +127,7 @@
     /**
      * @see javax.net.ssl.KeyManagerFactorySpi.engineGetKeyManagers()
      */
+    @Override
     public KeyManager[] engineGetKeyManagers() {
         if (keyStore == null) {
             throw new IllegalStateException("KeyManagerFactory is not initialized");

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java Sun Dec 14 10:30:16 2008
@@ -28,6 +28,7 @@
 import java.security.Principal;
 import java.security.PrivateKey;
 import java.security.UnrecoverableEntryException;
+import java.security.KeyStore.PrivateKeyEntry;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
 import java.util.Enumeration;
@@ -40,11 +41,11 @@
 
 /**
  * KeyManager implementation.
- * This implementation uses hashed key store information.
- * It works faster than retrieving all of the data from the key store.
- * Any key store changes, that happen after key manager was created, have no effect.
- * The implementation does not use peer information (host, port)
- * that may be obtained from socket or engine.
+ * 
+ * This implementation uses hashed key store information. It works faster than retrieving all of the
+ * data from the key store. Any key store changes, that happen after key manager was created, have
+ * no effect. The implementation does not use peer information (host, port) that may be obtained
+ * from socket or engine.
  * 
  * @see javax.net.ssl.KeyManager
  * 
@@ -52,7 +53,7 @@
 public class KeyManagerImpl extends X509ExtendedKeyManager {
 
     // hashed key store information
-    private final Hashtable hash = new Hashtable();
+    private final Hashtable<String, PrivateKeyEntry> hash;
 
     /**
      * Creates Key manager
@@ -61,21 +62,20 @@
      * @param pwd
      */
     public KeyManagerImpl(KeyStore keyStore, char[] pwd) {
-        String alias;
-        KeyStore.PrivateKeyEntry entry;
-        Enumeration aliases;
+        super();
+        this.hash = new Hashtable<String, PrivateKeyEntry>();
+        final Enumeration<String> aliases;
         try {
             aliases = keyStore.aliases();
         } catch (KeyStoreException e) {
             return;
         }
         for (; aliases.hasMoreElements();) {
-            alias = (String) aliases.nextElement();          
+            final String alias = aliases.nextElement();
             try {
-                if (keyStore.entryInstanceOf(alias,
-                        KeyStore.PrivateKeyEntry.class)) {
-                    entry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(alias,
-                            new KeyStore.PasswordProtection(pwd));
+                if (keyStore.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class)) {
+                    final KeyStore.PrivateKeyEntry entry = (KeyStore.PrivateKeyEntry) keyStore
+                            .getEntry(alias, new KeyStore.PasswordProtection(pwd));
                     hash.put(alias, entry);
                 }
             } catch (KeyStoreException e) {
@@ -86,45 +86,21 @@
                 continue;
             }
         }
-
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.chooseClientAlias(String[]
-     *      keyType, Principal[] issuers, Socket socket)
-     */
-    public String chooseClientAlias(String[] keyType, Principal[] issuers,
-            Socket socket) {
-        String[] al = chooseAlias(keyType, issuers);
-        if (al != null) {
-            return al[0];
-        } else {
-            return null;
-        }
+    public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket) {
+        final String[] al = chooseAlias(keyType, issuers);
+        return (al == null ? null : al[0]);
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.chooseServerAlias(String
-     *      keyType, Principal[] issuers, Socket socket)
-     */
-    public String chooseServerAlias(String keyType, Principal[] issuers,
-            Socket socket) {
-        String[] al = chooseAlias(new String[] { keyType }, issuers);
-        if (al != null) {
-            return al[0];
-        } else {
-            return null;
-        }
+    public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket) {
+        final String[] al = chooseAlias(new String[] { keyType }, issuers);
+        return (al == null ? null : al[0]);
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.getCertificateChain(String
-     *      alias)
-     */
     public X509Certificate[] getCertificateChain(String alias) {
         if (hash.containsKey(alias)) {
-            Certificate[] certs = ((KeyStore.PrivateKeyEntry) hash.get(alias))
-                    .getCertificateChain();
+            Certificate[] certs = hash.get(alias).getCertificateChain();
             if (certs[0] instanceof X509Certificate) {
                 X509Certificate[] xcerts = new X509Certificate[certs.length];
                 for (int i = 0; i < certs.length; i++) {
@@ -137,74 +113,43 @@
 
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.getClientAliases(String
-     *      keyType, Principal[] issuers)
-     */
     public String[] getClientAliases(String keyType, Principal[] issuers) {
         return chooseAlias(new String[] { keyType }, issuers);
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.getServerAliases(String
-     *      keyType, Principal[] issuers)
-     */
     public String[] getServerAliases(String keyType, Principal[] issuers) {
         return chooseAlias(new String[] { keyType }, issuers);
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.getPrivateKey(String alias)
-     */
     public PrivateKey getPrivateKey(String alias) {
         if (hash.containsKey(alias)) {
-            return ((KeyStore.PrivateKeyEntry) hash.get(alias)).getPrivateKey();
+            return hash.get(alias).getPrivateKey();
         }
         return null;
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.chooseEngineClientAlias(String[]
-     *      keyType, Principal[] issuers, SSLEngine engine)
-     */
-    public String chooseEngineClientAlias(String[] keyType,
-            Principal[] issuers, SSLEngine engine) {
-        String[] al = chooseAlias(keyType, issuers);
-        if (al != null) {
-            return al[0];
-        } else {
-            return null;
-        }
+    @Override
+    public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine) {
+        final String[] al = chooseAlias(keyType, issuers);
+        return (al == null ? null : al[0]);
     }
 
-    /**
-     * @see javax.net.ssl.X509ExtendedKeyManager.chooseEngineServerAlias(String
-     *      keyType, Principal[] issuers, SSLEngine engine)
-     */
-    public String chooseEngineServerAlias(String keyType, Principal[] issuers,
-            SSLEngine engine) {
-        String[] al = chooseAlias(new String[] { keyType }, issuers);
-        if (al != null) {
-            return al[0];
-        } else {
-            return null;
-        }
+    @Override
+    public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine) {
+        final String[] al = chooseAlias(new String[] { keyType }, issuers);
+        return (al == null ? null : al[0]);
     }
 
     private String[] chooseAlias(String[] keyType, Principal[] issuers) {
-        String alias;
-        KeyStore.PrivateKeyEntry entry;
-        
         if (keyType == null || keyType.length == 0) {
             return null;
         }
-        Vector found = new Vector();
-        int count = 0;
-        for (Enumeration aliases = hash.keys(); aliases.hasMoreElements();) {
-            alias = (String) aliases.nextElement();
-            entry = (KeyStore.PrivateKeyEntry) hash.get(alias);
-            Certificate[] certs = entry.getCertificateChain();
-            String alg = certs[0].getPublicKey().getAlgorithm();
+        Vector<String> found = new Vector<String>();
+        for (Enumeration<String> aliases = hash.keys(); aliases.hasMoreElements();) {
+            final String alias = aliases.nextElement();
+            final KeyStore.PrivateKeyEntry entry = hash.get(alias);
+            final Certificate[] certs = entry.getCertificateChain();
+            final String alg = certs[0].getPublicKey().getAlgorithm();
             for (int i = 0; i < keyType.length; i++) {
                 if (alg.equals(keyType[i])) {
                     if (issuers != null && issuers.length != 0) {
@@ -216,7 +161,6 @@
                                 for (int iii = 0; iii < issuers.length; iii++) {
                                     if (issuer.equals(issuers[iii])) {
                                         found.add(alias);
-                                        count++;
                                         break loop;
                                     }
                                 }
@@ -225,18 +169,13 @@
                         }
                     } else {
                         found.add(alias);
-                        count++;
                     }
                 }
             }
         }
-        if (count > 0) {
-            String[] result = new String[count];
-            found.toArray(result);
-            return result;
-        } else {
-            return null;
+        if (!found.isEmpty()) {
+            return found.toArray(new String[found.size()]);
         }
+        return null;
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java Sun Dec 14 10:30:16 2008
@@ -41,6 +41,7 @@
             prefix = name + "["+Thread.currentThread().getName()+"] ";
         }
 
+        @Override
         public void print(String msg) {
             for (int i=0; i<indent; i++) {
                 super.print("  ");
@@ -56,6 +57,7 @@
             indent --;
         }
 
+        @Override
         public void println(String msg) {
             print(prefix);
             super.println(msg);

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java Sun Dec 14 10:30:16 2008
@@ -28,41 +28,13 @@
  * Represents Protocol Version
  */
 public class ProtocolVersion {
-
-    /**
-     * Protocol name
-     */
-    public final String name;
-
-    /**
-     * Protocol version as byte array
-     */
-    public final byte[] version;
-
     /**
-     * Protocols supported by this provider implementaton
+     * Protocols supported by this provider implementation
      */
     public static final String[] supportedProtocols = new String[] { "TLSv1",
             "SSLv3" };
 
-    private static Hashtable protocolsByName = new Hashtable(4);
-
-    private ProtocolVersion(String name, byte[] version) {
-        this.name = name;
-        this.version = version;
-    }
-
-    /**
-     * Compares this ProtocolVersion to the specified object.
-     */
-    public boolean equals(Object o) {
-        if (o instanceof ProtocolVersion
-                && this.version[0] == ((ProtocolVersion) o).version[0]
-                && this.version[1] == ((ProtocolVersion) o).version[1]) {
-            return true;
-        }
-        return false;
-    }
+    private static Hashtable<String, ProtocolVersion> protocolsByName = new Hashtable<String, ProtocolVersion>(4);
 
     /**
      * 
@@ -112,7 +84,7 @@
      * @return
      */
     public static ProtocolVersion getByName(String name) {
-        return (ProtocolVersion) protocolsByName.get(name);
+        return protocolsByName.get(name);
     }
 
     /**
@@ -161,4 +133,31 @@
         protocolsByName.put("TLS", TLSv1);
     }
 
+    /**
+     * Protocol name
+     */
+    public final String name;
+
+    /**
+     * Protocol version as byte array
+     */
+    public final byte[] version;
+
+    private ProtocolVersion(String name, byte[] version) {
+        this.name = name;
+        this.version = version;
+    }
+
+    /**
+     * Compares this ProtocolVersion to the specified object.
+     */
+    @Override
+    public boolean equals(Object o) {
+        if (o instanceof ProtocolVersion
+                && this.version[0] == ((ProtocolVersion) o).version[0]
+                && this.version[1] == ((ProtocolVersion) o).version[1]) {
+            return true;
+        }
+        return false;
+    }
 }
\ No newline at end of file

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java Sun Dec 14 10:30:16 2008
@@ -57,6 +57,7 @@
     /**
      * Returns the number of bytes available for reading.
      */
+    @Override
     public int available() throws IOException {
         // in assumption that the buffer has been set
         return in.remaining();
@@ -73,6 +74,7 @@
      * Reads the following byte value. If there are no bytes in the source 
      * buffer, method throws java.nio.BufferUnderflowException.
      */
+    @Override
     public int read() throws IOException {
         // TODO: implement optimized read(int) 
         // and read(byte[], int, int) methods

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java Sun Dec 14 10:30:16 2008
@@ -58,12 +58,14 @@
         super();
     }
 
+    @Override
     public void engineInit(KeyManager[] kms, TrustManager[] tms,
             SecureRandom sr) throws KeyManagementException {
         sslParameters = new SSLParameters(kms, tms, sr, clientSessionContext,
                 serverSessionContext);
     }
 
+    @Override
     public SSLSocketFactory engineGetSocketFactory() {
         if (sslParameters == null) {
             throw new IllegalStateException("SSLContext is not initiallized.");
@@ -71,6 +73,7 @@
         return new SSLSocketFactoryImpl(sslParameters);
     }
 
+    @Override
     public SSLServerSocketFactory engineGetServerSocketFactory() {
         if (sslParameters == null) {
             throw new IllegalStateException("SSLContext is not initiallized.");
@@ -78,6 +81,7 @@
         return new SSLServerSocketFactoryImpl(sslParameters);
     }
 
+    @Override
     public SSLEngine engineCreateSSLEngine(String host, int port) {
         if (sslParameters == null) {
             throw new IllegalStateException("SSLContext is not initiallized.");
@@ -86,6 +90,7 @@
                 (SSLParameters) sslParameters.clone());
     }
 
+    @Override
     public SSLEngine engineCreateSSLEngine() {
         if (sslParameters == null) {
             throw new IllegalStateException("SSLContext is not initiallized.");
@@ -93,10 +98,12 @@
         return new SSLEngineImpl((SSLParameters) sslParameters.clone());
     }
 
+    @Override
     public SSLSessionContext engineGetServerSessionContext() {
         return serverSessionContext;
     }
 
+    @Override
     public SSLSessionContext engineGetClientSessionContext() {
         return clientSessionContext;
     }

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java Sun Dec 14 10:30:16 2008
@@ -77,11 +77,10 @@
                 pos = len;
                 // data was written, exit
                 break;
-            } else {
-                // write chunk of data
-                dsts[i].put(buffer, pos, rem);
-                pos += rem;
             }
+            // write chunk of data
+            dsts[i].put(buffer, pos, rem);
+            pos += rem;
         }
         if (pos != len) {
             // The data did not feet into the buffers,

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java Sun Dec 14 10:30:16 2008
@@ -114,6 +114,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.");
@@ -143,6 +144,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);
@@ -173,6 +175,7 @@
      * @see javax.net.ssl.SSLEngine#closeOutbound() method documentation
      * for more information
      */
+    @Override
     public void closeOutbound() {
         if (logger != null) {
             logger.println("closeOutbound() "+isOutboundDone);
@@ -199,6 +202,7 @@
      * @see javax.net.ssl.SSLEngine#getDelegatedTask() method documentation
      * for more information
      */
+    @Override
     public Runnable getDelegatedTask() {
         return handshakeProtocol.getTask();
     }
@@ -209,6 +213,7 @@
      * @see javax.net.ssl.SSLEngine#getSupportedCipherSuites() method
      * documentation for more information
      */
+    @Override
     public String[] getSupportedCipherSuites() {
         return CipherSuite.getSupportedCipherSuiteNames();
     }
@@ -220,6 +225,7 @@
      * @see javax.net.ssl.SSLEngine#getEnabledCipherSuites() method
      * documentation for more information
      */
+    @Override
     public String[] getEnabledCipherSuites() {
         return sslParameters.getEnabledCipherSuites();
     }
@@ -229,6 +235,7 @@
      * @see javax.net.ssl.SSLEngine#setEnabledCipherSuites(String) method
      * documentation for more information
      */
+    @Override
     public void setEnabledCipherSuites(String[] suites) {
         sslParameters.setEnabledCipherSuites(suites);
     }
@@ -238,8 +245,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();
     }
 
     /**
@@ -247,6 +255,7 @@
      * @see javax.net.ssl.SSLEngine#getEnabledProtocols() method
      * documentation for more information
      */
+    @Override
     public String[] getEnabledProtocols() {
         return sslParameters.getEnabledProtocols();
     }
@@ -256,6 +265,7 @@
      * @see javax.net.ssl.SSLEngine#setEnabledProtocols(String) method
      * documentation for more information
      */
+    @Override
     public void setEnabledProtocols(String[] protocols) {
         sslParameters.setEnabledProtocols(protocols);
     }
@@ -265,6 +275,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(
@@ -279,6 +290,7 @@
      * @see javax.net.ssl.SSLEngine#getUseClientMode() method
      * documentation for more information
      */
+    @Override
     public boolean getUseClientMode() {
         return sslParameters.getUseClientMode();
     }
@@ -288,6 +300,7 @@
      * @see javax.net.ssl.SSLEngine#setNeedClientAuth(boolean) method
      * documentation for more information
      */
+    @Override
     public void setNeedClientAuth(boolean need) {
         sslParameters.setNeedClientAuth(need);
     }
@@ -297,6 +310,7 @@
      * @see javax.net.ssl.SSLEngine#getNeedClientAuth() method
      * documentation for more information
      */
+    @Override
     public boolean getNeedClientAuth() {
         return sslParameters.getNeedClientAuth();
     }
@@ -306,6 +320,7 @@
      * @see javax.net.ssl.SSLEngine#setWantClientAuth(boolean) method
      * documentation for more information
      */
+    @Override
     public void setWantClientAuth(boolean want) {
         sslParameters.setWantClientAuth(want);
     }
@@ -315,6 +330,7 @@
      * @see javax.net.ssl.SSLEngine#getWantClientAuth() method
      * documentation for more information
      */
+    @Override
     public boolean getWantClientAuth() {
         return sslParameters.getWantClientAuth();
     }
@@ -324,6 +340,7 @@
      * @see javax.net.ssl.SSLEngine#setEnableSessionCreation(boolean) method
      * documentation for more information
      */
+    @Override
     public void setEnableSessionCreation(boolean flag) {
         sslParameters.setEnableSessionCreation(flag);
     }
@@ -333,6 +350,7 @@
      * @see javax.net.ssl.SSLEngine#getEnableSessionCreation() method
      * documentation for more information
      */
+    @Override
     public boolean getEnableSessionCreation() {
         return sslParameters.getEnableSessionCreation();
     }
@@ -344,6 +362,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
@@ -365,12 +384,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;
     }
 
     /**
@@ -378,6 +397,7 @@
      * @see javax.net.ssl.SSLEngine#isInboundDone() method
      * documentation for more information
      */
+    @Override
     public boolean isInboundDone() {
         return isInboundDone || engine_was_closed;
     }
@@ -387,6 +407,7 @@
      * @see javax.net.ssl.SSLEngine#isOutboundDone() method
      * documentation for more information
      */
+    @Override
     public boolean isOutboundDone() {
         return isOutboundDone;
     }
@@ -402,6 +423,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) {
@@ -566,6 +588,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) {

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java Sun Dec 14 10:30:16 2008
@@ -37,6 +37,7 @@
     /**
      * @see java.io.InputStream#available()
      */
+    @Override
     public abstract int available() throws IOException;
 
     /**
@@ -49,11 +50,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 +122,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/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java?rev=726511&r1=726510&r2=726511&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java Sun Dec 14 10:30:16 2008
@@ -241,7 +241,7 @@
                 enabledCipherSuiteNames[i] = enabledCipherSuites[i].getName();
             }
         }
-        return (String[]) enabledCipherSuiteNames.clone();
+        return enabledCipherSuiteNames.clone();
     }
 
     /**
@@ -269,7 +269,7 @@
      * @return the set of enabled protocols
      */
     protected String[] getEnabledProtocols() {
-        return (String[]) enabledProtocols.clone();
+        return enabledProtocols.clone();
     }
 
     /**
@@ -360,6 +360,7 @@
      * Returns the clone of this object.
      * @return the clone.
      */
+    @Override
     protected Object clone() {
         SSLParameters parameters = new SSLParameters();
 



Mime
View raw message