OSDN Git Service

2003-09-25 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Sep 2003 08:22:56 +0000 (08:22 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Sep 2003 08:22:56 +0000 (08:22 +0000)
* java/net/InetAddress.java:
Reorder imports, remove implementation comment.
(isMulticastAddress): Merged documentation from classpath.
* java/net/URLConnection.java
(setRequestProperty): Check key for null, fix documentation.
(adREquestProperty): Check key for null, remove wrong implementation
and replace it with comment to overwrite this method in subclasses,
fix documentation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71767 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c98cf13..b8769cb 100644 (file)
@@ -1,3 +1,14 @@
+2003-09-25  Michael Koch  <konqueror@gmx.de>
+
+       * java/net/InetAddress.java:
+       Reorder imports, remove implementation comment.
+       (isMulticastAddress): Merged documentation from classpath.
+       * java/net/URLConnection.java
+       (setRequestProperty): Check key for null, fix documentation.
+       (adREquestProperty): Check key for null, remove wrong implementation
+       and replace it with comment to overwrite this method in subclasses,
+       fix documentation.
+
 2003-09-25  Tom Tromey  <tromey@redhat.com>
 
        * java/lang/reflect/Proxy.java (generate): Uncomment protection
index 6a841d0..65c84d8 100644 (file)
@@ -38,18 +38,11 @@ exception statement from your version. */
 
 package java.net;
 
+import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.IOException;
-import java.io.Serializable;
 import java.io.ObjectStreamException;
-
-/*
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
- * (The latter turns out to have some errors ...)
- * Status:  Believed complete and correct.
- */
+import java.io.Serializable;
 
 /**
  * This class models an Internet address.  It does not have a public
@@ -137,7 +130,11 @@ public class InetAddress implements Serializable
   }
 
   /**
-   * Utility routine to check if the InetAddress is an IP multicast address
+   * Returns true if this address is a multicast address, false otherwise.
+   * An address is multicast if the high four bits are "1110".  These are
+   * also known as "Class D" addresses.
+   *
+   * @return true if mulitcast, false if not
    *
    * @since 1.1
    */
index 3b8a85b..5c43a7c 100644 (file)
@@ -698,12 +698,11 @@ public abstract class URLConnection
   }
 
   /**
-   * Returns the default value used to determine whether or not caching
-   * of documents will be done when possible.
-   *
-   * @param key Key of the property to set
-   * @param value Value of the Property to set
+   * Sets the value of the named request property
    *
+   * @param key The name of the property
+   * @param value The value of the property
+   * 
    * @exception IllegalStateException If already connected
    * @exception NullPointerException If key is null
    *
@@ -717,12 +716,16 @@ public abstract class URLConnection
     if (connected)
       throw new IllegalStateException ("Already connected");
 
+    if (key == null)
+      throw new NullPointerException ("key is null");
+    
     // Do nothing unless overridden by subclasses that support setting
     // header fields in the request.
   }
 
   /**
-   * Sets the value of the named request property
+   * Adds a new request property by a key/value pair.
+   * This method does not overwrite* existing properties with the same key.
    *
    * @param key Key of the property to add
    * @param value Value of the Property to add
@@ -740,10 +743,11 @@ public abstract class URLConnection
     if (connected)
       throw new IllegalStateException ("Already connected");
 
-    if (getRequestProperty (key) == null)
-      {
-        setRequestProperty (key, value);
-      }
+    if (key == null)
+      throw new NullPointerException ("key is null");
+    
+    // Do nothing unless overridden by subclasses that support adding
+    // header fields in the request.
   }
 
   /**