2003-05-27 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 May 2003 06:17:57 +0000 (06:17 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 May 2003 06:17:57 +0000 (06:17 +0000)
* java/net/URLConnection.java
(getHeaderFieldInt): Merged with classpath.

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

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

index a36a473..1ae1bff 100644 (file)
@@ -1,5 +1,10 @@
 2003-05-27  Michael Koch  <konqueror@gmx.de>
 
+       * java/net/URLConnection.java
+       (getHeaderFieldInt): Merged with classpath.
+
+2003-05-27  Michael Koch  <konqueror@gmx.de>
+
        * java/io/PrintStream.java
        (PrintStream): Reformatted.
        (PrintStream): New method, merged from classpath.
index 75adf52..7684e52 100644 (file)
@@ -322,25 +322,29 @@ public abstract class URLConnection
    * is not present or cannot be parsed as an integer, the default value
    * will be returned.
    *
-   * @param name The name of the header field
-   * @param val The default value
+   * @param name The header field key to lookup
+   * @param defaultValue The defaule value if the header field is not found
+   * or can't be parsed.
    *
    * @return The value of the header field or the default value if the field
    * is missing or malformed
    */
-  public int getHeaderFieldInt(String name, int val)
+  public int getHeaderFieldInt(String name, int defaultValue)
   {
     String str = getHeaderField(name);
+    int result = defaultValue;
+    
     try
       {
        if (str != null)
-         val = Integer.parseInt(str);
+         result = Integer.parseInt (str);
       }
-    catch (NumberFormatException e)
-      {
-       ; // Do nothing; val is the default.
+    catch (NumberFormatException e) 
+      { 
+       ; // Do nothing; defaultValue is the default.
       }
-    return val;
+    
+    return result;
   }
 
   /**