hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1483735 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
Date Fri, 17 May 2013 11:01:28 GMT
Author: olegk
Date: Fri May 17 11:01:28 2013
New Revision: 1483735

URL: http://svn.apache.org/r1483735
Log:
Minor optimization

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java?rev=1483735&r1=1483734&r2=1483735&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
Fri May 17 11:01:28 2013
@@ -113,13 +113,17 @@ public class DefaultHttpRequestRetryHand
             // Do not retry if over max retry count
             return false;
         }
-        for (final Class<? extends IOException> rejectException : this.nonRetriableClasses)
{
-            if (rejectException.isInstance(exception)) {
-                return false;
+        if (this.nonRetriableClasses.contains(exception.getClass())) {
+            return false;
+        } else {
+            for (final Class<? extends IOException> rejectException : this.nonRetriableClasses)
{
+                if (rejectException.isInstance(exception)) {
+                    return false;
+                }
             }
         }
-        final HttpClientContext localcontext = HttpClientContext.adapt(context);
-        final HttpRequest request = localcontext.getRequest();
+        final HttpClientContext clientContext = HttpClientContext.adapt(context);
+        final HttpRequest request = clientContext.getRequest();
 
         if(requestIsAborted(request)){
             return false;
@@ -130,7 +134,7 @@ public class DefaultHttpRequestRetryHand
             return true;
         }
 
-        if (!localcontext.isRequestSent() || this.requestSentRetryEnabled) {
+        if (!clientContext.isRequestSent() || this.requestSentRetryEnabled) {
             // Retry if the request has not been sent fully or
             // if it's OK to retry methods that have been sent
             return true;



Mime
View raw message