directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r902258 - in /directory/apacheds/trunk: core-avl/src/main/java/org/apache/directory/server/core/avltree/ i18n/src/main/resources/org/apache/directory/server/i18n/
Date Fri, 22 Jan 2010 20:34:08 GMT
Author: felixk
Date: Fri Jan 22 20:34:07 2010
New Revision: 902258

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

Modified:
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayMarshaller.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeSingleton.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayMarshaller.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayMarshaller.java?rev=902258&r1=902257&r2=902258&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayMarshaller.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayMarshaller.java
Fri Jan 22 20:34:07 2010
@@ -27,6 +27,7 @@
 import java.io.IOException;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -126,7 +127,7 @@
             }
             catch (NullPointerException npe )
             {
-                System.out.println( "Bad serialization, tree : [" + StringTools.dumpBytes(
data ) + "]");
+                System.out.println( I18n.err( I18n.ERR_438, StringTools.dumpBytes( data )
) );
                 throw npe;
             }
 
@@ -154,7 +155,7 @@
         {
             if ( ( data == null ) || ( data.length == 0 ) )
             {
-                throw new IOException( "Null or empty data array is invalid." );
+                throw new IOException( I18n.err( I18n.ERR_439 ) );
             }
     
             if ( ( data.length == 1 ) && ( data[0] == 0 ) )
@@ -171,7 +172,7 @@
             
             if( startByte != 0 )
             {
-                throw new IOException("wrong array serialized data format");
+                throw new IOException( I18n.err( I18n.ERR_440 ) );
             }
             
             int size = din.readInt();
@@ -198,7 +199,7 @@
         }
         catch (NullPointerException npe )
         {
-            System.out.println( "Bad tree : [" + StringTools.dumpBytes( data ) + "]");
+            System.out.println( I18n.err( I18n.ERR_441, StringTools.dumpBytes( data ) ) );
             throw npe;
         }
     }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java?rev=902258&r1=902257&r2=902258&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMarshaller.java
Fri Jan 22 20:34:07 2010
@@ -27,6 +27,8 @@
 import java.io.IOException;
 import java.util.Comparator;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * Class to serialize the AvlTree node data.
@@ -166,7 +168,7 @@
     {
         if ( data == null || data.length == 0 )
         {
-            throw new IOException( "Null or empty data array is invalid." );
+            throw new IOException( I18n.err( I18n.ERR_442 ) );
         }
 
         if ( data.length == 1 && data[0] == 0 )
@@ -181,7 +183,7 @@
         
         if( startByte != 0 )
         {
-            throw new IOException("wrong AvlTree serialized data format");
+            throw new IOException( I18n.err( I18n.ERR_443 ) );
         }
         
         int size = din.readInt();

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeSingleton.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeSingleton.java?rev=902258&r1=902257&r2=902258&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeSingleton.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeSingleton.java
Fri Jan 22 20:34:07 2010
@@ -23,6 +23,8 @@
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * An immutable AvlTree wrapping a singleton.
@@ -169,8 +171,7 @@
     
     public K insert( K key )
     {
-        throw new UnsupportedOperationException( "This singleton AvlTree does not support
changes " +
-        		"since the behavoir of alterations on a singleton are undefined." );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_444 ) );
     }
 
     
@@ -188,7 +189,6 @@
     
     public K remove( K key )
     {
-        throw new UnsupportedOperationException( "This singleton AvlTree does not support
changes " +
-        "since the behavoir of alterations on a singleton are undefined." );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_444 ) );
     }
 }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java?rev=902258&r1=902257&r2=902258&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/DefaultMarshaller.java
