Update of /cvsroot/freenet/freenet/src/freenet/node/rt
In directory sc8-pr-cvs1:/tmp/cvs-serv17556/src/freenet/node/rt

Modified Files:
        RoutingPointStore.java 
Log Message:
Work around NPE by initially filling the store with non-null keys. Wheter or not this 
is the right way to do it is still tbd.

Index: RoutingPointStore.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/rt/RoutingPointStore.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- RoutingPointStore.java      3 Nov 2003 08:04:52 -0000       1.1
+++ RoutingPointStore.java      3 Nov 2003 08:52:18 -0000       1.2
@@ -137,10 +137,11 @@
        public RoutingPointStore(int accuracy,int initTime,BigInteger keyspace) {
                this.keyspace = keyspace;
                points = new RoutingPoint[accuracy];
+               if(initTime < 0) throw new IllegalArgumentException("negative 
initTime");
                for (int x = 0; x < points.length; x++) {
                        points[x] = new RoutingPoint();
                }
-               setAllTimes(initTime);
+               distributeKeysEvenly();
                logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
        }
 
@@ -180,7 +181,7 @@
        //TODO: Documentation
        public RoutingPointStore(Key k, int high, int low, int accuracy,BigInteger 
keyspace) {
                this(accuracy,-1,keyspace);
-//             We will overwrite the initTime:s in as second so they doesn't really 
matter.
+               //We will overwrite the initTime:s in a second so they doesn't really 
matter.
                //Make sure that we detect any assignment problems but setting 
initTime to -1 
                if (high < 0 || low < 0)
                        throw new IllegalArgumentException("negative high " + high + " 
or low " + low);

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

Reply via email to