hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r569782 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl: auth/RFC2617Scheme.java client/DefaultAuthenticationHandler.java
Date Sun, 26 Aug 2007 09:05:19 GMT
Author: rolandw
Date: Sun Aug 26 02:05:19 2007
New Revision: 569782

URL: http://svn.apache.org/viewvc?rev=569782&view=rev
Log:
interface FormattedHeader to avoid instanceof check on implementation class

Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/auth/RFC2617Scheme.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/auth/RFC2617Scheme.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/auth/RFC2617Scheme.java?rev=569782&r1=569781&r2=569782&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/auth/RFC2617Scheme.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/auth/RFC2617Scheme.java
Sun Aug 26 02:05:19 2007
@@ -35,11 +35,11 @@
 
 import org.apache.http.Header;
 import org.apache.http.HeaderElement;
+import org.apache.http.FormattedHeader;
 import org.apache.http.auth.AuthScheme;
 import org.apache.http.auth.AUTH;
 import org.apache.http.auth.MalformedChallengeException;
 import org.apache.http.message.BasicHeaderValueParser;
-import org.apache.http.message.BufferedHeader;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.CharArrayBuffer;
 
@@ -96,9 +96,9 @@
 
         CharArrayBuffer buffer;
         int pos;
-        if (header instanceof BufferedHeader) {
-            buffer = ((BufferedHeader) header).getBuffer();
-            pos = ((BufferedHeader) header).getValuePos();
+        if (header instanceof FormattedHeader) {
+            buffer = ((FormattedHeader) header).getBuffer();
+            pos = ((FormattedHeader) header).getValuePos();
         } else {
             String s = header.getValue();
             if (s == null) {

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java?rev=569782&r1=569781&r2=569782&view=diff
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
Sun Aug 26 02:05:19 2007
@@ -41,6 +41,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.Header;
+import org.apache.http.FormattedHeader;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.auth.AUTH;
@@ -51,7 +52,6 @@
 import org.apache.http.client.AuthenticationHandler;
 import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.client.protocol.ClientContext;
-import org.apache.http.message.BufferedHeader;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
@@ -101,9 +101,9 @@
             Header header = headers[i];
             CharArrayBuffer buffer;
             int pos;
-            if (header instanceof BufferedHeader) {
-                buffer = ((BufferedHeader) header).getBuffer();
-                pos = ((BufferedHeader) header).getValuePos();
+            if (header instanceof FormattedHeader) {
+                buffer = ((FormattedHeader) header).getBuffer();
+                pos = ((FormattedHeader) header).getValuePos();
             } else {
                 String s = header.getValue();
                 if (s == null) {



Mime
View raw message