Author: nextgens
Date: 2008-08-26 14:15:25 +0000 (Tue, 26 Aug 2008)
New Revision: 22175

Modified:
   trunk/freenet/src/freenet/support/io/TempBucketFactory.java
Log:
paranoia

Modified: trunk/freenet/src/freenet/support/io/TempBucketFactory.java
===================================================================
--- trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-26 
14:05:37 UTC (rev 22174)
+++ trunk/freenet/src/freenet/support/io/TempBucketFactory.java 2008-08-26 
14:15:25 UTC (rev 22175)
@@ -135,10 +135,10 @@
                                        boolean shouldMigrate = false;
                                        boolean isOversized = false;

-                                       if(futureSize > maxRAMBucketSize * 
RAMBUCKET_CONVERSION_FACTOR) {
+                                       if(futureSize >= 
Math.min(Integer.MAX_VALUE, maxRAMBucketSize * RAMBUCKET_CONVERSION_FACTOR)) {
                                                isOversized = true;
                                                shouldMigrate = true;
-                                       } else if ((futureSize - currentSize) + 
bytesInUse > maxRamUsed)
+                                       } else if ((futureSize - currentSize) + 
bytesInUse >= maxRamUsed)
                                                shouldMigrate = true;

                                        if(shouldMigrate) {


Reply via email to