Author: toad
Date: 2009-01-29 16:31:59 +0000 (Thu, 29 Jan 2009)
New Revision: 25362

Modified:
   branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java
Log:
Throw an exception if a non-persistent compression job is started on the 
database thread or vice versa.
Maybe will help to find the cause of saces' NPEs


Modified: branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java        
2009-01-29 00:26:44 UTC (rev 25361)
+++ branches/db4o/freenet/src/freenet/client/async/InsertCompressor.java        
2009-01-29 16:31:59 UTC (rev 25362)
@@ -231,6 +231,8 @@
         */
        public static InsertCompressor start(ObjectContainer container, 
ClientContext context, SingleFileInserter inserter, 
                        Bucket origData, int minSize, BucketFactory bf, boolean 
persistent) {
+               if(persistent != (container != null))
+                       throw new IllegalStateException("Starting compression, 
persistent="+persistent+" but container="+container);
                InsertCompressor compressor = new 
InsertCompressor(context.nodeDBHandle, inserter, origData, minSize, bf, 
persistent);
                if(persistent)
                        container.store(compressor);

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to