From 4742a3dbf1371728e461b555a580d7432376445b Mon Sep 17 00:00:00 2001 From: Wolfgang Baer Date: Mon, 6 Mar 2006 19:08:30 +0000 Subject: 2006-03-06 Wolfgang Baer * gnu/java/net/protocol/http/HTTPURLConnection.java: Organized imports. (getRequestProperty): Remove duplicated null check. * java/net/URLConnection.java: (URLConnection): Javadoc fix. (addRequestProperty): Likewise. (getDefaultRequestProperty): Likewise. (getHeaderField): Likewise. (getHeaderFieldDate): Likewise. (getHeaderFieldKey): Likewise. (getHeaderFields): Likewise. (getRequestProperties): Likewise. (getRequestProperty): Likewise. (setDefaultRequestProperty): Likewise. (setRequestProperty): Likewise. --- ChangeLog | 17 +++++++++ gnu/java/net/protocol/http/HTTPURLConnection.java | 9 +---- java/net/URLConnection.java | 42 +++++++++++++---------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index a45040f0e..5f4e0b8e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2006-03-06 Wolfgang Baer + + * gnu/java/net/protocol/http/HTTPURLConnection.java: Organized imports. + (getRequestProperty): Remove duplicated null check. + * java/net/URLConnection.java: + (URLConnection): Javadoc fix. + (addRequestProperty): Likewise. + (getDefaultRequestProperty): Likewise. + (getHeaderField): Likewise. + (getHeaderFieldDate): Likewise. + (getHeaderFieldKey): Likewise. + (getHeaderFields): Likewise. + (getRequestProperties): Likewise. + (getRequestProperty): Likewise. + (setDefaultRequestProperty): Likewise. + (setRequestProperty): Likewise. + 2006-03-06 Tom Tromey * javax/swing/plaf/synth/Region.java (FILE_CHOOSER): Renamed. diff --git a/gnu/java/net/protocol/http/HTTPURLConnection.java b/gnu/java/net/protocol/http/HTTPURLConnection.java index 5c2af9eb7..5300c664c 100644 --- a/gnu/java/net/protocol/http/HTTPURLConnection.java +++ b/gnu/java/net/protocol/http/HTTPURLConnection.java @@ -48,12 +48,8 @@ import java.io.OutputStream; import java.net.ProtocolException; import java.net.URL; import java.security.cert.Certificate; -import java.util.ArrayList; import java.util.Collections; import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.Map; import javax.net.ssl.HandshakeCompletedEvent; @@ -410,10 +406,7 @@ public class HTTPURLConnection } public String getRequestProperty(String key) - { - if (key == null) - return null; - + { return requestHeaders.getValue(key); } diff --git a/java/net/URLConnection.java b/java/net/URLConnection.java index b4a55a01a..6730fd1d2 100644 --- a/java/net/URLConnection.java +++ b/java/net/URLConnection.java @@ -1,5 +1,5 @@ /* URLConnection.java -- Abstract superclass for reading from URL's - Copyright (C) 1998, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -168,7 +168,7 @@ public abstract class URLConnection /** * Creates a URL connection to a given URL. A real connection is not made. - * Use #connect to do this. + * Use connect() to do this. * * @param url The Object to create the URL connection to * @@ -277,8 +277,8 @@ public abstract class URLConnection /** * Return a String representing the header value at the specified index. * This allows the caller to walk the list of header fields. The analogous - * getHeaderFieldKey(int) method allows access to the corresponding key - * for this header field + * {@link #getHeaderField(int)} method allows access to the corresponding + * key for this header field * * @param index The index into the header field list to retrieve the value for * @@ -305,9 +305,10 @@ public abstract class URLConnection } /** - * Returns a map of all sent header fields - * - * @return all header fields + * Returns an unmodifiable Map containing all sent header fields. + * + * @return The map of header fields. The map consists of String keys with + * an unmodifiable List of String objects as value. * * @since 1.4 */ @@ -355,7 +356,7 @@ public abstract class URLConnection * @param defaultValue The default date if the header field is not found * or can't be converted. * - * @return Returns the date value of the header filed or the default value + * @return The date value of the header filed or the default value * if the field is missing or malformed */ public long getHeaderFieldDate(String name, long defaultValue) @@ -388,8 +389,8 @@ public abstract class URLConnection /** * Returns a String representing the header key at the specified index. * This allows the caller to walk the list of header fields. The analogous - * getHeaderField(int) method allows access to the corresponding value for - * this tag. + * {@link #getHeaderField(int)} method allows access to the corresponding + * value for this tag. * * @param index The index into the header field list to retrieve the key for. * @@ -722,7 +723,9 @@ public abstract class URLConnection } /** - * Sets the value of the named request property + * Sets the value of the named request property. + * This method does overwrite the value of existing properties with + * the new value. * * @param key The name of the property * @param value The value of the property @@ -757,8 +760,8 @@ public abstract class URLConnection * @exception IllegalStateException If already connected * @exception NullPointerException If key is null * - * @see URLConnection#getRequestProperty(String key) - * @see URLConnection#setRequestProperty(String key, String value) + * @see URLConnection#getRequestProperty(String) + * @see URLConnection#setRequestProperty(String, String) * * @since 1.4 */ @@ -783,8 +786,8 @@ public abstract class URLConnection * * @exception IllegalStateException If already connected * - * @see URLConnection#setRequestProperty(String key, String value) - * @see URLConnection#addRequestProperty(String key, String value) + * @see URLConnection#setRequestProperty(String, String) + * @see URLConnection#addRequestProperty(String, String) */ public String getRequestProperty(String key) { @@ -798,8 +801,9 @@ public abstract class URLConnection /** * Returns an unmodifiable Map containing the request properties. - * - * @return The map of properties + * + * @return The map of properties. The map consists of String keys with an + * unmodifiable List of String objects as value. * * @exception IllegalStateException If already connected * @@ -826,7 +830,7 @@ public abstract class URLConnection * @deprecated 1.3 The method setRequestProperty should be used instead. * This method does nothing now. * - * @see URLConnection#setRequestProperty(String key, String value) + * @see URLConnection#setRequestProperty(String, String) */ public static void setDefaultRequestProperty(String key, String value) { @@ -845,7 +849,7 @@ public abstract class URLConnection * @deprecated 1.3 The method getRequestProperty should be used instead. * This method does nothing now. * - * @see URLConnection#getRequestProperty(String key) + * @see URLConnection#getRequestProperty(String) */ public static String getDefaultRequestProperty(String key) { -- cgit v1.2.1