directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1161678 - /directory/apacheds/branches/apacheds-jdbm/jdbm/src/main/java/jdbm/btree/BTree.java
Date Thu, 25 Aug 2011 18:25:08 GMT
Author: elecharny
Date: Thu Aug 25 18:25:08 2011
New Revision: 1161678

URL: http://svn.apache.org/viewvc?rev=1161678&view=rev
Log:
Applied Selcuk second patch

Modified:
    directory/apacheds/branches/apacheds-jdbm/jdbm/src/main/java/jdbm/btree/BTree.java

Modified: directory/apacheds/branches/apacheds-jdbm/jdbm/src/main/java/jdbm/btree/BTree.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-jdbm/jdbm/src/main/java/jdbm/btree/BTree.java?rev=1161678&r1=1161677&r2=1161678&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-jdbm/jdbm/src/main/java/jdbm/btree/BTree.java (original)
+++ directory/apacheds/branches/apacheds-jdbm/jdbm/src/main/java/jdbm/btree/BTree.java Thu
Aug 25 18:25:08 2011
@@ -686,7 +686,7 @@ public class BTree<K, V> implements Exte
     {
         BTree<K, V> bTreeCopy;
         
-        if ( readOnlyAction )
+        if ( readOnlyAction && isActionCapable )
         {
             bTreeCopy = ( BTree<K, V> )recordManager.fetch( recordId );
         }
@@ -826,12 +826,19 @@ public class BTree<K, V> implements Exte
     
     BPage<K,V> copyOnWrite( BPage<K,V> page) throws IOException
     {
-        byte[] array;
-        array = this.bpageSerializer.serialize( page );
-        BPage<K,V> pageCopy = this.bpageSerializer.deserialize( array );
-        pageCopy.recordId = page.recordId;
-        pageCopy.btree = page.btree;
-        return pageCopy;
+    	if ( !isActionCapable )
+    	{
+    		return page;
+    	}
+    	else
+    	{
+    		byte[] array;
+    		array = this.bpageSerializer.serialize( page );
+    		BPage<K,V> pageCopy = this.bpageSerializer.deserialize( array );
+    		pageCopy.recordId = page.recordId;
+    		pageCopy.btree = page.btree;
+    		return pageCopy;
+    	}
     }
     
     @SuppressWarnings("unchecked") 



Mime
View raw message