db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1103718 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java
Date Mon, 16 May 2011 12:41:19 GMT
Author: kristwaa
Date: Mon May 16 12:41:19 2011
New Revision: 1103718

URL: http://svn.apache.org/viewvc?rev=1103718&view=rev
Log:
DERBY-5098: embedded/in-memory: SQLNonTransientConnectionException: No current connection
due to invalid page format 

Removed redundant checks for whether more space has to be allocated to
accomodate the write.

Patch file: derby-5098-2a-remove_redundant_checks.diff

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java?rev=1103718&r1=1103717&r2=1103718&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/io/vfmem/BlockedByteArray.java Mon
May 16 12:41:19 2011
@@ -187,9 +187,7 @@ public class BlockedByteArray {
             throw new ArrayIndexOutOfBoundsException(len);
         }
         // Increase the capacity if required.
-        if (pos + len >= (long)allocatedBlocks * blockSize) {
-            increaseCapacity(pos + len);
-        }
+        increaseCapacity(pos + len);
         // Calculate the block number and the index within this block.
         int block = (int)(pos / blockSize);
         int index = (int)(pos % blockSize);
@@ -226,10 +224,7 @@ public class BlockedByteArray {
             checkBlockSize(0);
         }
         // Increase the capacity if required.
-        if (pos >= (long)allocatedBlocks * blockSize) {
-            increaseCapacity(pos);
-        }
-
+        increaseCapacity(pos);
         // Calculate the block number and the index within this block.
         int block = (int)(pos / blockSize);
         int index = (int)(pos % blockSize);



Mime
View raw message