directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r902302 - in /directory/apacheds/trunk: i18n/src/main/resources/org/apache/directory/server/i18n/ interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/ jdbm/ jdbm/src/main/java/jdbm/ jdbm/src/main/java/jdbm/btree/ jd...
Date Fri, 22 Jan 2010 22:45:18 GMT
Author: felixk
Date: Fri Jan 22 22:45:16 2010
New Revision: 902302

URL: http://svn.apache.org/viewvc?rev=902302&view=rev
Log:
I18n

Modified:
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
    directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
    directory/apacheds/trunk/jdbm/pom.xml
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/RecordManagerFactory.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/Conversion.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/IntegerComparator.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LongComparator.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/MRU.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/StringComparator.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashBucket.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashDirectory.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BlockIo.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/DataPage.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/FileHeader.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageHeader.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageManager.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Provider.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordFile.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/TransactionManager.java

Modified: directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties (original)
+++ directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties Fri Jan 22 22:45:16 2010
@@ -533,62 +533,62 @@
 ERR_509=Cannot copy non-existant source file {0}
 ERR_510=Should not be hitting root without config/config pattern.
 ERR_511=parent cannot be null
-ERR_512=
-ERR_513=
-ERR_514=
-ERR_515=
-ERR_516=
-ERR_517=
-ERR_518=
-ERR_519=
-ERR_520=
-ERR_521=
-ERR_522=
-ERR_523=
-ERR_524=
-ERR_525=
-ERR_526=
-ERR_527=
-ERR_528=
-ERR_529=
-ERR_530=
-ERR_531=
-ERR_532=
-ERR_533=
-ERR_534=
-ERR_535=
-ERR_536=
-ERR_537=
-ERR_538=
-ERR_539=
-ERR_540=
-ERR_541=
-ERR_542=
-ERR_543=
-ERR_544=
-ERR_545=
-ERR_546=
-ERR_547=
-ERR_548=
-ERR_549=
-ERR_550=
-ERR_551=
-ERR_552=
-ERR_553=
-ERR_554=
-ERR_555=
-ERR_556=
-ERR_557=
-ERR_558=
-ERR_559=
-ERR_560=
-ERR_561=
-ERR_562=
-ERR_563=
-ERR_564=
-ERR_565=
-ERR_566=
-ERR_567=
+ERR_512=Failed to authenticate user '{0}'.
+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=Argument 'comparator' is null
+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=bogus block id {0}
+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}]
 ERR_568=
 ERR_569=
 ERR_570=

Modified: directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java Fri Jan 22 22:45:16 2010
@@ -301,7 +301,7 @@
 
         if ( userEntry == null )
         {
-            throw new LdapAuthenticationException( "Failed to authenticate user '" + principalDn + "'." );
+            throw new LdapAuthenticationException( I18n.err( I18n.ERR_512, principalDn ) );
         }
 
         EntryAttribute objectClass = userEntry.getOriginalEntry().get( SchemaConstants.OBJECT_CLASS_AT );

Modified: directory/apacheds/trunk/jdbm/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/pom.xml?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/pom.xml (original)
+++ directory/apacheds/trunk/jdbm/pom.xml Fri Jan 22 22:45:16 2010
@@ -35,6 +35,12 @@
 
   <packaging>jar</packaging>
 
-  <dependencies />
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+  </dependencies>
 </project>
 

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/RecordManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/RecordManagerFactory.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/RecordManagerFactory.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/RecordManagerFactory.java Fri Jan 22 22:45:16 2010
@@ -51,6 +51,8 @@
 import java.io.IOException;
 import java.util.Properties;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * This is the factory class to use for instantiating {@link RecordManager}
  * instances.
@@ -105,11 +107,8 @@
             clazz = Thread.currentThread().getContextClassLoader().loadClass( provider );
             factory = (RecordManagerProvider) clazz.newInstance();
         } catch ( Exception except ) {
-            throw new IllegalArgumentException( "Invalid record manager provider: "
-                                                + provider
-                                                + "\n[" + except.getClass().getName()
-                                                + ": " + except.getLocalizedMessage()
-                                                + "]" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_567, provider, except.getClass().getName(),
+                except.getLocalizedMessage() ) );
         }
         return factory.createRecordManager( name, options );
     }

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java Fri Jan 22 22:45:16 2010
@@ -58,6 +58,8 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Page of a Btree.
  * <p>
