directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r919765 [2/3] - in /directory/shared/trunk: i18n/src/main/java/org/apache/directory/shared/i18n/ i18n/src/main/resources/org/apache/directory/shared/i18n/ ldap/src/main/java/org/apache/directory/shared/ldap/schema/ ldap/src/main/java/org/ap...
Date Sat, 06 Mar 2010 13:44:55 GMT
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -59,8 +60,7 @@
      */
     public void register( Normalizer normalizer ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04283 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -69,8 +69,7 @@
      */
     public Normalizer unregister( String numericOid ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04283 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -79,8 +78,7 @@
      */
     public void unregisterSchemaElements( String schemaName ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04283 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -170,8 +168,7 @@
      */
     public void renameSchema( String originalSchemaName, String newSchemaName ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04283 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -189,8 +186,7 @@
      */
     public void clear() throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04283 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -199,7 +195,6 @@
      */
     public Normalizer unregister( Normalizer schemaObject ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04283 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java Sat Mar  6 13:44:54 2010
@@ -25,6 +25,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
@@ -78,8 +79,7 @@
      */
     public void registerDescendants( ObjectClass objectClass, List<ObjectClass> ancestors ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -88,8 +88,7 @@
      */
     public void unregisterDescendants( ObjectClass attributeType, List<ObjectClass> ancestors ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -98,8 +97,7 @@
      */
     public void register( ObjectClass objectClass ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -108,8 +106,7 @@
      */
     public ObjectClass unregister( String numericOid ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -199,8 +196,7 @@
      */
     public void renameSchema( String originalSchemaName, String newSchemaName ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -209,8 +205,7 @@
      */
     public void unregisterSchemaElements( String schemaName ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -228,8 +223,7 @@
      */
     public void clear() throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -238,7 +232,6 @@
      */
     public ObjectClass unregister( ObjectClass schemaObject ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04284 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
@@ -59,8 +60,7 @@
      */
     public void register( SyntaxChecker syntaxChecker ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04285 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -69,8 +69,7 @@
      */
     public SyntaxChecker unregister( String numericOid ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04285 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -79,8 +78,7 @@
      */
     public void unregisterSchemaElements( String schemaName ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04285 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -170,8 +168,7 @@
      */
     public void renameSchema( String originalSchemaName, String newSchemaName ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04285 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -189,8 +186,7 @@
      */
     public void clear() throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04285 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 
 
@@ -199,7 +195,6 @@
      */
     public SyntaxChecker unregister( SyntaxChecker schemaObject ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy",
-            ResultCodeEnum.NO_SUCH_OPERATION );
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_04285 ), ResultCodeEnum.NO_SUCH_OPERATION );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java Sat Mar  6 13:44:54 2010
@@ -29,6 +29,7 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.asn1.primitives.OID;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
 import org.slf4j.Logger;
@@ -84,7 +85,7 @@
         }
         else
         {
-            String msg = "OID '" + oid + "' was not found within the OID registry";
+            String msg = I18n.err( I18n.ERR_04286, oid );
             LOG.error( msg );
             throw new NamingException( msg );
         }
@@ -108,7 +109,7 @@
         }
         else
         {
-            String msg = "There is no SchemaObject associated with OID '" + oid + "'";
+            String msg = I18n.err( I18n.ERR_04287, oid );
             LOG.error( msg );
             throw new NamingException( msg );
         }
@@ -133,7 +134,7 @@
 
         if ( null == schemaObject )
         {
-            String msg = "OID '" + oid + "' was not found within the OID registry";
+            String msg = I18n.err( I18n.ERR_04288, oid );
             LOG.error( msg );
             throw new NamingException( msg );
         }
@@ -181,7 +182,7 @@
     {
         if ( schemaObject == null )
         {
-            String message = "Cannot register a Null SchemaObject !";
+            String message = I18n.err( I18n.ERR_04289 );
 
             LOG.debug( message );
             throw new NamingException( message );
@@ -191,7 +192,7 @@
 
         if ( !OID.isOID( oid ) )
         {
-            String message = "The given SchemaObject does not have a valid OID";
+            String message = I18n.err( I18n.ERR_04290 );
 
             LOG.debug( message );
             throw new NamingException( message );
@@ -202,7 +203,7 @@
          */
         if ( byOid.containsKey( oid ) )
         {
-            String message = "There is already a SchemaObject for OID " + oid;
+            String message = I18n.err( I18n.ERR_04291, oid );
             LOG.info( message );
             return;
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java Sat Mar  6 13:44:54 2010
@@ -30,6 +30,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
@@ -721,7 +722,7 @@
         catch ( NamingException ne )
         {
             // Not allowed.
-            String msg = "Cannot build the references for " + schemaObject.getName() + ", error : " + ne.getMessage();
+            String msg = I18n.err( I18n.ERR_04292, schemaObject.getName(), ne.getLocalizedMessage() );
 
             Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
@@ -742,7 +743,7 @@
         catch ( NamingException ne )
         {
             // Not allowed.
-            String msg = "Cannot remove the references for " + schemaObject.getName() + ", error : " + ne.getMessage();
+            String msg = I18n.err( I18n.ERR_04293, schemaObject.getName(), ne.getLocalizedMessage() );
 
             Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
@@ -1000,8 +1001,8 @@
         else
         {
             // This is an error. 
-            Throwable error = new LdapSchemaViolationException( "The MatchingRule " + matchingRule.getOid()
-                + " does not have a syntax." + " This is invalid", ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04294, matchingRule.getOid() ), 
+            		ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
         }
 
@@ -1011,8 +1012,8 @@
         if ( normalizer == null )
         {
             // Ok, no normalizer, this is an error
-            Throwable error = new LdapSchemaViolationException( "The MatchingRule " + matchingRule.getOid()
-                + " does not have a normalizer." + " This is invalid", ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04295, matchingRule.getOid() ),
+            		ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
         }
 
@@ -1022,8 +1023,8 @@
         if ( comparator == null )
         {
             // Ok, no comparator, this is an error
-            Throwable error = new LdapSchemaViolationException( "The MatchingRule " + matchingRule.getOid()
-                + " does not have a comparator." + " This is invalid", ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04296, matchingRule.getOid() ),
+            		ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
         }
     }
@@ -1067,9 +1068,7 @@
                 else
                 {
                     // Not allowed : we have a cyle
-                    Throwable error = new LdapSchemaViolationException( "The AttributeType " + attributeType.getOid()
-                        + " can't have itself as a superior, or"
-                        + " a cycle has been detected while processing the superior's tree",
+                    Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04297, attributeType.getOid() ),
                         ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                     errors.add( error );
                     return;
@@ -1101,8 +1100,7 @@
             {
                 // This is an error. if the AT does not have a Syntax,
                 // then it must have a superior, which syntax is get from.
-                Throwable error = new LdapSchemaViolationException( "The AttributeType " + attributeType.getOid()
-                    + " does not have a superior" + " nor a Syntax. This is invalid",
+                Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04298, attributeType.getOid() ),
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
             }
@@ -1237,8 +1235,7 @@
                 if ( musts.contains( may ) )
                 {
                     // This is not allowed.
-                    Throwable error = new LdapSchemaViolationException( "The ObjectClass " + objectClass.getOid()
-                        + " has some AttribteType in MAY which is already declared" + " in one of its superior MUST",
+                    Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04299, objectClass.getOid() ),
                         ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                     errors.add( error );
                     return;
@@ -1282,10 +1279,7 @@
                 else
                 {
                     // Not allowed : we have a cyle
-                    Throwable error = new LdapSchemaViolationException( "The ObjectClass " + objectClass.getOid()
-                        + " can't have itself as a superior, or"
-                        + " a cycle has been detected while processing the superior's tree,"
-                        + " or this superior has already been added : \n" + superior,
+                    Throwable error = new LdapSchemaViolationException( I18n.err( I18n.ERR_04300, objectClass.getOid(), superior) ,
                         ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                     errors.add( error );
                     return;
@@ -1528,8 +1522,7 @@
             if ( globalOidRegistry.contains( schemaObject.getOid() ) )
             {
                 // TODO : throw an exception here
-                String msg = "Registering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
-                    + "failed, it's already present in the Registries";
+                String msg = I18n.err( I18n.ERR_04301, schemaObject.getObjectType(), schemaObject.getOid() );
                 LOG.error( msg );
                 Throwable error = new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
                 errors.add( error );
@@ -1609,8 +1602,7 @@
         if ( !( schemaObject instanceof LoadableSchemaObject ) && globalOidRegistry.contains( schemaObject.getOid() ) )
         {
             // TODO : throw an exception here
-            String msg = "Registering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
-                + "failed, it's already present in the Registries";
+            String msg = I18n.err( I18n.ERR_04301, schemaObject.getObjectType(), schemaObject.getOid() );
             LOG.error( msg );
             Throwable error = new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             errors.add( error );
@@ -1679,8 +1671,7 @@
         if ( !( schemaObject instanceof LoadableSchemaObject ) && !globalOidRegistry.contains( schemaObject.getOid() ) )
         {
             // TODO : throw an exception here
-            String msg = "Unregistering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
-                + "failed, it's not present in the Registries";
+            String msg = I18n.err( I18n.ERR_04302, schemaObject.getObjectType(), schemaObject.getOid() );
             LOG.error( msg );
             Throwable error = new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             errors.add( error );
@@ -1748,8 +1739,7 @@
             if ( !globalOidRegistry.contains( schemaObject.getOid() ) )
             {
                 // TODO : throw an exception here
-                String msg = "Unregistering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
-                    + "failed, it's not present in the Registries";
+                String msg = I18n.err( I18n.ERR_04302, schemaObject.getObjectType(), schemaObject.getOid() );
                 LOG.error( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationChecker.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationChecker.java Sat Mar  6 13:44:54 2010
@@ -25,6 +25,8 @@
 import java.text.ParseException;
 import java.util.Map;
 
+import org.apache.directory.shared.i18n.I18n;
+
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
 
@@ -112,20 +114,17 @@
         }
         catch ( TokenStreamException e )
         {
-            String msg = "Parser failure on subtree specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04329, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, 0 );
         }
         catch ( RecognitionException e )
         {
-            String msg = "Parser failure on subtree specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04329, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, e.getColumn() );
         }
         catch ( Exception e )
         {
-            String msg = "Parser failure on subtree specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04329, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, 0 );
         }
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationModifier.java Sat Mar  6 13:44:54 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.ldap.subtree;
 
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.DN;
 
@@ -130,7 +131,7 @@
     {
         if ( minBaseDistance < 0 )
         {
-            throw new IllegalArgumentException( "A negative minimum base distance is undefined!" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04330 ) );
         }
 
         this.minBaseDistance = minBaseDistance;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java Sat Mar  6 13:44:54 2010
@@ -25,6 +25,7 @@
 import java.text.ParseException;
 import java.util.Map;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 
@@ -123,20 +124,17 @@
         }
         catch ( TokenStreamException e )
         {
-            String msg = "Parser failure on subtree specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04329, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, 0 );
         }
         catch ( RecognitionException e )
         {
-            String msg = "Parser failure on subtree specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04329, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, e.getColumn() );
         }
         catch ( Exception e )
         {
-            String msg = "Parser failure on subtree specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04329, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, 0 );
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java Sat Mar  6 13:44:54 2010
@@ -23,6 +23,7 @@
 import java.util.List;
 
 import org.apache.commons.lang.NullArgumentException;
+import org.apache.directory.shared.i18n.I18n;
 
 /**
  * The Trigger Specification Bean.
@@ -47,11 +48,11 @@
             actionTime == null || 
             spSpecs == null )
         {
-            throw new NullArgumentException( "TriggerSpecification cannot be initialized with any NULL argument." );
+            throw new NullArgumentException( I18n.err( I18n.ERR_04331 ) );
         }
         if ( spSpecs.size() == 0 )
         {
-            throw new IllegalArgumentException( "TriggerSpecification cannot be initialized with emtpy SPSPec list." );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04332 ) );
         }
         this.ldapOperation = ldapOperation;
         this.actionTime = actionTime;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecificationParser.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecificationParser.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecificationParser.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,7 @@
 import java.io.StringReader;
 import java.text.ParseException;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
 
 import antlr.RecognitionException;
@@ -119,14 +120,12 @@
         }
         catch ( TokenStreamException e )
         {
-            String msg = "Parser failure on Trigger Specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04333, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, 0 );
         }
         catch ( RecognitionException e )
         {
-            String msg = "Parser failure on Trigger Specification:\n\t" + spec;
-            msg += "\nAntlr exception trace:\n" + e.getMessage();
+            String msg = I18n.err( I18n.ERR_04333, spec, e.getLocalizedMessage() );
             throw new ParseException( msg, e.getColumn() );
         }
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AbstractSimpleComponentsMonitor.java Sat Mar  6 13:44:54 2010
@@ -26,6 +26,8 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 public abstract class AbstractSimpleComponentsMonitor implements ComponentsMonitor
 {
@@ -43,7 +45,7 @@
     {
         if ( !components.remove( component ) )
         {
-            throw new IllegalArgumentException( "Unregistered or previously used component: " + component );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04336, component ) );
         }
 
         return this;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ArrayUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ArrayUtils.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ArrayUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ArrayUtils.java Sat Mar  6 13:44:54 2010
@@ -22,6 +22,8 @@
 
 import java.lang.reflect.Array;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -1235,7 +1237,7 @@
     {
         if ( array1 == null || array2 == null )
         {
-            throw new IllegalArgumentException( "The Array must not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04337 ) );
         }
         return array1.getClass().getName().equals( array2.getClass().getName() );
     }
@@ -4552,7 +4554,7 @@
         {
             if ( index != 0 )
             {
-                throw new IndexOutOfBoundsException( "Index: " + index + ", Length: 0" );
+                throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_04338, index ,0 ) );
             }
             Object joinedArray = Array.newInstance( element != null ? element.getClass() : Object.class, 1 );
             Array.set( joinedArray, 0, element );
@@ -4561,7 +4563,7 @@
         int length = array.length;
         if ( index > length || index < 0 )
         {
-            throw new IndexOutOfBoundsException( "Index: " + index + ", Length: " + length );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_04338, index, length ) );
         }
         Object result = Array.newInstance( array.getClass().getComponentType(), length + 1 );
         System.arraycopy( array, 0, result, 0, index );
@@ -5336,7 +5338,7 @@
         int length = getLength( array );
         if ( index < 0 || index >= length )
         {
-            throw new IndexOutOfBoundsException( "Index: " + index + ", Length: " + length );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_04338, index, length ) );
         }
 
         Object result = Array.newInstance( array.getClass().getComponentType(), length - 1 );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java Sat Mar  6 13:44:54 2010
@@ -33,6 +33,7 @@
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
@@ -501,7 +502,7 @@
 
         if ( ( attr0 == null ) && ( attr1 == null ) )
         {
-            throw new IllegalArgumentException( "Cannot figure out attribute ID if both args are null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04339 ) );
         }
         else if ( attr0 == null )
         {
@@ -513,7 +514,7 @@
         }
         else if ( !attr0.getID().equalsIgnoreCase( attr1.getID() ) )
         {
-            throw new IllegalArgumentException( "Cannot take difference of attributes with different IDs!" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04340 ) );
         }
         else
         {
@@ -558,7 +559,7 @@
 
         if ( attr0 == null && attr1 == null )
         {
-            throw new IllegalArgumentException( "Cannot figure out attribute ID if both args are null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04341 ) );
         }
         else if ( attr0 == null )
         {
@@ -570,7 +571,7 @@
         }
         else if ( !attr0.getID().equalsIgnoreCase( attr1.getID() ) )
         {
-            throw new IllegalArgumentException( "Cannot take union of attributes with different IDs!" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04342 ) );
         }
         else
         {
@@ -769,7 +770,7 @@
             if ( !StringTools.isAlphaDigitMinus( str, pos.start ) )
             {
                 // We must have at least one keychar
-                throw new ParseException( "An empty option is not allowed", pos.start );
+                throw new ParseException( I18n.err( I18n.ERR_04343 ), pos.start );
             }
 
             pos.start++;
@@ -847,14 +848,14 @@
         // We must have at least one '.' number
         if ( !StringTools.isCharASCII( str, pos.start, '.' ) )
         {
-            throw new ParseException( "Invalid OID, missing '.'", pos.start );
+            throw new ParseException( I18n.err( I18n.ERR_04344 ), pos.start );
         }
 
         pos.start++;
 
         if ( !parseNumber( str, pos ) )
         {
-            throw new ParseException( "Invalid OID, missing a number after a '.'", pos.start );
+            throw new ParseException( I18n.err( I18n.ERR_04345 ), pos.start );
         }
 
         while ( true )
@@ -869,7 +870,7 @@
 
             if ( !parseNumber( str, pos ) )
             {
-                throw new ParseException( "Invalid OID, missing a number after a '.'", pos.start );
+                throw new ParseException(I18n.err( I18n.ERR_04345 ), pos.start );
             }
         }
     }
@@ -900,7 +901,7 @@
 
         if ( c == '\0' )
         {
-            throw new ParseException( "Empty attributes", pos.start );
+            throw new ParseException( I18n.err( I18n.ERR_04346 ), pos.start );
         }
 
         int start = pos.start;
@@ -941,7 +942,7 @@
         }
         else
         {
-            throw new ParseException( "Bad char in attribute", pos.start );
+            throw new ParseException( I18n.err( I18n.ERR_04347 ), pos.start );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base64.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base64.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base64.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base64.java Sat Mar  6 13:44:54 2010
@@ -20,6 +20,8 @@
 
 package org.apache.directory.shared.ldap.util;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * decoding of base64 characters to raw bytes.
@@ -162,7 +164,7 @@
         // if there is STILL something wrong we just have to throw up now!
         if ( l_index != l_out.length )
         {
-            throw new Error( "Miscalculated data length (wrote " + l_index + " instead of " + l_out.length + ")" );
+            throw new Error( I18n.err( I18n.ERR_04348, l_index, l_out.length ) );
         }
 
         return l_out;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/BooleanUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/BooleanUtils.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/BooleanUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/BooleanUtils.java Sat Mar  6 13:44:54 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.ldap.util;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -278,7 +280,7 @@
             return false;
         }
         // no match
-        throw new IllegalArgumentException( "The Integer did not match either specified value" );
+        throw new IllegalArgumentException( I18n.err( I18n.ERR_04349 ) );
     }
 
 
@@ -329,7 +331,7 @@
             return false;
         }
         // no match
-        throw new IllegalArgumentException( "The Integer did not match either specified value" );
+        throw new IllegalArgumentException( I18n.err( I18n.ERR_04349 ) );
     }
 
 
@@ -371,7 +373,7 @@
             return null;
         }
         // no match
-        throw new IllegalArgumentException( "The Integer did not match any specified value" );
+        throw new IllegalArgumentException( I18n.err( I18n.ERR_04349 ) );
     }
 
 
@@ -431,7 +433,7 @@
             return null;
         }
         // no match
-        throw new IllegalArgumentException( "The Integer did not match any specified value" );
+        throw new IllegalArgumentException( I18n.err( I18n.ERR_04349 ) );
     }
 
 
@@ -738,7 +740,7 @@
             return null;
         }
         // no match
-        throw new IllegalArgumentException( "The String did not match any specified value" );
+        throw new IllegalArgumentException( I18n.err( I18n.ERR_04350 ) );
     }
 
 
@@ -880,7 +882,7 @@
             return false;
         }
         // no match
-        throw new IllegalArgumentException( "The String did not match either specified value" );
+        throw new IllegalArgumentException( I18n.err( I18n.ERR_04350 ) );
     }
 
 
@@ -1103,11 +1105,11 @@
         // Validates input
         if ( array == null )
         {
-            throw new IllegalArgumentException( "The Array must not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04352 ) );
         }
         else if ( array.length == 0 )
         {
-            throw new IllegalArgumentException( "Array is empty" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04352 ) );
         }
 
         // Loops through array, comparing each item
@@ -1156,11 +1158,11 @@
     {
         if ( array == null )
         {
-            throw new IllegalArgumentException( "The Array must not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04351 ) );
         }
         else if ( array.length == 0 )
         {
-            throw new IllegalArgumentException( "Array is empty" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04352 ) );
         }
         boolean[] primitive = null;
         try
@@ -1169,7 +1171,7 @@
         }
         catch ( NullPointerException ex )
         {
-            throw new IllegalArgumentException( "The array must not contain any null elements" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04353 ) );
         }
         return ( xor( primitive ) ? Boolean.TRUE : Boolean.FALSE );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ByteBuffer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ByteBuffer.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ByteBuffer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ByteBuffer.java Sat Mar  6 13:44:54 2010
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.ldap.util;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A dynamically growing byte[]. 
@@ -49,7 +51,7 @@
     {
         if ( initialSize <= 0 )
         {
-            throw new IllegalArgumentException( "initialSize must be greater than zero" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04354 ) );
         }
         this.initialSize = initialSize;
         this.buf = new byte[initialSize];

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/EqualsBuilder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/EqualsBuilder.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/EqualsBuilder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/EqualsBuilder.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,8 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -311,7 +313,7 @@
                 {
                     // this can't happen. Would get a Security exception instead
                     // throw a runtime exception in case the impossible happens.
-                    throw new InternalError( "Unexpected IllegalAccessException" );
+                    throw new InternalError( I18n.err( I18n.ERR_04355 ) );
                 }
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ExceptionUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ExceptionUtils.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ExceptionUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ExceptionUtils.java Sat Mar  6 13:44:54 2010
@@ -33,6 +33,8 @@
 import java.util.List;
 import java.util.StringTokenizer;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -735,7 +737,7 @@
         }
         if ( writer == null )
         {
-            throw new IllegalArgumentException( "The PrintWriter must not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04356 ) );
         }
         String trace[] = getRootCauseStackTrace( throwable );
         for ( int i = 0; i < trace.length; i++ )
@@ -813,7 +815,7 @@
     {
         if ( causeFrames == null || wrapperFrames == null )
         {
-            throw new IllegalArgumentException( "The List must not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04357 ) );
         }
         int causeFrameIndex = causeFrames.size() - 1;
         int wrapperFrameIndex = wrapperFrames.size() - 1;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/GeneralizedTime.java Sat Mar  6 13:44:54 2010
@@ -26,6 +26,8 @@
 import java.util.Calendar;
 import java.util.TimeZone;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>This class represents the generalized time syntax as defined in 
@@ -160,7 +162,7 @@
     {
         if ( calendar == null )
         {
-            throw new IllegalArgumentException( "Calendar must not be null." );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04358 ) );
         }
 
         this.calendar = calendar;
@@ -184,7 +186,7 @@
     {
         if ( generalizedTime == null )
         {
-            throw new ParseException( "generalizedTime is null", 0 );
+            throw new ParseException( I18n.err( I18n.ERR_04359 ), 0 );
         }
 
         this.upGeneralizedTime = generalizedTime;
@@ -200,8 +202,7 @@
 
         if ( upGeneralizedTime.length() < 11 )
         {
-            throw new ParseException(
-                "Generalized Time too short, doesn't contain field 'minute' or 'fraction of hour' or 'timezone'.", 10 );
+            throw new ParseException( I18n.err( I18n.ERR_04360 ), 10 );
         }
 
         // pos 10: 
@@ -217,9 +218,7 @@
 
             if ( upGeneralizedTime.length() < 13 )
             {
-                throw new ParseException(
-                    "Generalized Time too short, doesn't contain field 'second' or 'fraction of minute' or 'timezone'.",
-                    12 );
+                throw new ParseException( I18n.err( I18n.ERR_04361 ), 12 );
             }
 
             // pos 12: 
@@ -235,8 +234,7 @@
 
                 if ( upGeneralizedTime.length() < 15 )
                 {
-                    throw new ParseException(
-                        "Generalized Time too short, doesn't contain field 'fraction of second' or 'timezone'.", 14 );
+                    throw new ParseException( I18n.err( I18n.ERR_04362 ), 14 );
                 }
 
                 // pos 14: 
@@ -262,8 +260,7 @@
                 }
                 else
                 {
-                    throw new ParseException(
-                        "Invalid Time too short, expected field 'fraction of second' or 'timezone'.", 14 );
+                    throw new ParseException( I18n.err( I18n.ERR_04363 ), 14 );
                 }
             }
             else if ( c == '.' || c == ',' )
@@ -283,8 +280,7 @@
             }
             else
             {
-                throw new ParseException(
-                    "Invalid Time too short, expected field 'second' or 'fraction of minute' or 'timezone'.", 12 );
+                throw new ParseException( I18n.err( I18n.ERR_04364 ), 12 );
             }
         }
         else if ( c == '.' || c == ',' )
@@ -304,8 +300,7 @@
         }
         else
         {
-            throw new ParseException(
-                "Invalid Generalized Time, expected field 'minute' or 'fraction of hour' or 'timezone'.", 10 );
+            throw new ParseException( I18n.err( I18n.ERR_04365 ), 10 );
         }
 
         // this calculates and verifies the calendar
@@ -315,7 +310,7 @@
         }
         catch ( IllegalArgumentException iae )
         {
-            throw new ParseException( "Invalid date/time values.", 0 );
+            throw new ParseException( I18n.err( I18n.ERR_04366 ), 0 );
         }
 
         calendar.setLenient( true );
@@ -326,7 +321,7 @@
     {
         if ( upGeneralizedTime.length() < pos + 1 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'timezone'.", pos );
+            throw new ParseException( I18n.err( I18n.ERR_04367 ), pos );
         }
 
         char c = upGeneralizedTime.charAt( pos );
@@ -337,7 +332,7 @@
 
             if ( upGeneralizedTime.length() > pos + 1 )
             {
-                throw new ParseException( "Invalid Generalized Time, expected 'timezone' as the last field.", pos + 1 );
+                throw new ParseException( I18n.err( I18n.ERR_04368 ), pos + 1 );
             }
         }
         else if ( c == '+' || c == '-' )
@@ -362,14 +357,12 @@
             }
             else
             {
-                throw new ParseException(
-                    "Invalid Generalized Time, expected field 'timezone' must contain 2 or 4 digits.", pos );
+                throw new ParseException( I18n.err( I18n.ERR_04369 ), pos );
             }
 
             if ( upGeneralizedTime.length() > pos + 1 + digits.length() )
             {
-                throw new ParseException( "Invalid Generalized Time, expected 'timezone' as the last field.", pos + 1
-                    + digits.length() );
+                throw new ParseException( I18n.err( I18n.ERR_04370 ), pos + 1 + digits.length() );
             }
         }
     }
@@ -436,7 +429,7 @@
         // minimum one digit
         if ( fraction.length() == 0 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain number for 'fraction'.", startIndex );
+            throw new ParseException( I18n.err( I18n.ERR_04371 ), startIndex );
         }
 
         return fraction;
@@ -468,7 +461,7 @@
         // read minute
         if ( upGeneralizedTime.length() < 14 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'second'.", 12 );
+            throw new ParseException( I18n.err( I18n.ERR_04372 ), 12 );
         }
         try
         {
@@ -477,7 +470,7 @@
         }
         catch ( NumberFormatException e )
         {
-            throw new ParseException( "Invalid Generalized Time, field 'second' is not numeric.", 12 );
+            throw new ParseException( I18n.err( I18n.ERR_04373 ), 12 );
         }
     }
 
@@ -487,7 +480,7 @@
         // read minute
         if ( upGeneralizedTime.length() < 12 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'minute'.", 10 );
+            throw new ParseException( I18n.err( I18n.ERR_04374 ), 10 );
         }
         try
         {
@@ -496,7 +489,7 @@
         }
         catch ( NumberFormatException e )
         {
-            throw new ParseException( "Invalid Generalized Time, field 'minute' is not numeric.", 10 );
+            throw new ParseException( I18n.err( I18n.ERR_04375 ), 10 );
         }
     }
 
@@ -505,7 +498,7 @@
     {
         if ( upGeneralizedTime.length() < 10 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'hour'.", 8 );
+            throw new ParseException( I18n.err( I18n.ERR_04376 ), 8 );
         }
         try
         {
@@ -514,7 +507,7 @@
         }
         catch ( NumberFormatException e )
         {
-            throw new ParseException( "Invalid Generalized Time, field 'hour' is not numeric.", 8 );
+            throw new ParseException( I18n.err( I18n.ERR_04377 ), 8 );
         }
     }
 
@@ -523,7 +516,7 @@
     {
         if ( upGeneralizedTime.length() < 8 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'day'.", 6 );
+            throw new ParseException( I18n.err( I18n.ERR_04378 ), 6 );
         }
         try
         {
@@ -532,7 +525,7 @@
         }
         catch ( NumberFormatException e )
         {
-            throw new ParseException( "Invalid Generalized Time, field 'day' is not numeric.", 6 );
+            throw new ParseException( I18n.err( I18n.ERR_04379 ), 6 );
         }
     }
 
@@ -541,7 +534,7 @@
     {
         if ( upGeneralizedTime.length() < 6 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'month'.", 4 );
+            throw new ParseException( I18n.err( I18n.ERR_04380 ), 4 );
         }
         try
         {
@@ -550,7 +543,7 @@
         }
         catch ( NumberFormatException e )
         {
-            throw new ParseException( "Invalid Generalized Time, field 'month' is not numeric.", 4 );
+            throw new ParseException( I18n.err( I18n.ERR_04381 ), 4 );
         }
     }
 
@@ -559,7 +552,7 @@
     {
         if ( upGeneralizedTime.length() < 4 )
         {
-            throw new ParseException( "Generalized Time too short, doesn't contain field 'century/year'.", 0 );
+            throw new ParseException( I18n.err( I18n.ERR_04382 ), 0 );
         }
         try
         {
@@ -568,7 +561,7 @@
         }
         catch ( NumberFormatException e )
         {
-            throw new ParseException( "Invalid Generalized Time, field 'century/year' is not numeric.", 0 );
+            throw new ParseException( I18n.err( I18n.ERR_04383 ), 0 );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/HashCodeBuilder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/HashCodeBuilder.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/HashCodeBuilder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/HashCodeBuilder.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,8 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -145,19 +147,19 @@
         super();
         if ( initialNonZeroOddNumber == 0 )
         {
-            throw new IllegalArgumentException( "HashCodeBuilder requires a non zero initial value" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04384 ) );
         }
         if ( initialNonZeroOddNumber % 2 == 0 )
         {
-            throw new IllegalArgumentException( "HashCodeBuilder requires an odd initial value" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04385 ) );
         }
         if ( multiplierNonZeroOddNumber == 0 )
         {
-            throw new IllegalArgumentException( "HashCodeBuilder requires a non zero multiplier" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04386 ) );
         }
         if ( multiplierNonZeroOddNumber % 2 == 0 )
         {
-            throw new IllegalArgumentException( "HashCodeBuilder requires an odd multiplier" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04387 ) );
         }
         iConstant = multiplierNonZeroOddNumber;
         iTotal = initialNonZeroOddNumber;
@@ -373,7 +375,7 @@
 
         if ( object == null )
         {
-            throw new IllegalArgumentException( "The object to build a hash code for must not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04388 ) );
         }
         HashCodeBuilder builder = new HashCodeBuilder( initialNonZeroOddNumber, multiplierNonZeroOddNumber );
         Class clazz = object.getClass();
@@ -420,7 +422,7 @@
                 {
                     // this can't happen. Would get a Security exception instead
                     // throw a runtime exception in case the impossible happens.
-                    throw new InternalError( "Unexpected IllegalAccessException" );
+                    throw new InternalError( I18n.err( I18n.ERR_04355 ) );
                 }
             }
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributeWrapper.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,8 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.DirContext;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A read only wrapper around an Attributes object.
@@ -74,19 +76,19 @@
 
     public boolean add( Object attrVal )
     {
-        throw new UnsupportedOperationException( "Value addition not supported for immutable attribute" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04392 ) );
     }
 
 
     public boolean remove( Object attrval )
     {
-        throw new UnsupportedOperationException( "Value removal not supported for immutable attribute" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04393 ) );
     }
 
 
     public void clear()
     {
-        throw new UnsupportedOperationException( "Clearing all values not supported for immutable attribute" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04394 ) );
     }
 
 
@@ -104,7 +106,7 @@
 
     public Object clone()
     {
-        throw new IllegalStateException( "Now why would you ever want to clone an immutable object?" );
+        throw new IllegalStateException( I18n.err( I18n.ERR_04395 ) );
     }
 
 
@@ -122,18 +124,18 @@
 
     public Object remove( int ix )
     {
-        throw new UnsupportedOperationException( "Value removal not supported for immutable attribute" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04393 ) );
     }
 
 
     public void add( int ix, Object attrVal )
     {
-        throw new UnsupportedOperationException( "Value addition not supported for immutable attribute" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04392 ) );
     }
 
 
     public Object set( int ix, Object attrVal )
     {
-        throw new UnsupportedOperationException( "Value alteration is not supported for immutable attribute" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04396 ) );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ImmutableAttributesWrapper.java Sat Mar  6 13:44:54 2010
@@ -24,6 +24,8 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * Document me!
@@ -74,25 +76,25 @@
 
     public Attribute put( String attrID, Object val )
     {
-        throw new UnsupportedOperationException( "Putting attributes not supported by immutable attributes" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04389 ) );
     }
 
 
     public Attribute put( Attribute attr )
     {
-        throw new UnsupportedOperationException( "Putting attributes not supported by immutable attributes" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04389 ) );
     }
 
 
     public Attribute remove( String attrID )
     {
-        throw new UnsupportedOperationException( "Removing attributes not supported by immutable attributes" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_04390 ) );
     }
 
 
     public Object clone()
     {
-        throw new IllegalStateException( "Now why would you want to clone() an immutable object in the first place." );
+        throw new IllegalStateException( I18n.err( I18n.ERR_04391 ) );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/JoinIterator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/JoinIterator.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/JoinIterator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/JoinIterator.java Sat Mar  6 13:44:54 2010
@@ -23,6 +23,8 @@
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * An Iterator that joins the results of many iterators.
@@ -51,8 +53,7 @@
     {
         if ( iterators == null || iterators.length < 2 )
         {
-            throw new IllegalArgumentException( "Iterator[] arg must not be "
-                + "null, empty or composed of less than two Iterators" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04397 ) );
         }
 
         if ( iterators != null )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java Sat Mar  6 13:44:54 2010
@@ -32,6 +32,7 @@
 import javax.naming.InvalidNameException;
 
 import org.apache.directory.shared.asn1.codec.binary.Hex;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.util.HttpClientError;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.codec.util.URIException;
@@ -168,7 +169,7 @@
         if ( ( ( pos = StringTools.areEquals( chars, 0, LDAP_SCHEME ) ) == StringTools.NOT_EQUAL )
             && ( ( pos = StringTools.areEquals( chars, 0, LDAPS_SCHEME ) ) == StringTools.NOT_EQUAL ) )
         {
-            throw new LdapURLEncodingException( "A LdapUrl must start with \"ldap://\" or \"ldaps://\"" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04398 ) );
         }
         else
         {
@@ -178,7 +179,7 @@
         // The hostport
         if ( ( pos = parseHostPort( chars, pos ) ) == -1 )
         {
-            throw new LdapURLEncodingException( "The hostport is invalid" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04399 ) );
         }
 
         if ( pos == chars.length )
@@ -189,8 +190,7 @@
         // An optional '/'
         if ( !StringTools.isCharASCII( chars, pos, '/' ) )
         {
-            throw new LdapURLEncodingException( "Bad character, position " + pos + ", '" + chars[pos]
-                + "', '/' expected" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04400, pos, chars[pos] ) );
         }
 
         pos++;
@@ -203,7 +203,7 @@
         // An optional DN
         if ( ( pos = parseDN( chars, pos ) ) == -1 )
         {
-            throw new LdapURLEncodingException( "The DN is invalid" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04401 ) );
         }
 
         if ( pos == chars.length )
@@ -214,15 +214,14 @@
         // Optionals attributes
         if ( !StringTools.isCharASCII( chars, pos, '?' ) )
         {
-            throw new LdapURLEncodingException( "Bad character, position " + pos + ", '" + chars[pos]
-                + "', '?' expected" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
         }
 
         pos++;
 
         if ( ( pos = parseAttributes( chars, pos ) ) == -1 )
         {
-            throw new LdapURLEncodingException( "Attributes are invalid" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04403 ) );
         }
 
         if ( pos == chars.length )
@@ -233,15 +232,14 @@
         // Optional scope
         if ( !StringTools.isCharASCII( chars, pos, '?' ) )
         {
-            throw new LdapURLEncodingException( "Bad character, position " + pos + ", '" + chars[pos]
-                + "', '?' expected" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
         }
 
         pos++;
 
         if ( ( pos = parseScope( chars, pos ) ) == -1 )
         {
-            throw new LdapURLEncodingException( "Scope is invalid" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04404 ) );
         }
 
         if ( pos == chars.length )
@@ -252,8 +250,7 @@
         // Optional filter
         if ( !StringTools.isCharASCII( chars, pos, '?' ) )
         {
-            throw new LdapURLEncodingException( "Bad character, position " + pos + ", '" + chars[pos]
-                + "', '?' expected" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
         }
 
         pos++;
@@ -265,7 +262,7 @@
 
         if ( ( pos = parseFilter( chars, pos ) ) == -1 )
         {
-            throw new LdapURLEncodingException( "Filter is invalid" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04405 ) );
         }
 
         if ( pos == chars.length )
@@ -276,15 +273,14 @@
         // Optional extensions
         if ( !StringTools.isCharASCII( chars, pos, '?' ) )
         {
-            throw new LdapURLEncodingException( "Bad character, position " + pos + ", '" + chars[pos]
-                + "', '?' expected" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
         }
 
         pos++;
 
         if ( ( pos = parseExtensions( chars, pos ) ) == -1 )
         {
-            throw new LdapURLEncodingException( "Extensions are invalid" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04406 ) );
         }
 
         if ( pos == chars.length )
@@ -293,7 +289,7 @@
         }
         else
         {
-            throw new LdapURLEncodingException( "Invalid character at the end of the ldapUrl" );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04407 ) );
         }
     }
 
@@ -308,7 +304,7 @@
     {
         if ( string == null )
         {
-            throw new LdapURLEncodingException( "The string is empty : this is not a valid LdapURL." );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04408 ) );
         }
 
         try
@@ -319,7 +315,7 @@
         }
         catch ( UnsupportedEncodingException uee )
         {
-            throw new LdapURLEncodingException( "Bad Ldap URL : " + string );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04409, string ) );
         }
     }
 
@@ -334,7 +330,7 @@
     {
         if ( ( bytes == null ) || ( bytes.length == 0 ) )
         {
-            throw new LdapURLEncodingException( "The byte array is empty : this is not a valid LdapURL." );
+            throw new LdapURLEncodingException( I18n.err( I18n.ERR_04410 ) );
         }
 
         string = StringTools.utf8ToString( bytes );
@@ -613,12 +609,12 @@
     {
         if ( data == null )
         {
-            throw new IllegalArgumentException( "Parameter may not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04411 ) );
         }
 
         if ( charset == null || charset.length() == 0 )
         {
-            throw new IllegalArgumentException( "charset may not be null or empty" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04412 ) );
         }
 
         try
@@ -660,7 +656,7 @@
 
         if ( data == null )
         {
-            throw new IllegalArgumentException( "Parameter may not be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04411 ) );
         }
 
         try
@@ -669,7 +665,7 @@
         }
         catch ( UnsupportedEncodingException e )
         {
-            throw new HttpClientError( "HttpClient requires ASCII support" );
+            throw new HttpClientError( I18n.err( I18n.ERR_04413 ) );
         }
     }
 
@@ -705,14 +701,14 @@
 
                     if ( u == -1 || l == -1 )
                     {
-                        throw new UrlDecoderException( "Invalid URL encoding" );
+                        throw new UrlDecoderException( I18n.err( I18n.ERR_04414 ) );
                     }
 
                     buffer.write( ( char ) ( ( u << 4 ) + l ) );
                 }
                 catch ( ArrayIndexOutOfBoundsException e )
                 {
-                    throw new UrlDecoderException( "Invalid URL encoding" );
+                    throw new UrlDecoderException( I18n.err( I18n.ERR_04414 ) );
                 }
             }
             else

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/MandatoryAndOptionalComponentsMonitor.java Sat Mar  6 13:44:54 2010
@@ -25,6 +25,8 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 public class MandatoryAndOptionalComponentsMonitor implements ComponentsMonitor
 {
@@ -43,8 +45,7 @@
             {
                 if ( mandatoryComponents[i].equals( optionalComponents[j] ) )
                 {
-                    throw new IllegalArgumentException( "Common element, \"" + mandatoryComponents[i]
-                        + "\" detected for Mandatory and Optional components." );
+                    throw new IllegalArgumentException( I18n.err( I18n.ERR_04415, mandatoryComponents[i] ) );
                 }
             }
         }
@@ -68,7 +69,7 @@
             }
             catch ( IllegalArgumentException e2 )
             {
-                throw new IllegalArgumentException( "Unregistered or previously used component: " + component );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_04416, component ) );
             }
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NamespaceTools.java Sat Mar  6 13:44:54 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.ldap.util;
 
 
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.name.DN;
 
 import java.util.ArrayList;
@@ -134,7 +135,7 @@
         }
         else
         {
-            NamingException e = new NamingException( descendant + " is not ancestually related to context:" + ancestor );
+            NamingException e = new NamingException( I18n.err( I18n.ERR_04417, descendant, ancestor ) );
 
             throw e;
         }
@@ -198,8 +199,7 @@
             {
                 if ( ii == 0 )
                 {
-                    throw new NamingException( "invalid name - a name cannot start with a '+': "
-                        + compositeNameComponent );
+                    throw new NamingException( I18n.err( I18n.ERR_04418, compositeNameComponent ) );
                 }
                 
                 if ( compositeNameComponent.charAt( ii - 1 ) != '\\' )
@@ -256,7 +256,7 @@
             {
                 if ( ii == 0 )
                 {
-                    throw new NamingException( "invalid name - a name cannot start with a '+': " + name );
+                    throw new NamingException( I18n.err( I18n.ERR_04418, name ) );
                 }
                 if ( name.charAt( ii - 1 ) != '\\' )
                 {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NestableDelegate.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NestableDelegate.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NestableDelegate.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NestableDelegate.java Sat Mar  6 13:44:54 2010
@@ -29,6 +29,8 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -48,8 +50,7 @@
     /**
      * Constructor error message.
      */
-    private transient static final String MUST_BE_THROWABLE = "The Nestable implementation passed to the NestableDelegate(Nestable) "
-        + "constructor must extend java.lang.Throwable";
+    private transient static final String MUST_BE_THROWABLE = I18n.err( I18n.ERR_04419 );
 
     /**
      * Holds the reference to the exception or error that we're wrapping (which
@@ -263,15 +264,14 @@
     {
         if ( fromIndex < 0 )
         {
-            throw new IndexOutOfBoundsException( "The start index was out of bounds: " + fromIndex );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_04420, fromIndex ) );
         }
         
         Throwable[] throwables = ExceptionUtils.getThrowables( this.nestable );
         
         if ( fromIndex >= throwables.length )
         {
-            throw new IndexOutOfBoundsException( "The start index was out of bounds: " + fromIndex + " >= "
-                + throwables.length );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_04421, fromIndex, throwables.length ) );
         }
         
         for ( int i = fromIndex; i < throwables.length; i++ )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NoDuplicateKeysMap.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NoDuplicateKeysMap.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NoDuplicateKeysMap.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/NoDuplicateKeysMap.java Sat Mar  6 13:44:54 2010
@@ -23,6 +23,8 @@
 
 import java.util.HashMap;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A Map implementation derived from HashMap that only overrides a single method
@@ -43,7 +45,7 @@
     {
         if ( containsKey( key ) )
         {
-            throw new IllegalArgumentException( "Adding duplicate keys is not permitted." );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_04422 ) );
         }
         else
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/PreferencesDictionary.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/PreferencesDictionary.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/PreferencesDictionary.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/PreferencesDictionary.java Sat Mar  6 13:44:54 2010
@@ -25,6 +25,8 @@
 import java.util.prefs.Preferences;
 import java.util.prefs.BackingStoreException;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A wrapper around Preferences to access it as a Dictionary.
@@ -75,7 +77,7 @@
         }
         catch ( BackingStoreException e )
         {
-            throw new NestableRuntimeException( "can't get keys from prefs", e );
+            throw new NestableRuntimeException( I18n.err( I18n.ERR_04423 ), e );
         }
     }
 
@@ -88,7 +90,7 @@
         }
         catch ( BackingStoreException e )
         {
-            throw new NestableRuntimeException( "can't get keys from prefs", e );
+            throw new NestableRuntimeException( I18n.err( I18n.ERR_04423 ), e );
         }
     }
 
@@ -110,7 +112,7 @@
         }
         catch ( BackingStoreException e )
         {
-            throw new NestableRuntimeException( "can't get keys from prefs", e );
+            throw new NestableRuntimeException( I18n.err( I18n.ERR_04423 ), e );
         }
     }
 
@@ -124,7 +126,7 @@
         }
         catch ( BackingStoreException e )
         {
-            throw new NestableRuntimeException( "can't get keys from prefs", e );
+            throw new NestableRuntimeException( I18n.err( I18n.ERR_04423 ), e );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ReflectionToStringBuilder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ReflectionToStringBuilder.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ReflectionToStringBuilder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/ReflectionToStringBuilder.java Sat Mar  6 13:44:54 2010
@@ -26,6 +26,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * <p>
@@ -674,7 +676,7 @@
                         // instead
                         // throw a runtime exception in case the impossible
                         // happens.
-                        throw new InternalError( "Unexpected IllegalAccessException: " + ex.getMessage() );
+                        throw new InternalError( I18n.err( I18n.ERR_04424, ex.getLocalizedMessage() ) );
                     }
                 }
             }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SequencedHashMap.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SequencedHashMap.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SequencedHashMap.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SequencedHashMap.java Sat Mar  6 13:44:54 2010
@@ -37,6 +37,8 @@
 import java.util.NoSuchElementException;
 import java.util.Set;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A map of objects whose mapping entries are sequenced based on the order in
@@ -960,7 +962,7 @@
                     return pos;
                 default:
                     // should never happen
-                    throw new Error( "bad iterator type: " + returnType );
+                    throw new Error( I18n.err( I18n.ERR_04425, returnType ) );
             }
 
         }
@@ -981,7 +983,7 @@
         {
             if ( ( returnType & REMOVED_MASK ) != 0 )
             {
-                throw new IllegalStateException( "remove() must follow next()" );
+                throw new IllegalStateException( I18n.err( I18n.ERR_04426 ) );
             }
             if ( modCount != expectedModCount )
             {
@@ -1059,7 +1061,7 @@
 
         if ( index < 0 )
         {
-            throw new ArrayIndexOutOfBoundsException( index + " < 0" );
+            throw new ArrayIndexOutOfBoundsException( I18n.err( I18n.ERR_04427, index ) );
         }
 
         // loop to one before the position
@@ -1074,7 +1076,7 @@
         // if sentinel is next, past end of list
         if ( pos.next == sentinel )
         {
-            throw new ArrayIndexOutOfBoundsException( index + " >= " + ( i + 1 ) );
+            throw new ArrayIndexOutOfBoundsException( I18n.err( I18n.ERR_04428, index, ( i + 1 ) ) );
         }
 
         return pos.next;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java?rev=919765&r1=919764&r2=919765&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java Sat Mar  6 13:44:54 2010
@@ -37,6 +37,7 @@
 import javax.naming.InvalidNameException;
 
 import org.apache.directory.shared.asn1.codec.binary.Hex;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.schema.syntaxCheckers.UuidSyntaxChecker;
@@ -850,7 +851,7 @@
     {
         if ( ldapRegex == null )
         {
-            throw new PatternSyntaxException( "Regex was null", "null", -1 );
+            throw new PatternSyntaxException( I18n.err( I18n.ERR_04429 ), "null", -1 );
         }
 
         List<String> any = new ArrayList<String>();
@@ -859,7 +860,7 @@
 
         if ( index == -1 )
         {
-            throw new PatternSyntaxException( "Ldap regex must have wild cards!", remaining, -1 );
+            throw new PatternSyntaxException( I18n.err( I18n.ERR_04430 ), remaining, -1 );
         }
 
         String initialPattern = null;
@@ -3384,16 +3385,14 @@
     {
         if ( str == null || str.length() == 0 )
         {
-            throw new InvalidNameException( "Expected string to start with a '#' character.  " +
-                "Invalid hex encoded string for empty or null string."  );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04431 ) );
         }
         
         char[] chars = str.toCharArray();
         
         if ( chars[0] != '#' )
         {
-            throw new InvalidNameException( "Expected string to start with a '#' character.  " +
-                    "Invalid hex encoded string: " + str  );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04432, str ) );
         }
         
         // the bytes representing the encoded string of hex
@@ -3423,16 +3422,14 @@
     {
         if ( str == null )
         {
-            throw new InvalidNameException( "Expected string to be non-null " +
-            "with valid index."  );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04433 ) );
         }
         
         int length = str.length();
         
         if ( length == 0 )
         {
-            throw new InvalidNameException( "Expected string to be non-empty " +
-            "with valid index."  );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04434 ) );
         }
         
         // create buffer and add everything before start of scan
@@ -3477,7 +3474,7 @@
                 }
                 else
                 {
-                    throw new InvalidNameException( "The DN must contain valid escaped characters." );
+                    throw new InvalidNameException( I18n.err( I18n.ERR_04435 ) );
                 }
             }
             else
@@ -3489,7 +3486,7 @@
         if ( escaped )
         {
             // We should not have a '\' at the end of the string
-            throw new InvalidNameException( "The DN must not ends with a '\\'." );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04436 ) );
         }
 
         return buf.toString();
@@ -3506,16 +3503,14 @@
     {
         if ( str == null )
         {
-            throw new InvalidNameException( "Expected string to be non-null " +
-            "with valid index."  );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04433 ) );
         }
         
         int length = str.length();
         
         if ( length == 0 )
         {
-            throw new InvalidNameException( "Expected string to be non-empty " +
-            "with valid index."  );
+            throw new InvalidNameException( I18n.err( I18n.ERR_04434 ) );
         }
         
         // create buffer and add everything before start of scan
@@ -3541,7 +3536,7 @@
             }
             else
             {
-                throw new InvalidNameException( "The DN must contain valid escaped characters." );
+                throw new InvalidNameException( I18n.err( I18n.ERR_04435 ) );
             }
         }
 



Mime
View raw message