db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r510963 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data: CachedPage.java FileContainer.java
Date Fri, 23 Feb 2007 14:47:01 GMT
Author: djd
Date: Fri Feb 23 06:47:01 2007
New Revision: 510963

URL: http://svn.apache.org/viewvc?view=rev&rev=510963
Log:
Remove a couple of invalid checks on just allocated byte arrays in the store.
Checks were invalid because neither condition could ever be true, the
java new byte[] operator will always return an object of the correct size
or throw an exception.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/CachedPage.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/CachedPage.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/CachedPage.java?view=diff&rev=510963&r1=510962&r2=510963
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/CachedPage.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/CachedPage.java Fri
Feb 23 06:47:01 2007
@@ -854,17 +854,13 @@
 	** new page buffer and make subclass use the new page buffer
 	*/
 
-	protected void setPageArray(int pageSize) throws StandardException
+	protected void setPageArray(int pageSize)
 	{
 		if ((pageData == null) || (pageData.length != pageSize)) 
         {
+            // Give a chance for gc to release the old buffer
+            pageData = null; 
 			pageData = new byte[pageSize];
-
-			if (pageData == null || pageData.length != pageSize)
-            {
-				throw StandardException.newException(
-                        SQLState.DATA_OBJECT_ALLOCATION_FAILED, "PAGE");
-            }
 				
 			usePageBuffer(pageData);
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java?view=diff&rev=510963&r1=510962&r2=510963
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
Fri Feb 23 06:47:01 2007
@@ -996,11 +996,6 @@
 	{
 		// just write out the whole container header
 		byte[] array = new byte[CONTAINER_INFO_SIZE];
-		if (array == null || array.length != CONTAINER_INFO_SIZE)
-        {
-			throw StandardException.newException(
-                SQLState.DATA_OBJECT_ALLOCATION_FAILED, "byte[]");
-        }
 
 		try
 		{



Mime
View raw message