@@ -477,7 +479,7 @@
         if ( height == 0 ) {
             // remove leaf entry
             if ( compare( _keys[ index ], key ) != 0 ) {
-                throw new IllegalArgumentException( "Key not found: " + key );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_514, key ) );
             }
             result = new RemoveResult();
             result._value = _values[ index ];
@@ -498,7 +500,7 @@
             if ( result._underflow ) {
                 // underflow occured
                 if ( child._first != half+1 ) {
-                    throw new IllegalStateException( "Error during underflow [1]" );
+                    throw new IllegalStateException( I18n.err( I18n.ERR_513, "1" ) );
                 }
                 if ( index < _children.length-1 ) {
                     // exists greater brother page
@@ -538,7 +540,7 @@
                     } else {
                         // move all entries from page "child" to "brother"
                         if ( brother._first != half ) {
-                            throw new IllegalStateException( "Error during underflow [2]" );
+                            throw new IllegalStateException( I18n.err( I18n.ERR_513, "2" ) );
                         }
 
                         brother._first = 1;
@@ -617,7 +619,7 @@
                     } else {
                         // move all entries from page "brother" to "child"
                         if ( brother._first != half ) {
-                            throw new IllegalStateException( "Error during underflow [3]" );
+                            throw new IllegalStateException( I18n.err( I18n.ERR_513, "3" ) );
                         }
 
                         child._first = 1;
@@ -917,7 +919,7 @@
         for ( int i=_first; i<_btree._pageSize-1; i++ ) {
             if ( compare( (byte[]) _keys[ i ], (byte[]) _keys[ i+1 ] ) >= 0 ) {
                 dump( 0 );
-                throw new Error( "BPage not ordered" );
+                throw new Error( I18n.err( I18n.ERR_515 ) );
             }
         }
     }
@@ -938,7 +940,7 @@
                 if ( compare( (byte[]) _keys[ i ], child.getLargestKey() ) != 0 ) {
                     dump( 0 );
                     child.dump( 0 );
-                    throw new Error( "Invalid child subordinate key" );
+                    throw new Error( I18n.err( I18n.ERR_516 ) );
                 }
                 child.assertConsistencyRecursive( height );
             }

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BTree.java Fri Jan 22 22:45:16 2010
@@ -53,6 +53,8 @@
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
+
 import jdbm.RecordManager;
 import jdbm.helper.Serializer;
 import jdbm.helper.Tuple;
@@ -225,28 +227,28 @@
         BTree btree;
 
         if ( recman == null ) {
-            throw new IllegalArgumentException( "Argument 'recman' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_517 ) );
         }
 
         if ( comparator == null ) {
-            throw new IllegalArgumentException( "Argument 'comparator' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_518 ) );
         }
 
         if ( ! ( comparator instanceof Serializable ) ) {
-            throw new IllegalArgumentException( "Argument 'comparator' must be serializable" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_519 ) );
         }
 
         if ( keySerializer != null && ! ( keySerializer instanceof Serializable ) ) {
-            throw new IllegalArgumentException( "Argument 'keySerializer' must be serializable" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_520 ) );
         }
 
         if ( valueSerializer != null && ! ( valueSerializer instanceof Serializable ) ) {
-            throw new IllegalArgumentException( "Argument 'valueSerializer' must be serializable" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_521 ) );
         }
 
         // make sure there's an even number of entries per BPage
         if ( ( pageSize & 1 ) != 0 ) {
-            throw new IllegalArgumentException( "Argument 'pageSize' must be even" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_522 ) );
         }
 
         btree = new BTree();
