Update of /cvsroot/freenet/freenet/src/freenet/support
In directory sc8-pr-cvs1:/tmp/cvs-serv5586/src/freenet/support

Modified Files:
        FileBucket.java TempBucketFactory.java CryptBucket.java 
Log Message:
Work around problem with ThrottleAsyncEntropyYarrow/Yarrow initialization order.
Made randSource in Core private and started exposing it though a getter instead of 
directly.

Index: FileBucket.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/FileBucket.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- FileBucket.java     18 Oct 2003 00:17:56 -0000      1.16
+++ FileBucket.java     27 Oct 2003 14:45:16 -0000      1.17
@@ -38,7 +38,7 @@
      */
 
     public FileBucket() {
-       file = new File(tempDir, "t" + 
Fields.longToHex(Math.abs(Core.randSource.nextInt())));
+       file = new File(tempDir, "t" + 
Fields.longToHex(Math.abs(Core.getRandSource().nextInt())));
         // Useful for finding temp file leaks.
         //System.err.println("-- FileBucket.ctr(1) -- " + file.getAbsolutePath());
         //(new Exception("get stack")).printStackTrace();

Index: TempBucketFactory.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/TempBucketFactory.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- TempBucketFactory.java      1 Aug 2003 19:42:56 -0000       1.9
+++ TempBucketFactory.java      27 Oct 2003 14:45:16 -0000      1.10
@@ -73,12 +73,12 @@
     do {
       if (tmpDir != null) {
         f = new File(tmpDir, "tbf_" +
-            Long.toHexString(Math.abs(Core.randSource.nextInt())));
+            Long.toHexString(Math.abs(Core.getRandSource().nextInt())));
        Core.logger.log(this, "Temp file in "+tmpDir,
                        Core.logger.DEBUG);
       } else {
         f = new File("tbf_" +
-            Long.toHexString(Math.abs(Core.randSource.nextInt())));
+            Long.toHexString(Math.abs(Core.getRandSource().nextInt())));
        Core.logger.log(this, "Temp file in pwd",
                        Core.logger.DEBUG);
       }

Index: CryptBucket.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/CryptBucket.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- CryptBucket.java    1 Apr 2003 00:49:45 -0000       1.2
+++ CryptBucket.java    27 Oct 2003 14:45:16 -0000      1.3
@@ -30,7 +30,7 @@
        if (bc == null)
            throw new IllegalArgumentException();
        key = new byte[bc.getKeySize() >> 3];
-       Core.randSource.nextBytes(key);
+       Core.getRandSource().nextBytes(key);
     }
 
     /**
@@ -46,7 +46,7 @@
        if (bc == null)
            throw new IllegalArgumentException();
        key = new byte[bc.getKeySize() >> 3];
-       Core.randSource.nextBytes(key);
+       Core.getRandSource().nextBytes(key);
     }
 
     public OutputStream getOutputStream() throws IOException {

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to