[patch] merge from classpath java/net/Socket

Andreas Tobler toa@pop.agri.ch
Wed Sep 22 13:04:00 GMT 2004


Hi all,

this time I commit it directly, preaproved offlist.

Andreas

2004-09-21  Michael Koch  <konqueror@gmx.de>

	* java/net/Socket.java
	(getLocalAddress): Return InetAddress.ANY_IF if not bound yet.



Index: java/net/Socket.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/Socket.java,v
retrieving revision 1.39
diff -u -r1.39 Socket.java
--- java/net/Socket.java        20 Jul 2004 17:48:35 -0000      1.39
+++ java/net/Socket.java        21 Sep 2004 18:39:05 -0000
@@ -479,7 +479,8 @@

    /**
     * Returns the local address to which this socket is bound.  If this 
socket
-   * is not connected, then <code>null</code> is returned.
+   * is not connected, then a wildcard address, for which
+   * @see isAnyLocalAddress() is <code>true</code>, is returned.
     *
     * @return The local address
     *
@@ -488,7 +489,7 @@
    public InetAddress getLocalAddress()
    {
      if (! isBound())
-      return null;
+      return InetAddress.ANY_IF;

      InetAddress addr = null;



More information about the Java-patches mailing list