classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] RFC: java.net.InetAddress.toString() returns wrong addr


From: David Daney
Subject: Re: [cp-patches] RFC: java.net.InetAddress.toString() returns wrong address
Date: Thu, 29 Dec 2005 10:58:37 -0800
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)

Christian Thalinger wrote:
Hi!

While checking some FAILs in tgolem i stumbled across this common fail:

FAIL: gnu.testlet.java.net.InetSocketAddress.InetSocketAddressTest:
Error : test_Constructors failed - 1 No wildcard address returned
(number 1)

I searched a bit and i think toString() returns the wrong value.  Is
this correct?


I situations like this I ask myself: "What Would Sun Do" (WWSD). If it is good enough for Sun, it is good enough for me (unless it is obviously f****d up).



TWISTI


2005-12-29  Christian Thalinger  <address@hidden>

* java/net/InetAddress.java (toString): Return 0.0.0.0 for null hostname.


Index: java/net/InetAddress.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/InetAddress.java,v
retrieving revision 1.42
diff -u -3 -p -r1.42 InetAddress.java
--- java/net/InetAddress.java   2 Jul 2005 20:32:39 -0000       1.42
+++ java/net/InetAddress.java   29 Dec 2005 18:13:44 -0000
@@ -514,7 +514,7 @@ public class InetAddress implements Seri
   public String toString()
   {
     String addr = getHostAddress();
-    String host = (hostName != null) ? hostName : "";
+    String host = (hostName != null) ? hostName : "0.0.0.0";
     return host + "/" + addr;
   }


_______________________________________________
Classpath-patches mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/classpath-patches





reply via email to

[Prev in Thread] Current Thread [Next in Thread]