Author: toad
Date: 2008-07-21 14:32:14 +0000 (Mon, 21 Jul 2008)
New Revision: 21287

Modified:
   
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
Log:
Paranoia (yes this happens :( )

Modified: 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java  
    2008-07-21 14:04:19 UTC (rev 21286)
+++ 
branches/db4o/freenet/src/freenet/client/async/ClientRequestSchedulerBase.java  
    2008-07-21 14:32:14 UTC (rev 21287)
@@ -14,6 +14,7 @@
 import freenet.node.BaseSendableGet;
 import freenet.node.RequestStarter;
 import freenet.node.SendableGet;
+import freenet.node.SendableInsert;
 import freenet.node.SendableRequest;
 import freenet.support.Logger;
 import freenet.support.SectoredRandomGrabArrayWithInt;
@@ -64,8 +65,10 @@
        }

        void innerRegister(SendableRequest req, RandomSource random, 
ObjectContainer container) {
-               if(isInsertScheduler && req instanceof SendableGet)
+               if(isInsertScheduler && req instanceof BaseSendableGet)
                        throw new IllegalArgumentException("Adding a 
SendableGet to an insert scheduler!!");
+               if((!isInsertScheduler) && req instanceof SendableInsert)
+                       throw new IllegalArgumentException("Adding a 
SendableInsert to a request scheduler!!");
                if(req.persistent() != persistent())
                        throw new IllegalArgumentException("innerRegister for 
persistence="+req.persistent()+" but our persistence is "+persistent());
                if(req.getPriorityClass(container) == 0) {


Reply via email to