Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.1734 diff -u -b -B -r1.1734 ChangeLog --- ChangeLog 28 Dec 2003 21:50:38 -0000 1.1734 +++ ChangeLog 30 Dec 2003 12:27:43 -0000 @@ -1,3 +1,16 @@ +2003-12-30 Michael Koch + + * java/net/URLConnection.java + (req_props): Removed. + (getHeaderField): Do nothing here. Implementation has to be in + subclass. + (setRequestProperty): Likewise. + (addRequestProperty): Likewise. + (getRequestProperty): Likewise. + (getRequestProperties): Likewise. + (setDefaultRequestProperty): Likewise. + (getDefaultRequestProperty): Likewise. + 2003-12-28 Michael Koch * gnu/java/net/HeaderFieldHelper.java Index: java/net/URLConnection.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/net/URLConnection.java,v retrieving revision 1.19 diff -u -b -B -r1.19 URLConnection.java --- java/net/URLConnection.java 12 Oct 2003 17:24:37 -0000 1.19 +++ java/net/URLConnection.java 30 Dec 2003 12:27:43 -0000 @@ -160,10 +160,6 @@ */ protected URL url; - /** - * The list of request properties for this connection - */ - private final Hashtable req_props; /** * Creates a URL connection to a given URL. A real connection is not made. @@ -179,7 +175,6 @@ this.url = url; allowUserInteraction = defaultAllowUserInteraction; useCaches = defaultUseCaches; - req_props = new Hashtable(); } /** @@ -298,15 +293,8 @@ */ public String getHeaderField(String name) { - for (int i = 0; ; i++) - { - String key = getHeaderFieldKey(i); - if (key == null) - return(null); - - if (key.toLowerCase().equals(name.toLowerCase())) - return(getHeaderField(i)); - } + // Subclasses for specific protocols override this. + return null; } /** @@ -746,7 +734,8 @@ if (key == null) throw new NullPointerException ("key is null"); - req_props.put (key.toLowerCase(), value); + // Do nothing unless overridden by subclasses that support setting + // header fields in the request. } /** @@ -772,10 +761,8 @@ if (key == null) throw new NullPointerException ("key is null"); - if (getRequestProperty (key) == null) - { - setRequestProperty (key, value); - } + // Do nothing unless overridden by subclasses that support adding + // header fields in the request. } /** @@ -795,7 +782,9 @@ if (connected) throw new IllegalStateException ("Already connected"); - return((String)req_props.get(key.toLowerCase())); + // Overridden by subclasses that support reading header fields from the + // request. + return null; } /** @@ -812,7 +801,9 @@ if (connected) throw new IllegalStateException ("Already connected"); - return Collections.unmodifiableMap(req_props); + // Overridden by subclasses that support reading header fields from the + // request. + return Collections.EMPTY_MAP; } /** @@ -823,9 +814,10 @@ * @param key The request property name the default is being set for * @param value The value to set the default to * - * @deprecated 1.3 The method setRequestProperty should be used instead + * @deprecated 1.3 The method setRequestProperty should be used instead. + * This method does nothing now. * - * @see URLConnectionr#setRequestProperty(String key, String value) + * @see URLConnection#setRequestProperty(String key, String value) */ public static void setDefaultRequestProperty (String key, String value) { @@ -841,11 +833,12 @@ * * @return The value of the default property or null if not available * - * @deprecated 1.3 The method getRequestProperty should be used instead + * @deprecated 1.3 The method getRequestProperty should be used instead. + * This method does nothing now. * * @see URLConnection#getRequestProperty(String key) */ - public static String getDefaultRequestProperty (String key) + public static String getDefaultRequestProperty(String key) { // This method does nothing since JDK 1.3. return null;