directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1292436 [1/2] - in /directory/trunks/jdbm: ./ jdbm/ jdbm/src/main/java/jdbm/ jdbm/src/main/java/jdbm/btree/ jdbm/src/main/java/jdbm/helper/ jdbm/src/main/java/jdbm/htree/ jdbm/src/main/java/jdbm/recman/ jdbm/src/main/resources/ jdbm/src/ma...
Date Wed, 22 Feb 2012 18:32:47 GMT
Author: elecharny
Date: Wed Feb 22 18:32:45 2012
New Revision: 1292436

URL: http://svn.apache.org/viewvc?rev=1292436&view=rev
Log:
added the JDBM subproject

Added:
    directory/trunks/jdbm/   (with props)
    directory/trunks/jdbm/jdbm/
      - copied from r1292422, directory/apacheds/trunk/jdbm/
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/I18n.java
    directory/trunks/jdbm/jdbm/src/main/resources/
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors.properties
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_de.properties
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_fr.properties
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages.properties
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_de.properties
    directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_fr.properties
    directory/trunks/jdbm/pom.xml
Modified:
    directory/trunks/jdbm/jdbm/pom.xml
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/RecordManagerFactory.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BPage.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BTree.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/Conversion.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/IntegerComparator.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/LongComparator.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/MRU.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/SoftCache.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/StringComparator.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashBucket.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashDirectory.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BlockIo.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/DataPage.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/FileHeader.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageHeader.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageManager.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/Provider.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordFile.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordHeader.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java
    directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/TransactionManager.java

Propchange: directory/trunks/jdbm/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb 22 18:32:45 2012
@@ -0,0 +1 @@
+target

Modified: directory/trunks/jdbm/jdbm/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/pom.xml?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/pom.xml (original)
+++ directory/trunks/jdbm/jdbm/pom.xml Wed Feb 22 18:32:45 2012
@@ -20,9 +20,9 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
-    <groupId>org.apache.directory.server</groupId>
-    <artifactId>apacheds-parent</artifactId>
-    <version>2.0.0-M6-SNAPSHOT</version>
+    <groupId>org.apache.directory.jdbm</groupId>
+    <artifactId>apacheds-jdbm-parent</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
   
   <artifactId>apacheds-jdbm</artifactId>
@@ -37,11 +37,6 @@
       <artifactId>junit-addons</artifactId>
       <scope>test</scope>
     </dependency>
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>apacheds-i18n</artifactId>
-    </dependency>
   </dependencies>
   
   <build>

