summaryrefslogtreecommitdiff
path: root/gnu/java/net/protocol
diff options
context:
space:
mode:
authorWolfgang Baer <WBaer@gmx.de>2006-02-09 09:37:08 +0000
committerWolfgang Baer <WBaer@gmx.de>2006-02-09 09:37:08 +0000
commitd8993f8af9c2de977890ab8d5a2724f081b8485d (patch)
tree6b04a3b7dd6e9aa96fd634abd3b032a1ed64941c /gnu/java/net/protocol
parentf278169dbae312d08e804a532664a812130b9b54 (diff)
downloadclasspath-d8993f8af9c2de977890ab8d5a2724f081b8485d.tar.gz
2006-02-09 Wolfgang Baer <WBaer@gmx.de>
* java/net/URLConnection.java: (setAllowUserInteraction): Throw IllegalStateException if connected. (getRequestProperty): Document return value if key is null. * gnu/java/net/protocol/http/HTTPURLConnection.java: (getRequestProperty): Return null if key is null. (getRequestProperties): Throw IllegalStateException if connected. (setRequestProperty): Call super method for exception tests. (addRequestProperty): Likewise.
Diffstat (limited to 'gnu/java/net/protocol')
-rw-r--r--gnu/java/net/protocol/http/HTTPURLConnection.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnu/java/net/protocol/http/HTTPURLConnection.java b/gnu/java/net/protocol/http/HTTPURLConnection.java
index b6d7f6895..9ac8fb1e6 100644
--- a/gnu/java/net/protocol/http/HTTPURLConnection.java
+++ b/gnu/java/net/protocol/http/HTTPURLConnection.java
@@ -449,21 +449,31 @@ public class HTTPURLConnection
public String getRequestProperty(String key)
{
+ if (key == null)
+ return null;
+
return requestHeaders.getValue(key);
}
public Map getRequestProperties()
{
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
return requestHeaders;
}
public void setRequestProperty(String key, String value)
{
+ super.setRequestProperty(key, value);
+
requestHeaders.put(key, value);
}
public void addRequestProperty(String key, String value)
{
+ super.addRequestProperty(key, value);
+
String old = requestHeaders.getValue(key);
if (old == null)
{