@@ -297,10 +299,10 @@
         throws IOException
     {
         if ( key == null ) {
-            throw new IllegalArgumentException( "Argument 'key' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_523 ) );
         }
         if ( value == null ) {
-            throw new IllegalArgumentException( "Argument 'value' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_524 ) );
         }
 
         BPage rootPage = getRoot();
@@ -353,7 +355,7 @@
         throws IOException
     {
         if ( key == null ) {
-            throw new IllegalArgumentException( "Argument 'key' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_523 ) );
         }
 
         BPage rootPage = getRoot();
@@ -394,7 +396,7 @@
         throws IOException
     {
         if ( key == null ) {
-            throw new IllegalArgumentException( "Argument 'key' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_523 ) );
         }
         BPage rootPage = getRoot();
         if ( rootPage == null ) {

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ByteArrayComparator.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,8 @@
 import java.util.Comparator;
 import java.io.Serializable;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Comparator for byte arrays.
  *
@@ -76,11 +78,11 @@
      public int compare( Object obj1, Object obj2 )
      {
         if ( obj1 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj1' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) );
         }
 
         if ( obj2 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj2' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) );
         }
 
         return compareByteArray( (byte[]) obj1, (byte[]) obj2 );

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/Conversion.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/Conversion.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/Conversion.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/Conversion.java Fri Jan 22 22:45:16 2010
@@ -46,6 +46,8 @@
 
 package jdbm.helper;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * Miscelaneous conversion utility methods.
@@ -67,7 +69,7 @@
             return s.getBytes( "UTF8" );
         } catch ( java.io.UnsupportedEncodingException uee ) {
             uee.printStackTrace();
-            throw new Error( "Platform doesn't support UTF8 encoding" );
+            throw new Error( I18n.err( I18n.ERR_527 ) );
         }
     }
 
@@ -129,7 +131,7 @@
             return new String( buf, "UTF8" );
         } catch ( java.io.UnsupportedEncodingException uee ) {
             uee.printStackTrace();
-            throw new Error( "Platform doesn't support UTF8 encoding" );
+            throw new Error( I18n.err( I18n.ERR_527 ) );
         }
     }
 

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/IntegerComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/IntegerComparator.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/IntegerComparator.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/IntegerComparator.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,8 @@
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Comparator for Integer objects.
  *
@@ -80,11 +82,11 @@
         }
 
         if ( obj1 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj1' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) );
         }
 
         if ( obj2 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj2' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) );
         }
 
         // complicated to avoid usage of Integer.compareTo, as this

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LongComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LongComparator.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LongComparator.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/LongComparator.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,8 @@
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Comparator for java.lang.Long objects.
  *
@@ -76,11 +78,11 @@
      public int compare( Object obj1, Object obj2 )
      {
         if ( obj1 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj1' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) );
         }
 
         if ( obj2 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj2' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) );
         }
 
         long l1 = ( (Long) obj1 ).longValue();

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/MRU.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/MRU.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/MRU.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/MRU.java Fri Jan 22 22:45:16 2010
@@ -51,6 +51,8 @@
 import java.util.Hashtable;
 import java.util.Vector;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  *  MRU - Most Recently Used cache policy.
@@ -94,7 +96,7 @@
      */
     public MRU(int max) {
         if (max <= 0) {
-            throw new IllegalArgumentException("MRU cache must contain at least one entry");
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_528 ));
         }
         _max = max;
     }
@@ -174,7 +176,7 @@
      */
     public void addListener(CachePolicyListener listener) {
         if (listener == null) {
-            throw new IllegalArgumentException("Cannot add null listener.");
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_539 ) );
         }
         if ( ! listeners.contains(listener)) {
             listeners.addElement(listener);

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/ObjectBAComparator.java Fri Jan 22 22:45:16 2010
@@ -50,6 +50,8 @@
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Comparator for objects which have been serialized into byte arrays.
  * In effect, it wraps another Comparator which compares object and provides
@@ -82,7 +84,7 @@
     public ObjectBAComparator( Comparator comparator )
     {
         if ( comparator == null ) {
-            throw new IllegalArgumentException( "Argument 'comparator' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_530 ) );
         }
 
         _comparator = comparator;
@@ -99,11 +101,11 @@
      public int compare( Object obj1, Object obj2 )
      {
         if ( obj1 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj1' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) );
         }
 
         if ( obj2 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj2' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) );
         }
 
         try {

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/SoftCache.java Fri Jan 22 22:45:16 2010
@@ -53,6 +53,8 @@
 import java.util.Map;
 import java.util.HashMap;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Wraps a deterministic cache policy with a <q>Level-2</q> cache based on
  * J2SE's {@link SoftReference soft references}. Soft references allow
@@ -124,7 +126,7 @@
      */
     public SoftCache(float loadFactor, CachePolicy internal) throws IllegalArgumentException, NullPointerException {
         if (internal == null) {
-            throw new NullPointerException("Internal cache cannot be null.");
+            throw new NullPointerException( I18n.err( I18n.ERR_531 ) );
         }
         _internal = internal;
         _cacheMap = new HashMap(INITIAL_CAPACITY, loadFactor);
@@ -141,9 +143,9 @@
      */
     public void put(Object key, Object value) throws CacheEvictionException {
         if (key == null) {
-            throw new IllegalArgumentException("key cannot be null.");
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_532 ) );
         } else if (value == null) {
-            throw new IllegalArgumentException("value cannot be null.");
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_533 ) );
         }
         _internal.put(key, value);
         removeClearedEntries();

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/StringComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/StringComparator.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/StringComparator.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/StringComparator.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,8 @@
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * Comparator for String objects.  Delegates to String.compareTo().
  *
@@ -76,11 +78,11 @@
      public int compare( Object obj1, Object obj2 )
      {
         if ( obj1 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj1' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_525 ) );
         }
 
         if ( obj2 == null ) {
-            throw new IllegalArgumentException( "Argument 'obj2' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_526 ) );
         }
 
         return ( (String) obj1 ).compareTo((String) obj2 );

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashBucket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashBucket.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashBucket.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashBucket.java Fri Jan 22 22:45:16 2010
@@ -53,6 +53,8 @@
 
 import java.util.ArrayList;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  * A bucket is a placeholder for multiple (key, value) pairs.  Buckets
  * are used to store collisions (same hash value) at all levels of an
@@ -124,9 +126,7 @@
     public HashBucket( int level )
     {
         if ( level > HashDirectory.MAX_DEPTH+1 ) {
-            throw new IllegalArgumentException(
-                            "Cannot create bucket with depth > MAX_DEPTH+1. "
-                            + "Depth=" + level );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_534, level ) );
         }
         _depth = level;
         _keys = new ArrayList( OVERFLOW_SIZE );

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashDirectory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashDirectory.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashDirectory.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/htree/HashDirectory.java Fri Jan 22 22:45:16 2010
@@ -59,6 +59,8 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  Hashtable directory page.
  *
@@ -254,8 +256,7 @@
                 } else {
                     // overflow, so create a new directory
                     if (_depth == MAX_DEPTH) {
-                        throw new RuntimeException( "Cannot create deeper directory. "
-                                                    + "Depth=" + _depth );
+                        throw new RuntimeException( I18n.err( I18n.ERR_535, _depth ) );
                     }
                     HashDirectory dir = new HashDirectory( (byte) (_depth+1) );
                     long dir_recid = _recman.insert( dir );

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BaseRecordManager.java Fri Jan 22 22:45:16 2010
@@ -53,6 +53,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.server.i18n.I18n;
+
 import jdbm.RecordManager;
 import jdbm.helper.Serializer;
 import jdbm.helper.DefaultSerializer;
@@ -241,8 +243,7 @@
     {
         checkIfClosed();
         if ( recid <= 0 ) {
-            throw new IllegalArgumentException( "Argument 'recid' is invalid: "
-                                                + recid );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_536, recid ) );
         }
 
         if ( DEBUG ) {
@@ -283,8 +284,7 @@
     {
         checkIfClosed();
         if ( recid <= 0 ) {
-            throw new IllegalArgumentException( "Argument 'recid' is invalid: "
-                                                + recid );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_536, recid ) );
         }
 
         Location logRecid = new Location( recid );
@@ -331,8 +331,7 @@
 
         checkIfClosed();
         if ( recid <= 0 ) {
-            throw new IllegalArgumentException( "Argument 'recid' is invalid: "
-                                                + recid );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_536, recid ) );
         }
         data = _physMgr.fetch( _logMgr.fetch( new Location( recid ) ) );
         if ( DEBUG ) {
@@ -465,7 +464,7 @@
     {
         long recid = getRoot( NAME_DIRECTORY_ROOT );
         if ( recid == 0 ) {
-            throw new IOException( "Name directory must exist" );
+            throw new IOException( I18n.err( I18n.ERR_537 ) );
         }
         update( recid, _nameDirectory );
     }
@@ -479,7 +478,7 @@
         throws IllegalStateException
     {
         if ( _file == null ) {
-            throw new IllegalStateException( "RecordManager has been closed" );
+            throw new IllegalStateException( I18n.err( I18n.ERR_538 ) );
         }
     }
 }

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BlockIo.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BlockIo.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BlockIo.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/BlockIo.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,10 @@
 
 import java.io.*;
 
+import org.apache.directory.server.i18n.I18n;
+
+import org.apache.directory.server.i18n.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
@@ -83,7 +87,7 @@
     BlockIo(long blockId, byte[] data) {
         // removeme for production version
         if (blockId > 10000000000L)
-            throw new Error("bogus block id " + blockId);
+            throw new Error( I18n.err( I18n.ERR_539, blockId ) );
         this.blockId = blockId;
         this.data = data;
     }
@@ -100,10 +104,10 @@
      */
     void setBlockId(long id) {
         if (isInTransaction())
-            throw new Error("BlockId assigned for transaction block");
+            throw new Error( I18n.err( I18n.ERR_540 ) );
         // removeme for production version
         if (id > 10000000000L)
-            throw new Error("bogus block id " + id);
+            throw new Error( I18n.err( I18n.ERR_539, id ) );
         blockId = id;
     }
 
@@ -175,8 +179,7 @@
     synchronized void decrementTransactionCount() {
         transactionCount--;
         if (transactionCount < 0)
-            throw new Error("transaction count on block "
-                            + getBlockId() + " below zero!");
+            throw new Error( I18n.err( I18n.ERR_541, getBlockId() ) );
 
     }
 

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java Fri Jan 22 22:45:16 2010
@@ -59,6 +59,8 @@
 import java.io.IOException;
 import java.util.Enumeration;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  A RecordManager wrapping and caching another RecordManager.
  *
@@ -92,10 +94,10 @@
     public CacheRecordManager( RecordManager recman, CachePolicy cache )
     {
         if ( recman == null ) {
-            throw new IllegalArgumentException( "Argument 'recman' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_517 ) );
         }
         if ( cache == null ) {
-            throw new IllegalArgumentException( "Argument 'cache' is null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_542 ) );
         }
         _recman = recman;
         _cache = cache;
@@ -399,7 +401,7 @@
         throws IllegalStateException
     {
         if ( _recman == null ) {
-            throw new IllegalStateException( "RecordManager has been closed" );
+            throw new IllegalStateException( I18n.err( I18n.ERR_538 ) );
         }
     }
 

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/DataPage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/DataPage.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/DataPage.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/DataPage.java Fri Jan 22 22:45:16 2010
@@ -47,6 +47,8 @@
 
 package jdbm.recman;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  Class describing a page that holds data.
  */
@@ -84,8 +86,7 @@
     void setFirst(short value) {
   paranoiaMagicOk();
   if (value > 0 && value < O_DATA)
-      throw new Error("DataPage.setFirst: offset " + value 
-          + " too small");
+      throw new Error( I18n.err( I18n.ERR_543, value ) );
   block.writeShort(O_FIRST, value);
     }
 }

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/FileHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/FileHeader.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/FileHeader.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/FileHeader.java Fri Jan 22 22:45:16 2010
@@ -47,6 +47,8 @@
 
 package jdbm.recman;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  This class represents a file header. It is a 1:1 representation of
  *  the data that appears in block 0 of a file.
@@ -78,8 +80,7 @@
         if (isNew)
             block.writeShort(O_MAGIC, Magic.FILE_HEADER);
         else if (!magicOk())
-            throw new Error("CRITICAL: file header magic not OK " 
-                            + block.readShort(O_MAGIC));
+            throw new Error( I18n.err( I18n.ERR_544, block.readShort(O_MAGIC) ) );
     }
 
     /** Returns true if the magic corresponds with the fileHeader magic.  */

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/LogicalRowIdManager.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,8 @@
 
 import java.io.IOException;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  This class manages the linked lists of logical rowid pages.
  */
@@ -89,7 +91,7 @@
       }
       retval = freeman.get();
       if (retval == null) {
-    throw new Error("couldn't obtain free translation");
+    throw new Error( I18n.err( I18n.ERR_545 ) );
       }
   }
   // write the translation.

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageHeader.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageHeader.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageHeader.java Fri Jan 22 22:45:16 2010
@@ -47,6 +47,8 @@
 
 package jdbm.recman;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  This class represents a page header. It is the common superclass for
  *  all different page views.
@@ -71,9 +73,7 @@
     protected PageHeader(BlockIo block) {
         initialize(block);
         if (!magicOk())
-            throw new Error("CRITICAL: page header magic for block "
-                            + block.getBlockId() + " not OK "
-                            + getMagic());
+            throw new Error( I18n.err( I18n.ERR_546, block.getBlockId(), getMagic() ) );
     }
     
     /**
@@ -116,8 +116,7 @@
      */
     protected void paranoiaMagicOk() {
         if (!magicOk())
-            throw new Error("CRITICAL: page header magic not OK "
-                            + getMagic());
+            throw new Error( I18n.err( I18n.ERR_547, getMagic() ) );
     }
     
     /** Returns the magic code */

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageManager.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/PageManager.java Fri Jan 22 22:45:16 2010
@@ -49,6 +49,8 @@
 
 import java.io.*;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  This class manages the linked lists of pages that make up a file.
  */
@@ -81,7 +83,7 @@
     long allocate(short type) throws IOException {
         
         if (type == Magic.FREE_PAGE)
-            throw new Error("allocate of free page?");
+            throw new Error( I18n.err( I18n.ERR_548 ) );
         
         // do we have something on the free list?
         long retval = header.getFirstOf(Magic.FREE_PAGE);
@@ -141,9 +143,9 @@
      */
     void free(short type, long recid) throws IOException {
         if (type == Magic.FREE_PAGE)
-            throw new Error("free free page?");
+            throw new Error( I18n.err( I18n.ERR_549 ) );
         if (recid == 0)
-            throw new Error("free header page?");
+            throw new Error( I18n.err( I18n.ERR_550 ) );
         
         // get the page and read next and previous pointers
         BlockIo buf = file.get(recid);

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Provider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Provider.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Provider.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/Provider.java Fri Jan 22 22:45:16 2010
@@ -51,6 +51,8 @@
 import java.io.IOException;
 import java.util.Properties;
 
+import org.apache.directory.server.i18n.I18n;
+
 import jdbm.RecordManager;
 import jdbm.RecordManagerOptions;
 import jdbm.RecordManagerProvider;
@@ -102,11 +104,11 @@
             MRU cache = new MRU( cacheSize );
             recman = new CacheRecordManager( recman, cache );
         } else if ( value.equalsIgnoreCase( RecordManagerOptions.SOFT_REF_CACHE ) ) {
-            throw new IllegalArgumentException( "Soft reference cache not implemented" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_551 ) );
         } else if ( value.equalsIgnoreCase( RecordManagerOptions.WEAK_REF_CACHE ) ) {
-            throw new IllegalArgumentException( "Weak reference cache not implemented" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_552 ) );
         } else {
-            throw new IllegalArgumentException( "Invalid cache type: " + value );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_553, value ) );
         }
 
         return recman;

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordFile.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordFile.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordFile.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordFile.java Fri Jan 22 22:45:16 2010
@@ -50,6 +50,8 @@
 import java.io.*;
 import java.util.*;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  This class represents a random access file as a set of fixed size
  *  records. Each record has a physical record number, and records are
