harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r431829 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
Date Wed, 16 Aug 2006 05:37:49 GMT
Author: pyang
Date: Tue Aug 15 22:37:49 2006
New Revision: 431829

URL: http://svn.apache.org/viewvc?rev=431829&view=rev
Log:
Patch applied for HARMONY-1189 ([classlib][luni] java.net.HttpURLConnection.getHeaderFieldXXX
family methods return incorrect value when http server replied bad response code.)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java?rev=431829&r1=431828&r2=431829&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnection.java
Tue Aug 15 22:37:49 2006
@@ -736,10 +736,13 @@
     public String getHeaderField(int pos) {
         try {
             getInputStream();
-            return resHeader.get(pos);
         } catch (IOException e) {
+            // ignore
+        }
+        if (null == resHeader) {
             return null;
         }
+        return resHeader.get(pos);
     }
 
     /**
@@ -759,10 +762,13 @@
     public String getHeaderField(String key) {
         try {
             getInputStream();
-            return resHeader.get(key);
         } catch (IOException e) {
+            // ignore
+        }
+        if (null == resHeader) {
             return null;
         }
+        return resHeader.get(key);
     }
 
     /**
@@ -780,10 +786,13 @@
     public String getHeaderFieldKey(int pos) {
         try {
             getInputStream();
-            return resHeader.getKey(pos);
         } catch (IOException e) {
+            // ignore
+        }
+        if (null == resHeader) {
             return null;
         }
+        return resHeader.getKey(pos);
     }
 
     /**
@@ -798,11 +807,14 @@
     public Map<String, List<String>> getHeaderFields() {
         try {
             // ensure that resHeader exists
-            getInputStream();
-            return resHeader.getFieldMap();
+            getInputStream(); 
         } catch (IOException e) {
+            // ignore
+        }
+        if (null == resHeader) {
             return null;
         }
+        return resHeader.getFieldMap();
     }
 
     /**



Mime
View raw message