Author: toad
Date: 2007-08-09 18:55:36 +0000 (Thu, 09 Aug 2007)
New Revision: 14567

Modified:
   trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java
Log:
Don't accept NaN currentValue! This should have gone in on 1051, oh well...

Modified: trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java
===================================================================
--- trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java      
2007-08-09 18:13:39 UTC (rev 14566)
+++ trunk/freenet/src/freenet/support/math/TimeDecayingRunningAverage.java      
2007-08-09 18:55:36 UTC (rev 14567)
@@ -90,7 +90,7 @@
                started = fs.getBoolean("Started", false);
                if(started) {
                        curValue = fs.getDouble("CurrentValue", curValue);
-                       if(curValue > maxReport || curValue < minReport) {
+                       if(curValue > maxReport || curValue < minReport || 
Double.isNaN(curValue)) {
                                curValue = defaultValue;
                                totalReports = 0;
                                createdTime = System.currentTimeMillis();


Reply via email to