Author: nextgens
Date: 2006-07-03 22:08:05 +0000 (Mon, 03 Jul 2006)
New Revision: 9452
Modified:
trunk/freenet/src/freenet/client/ArchiveStoreItem.java
trunk/freenet/src/freenet/support/Base64.java
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
Log:
more consistency fixes
Modified: trunk/freenet/src/freenet/client/ArchiveStoreItem.java
===================================================================
--- trunk/freenet/src/freenet/client/ArchiveStoreItem.java 2006-07-03
21:50:21 UTC (rev 9451)
+++ trunk/freenet/src/freenet/client/ArchiveStoreItem.java 2006-07-03
22:08:05 UTC (rev 9452)
@@ -20,7 +20,7 @@
/** Expected to delete any stored data on disk, and decrement
cachedData.
* Implemented to remove self from context.
*/
- public void finalize() {
+ protected void finalize() {
context.removeItem(this);
}
Modified: trunk/freenet/src/freenet/support/Base64.java
===================================================================
--- trunk/freenet/src/freenet/support/Base64.java 2006-07-03 21:50:21 UTC
(rev 9451)
+++ trunk/freenet/src/freenet/support/Base64.java 2006-07-03 22:08:05 UTC
(rev 9452)
@@ -1,5 +1,7 @@
package freenet.support;
+import java.util.Random;
+
/**
* This class provides encoding of byte arrays into Base64-encoded strings,
* and decoding the other way.
@@ -22,10 +24,11 @@
throws IllegalBase64Exception
{
int iter;
+ Random r = new Random();
for (iter = 0; iter < 1000; iter++) {
- byte[] b = new byte[(int) (Math.random()*64.0)];
+ byte[] b = new byte[r.nextInt(64)];
for (int i = 0; i < b.length; i++)
- b[i] = (byte) (Math.random() * 256.0);
+ b[i] = (byte) (r.nextInt(256));
String encoded = encode(b);
System.out.println(encoded);
byte[] decoded = decode(encoded);
Modified:
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
===================================================================
---
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
2006-07-03 21:50:21 UTC (rev 9451)
+++
trunk/freenet/src/freenet/support/math/BootstrappingDecayingRunningAverage.java
2006-07-03 22:08:05 UTC (rev 9452)
@@ -18,7 +18,7 @@
* b) We don't get big problems with influence of the initial value,
* which is usually not very reliable.
*/
-public class BootstrappingDecayingRunningAverage implements
+public final class BootstrappingDecayingRunningAverage implements
RunningAverage {
private static final long serialVersionUID = -1;