@@ -150,7 +152,7 @@
 
          // sanity check: can't be on in use list
          if (inUse.get(key) != null) {
-             throw new Error("double get for block " + blockid);
+             throw new Error( I18n.err( I18n.ERR_554, blockid ) );
          }
 
          // get a new node and read it from the file
@@ -177,7 +179,7 @@
     throws IOException {
         BlockIo node = (BlockIo) inUse.get(new Long(blockid));
         if (node == null)
-            throw new IOException("bad blockid " + blockid + " on release");
+            throw new IOException( I18n.err( I18n.ERR_555, blockid ) );
         if (!node.isDirty() && isDirty)
             node.setDirty();
         release(node);
@@ -224,8 +226,7 @@
         // debugging...
         if (!inUse.isEmpty() && inUse.size() > 1) {
             showList(inUse.values().iterator());
-            throw new Error("in use list not empty at commit time ("
-                            + inUse.size() + ")");
+            throw new Error( I18n.err( I18n.ERR_556, inUse.size() ) );
         }
 
         //  System.out.println("committing...");
@@ -267,8 +268,7 @@
         // debugging...
         if (!inUse.isEmpty()) {
             showList(inUse.values().iterator());
-            throw new Error("in use list not empty at rollback time ("
-                            + inUse.size() + ")");
+            throw new Error( I18n.err( I18n.ERR_557, inUse.size() ) );
         }
         //  System.out.println("rollback...");
         dirty.clear();
@@ -277,8 +277,7 @@
 
         if (!inTxn.isEmpty()) {
             showList(inTxn.values().iterator());
-            throw new Error("in txn list not empty at rollback time ("
-                            + inTxn.size() + ")");
+            throw new Error( I18n.err( I18n.ERR_558, inTxn.size() ) );
         };
     }
 