Fri Jan 22 20:34:07 2010
@@ -26,6 +26,8 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * A Marshaller which uses default Java Serialization.
@@ -65,7 +67,7 @@
         }
         catch ( ClassNotFoundException e )
         {
-            IOException ioe = new IOException( "Could not find class" );
+            IOException ioe = new IOException( I18n.err( I18n.ERR_445 ) );
             ioe.initCause( e );
             throw ioe;
         }

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java?rev=902258&r1=902257&r2=902258&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
Fri Jan 22 20:34:07 2010
@@ -19,6 +19,7 @@
 package org.apache.directory.server.core.avltree;
 
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.AbstractTupleCursor;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
@@ -70,13 +71,13 @@
 
     public void beforeKey( K key ) throws Exception
     {
-        throw new UnsupportedOperationException( "This cursor locks down the key so keywise
advances are not allowed." );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
     }
 
 
     public void afterKey( K key ) throws Exception
     {
-        throw new UnsupportedOperationException( "This cursor locks down the key so keywise
advances are not allowed." );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
     }
 
 
@@ -85,7 +86,7 @@
         checkNotClosed( "beforeValue()" );
         if ( key != null && ! key.equals( this.key ) )
         {
-            throw new UnsupportedOperationException( "This cursor locks down the key so keywise
advances are not allowed." );
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
         }
 
         wrapped.before( value );
@@ -98,7 +99,7 @@
         checkNotClosed( "afterValue()" );
         if ( key != null && ! key.equals( this.key ) )
         {
-            throw new UnsupportedOperationException( "This cursor locks down the key so keywise
advances are not allowed." );
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
         }
 
         wrapped.after( value );

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java?rev=902258&r1=902257&r2=902258&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
(original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/SingletonOrOrderedSet.java
Fri Jan 22 20:34:07 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.core.avltree;
 
+import org.apache.directory.server.i18n.I18n;
+
 
 /**
  * Stores either a single object or many of them in an AvlTree.
@@ -41,7 +43,7 @@
     {
         if ( singleton == null )
         {
-            throw new NullPointerException( "singleton must not be null" );
+            throw new NullPointerException( I18n.err( I18n.ERR_447 ) );
         }
         
         this.singleton = singleton;
@@ -58,7 +60,7 @@
     {
         if ( orderedSet == null )
         {
-            throw new NullPointerException( "orderedSet must not be null" );
+            throw new NullPointerException( I18n.err( I18n.ERR_448 ) );
         }
         
         this.orderedSet = orderedSet;
@@ -100,7 +102,7 @@
             return singleton;
         }
         
-        throw new RuntimeException( "Cannot request singleton when in ordered set mode."
);
+        throw new RuntimeException( I18n.err( I18n.ERR_449 ) );
     }
     
     
@@ -114,13 +116,12 @@
     {
         if ( singleton == null )
         {
-            throw new NullPointerException( "singleton must not be null" );
+            throw new NullPointerException( I18n.err( I18n.ERR_447 ) );
         }
         
         if ( this.orderedSet != null )
         {
-            throw new RuntimeException( "Cannot set a singleton when using multiple values:
" +
-            		"use switchToSingleton()" );
+            throw new RuntimeException( I18n.err( I18n.ERR_450 ) );
         }
         
         V retval = this.singleton;
@@ -141,12 +142,12 @@
     {
         if ( singleton == null )
         {
-            throw new NullPointerException( "singleton must not be null" );
+            throw new NullPointerException( I18n.err( I18n.ERR_447 ) );
         }
         
         if ( this.singleton != null )
         {
-            throw new RuntimeException( "Already in singleton mode." );
+            throw new RuntimeException( I18n.err( I18n.ERR_451 ) );
         }
         
         AvlTree<V> retval = this.orderedSet;
@@ -169,7 +170,7 @@
             return orderedSet;
         }
         
-        throw new RuntimeException( "Cannot get ordered set in singleton mode." );
+        throw new RuntimeException( I18n.err( I18n.ERR_452 ) );
     }
     
     
@@ -184,13 +185,12 @@
     {
         if ( orderedSet == null )
         {
-            throw new NullPointerException( "orderedSet must not be null" );
+            throw new NullPointerException( I18n.err( I18n.ERR_448 ) );
         }
         
         if ( this.singleton != null )
         {
-            throw new RuntimeException( "Cannot set a orderedSet when in singleton mode:
" +
-                    "use switchToSingleValue()" );
+            throw new RuntimeException( I18n.err( I18n.ERR_453 ) );
         }
         
         AvlTree<V> retval = this.orderedSet;
@@ -211,12 +211,12 @@
     {
         if ( orderedSet == null )
         {
-            throw new NullPointerException( "orderedSet must not be null" );
+            throw new NullPointerException( I18n.err( I18n.ERR_448 ) );
         }
         
         if ( this.orderedSet != null )
         {
-            throw new RuntimeException( "Already in ordered set mode." );
+            throw new RuntimeException( I18n.err( I18n.ERR_454 ) );
         }
         
         V retval = this.singleton;

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=902258&r1=902257&r2=902258&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 20:34:07 2010
@@ -459,23 +459,23 @@
 ERR_435=Got more than one result for the entity name: {0}
 ERR_436=Names used for principals must be normalized!
 ERR_437=Unknown JNDI Context.REFERRAL value of {0}
-ERR_438=
-ERR_439=
-ERR_440=
-ERR_441=
-ERR_442=
-ERR_443=
-ERR_444=
-ERR_445=
-ERR_446=
-ERR_447=
-ERR_448=
-ERR_449=
-ERR_450=
-ERR_451=
-ERR_452=
-ERR_453=
-ERR_454=
+ERR_438=Bad serialization, tree : [{0}]
+ERR_439=Null or empty data array is invalid.
+ERR_440=wrong array serialized data format
+ERR_441=Bad tree : [{0}]
+ERR_442=Null or empty data array is invalid.
+ERR_443=wrong AvlTree serialized data format
+ERR_444=This singleton AvlTree does not support changes since the behavior of alterations
on a singleton are undefined.
+ERR_445=Could not find class
+ERR_446=This cursor locks down the key so keywise advances are not allowed.
+ERR_447=singleton must not be null
+ERR_448=orderedSet must not be null
+ERR_449=Cannot request singleton when in ordered set mode.
+ERR_450=Cannot set a singleton when using multiple values: use switchToSingleton()
+ERR_451=Already in singleton mode.
+ERR_452=Cannot get ordered set in singleton mode.
+ERR_453=Cannot set a orderedSet when in singleton mode: use switchToSingleValue()
+ERR_454=Already in ordered set mode.
 ERR_455=
 ERR_456=
 ERR_457=



Mime
View raw message