summaryrefslogtreecommitdiffstats
path: root/libjava/java/net/URLConnection.java
diff options
context:
space:
mode:
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 08:22:56 +0000
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-25 08:22:56 +0000
commit40a9a8b860d4c4f41df878b0815ce5d82e66b325 (patch)
treea76a1c6adac953df1d6d51da71baa722a834173a /libjava/java/net/URLConnection.java
parentc10e4953f46004a10132098e4dcd1a339626bf0b (diff)
downloadppe42-gcc-40a9a8b860d4c4f41df878b0815ce5d82e66b325.tar.gz
ppe42-gcc-40a9a8b860d4c4f41df878b0815ce5d82e66b325.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71767 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/net/URLConnection.java')
-rw-r--r--libjava/java/net/URLConnection.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/libjava/java/net/URLConnection.java b/libjava/java/net/URLConnection.java
index 3b8a85be139..5c43a7cac24 100644
--- a/libjava/java/net/URLConnection.java
+++ b/libjava/java/net/URLConnection.java
@@ -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.
}
/**
OpenPOWER on IntegriCloud