@@ -293,19 +292,19 @@
 
         if (!inTxn.isEmpty()) {
             showList(inTxn.values().iterator());
-            throw new Error("In transaction not empty");
+            throw new Error( I18n.err( I18n.ERR_559 ) );
         }
 
         // these actually ain't that bad in a production release
         if (!dirty.isEmpty()) {
             System.out.println("ERROR: dirty blocks at close time");
             showList(dirty.values().iterator());
-            throw new Error("Dirty blocks at close time");
+            throw new Error( I18n.err( I18n.ERR_560 ) );
         }
         if (!inUse.isEmpty()) {
             System.out.println("ERROR: inUse blocks at close time");
             showList(inUse.values().iterator());
-            throw new Error("inUse blocks at close time");
+            throw new Error( I18n.err( I18n.ERR_561 ) );
         }
 
         // debugging stuff to keep an eye on the free list

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/RecordHeader.java Fri Jan 22 22:45:16 2010
@@ -47,6 +47,8 @@
 
 package jdbm.recman;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  The data that comes at the start of a record of data. It stores 
  *  both the current size and the avaliable size for the record - the latter
@@ -72,9 +74,7 @@
         this.block = block;
         this.pos = pos;
         if (pos > (RecordFile.BLOCK_SIZE - SIZE))