Added: directory/trunks/jdbm/jdbm/src/main/java/jdbm/I18n.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/I18n.java?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/I18n.java (added)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/I18n.java Wed Feb 22 18:32:45 2012
@@ -0,0 +1,203 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package jdbm;
+
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * Provides i18n handling of error codes.
+ * About formatting see also {@link MessageFormat}
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public enum I18n
+{
+    ERR_513("ERR_513"),
+    ERR_514("ERR_514"),
+    ERR_515("ERR_515"),
+    ERR_516("ERR_516"),
+    ERR_517("ERR_517"),
+    ERR_518("ERR_518"),
+    ERR_519("ERR_519"),
+    // ERR_520( "ERR_520" ),
+    // ERR_521( "ERR_521" ),
+    ERR_522("ERR_522"),
+    ERR_523("ERR_523"),
+    ERR_524("ERR_524"),
+    ERR_525("ERR_525"),
+    ERR_526("ERR_526"),
+    ERR_527("ERR_527"),
+    ERR_528("ERR_528"),
+    ERR_529("ERR_529"),
+    // ERR_530( "ERR_530" ),
+    ERR_531("ERR_531"),
+    ERR_532("ERR_532"),
+    ERR_533("ERR_533"),
+    ERR_534("ERR_534"),
+    ERR_535("ERR_535"),
+    ERR_536("ERR_536"),
+    ERR_537("ERR_537"),
+    ERR_538("ERR_538"),
+    ERR_539_BAD_BLOCK_ID("ERR_539_BAD_BLOCK_ID"),
+    ERR_540("ERR_540"),
+    ERR_541("ERR_541"),
+    ERR_542("ERR_542"),
+    ERR_543("ERR_543"),
+    ERR_544("ERR_544"),
+    ERR_545("ERR_545"),
+    ERR_546("ERR_546"),
+    ERR_547("ERR_547"),
+    ERR_548("ERR_548"),
+    ERR_549("ERR_549"),
+    ERR_550("ERR_550"),
+    ERR_551("ERR_551"),
+    ERR_552("ERR_552"),
+    ERR_553("ERR_553"),
+    ERR_554("ERR_554"),
+    ERR_555("ERR_555"),
+    ERR_556("ERR_556"),
+    ERR_557("ERR_557"),
+    ERR_558("ERR_558"),
+    ERR_559("ERR_559"),
+    ERR_560("ERR_560"),
+    ERR_561("ERR_561"),
+    ERR_562("ERR_562"),
+    ERR_563("ERR_563"),
+    ERR_564("ERR_564"),
+    ERR_565("ERR_565"),
+    ERR_566("ERR_566"),
+    ERR_567("ERR_567");
+
+    private static ResourceBundle errBundle = ResourceBundle
+        .getBundle( "jdbm.errors" );
+
+    private final static ResourceBundle msgBundle = ResourceBundle
+        .getBundle( "jdbm/messages" );
+
+    /** The error code */
+    private String errorCode;
+
+
+    /**
+     * Creates a new instance of I18n.
+     */
+    private I18n( String errorCode )
+    {
+        this.errorCode = errorCode;
+    }
+
+
+    /**
+     * @return the errorCode
+     */
+    public String getErrorCode()
+    {
+        return errorCode;
+    }
+
+
+    /**
+     * 
+     * Translate an error code with argument(s)
+     *
+     * @param err The error code
+     * @param args The argument(s)
+     * @return The translate error code
+     */
+    public static String err( I18n err, Object... args )
+    {
+        try
+        {
+            return err + " " + MessageFormat.format( errBundle.getString( err.getErrorCode() ), args );
+        }
+        catch ( Exception e )
+        {
+            StringBuffer sb = new StringBuffer();
+            boolean comma = false;
+
+            for ( Object obj : args )
+            {
+                if ( comma )
+                {
+                    sb.append( "," );
+                }
+                else
+                {
+                    comma = true;
+                }
+
+                sb.append( obj );
+            }
+
+            return err + " (" + sb.toString() + ")";
+        }
+    }
+
+
+    /**
+     * 
+     * Translate a message with argument(s)
+     *
+     * @param msg The message
+     * @param args The argument(s)
+     * @return The translated message
+     */
+    public static String msg( String msg, Object... args )
+    {
+        try
+        {
+            return MessageFormat.format( msgBundle.getString( msg ), args );
+        }
+        catch ( MissingResourceException mre )
+        {
+            try
+            {
+                return MessageFormat.format( msg, args );
+            }
+            catch ( Exception e )
+            {
+                StringBuffer sb = new StringBuffer();
+                boolean comma = false;
+
+                for ( Object obj : args )
+                {
+                    if ( comma )
+                    {
+                        sb.append( "," );
+                    }
+                    else
+                    {
+                        comma = true;
+                    }
+
+                    sb.append( obj );
+                }
+
+                return msg + " (" + sb.toString() + ")";
+            }
+        }
+    }
+}
+    
\ No newline at end of file

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/RecordManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/RecordManagerFactory.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/RecordManagerFactory.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/RecordManagerFactory.java Wed Feb 22 18:32:45 2012
@@ -51,7 +51,7 @@ package jdbm;
 import java.io.IOException;
 import java.util.Properties;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BPage.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BPage.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BPage.java Wed Feb 22 18:32:45 2012
@@ -61,7 +61,7 @@ import jdbm.helper.Serializer;
 import jdbm.helper.Tuple;
 import jdbm.helper.TupleBrowser;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -331,7 +331,7 @@ public class BPage<K, V> implements Seri
 
     /**
      * Find first entry and return a browser positioned before it.
-     *@param context Action Context in case of 
+     *@param context Action Context in case of
      * @return TupleBrowser positionned just before the first entry.
      */
     TupleBrowser<K, V> findFirst( ActionContext context ) throws IOException
@@ -395,7 +395,7 @@ public class BPage<K, V> implements Seri
             }
 
             // This is to deal with the special case where the key already exists.
-            // In this case, the index will contain the key's position, but as a 
+            // In this case, the index will contain the key's position, but as a
             // negative number
             if ( keyExists )
             {
@@ -865,7 +865,7 @@ public class BPage<K, V> implements Seri
      * Find the first children node with a key equal or greater than the given
      * key.
      *
-     * @return index of first children with equal or greater key. If the 
+     * @return index of first children with equal or greater key. If the
      * key already exists, the index value will be negative
      */
     private int findChildren( K key )
@@ -1289,7 +1289,7 @@ public class BPage<K, V> implements Seri
     }
 
 
-    /** 
+    /**
      * Serialize the content of an object into a byte array.
      *
      * @param obj Object to serialize
@@ -1450,7 +1450,7 @@ public class BPage<K, V> implements Seri
          * Create a browser.
          *
          * @param page Current page
-         * @param context context in case of action capable record manager 
+         * @param context context in case of action capable record manager
          * @param index Position of the next tuple to return.
          */
         Browser( BPage<K, V> page, int index, ActionContext context )
