2005-04-26 Sven de Marothy <sven@physto.se>
authorSven de Marothy <sven@physto.se>
Tue, 26 Apr 2005 21:55:30 +0000 (23:55 +0200)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 26 Apr 2005 21:55:30 +0000 (21:55 +0000)
* java/net/InetAddress.java
(toString): Don't print empty hostnames.

From-SVN: r98793

libjava/ChangeLog
libjava/java/net/InetAddress.java

index fcd667f..bf0a93a 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-26  Sven de Marothy  <sven@physto.se>
+
+       * java/net/InetAddress.java
+       (toString): Don't print empty hostnames.
+
 2005-04-26  Luca Barbieri  <luca.barbieri@gmail.com>
 
        PR libgcj/21136:
index 9de34c1..cfb7a5f 100644 (file)
@@ -495,7 +495,7 @@ public class InetAddress implements Serializable
   public String toString()
   {
     String addr = getHostAddress();
-    String host = (hostName != null) ? hostName : addr;
+    String host = (hostName != null) ? hostName : "";
     return host + "/" + addr;
   }