[freenet-cvs] r12203 - in trunk/freenet/src/freenet: client pluginmanager support/math

nextgens at freenetproject.org nextgens at freenetproject.org
Sun Mar 18 13:42:41 UTC 2007


Author: nextgens
Date: 2007-03-18 13:42:40 +0000 (Sun, 18 Mar 2007)
New Revision: 12203

Modified:
   trunk/freenet/src/freenet/client/StandardOnionFECCodec.java
   trunk/freenet/src/freenet/pluginmanager/TestPlugin.java
   trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
Log:
Fix/improve r12179, r12181 and r12183

Modified: trunk/freenet/src/freenet/client/StandardOnionFECCodec.java
===================================================================
--- trunk/freenet/src/freenet/client/StandardOnionFECCodec.java	2007-03-18 13:34:58 UTC (rev 12202)
+++ trunk/freenet/src/freenet/client/StandardOnionFECCodec.java	2007-03-18 13:42:40 UTC (rev 12203)
@@ -60,7 +60,7 @@
 				Logger.minor(this, "Splitfile encode: k="+k+", n="+n+" encode took "+(endTime-startTime)+"ms");
 			finished = true;
 			synchronized(this) {
-				notifyAll();
+				notify();
 			}
 		}
 
@@ -187,7 +187,7 @@
 		} finally {
 			synchronized(runningDecodesSync) {
 				runningDecodes--;
-				runningDecodesSync.notifyAll();
+				runningDecodesSync.notify();
 			}
 		}
 	}
@@ -359,7 +359,7 @@
 		} finally {
 			synchronized(runningDecodesSync) {
 				runningDecodes--;
-				runningDecodesSync.notifyAll();
+				runningDecodesSync.notify();
 			}
 		}
 	}

Modified: trunk/freenet/src/freenet/pluginmanager/TestPlugin.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/TestPlugin.java	2007-03-18 13:34:58 UTC (rev 12202)
+++ trunk/freenet/src/freenet/pluginmanager/TestPlugin.java	2007-03-18 13:42:40 UTC (rev 12203)
@@ -158,7 +158,7 @@
 				"freenet:CHK at aH73gnCP5BHrBllzjkMidAL9omoZhArbLx~E8ohfhXY,tFiT49y7VJycJggw9oITCP5LxPza~WnrmM3KY02V~3g,AAEA--8",
 				"freenet:CHK at EWWH3-KJevOv5bFRZunpJWZmKCY5UmtStpsRL~68U1A,opipVzjgGF4jKm~f9hTRY1fjrGhDfl2vQYs5IdabixE,AAEA--8"};
 
-		return strs[Math.abs(rnd.nextInt() + 1)%strs.length];
+		return strs[rnd.nextInt(strs.length)];
 	}
 
 }

Modified: trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
===================================================================
--- trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java	2007-03-18 13:34:58 UTC (rev 12202)
+++ trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java	2007-03-18 13:42:40 UTC (rev 12203)
@@ -57,8 +57,9 @@
         if(fs != null) {
         	currentValue = fs.getDouble("CurrentValue", currentValue);
         	reports = fs.getLong("Reports", reports);
-        	zeros = fs.getLong("Zeros", reports);
-        	ones = fs.getLong("Ones", reports);
+        	zeros = fs.getLong("Zeros", 0);
+        	ones = fs.getLong("Ones", 0);
+        	if(reports == 0) zeros = ones = 0;
         }
     }
     




More information about the cvs mailing list