From fb2418cb144f9afb4bc734f56abc52987bd73fc2 Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Fri, 11 Apr 2008 03:50:37 -0400 Subject: [PATCH] 6571950: SSLSocket(raddr, rport, laddr, lport) allows null as laddr that spec doesn't reflect Add the description that while the local address parameter is null, anyLocalAddress will be used instead. Reviewed-by: weijun --- jdk/src/share/classes/java/net/Socket.java | 5 +++-- jdk/src/share/classes/javax/net/ssl/SSLSocket.java | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/jdk/src/share/classes/java/net/Socket.java b/jdk/src/share/classes/java/net/Socket.java index 5dd5f7f2e41..e0769176af3 100644 --- a/jdk/src/share/classes/java/net/Socket.java +++ b/jdk/src/share/classes/java/net/Socket.java @@ -1,5 +1,5 @@ /* - * Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -253,7 +253,8 @@ class Socket implements java.io.Closeable { * * @param host the name of the remote host, or null for the loopback address. * @param port the remote port - * @param localAddr the local address the socket is bound to + * @param localAddr the local address the socket is bound to, or + * null for the anyLocal address. * @param localPort the local port the socket is bound to, or * zero for a system selected free port. * @exception IOException if an I/O error occurs when creating the socket. diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java index 8c3801b8db9..51434943166 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -212,8 +212,10 @@ public abstract class SSLSocket extends Socket * @param host name of the host with which to connect, or * null for the loopback address. * @param port number of the server's port - * @param clientAddress the client's host - * @param clientPort number of the client's port + * @param clientAddress the client's address the socket is bound to, or + * null for the anyLocal address. + * @param clientPort the client's port the socket is bound to, or + * zero for a system selected free port. * @throws IOException if an I/O error occurs when creating the socket * @throws SecurityException if a security manager exists and its * checkConnect method doesn't allow the operation. @@ -241,8 +243,10 @@ public abstract class SSLSocket extends Socket * * @param address the server's host * @param port its port - * @param clientAddress the client's host - * @param clientPort number of the client's port + * @param clientAddress the client's address the socket is bound to, or + * null for the anyLocal address. + * @param clientPort the client's port the socket is bound to, or + * zero for a system selected free port. * @throws IOException if an I/O error occurs when creating the socket * @throws SecurityException if a security manager exists and its * checkConnect method doesn't allow the operation.