hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1529295 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/FutureRequestExecutionMetrics.java
Date Fri, 04 Oct 2013 20:54:49 GMT
Author: olegk
Date: Fri Oct  4 20:54:49 2013
New Revision: 1529295

URL: http://svn.apache.org/r1529295
Log:
HTTPCLIENT-1413: Fixed divide by zero error in FutureRequestExecutionMetrics

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

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/FutureRequestExecutionMetrics.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/FutureRequestExecutionMetrics.java?rev=1529295&r1=1529294&r2=1529295&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/FutureRequestExecutionMetrics.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/FutureRequestExecutionMetrics.java
Fri Oct  4 20:54:49 2013
@@ -139,7 +139,7 @@ public final class FutureRequestExecutio
 
         public long averageDuration() {
             final long counter = count.get();
-            return cumulativeDuration.get() / counter;
+            return counter > 0 ? cumulativeDuration.get() / counter : 0;
         }
 
         @Override



Mime
View raw message