@@ -1476,21 +1476,21 @@ public class BPage<K, V> implements Seri
             btree.setAsCurrentAction( context );
             try
             {
-                // First, check that we are within a page                                                            
+                // First, check that we are within a page
                 if ( index < page.btree.pageSize )
                 {
-                    // We are. Now check that we have a Tuple                                                        
+                    // We are. Now check that we have a Tuple
                     if ( page.keys[index] == null )
                     {
-                        // no : reached end of the tree.                                                             
+                        // no : reached end of the tree.
                         return false;
                     }
                 }
-                // all the tuple for this page has been read. Move to the                                            
-                // next page, if we have one.                                                                        
+                // all the tuple for this page has been read. Move to the
+                // next page, if we have one.
                 else if ( page.next != 0 )
                 {
-                    // move to next page                                                                             
+                    // move to next page
                     page = page.loadBPage( page.next );
                     index = page.first;
                 }

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BTree.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BTree.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BTree.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/btree/BTree.java Wed Feb 22 18:32:45 2012
@@ -69,7 +69,7 @@ import jdbm.helper.Tuple;
 import jdbm.helper.TupleBrowser;
 import jdbm.helper.WrappedRuntimeException;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -1058,7 +1058,7 @@ public class BTree<K, V> implements Exte
 
     /**
      * Used to point to the root page that the reader needs based on the reader's
-     * read action context. ReadWrite actions always use the latest root. 
+     * read action context. ReadWrite actions always use the latest root.
      */
     class MetaRoot
     {

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java Wed Feb 22 18:32:45 2012
@@ -50,7 +50,7 @@ package jdbm.helper;
 import java.util.Comparator;
 import java.io.Serializable;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/Conversion.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/Conversion.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/Conversion.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/Conversion.java Wed Feb 22 18:32:45 2012
@@ -46,7 +46,7 @@
 
 package jdbm.helper;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -201,23 +201,23 @@ public class Conversion
     {
         byte[] buf;
 
-        buf = convertToByteArray( (int) 5 );
+        buf = convertToByteArray( 5 );
         System.out.println( "int value of 5 is: " + convertToInt( buf ) );
 
-        buf = convertToByteArray( (int) -1 );
+        buf = convertToByteArray( -1 );
         System.out.println( "int value of -1 is: " + convertToInt( buf ) );
 
-        buf = convertToByteArray( (int) 22111000 );
+        buf = convertToByteArray( 22111000 );
         System.out.println( "int value of 22111000 is: " + convertToInt( buf ) );
 
 
-        buf = convertToByteArray( (long) 5L );
+        buf = convertToByteArray( 5L );
         System.out.println( "long value of 5 is: " + convertToLong( buf ) );
 
-        buf = convertToByteArray( (long) -1L );
+        buf = convertToByteArray( -1L );
         System.out.println( "long value of -1 is: " + convertToLong( buf ) );
 
-        buf = convertToByteArray( (long) 1112223334445556667L );
+        buf = convertToByteArray( 1112223334445556667L );
         System.out.println( "long value of 1112223334445556667 is: " + convertToLong( buf ) );
     }
 

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/IntegerComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/IntegerComparator.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/IntegerComparator.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/IntegerComparator.java Wed Feb 22 18:32:45 2012
@@ -50,7 +50,7 @@ package jdbm.helper;
 import java.io.Serializable;
 import java.util.Comparator;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/LongComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/LongComparator.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/LongComparator.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/LongComparator.java Wed Feb 22 18:32:45 2012
@@ -50,7 +50,7 @@ package jdbm.helper;
 import java.io.Serializable;
 import java.util.Comparator;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/MRU.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/MRU.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/MRU.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/MRU.java Wed Feb 22 18:32:45 2012
@@ -55,7 +55,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -244,7 +244,7 @@ public class MRU<K, V> implements CacheP
 
 
     /**
-     * Remove a CacheEntry from linked list, and relink the 
+     * Remove a CacheEntry from linked list, and relink the
      * remaining element sin the list.
      */
     protected void removeEntry( CacheEntry entry )

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java Wed Feb 22 18:32:45 2012
@@ -51,7 +51,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.Comparator;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/SoftCache.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/SoftCache.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/SoftCache.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/SoftCache.java Wed Feb 22 18:32:45 2012
@@ -54,7 +54,7 @@ import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/StringComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/StringComparator.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/StringComparator.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/helper/StringComparator.java Wed Feb 22 18:32:45 2012
@@ -50,7 +50,7 @@ package jdbm.helper;
 import java.io.Serializable;
 import java.util.Comparator;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashBucket.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashBucket.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashBucket.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashBucket.java Wed Feb 22 18:32:45 2012
@@ -54,7 +54,7 @@ import java.io.ObjectOutput;
 
 import java.util.ArrayList;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashDirectory.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashDirectory.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashDirectory.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/htree/HashDirectory.java Wed Feb 22 18:32:45 2012
@@ -58,7 +58,7 @@ import jdbm.RecordManager;
 import jdbm.helper.FastIterator;
 import jdbm.helper.IterationException;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java Wed Feb 22 18:32:45 2012
@@ -61,7 +61,7 @@ import jdbm.RecordManager;
 import jdbm.helper.DefaultSerializer;
 import jdbm.helper.Serializer;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -610,9 +610,9 @@ public final class BaseRecordManager imp
 
 
     /**
-     * Used to serialize reads/write on a given logical rowid. Checks if there is a 
+     * Used to serialize reads/write on a given logical rowid. Checks if there is a
      * ongoing conflicting IO to the same logical rowid and waits for the ongoing
-     * write if there is one. 
+     * write if there is one.
      *
      * @param recid the logical rowid for which the fetch will be done.
      * @param io type of the IO

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BlockIo.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BlockIo.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BlockIo.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/BlockIo.java Wed Feb 22 18:32:45 2012
@@ -52,13 +52,13 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
- * This class wraps a page-sized byte array and provides methods to read and 
- * write data to and from it. The readers and writers are just the ones that 
- * the rest of the toolkit needs, nothing else. Values written are compatible 
+ * This class wraps a page-sized byte array and provides methods to read and
+ * write data to and from it. The readers and writers are just the ones that
+ * the rest of the toolkit needs, nothing else. Values written are compatible
  * with java.io routines.
  * 
  * This block is never accessed directly, so it does not have to be thread-safe.
@@ -201,7 +201,7 @@ public final class BlockIo implements ja
 
 
     /**
-     * Returns true if the block is still dirty with respect to the 
+     * Returns true if the block is still dirty with respect to the
      * transaction log.
      */
     /*No qualifier*/boolean isInTransaction()
@@ -324,13 +324,13 @@ public final class BlockIo implements ja
      */
     public long readLong( int pos )
     {
-        return ( ( long ) ( ( long ) data[pos + 0] << 56 ) |
+        return ( ( ( long ) data[pos + 0] << 56 ) |
             ( ( long ) ( data[pos + 1] & 0xff ) << 48 ) |
             ( ( long ) ( data[pos + 2] & 0xff ) << 40 ) |
             ( ( long ) ( data[pos + 3] & 0xff ) << 32 ) |
             ( ( long ) ( data[pos + 4] & 0xff ) << 24 ) |
             ( ( long ) ( data[pos + 5] & 0xff ) << 16 ) |
-            ( ( long ) ( data[pos + 6] & 0xff ) << 8 ) | ( ( long ) ( data[pos + 7] & 0xff ) ) );
+            ( ( long ) ( data[pos + 6] & 0xff ) << 8 ) | ( data[pos + 7] & 0xff ) );
     }
 
 

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java Wed Feb 22 18:32:45 2012
@@ -59,7 +59,7 @@ import jdbm.helper.WrappedRuntimeExcepti
 import java.io.IOException;
 import java.util.Enumeration;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -106,7 +106,7 @@ public class CacheRecordManager implemen
      * Get the underlying Record Manager.
      *
      * @return underlying RecordManager or null if CacheRecordManager has
-     *         been closed. 
+     *         been closed.
      */
     public RecordManager getRecordManager()
     {
@@ -118,7 +118,7 @@ public class CacheRecordManager implemen
      * Get the underlying cache policy
      *
      * @return underlying CachePolicy or null if CacheRecordManager has
-     *         been closed. 
+     *         been closed.
      */
     public CachePolicy<Long, CacheEntry> getCachePolicy()
     {
@@ -422,7 +422,7 @@ public class CacheRecordManager implemen
     }
 
     /**
-     * A class to store a cached entry. 
+     * A class to store a cached entry.
      */
     private static class CacheEntry
     {
@@ -445,7 +445,7 @@ public class CacheRecordManager implemen
     private class CacheListener implements CachePolicyListener<CacheEntry>
     {
 
-        /** 
+        /**
          * Notification that cache is evicting an object
          *
          * @param obj object evicted from cache

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/DataPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/DataPage.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/DataPage.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/DataPage.java Wed Feb 22 18:32:45 2012
@@ -21,7 +21,7 @@
  *
  * 4. Products derived from this Software may not be called "JDBM"
  *    nor may "JDBM" appear in their names without prior written
- *    permission of Cees de Groot. 
+ *    permission of Cees de Groot.
  *
  * 5. Due credit should be given to the JDBM Project
  *    (http://jdbm.sourceforge.net/).
@@ -47,7 +47,7 @@
 package jdbm.recman;
 
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -93,8 +93,8 @@ final class DataPage extends PageHeader
     }
 
 
-    /** 
-     * @return the first rowid's offset 
+    /**
+     * @return the first rowid's offset
      */
     short getFirst()
     {
@@ -102,8 +102,8 @@ final class DataPage extends PageHeader
     }
 
 
-    /** 
-     * Sets the first rowid's offset 
+    /**
+     * Sets the first rowid's offset
      */
     void setFirst( short value )
     {
@@ -133,7 +133,7 @@ final class DataPage extends PageHeader
         // The first rowId
         sb.append( "first rowId: " ).append( getFirst() ).append( ", " );
 
-        // The data per page 
+        // The data per page
         sb.append( "[p:" ).append( getPrev() ).append( ", " );
 
         // The next page

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/FileHeader.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/FileHeader.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/FileHeader.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/FileHeader.java Wed Feb 22 18:32:45 2012
@@ -21,7 +21,7 @@
  *
  * 4. Products derived from this Software may not be called "JDBM"
  *    nor may "JDBM" appear in their names without prior written
- *    permission of Cees de Groot. 
+ *    permission of Cees de Groot.
  *
  * 5. Due credit should be given to the JDBM Project
  *    (http://jdbm.sourceforge.net/).
@@ -49,7 +49,7 @@ package jdbm.recman;
 
 import java.io.IOException;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -71,7 +71,7 @@ import org.apache.directory.server.i18n.
  * <li>[72..79] : The BlockIo reference to the last FREEPHYSIDS_PAGE ID</li>
  * <li>[80..87]* : The reference to the BlockIo which is the root for the data contained in this File.
  * We may have more than one, but no more than 1014, if the BLOCK_SIZE is 8192</li>
- * </ul> 
+ * </ul>
  */
 class FileHeader implements BlockView
 {
@@ -114,8 +114,8 @@ class FileHeader implements BlockView
     }
 
 
-    /** 
-     * Returns the offset of the "first" block of the indicated list 
+    /**
+     * Returns the offset of the "first" block of the indicated list
      */
     private short offsetOfFirst( int list )
     {
@@ -123,8 +123,8 @@ class FileHeader implements BlockView
     }
 
 
-    /** 
-     * Returns the offset of the "last" block of the indicated list 
+    /**
+     * Returns the offset of the "last" block of the indicated list
      */
     private short offsetOfLast( int list )
     {
@@ -132,8 +132,8 @@ class FileHeader implements BlockView
     }
 
 
-    /** 
-     * Returns the offset of the indicated root 
+    /**
+     * Returns the offset of the indicated root
      */
     private short offsetOfRoot( int root )
     {

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java Wed Feb 22 18:32:45 2012
@@ -50,7 +50,7 @@ package jdbm.recman;
 
 import java.io.IOException;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageHeader.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageHeader.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageHeader.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageHeader.java Wed Feb 22 18:32:45 2012
@@ -21,7 +21,7 @@
  *
  * 4. Products derived from this Software may not be called "JDBM"
  *    nor may "JDBM" appear in their names without prior written
- *    permission of Cees de Groot. 
+ *    permission of Cees de Groot.
  *
  * 5. Due credit should be given to the JDBM Project
  *    (http://jdbm.sourceforge.net/).
@@ -49,7 +49,7 @@ package jdbm.recman;
 
 import java.io.IOException;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -156,8 +156,8 @@ public class PageHeader implements Block
     }
 
 
-    /** 
-     * @return The magic code (ie, the 2 first bytes of the inner BlockIo) 
+    /**
+     * @return The magic code (ie, the 2 first bytes of the inner BlockIo)
      */
     short getMagic()
     {
@@ -176,7 +176,7 @@ public class PageHeader implements Block
     }
 
 
-    /** 
+    /**
      * Sets the next blockIo.
      * 
      * @param The next Block ID
@@ -188,7 +188,7 @@ public class PageHeader implements Block
     }
 
 
-    /** 
+    /**
      * @return the previous block (ie the long at position 10 in the BlockIo)
      */
     long getPrev()
@@ -199,8 +199,8 @@ public class PageHeader implements Block
     }
 
 
-    /** 
-     * Sets the previous block. 
+    /**
+     * Sets the previous block.
      */
     void setPrev( long prev )
     {
@@ -209,7 +209,7 @@ public class PageHeader implements Block
     }
 
 
-    /** 
+    /**
      * Sets the type of the page header
      * 
      *  @param type The PageHeader type to store at position 0

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageManager.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageManager.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/PageManager.java Wed Feb 22 18:32:45 2012
@@ -21,7 +21,7 @@
  *
  * 4. Products derived from this Software may not be called "JDBM"
  *    nor may "JDBM" appear in their names without prior written
- *    permission of Cees de Groot. 
+ *    permission of Cees de Groot.
  *
  * 5. Due credit should be given to the JDBM Project
  *    (http://jdbm.sourceforge.net/).
@@ -49,7 +49,7 @@ package jdbm.recman;
 
 import java.io.IOException;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -83,7 +83,7 @@ final class PageManager
         // Note that we hold on to the recordFile header node.
         headerBuf = recordFile.get( 0 );
 
-        // Assume recordFile is new if the recordFile header's magic number is 0. 
+        // Assume recordFile is new if the recordFile header's magic number is 0.
         boolean isNew = headerBuf.readShort( 0 ) == 0;
 
         header = new FileHeader( headerBuf, isNew );
@@ -91,7 +91,7 @@ final class PageManager
 
 
     /**
-     * Allocates a page of the indicated type. 
+     * Allocates a page of the indicated type.
      * 
      * @param The page type we want to allocate
      * @return The record ID of the page.

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/Provider.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/Provider.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/Provider.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/Provider.java Wed Feb 22 18:32:45 2012
@@ -57,7 +57,7 @@ import jdbm.RecordManagerOptions;
 import jdbm.RecordManagerProvider;
 import jdbm.helper.MRU;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordFile.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordFile.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordFile.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordFile.java Wed Feb 22 18:32:45 2012
@@ -53,7 +53,7 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -157,8 +157,8 @@ public final class RecordFile
 
 
     /**
-     * Gets a block from the file. The returned byte array is the in-memory 
-     * copy of the record, and thus can be written (and subsequently released 
+     * Gets a block from the file. The returned byte array is the in-memory
+     * copy of the record, and thus can be written (and subsequently released
      * with a dirty flag in order to write the block back).
      *
      * @param blockId The record number to retrieve.
@@ -439,7 +439,7 @@ public final class RecordFile
 
 
     /**
-     * Returns a new BlockIo. The BlockIo is retrieved (and removed) from the 
+     * Returns a new BlockIo. The BlockIo is retrieved (and removed) from the
      * released list or created new.
      */
     private BlockIo getNewBlockIo( long blockId ) throws IOException
@@ -448,7 +448,7 @@ public final class RecordFile
 
         if ( !free.isEmpty() )
         {
-            blockIo = ( BlockIo ) free.removeFirst();
+            blockIo = free.removeFirst();
             blockIo.setBlockId( blockId );
         }
 

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordHeader.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordHeader.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordHeader.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/RecordHeader.java Wed Feb 22 18:32:45 2012
@@ -21,7 +21,7 @@
  *
  * 4. Products derived from this Software may not be called "JDBM"
  *    nor may "JDBM" appear in their names without prior written
- *    permission of Cees de Groot. 
+ *    permission of Cees de Groot.
  *
  * 5. Due credit should be given to the JDBM Project
  *    (http://jdbm.sourceforge.net/).
@@ -47,14 +47,14 @@
 package jdbm.recman;
 
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
- * The data that comes at the start of a record of data. It stores both the 
- * current size and the available size for the record - the latter can be 
- * bigger than the former, which allows the record to grow without needing to 
- * be moved and which allows the system to put small records in larger free 
+ * The data that comes at the start of a record of data. It stores both the
+ * current size and the available size for the record - the latter can be
+ * bigger than the former, which allows the record to grow without needing to
+ * be moved and which allows the system to put small records in larger free
  * spots.
  */
 class RecordHeader
@@ -70,7 +70,7 @@ class RecordHeader
 
 
     /**
-     * Constructs a record header from the indicated data starting at the 
+     * Constructs a record header from the indicated data starting at the
      * indicated position.
      */
     RecordHeader( BlockIo block, short pos )

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/SnapshotRecordManager.java Wed Feb 22 18:32:45 2012
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package jdbm.recman;
 
@@ -34,7 +34,7 @@ import jdbm.helper.EntryIO;
 import jdbm.helper.LRUCache;
 import jdbm.helper.Serializer;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -202,7 +202,7 @@ public class SnapshotRecordManager imple
              *  so that the readers wont see the effect of the aborted
              *  txn. The sensible thing to do would be to have the underling
              *  record manager expose a abort action interface. When that lacks.
-             *  the right thing for the upper layer to do would is to rollback whatever 
+             *  the right thing for the upper layer to do would is to rollback whatever
              *  is part of what JDBM calls a txn.
              */
 

Modified: directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/TransactionManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/TransactionManager.java?rev=1292436&r1=1292422&r2=1292436&view=diff
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/TransactionManager.java (original)
+++ directory/trunks/jdbm/jdbm/src/main/java/jdbm/recman/TransactionManager.java Wed Feb 22 18:32:45 2012
@@ -48,10 +48,19 @@
 package jdbm.recman;
 
 
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TreeSet;
 
-import org.apache.directory.server.i18n.I18n;
+import jdbm.I18n;
 
 
 /**
@@ -75,13 +84,13 @@ public final class TransactionManager
     private FileOutputStream fos;
     private ObjectOutputStream oos;
 
-    /** 
+    /**
      * By default, we keep 10 transactions in the log file before
      * synchronizing it with the main database file.
      */
     static final int DEFAULT_TXNS_IN_LOG = 10;
 
-    /** 
+    /**
      * Maximum number of transactions before the log file is
      * synchronized with the main database file.
      */
@@ -93,7 +102,7 @@ public final class TransactionManager
      * core anyway, so we might as well point to them and spare us a lot
      * of hassle.
      */
-    private ArrayList[] txns = new ArrayList[DEFAULT_TXNS_IN_LOG];
+    private List<BlockIo>[] txns = new ArrayList[DEFAULT_TXNS_IN_LOG];
     private int curTxn = -1;
 
     /** Extension of a log file. */
@@ -117,8 +126,8 @@ public final class TransactionManager
     /**
      * Synchronize log file data with the main database file.
      * <p>
-     * After this call, the main database file is guaranteed to be 
-     * consistent and guaranteed to be the only file needed for 
+     * After this call, the main database file is guaranteed to be
+     * consistent and guaranteed to be the only file needed for
      * backup purposes.
      */
     public void synchronizeLog()
@@ -164,7 +173,7 @@ public final class TransactionManager
     {
         close();
 
-        TreeSet blockList = new TreeSet( new BlockIoComparator() );
+        TreeSet<BlockIo> blockList = new TreeSet<BlockIo>( new BlockIoComparator() );
 
         for ( int i = 0; i < _maxTxns; i++ )
         {
@@ -172,9 +181,10 @@ public final class TransactionManager
                 continue;
             // Add each block to the blockList, replacing the old copy of this
             // block if necessary, thus avoiding writing the same block twice
-            for ( Iterator k = txns[i].iterator(); k.hasNext(); )
+            for ( Iterator<BlockIo> k = txns[i].iterator(); k.hasNext(); )
             {
-                BlockIo block = ( BlockIo ) k.next();
+                BlockIo block = k.next();
+                
                 if ( blockList.contains( block ) )
                 {
                     block.decrementTransactionCount();
@@ -211,8 +221,12 @@ public final class TransactionManager
     {
         String logName = makeLogName();
         File logFile = new File( logName );
+        
         if ( !logFile.exists() )
+        {
             return;
+        }
+        
         if ( logFile.length() == 0 )
         {
             logFile.delete();
@@ -240,10 +254,11 @@ public final class TransactionManager
 
         while ( true )
         {
-            ArrayList blocks = null;
+            List<BlockIo> blocks = null;
+            
             try
             {
-                blocks = ( ArrayList ) ois.readObject();
+                blocks = ( List<BlockIo> ) ois.readObject();
             }
             catch ( ClassNotFoundException e )
             {
@@ -255,6 +270,7 @@ public final class TransactionManager
                 // corrupted logfile, ignore rest of transactions
                 break;
             }
+            
             synchronizeBlocks( blocks.iterator(), false );
 
             // ObjectInputStream must match exactly each
@@ -269,6 +285,7 @@ public final class TransactionManager
                 break;
             }
         }
+        
         owner.sync();
         ois.close();
         logFile.delete();
@@ -276,17 +293,19 @@ public final class TransactionManager
 
 
     /** Synchronizes the indicated blocks with the owner. */
-    private void synchronizeBlocks( Iterator blockIterator, boolean fromCore )
+    private void synchronizeBlocks( Iterator<BlockIo> blockIterator, boolean fromCore )
         throws IOException
     {
         // write block vector elements to the data file.
         while ( blockIterator.hasNext() )
         {
-            BlockIo cur = ( BlockIo ) blockIterator.next();
+            BlockIo cur = blockIterator.next();
             owner.sync( cur );
+            
             if ( fromCore )
             {
                 cur.decrementTransactionCount();
+                
                 if ( !cur.isInTransaction() )
                 {
                     owner.releaseFromTransaction( cur, true );
@@ -297,25 +316,26 @@ public final class TransactionManager
 
 
     /** Set clean flag on the blocks. */
-    private void setClean( ArrayList blocks )
+    private void setClean( List<BlockIo> blocks )
         throws IOException
     {
-        for ( Iterator k = blocks.iterator(); k.hasNext(); )
+        for ( Iterator<BlockIo> k = blocks.iterator(); k.hasNext(); )
         {
-            BlockIo cur = ( BlockIo ) k.next();
+            BlockIo cur = k.next();
             cur.setClean();
         }
     }
 
 
     /** Discards the indicated blocks and notify the owner. */
-    private void discardBlocks( ArrayList blocks )
+    private void discardBlocks( List<BlockIo> blocks )
         throws IOException
     {
-        for ( Iterator k = blocks.iterator(); k.hasNext(); )
+        for ( Iterator<BlockIo> k = blocks.iterator(); k.hasNext(); )
         {
-            BlockIo cur = ( BlockIo ) k.next();
+            BlockIo cur = k.next();
             cur.decrementTransactionCount();
+            
             if ( !cur.isInTransaction() )
             {
                 owner.releaseFromTransaction( cur, false );
@@ -332,12 +352,14 @@ public final class TransactionManager
     void start() throws IOException
     {
         curTxn++;
+        
         if ( curTxn == _maxTxns )
         {
             synchronizeLogFromMemory();
             curTxn = 0;
         }
-        txns[curTxn] = new ArrayList();
+        
+        txns[curTxn] = new ArrayList<BlockIo>();
     }
 
 
@@ -442,14 +464,13 @@ public final class TransactionManager
      *  their blockIds.
      */
     public static class BlockIoComparator
-        implements Comparator
+        implements Comparator<BlockIo>
     {
 
-        public int compare( Object o1, Object o2 )
+        public int compare( BlockIo block1, BlockIo block2 )
         {
-            BlockIo block1 = ( BlockIo ) o1;
-            BlockIo block2 = ( BlockIo ) o2;
             int result = 0;
+
             if ( block1.getBlockId() == block2.getBlockId() )
             {
                 result = 0;
@@ -462,6 +483,7 @@ public final class TransactionManager
             {
                 result = 1;
             }
+            
             return result;
         }
 
@@ -471,5 +493,4 @@ public final class TransactionManager
             return super.equals( obj );
         }
     } // class BlockIOComparator
-
 }

Added: directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors.properties
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors.properties?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors.properties (added)
+++ directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors.properties Wed Feb 22 18:32:45 2012
@@ -0,0 +1,79 @@
+#
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+#
+#
+
+#
+# Default error code translations comes here 
+#
+
+ERR_513=Error during underflow [{0}]
+ERR_514=Key not found: {0}
+ERR_515=BPage not ordered
+ERR_516=Invalid child subordinate key
+ERR_517=Argument ''recman'' is null
+ERR_518=Argument ''comparator'' is null
+ERR_519=Argument ''comparator'' must be serializable
+# ERR_520=Argument ''keySerializer'' must be serializable
+# ERR_521=Argument ''valueSerializer'' must be serializable
+ERR_522=Argument ''pageSize'' must be even
+ERR_523=Argument ''key'' is null
+ERR_524=Argument ''value'' is null
+ERR_525=Argument ''obj1'' is null
+ERR_526=Argument ''obj2'' is null
+ERR_527=Platform doesn''t support UTF8 encoding
+ERR_528=MRU cache must contain at least one entry
+ERR_529=Cannot add null listener.
+# ERR_530=
+ERR_531=Internal cache cannot be null.
+ERR_532=key cannot be null.
+ERR_533=value cannot be null.
+ERR_534=Cannot create bucket with depth > MAX_DEPTH+1. Depth={0}
+ERR_535=Cannot create deeper directory. Depth={0}
+ERR_536=Argument ''recid'' is invalid: {0}
+ERR_537=Name directory must exist
+ERR_538=RecordManager has been closed
+ERR_539_BAD_BLOCK_ID=bogus block id {0}, it should not be negative
+ERR_540=BlockId assigned for transaction block
+ERR_541=transaction count on block {0} below zero!
+ERR_542=Argument ''cache'' is null
+ERR_543=DataPage.setFirst: offset {0} too small
+ERR_544=CRITICAL: file header magic not OK {0}
+ERR_545=couldn''t obtain free translation
+ERR_546=CRITICAL: page header magic for block {0} not OK {1}
+ERR_547=CRITICAL: page header magic not OK {0}
+ERR_548=allocate of free page?
+ERR_549=free free page?
+ERR_550=free header page?
+ERR_551=Soft reference cache not implemented
+ERR_552=Weak reference cache not implemented
+ERR_553=Invalid cache type: {0}
+ERR_554=double get for block {0}
+ERR_555=bad blockid {0} on release
+ERR_556=in use list not empty at commit time ({0})
+ERR_557=in use list not empty at rollback time ({0})
+ERR_558=in txn list not empty at rollback time ({0})
+ERR_559=In transaction not empty
+ERR_560=Dirty blocks at close time
+ERR_561=inUse blocks at close time
+ERR_562=Offset too large for record header ({0}:{1})
+ERR_563=Argument ''maxTxns'' must be greater than 0.
+ERR_564=Cannot change setting while transactions are pending in the log
+ERR_565=Bad magic on log file
+ERR_566=Unexcepted exception: {0}
+ERR_567=Invalid record manager provider\: {0}\n[{1}\: {2}]

Added: directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_de.properties
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_de.properties?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_de.properties (added)
+++ directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_de.properties Wed Feb 22 18:32:45 2012
@@ -0,0 +1,24 @@
+#
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+#
+#
+
+#
+# German error code translations comes here 
+#
+

Added: directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_fr.properties
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_fr.properties?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_fr.properties (added)
+++ directory/trunks/jdbm/jdbm/src/main/resources/jdbm/errors_fr.properties Wed Feb 22 18:32:45 2012
@@ -0,0 +1,24 @@
+#
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+#
+#
+
+#
+# French error code translations comes here 
+#
+

Added: directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages.properties
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages.properties?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages.properties (added)
+++ directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages.properties Wed Feb 22 18:32:45 2012
@@ -0,0 +1,23 @@
+#
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+#
+#
+
+#
+# Default message translations comes here 
+#

Added: directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_de.properties?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_de.properties (added)
+++ directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_de.properties Wed Feb 22 18:32:45 2012
@@ -0,0 +1,23 @@
+#
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+#
+#
+
+#
+# German message translations comes here 
+#

Added: directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_fr.properties?rev=1292436&view=auto
==============================================================================
--- directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_fr.properties (added)
+++ directory/trunks/jdbm/jdbm/src/main/resources/jdbm/messages_fr.properties Wed Feb 22 18:32:45 2012
@@ -0,0 +1,23 @@
+#
+#   Licensed to the Apache Software Foundation (ASF) under one
+#   or more contributor license agreements.  See the NOTICE file
+#   distributed with this work for additional information
+#   regarding copyright ownership.  The ASF licenses this file
+#   to you under the Apache License, Version 2.0 (the
+#   "License"); you may not use this file except in compliance
+#   with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing,
+#   software distributed under the License is distributed on an
+#   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#   KIND, either express or implied.  See the License for the
+#   specific language governing permissions and limitations
+#   under the License.
+#
+#
+
+#
+# French message translations comes here 
+#



Mime
View raw message