Author: nextgens
Date: 2008-08-17 11:54:42 +0000 (Sun, 17 Aug 2008)
New Revision: 21955

Modified:
   trunk/freenet/src/freenet/support/io/ArrayBucket.java
Log:
ArrayBucket: disable the length check unless we are in debug mode so that trunk 
is usable.
I need to talk to toad about it; we have to decide whether we want a maxSize 
parameter or a defaultSize one

Modified: trunk/freenet/src/freenet/support/io/ArrayBucket.java
===================================================================
--- trunk/freenet/src/freenet/support/io/ArrayBucket.java       2008-08-17 
11:37:00 UTC (rev 21954)
+++ trunk/freenet/src/freenet/support/io/ArrayBucket.java       2008-08-17 
11:54:42 UTC (rev 21955)
@@ -96,7 +96,7 @@
                public synchronized void write(byte b[], int off, int len) {
                        if(readOnly) throw new IllegalStateException("Read 
only");
                        long sizeIfWritten = size + len;
-                       if(maxSize > -1 && maxSize < sizeIfWritten) // FIXME: 
should be IOE but how to do it?
+                       if(logDEBUG && maxSize > -1 && maxSize < sizeIfWritten) 
// FIXME: should be IOE but how to do it?
                                throw new IllegalArgumentException("The maxSize 
of the bucket is "+maxSize+
                                        " and writing "+len+ " bytes to it 
would make it oversize!");
                        super.write(b, off, len);
@@ -107,7 +107,7 @@
                public synchronized void write(int b) {
                        if(readOnly) throw new IllegalStateException("Read 
only");
                        long sizeIfWritten = size + 1;
-                       if(maxSize > -1 && maxSize < sizeIfWritten) // FIXME: 
should be IOE but how to do it?
+                       if(logDEBUG && maxSize > -1 && maxSize < sizeIfWritten) 
// FIXME: should be IOE but how to do it?
                                throw new IllegalArgumentException("The maxSize 
of the bucket is "+maxSize+
                                        " and writing 1 byte to it would make 
it oversize!");
                        super.write(b);


Reply via email to