-            throw new Error("Offset too large for record header (" 
-                            + block.getBlockId() + ":" 
-                            + pos + ")");
+            throw new Error( I18n.err( I18n.ERR_562, block.getBlockId(), pos ) );
     }
 
     /** Returns the current size */

Modified: directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/TransactionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/TransactionManager.java?rev=902302&r1=902301&r2=902302&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/TransactionManager.java (original)
+++ directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/TransactionManager.java Fri Jan 22 22:45:16 2010
@@ -50,6 +50,8 @@
 import java.io.*;
 import java.util.*;
 
+import org.apache.directory.server.i18n.I18n;
+
 /**
  *  This class manages the transaction log that belongs to every
  *  {@link RecordFile}. The transaction log is either clean, or
@@ -133,12 +135,10 @@
         throws IOException
     {
         if ( maxTxns <= 0 ) {
-            throw new IllegalArgumentException( 
-                "Argument 'maxTxns' must be greater than 0." );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_563 ) );
         }
         if ( curTxn != -1 ) {
-            throw new IllegalStateException( 
-                "Cannot change setting while transactions are pending in the log" );
+            throw new IllegalStateException( I18n.err( I18n.ERR_564 ) );
         }
         _maxTxns = maxTxns;
         txns = new ArrayList[ maxTxns ];
@@ -212,7 +212,7 @@
         try {
             if (ois.readShort() != Magic.LOGFILE_HEADER) {
                 ois.close();
-                throw new Error("Bad magic on log file");
+                throw new Error( I18n.err( I18n.ERR_565 ) );
             }
         } catch (IOException e) {
             // corrupted/empty logfile
@@ -227,7 +227,7 @@
                 blocks = (ArrayList) ois.readObject();
             } catch (ClassNotFoundException e) {
                 ois.close();
-                throw new Error("Unexcepted exception: " + e);
+                throw new Error( I18n.err( I18n.ERR_566, e ) );
             } catch (IOException e) {
                 // corrupted logfile, ignore rest of transactions
                 break;



Mime
View raw message