directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1593524 - in /directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree: AbstractPage.java InMemoryLeaf.java PersistedLeaf.java exception/KeyNotFoundException.java
Date Fri, 09 May 2014 12:16:03 GMT
Author: kayyagari
Date: Fri May  9 12:16:02 2014
New Revision: 1593524

URL: http://svn.apache.org/r1593524
Log:
created a static instance of KeyNotFoundException and used it wherever possible

Modified:
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java
    directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/exception/KeyNotFoundException.java

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java?rev=1593524&r1=1593523&r2=1593524&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
Fri May  9 12:16:02 2014
@@ -59,11 +59,6 @@ import org.apache.directory.mavibot.btre
     /** The last {@link PageIO} storing the serialized Page on disk */
     protected long lastOffset = -1L;
 
-    /** A static Exception used to avoid creating a new one every time */
-    protected KeyNotFoundException KEY_NOT_FOUND_EXCEPTION = new KeyNotFoundException(
-        "Cannot find an entry associated with this key" );
-
-
     /**
      * Creates a default empty AbstractPage
      *

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java?rev=1593524&r1=1593523&r2=1593524&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/InMemoryLeaf.java
Fri May  9 12:16:02 2014
@@ -27,7 +27,6 @@ import org.apache.directory.mavibot.btre
 import org.apache.directory.mavibot.btree.exception.EndOfFileExceededException;
 import org.apache.directory.mavibot.btree.exception.KeyNotFoundException;
 
-
 /**
  * A MVCC Leaf. It stores the keys and values. It does not have any children.
  *
@@ -486,7 +485,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            throw KEY_NOT_FOUND_EXCEPTION;
+            throw KeyNotFoundException.INSTANCE;
         }
     }
 
@@ -512,7 +511,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            throw KEY_NOT_FOUND_EXCEPTION;
+            throw KeyNotFoundException.INSTANCE;
         }
     }
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java?rev=1593524&r1=1593523&r2=1593524&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/PersistedLeaf.java
Fri May  9 12:16:02 2014
@@ -519,7 +519,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            throw KEY_NOT_FOUND_EXCEPTION;
+            throw KeyNotFoundException.INSTANCE;
         }
     }
 
@@ -561,7 +561,7 @@ import org.apache.directory.mavibot.btre
         }
         else
         {
-            throw KEY_NOT_FOUND_EXCEPTION;
+            throw KeyNotFoundException.INSTANCE;
         }
     }
 

Modified: directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/exception/KeyNotFoundException.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/exception/KeyNotFoundException.java?rev=1593524&r1=1593523&r2=1593524&view=diff
==============================================================================
--- directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/exception/KeyNotFoundException.java
(original)
+++ directory/mavibot/branches/with-txns/mavibot/src/main/java/org/apache/directory/mavibot/btree/exception/KeyNotFoundException.java
Fri May  9 12:16:02 2014
@@ -29,6 +29,10 @@ public class KeyNotFoundException extend
 {
     /** The serial version UUID */
     private static final long serialVersionUID = 1L;
+    
+    /** A static Exception used to avoid creating a new one every time */
+    public static final KeyNotFoundException INSTANCE = new KeyNotFoundException(
+        "Cannot find an entry associated with this key" );
 
 
     /**



Mime
View raw message