]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Inet4Address.java: Merged file header and javadocs.
authorMichael Koch <konqueror@gmx.de>
Mon, 18 Oct 2004 12:36:27 +0000 (12:36 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Mon, 18 Oct 2004 12:36:27 +0000 (12:36 +0000)
2004-10-18  Michael Koch  <konqueror@gmx.de>

* java/net/Inet4Address.java: Merged file header and javadocs.
* java/net/Inet6Address.java: Likewise.
* java/net/InetAddress.java
(getCanonicalHostName): Create Inet4Address object instead of
InetAddress and add comment regarding IPv6.
(toString): Simplified.

From-SVN: r89211

libjava/ChangeLog
libjava/java/net/Inet4Address.java
libjava/java/net/Inet6Address.java
libjava/java/net/InetAddress.java

index 080afaf0e0b93b5c44c0553518b81f159fcf7115..ded9f94b0b409eac974beae4e60c153bfdf87e75 100644 (file)
@@ -1,3 +1,12 @@
+2004-10-18  Michael Koch  <konqueror@gmx.de>
+
+       * java/net/Inet4Address.java: Merged file header and javadocs.
+       * java/net/Inet6Address.java: Likewise.
+       * java/net/InetAddress.java
+       (getCanonicalHostName): Create Inet4Address object instead of
+       InetAddress and add comment regarding IPv6.
+       (toString): Simplified.
+
 2004-10-18  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/net/protocol/http/Connection.java,
index 25629c85555169312c2ff74f18b8ff1011609305..917e9e3e667d74e4eeae8d85f8d82d5b227537b1 100644 (file)
@@ -1,5 +1,5 @@
-/* Inet4Address.java
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Inet4Address.java --
+   Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -35,23 +35,20 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package java.net;
 
 import java.io.ObjectStreamException;
 import java.util.Arrays;
 
-
-/**
- * @author Michael Koch
- * @date August 3, 2002.
- */
-
 /*
  * Written using on-line Java Platform 1.4 API Specification and
  * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt),
  * RFC 1918 (http://www.ietf.org/rfc/rfc1918.txt),
  * RFC 2365 (http://www.ietf.org/rfc/rfc2365.txt)
- * Status: Believed complete and correct.
+ *
+ * @author Michael Koch
+ * @status Believed complete and correct.
  */
 public final class Inet4Address extends InetAddress
 {
@@ -67,12 +64,14 @@ public final class Inet4Address extends InetAddress
   {
     return new InetAddress(addr, hostName);
   }
-
+  
   /**
-   * Creates a Inet4Address
+   * Initializes this object's addr instance variable from the passed in
+   * byte array.  Note that this constructor is protected and is called
+   * only by static methods in this class.
    *
-   * @param addr The IP address
-   * @param host The Hostname
+   * @param addr The IP number of this address as an array of bytes
+   * @param hostname The hostname of this IP address.
    */
   Inet4Address(byte[] addr, String host)
   {
index 5d527359980518855e8e24e84a4c7d27ec2a68e7..e0329d5214c6d2eae42bfa676ba733ad9ac31d41 100644 (file)
@@ -1,5 +1,5 @@
-/* Inet6Address.java
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Inet6Address.java --
+   Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -35,20 +35,17 @@ this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
+
 package java.net;
 
 import java.util.Arrays;
 
-
-/**
- * @author Michael Koch
- * @date August 3, 2002.
- */
-
 /*
  * Written using on-line Java Platform 1.4 API Specification and
  * RFC 1884 (http://www.ietf.org/rfc/rfc1884.txt)
- * Status: Believed complete and correct.
+ * 
+ * @author Michael Koch
+ * @status Believed complete and correct.
  */
 public final class Inet6Address extends InetAddress
 {
index 51bcf3ae6ecc89f81eaaa02d257c23a004bd1494..06e1a240abd4525625da1ef771a7f40c6b5ecac9 100644 (file)
@@ -313,7 +313,7 @@ public class InetAddress implements Serializable
       {
         try
          {
-            sm.checkConnect (hostName, -1);
+            sm.checkConnect(hostName, -1);
          }
        catch (SecurityException e)
          {
@@ -322,7 +322,8 @@ public class InetAddress implements Serializable
       }
 
     // Try to find the FDQN now
-    InetAddress address = new InetAddress (getAddress(), null);
+    // FIXME: This does not work with IPv6.
+    InetAddress address = new Inet4Address(getAddress(), null);
     return address.getHostName();
   }
 
@@ -487,14 +488,8 @@ public class InetAddress implements Serializable
    */
   public String toString()
   {
-    String host;
     String address = getHostAddress();
-
-    if (hostName != null)
-      host = hostName;
-    else
-      host = address;
-
+    String host = (hostName != null) ? hostName : address;
     return host + "/" + address;
   }