You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2018/06/10 07:43:47 UTC

[directory-ldap-api] branch master updated: Finishing migrating errors and messages to I18n for ldap-codec-core

This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-ldap-api.git


The following commit(s) were added to refs/heads/master by this push:
     new c4ca952  Finishing migrating errors and messages to I18n for ldap-codec-core
c4ca952 is described below

commit c4ca952078034600d9d0556619af75d40a313aab
Author: Emmanuel Lécharny <el...@symas.com>
AuthorDate: Sun Jun 10 09:43:35 2018 +0200

    Finishing migrating errors and messages to I18n for ldap-codec-core
---
 .../java/org/apache/directory/api/i18n/I18n.java   | 29 ++++++++++++-------
 .../apache/directory/api/i18n/errors.properties    | 24 ++++++----------
 .../apache/directory/api/i18n/messages.properties  | 33 ++++++++++++++++++++--
 .../api/ldap/codec/AttributeValueAssertion.java    |  7 ++---
 .../api/ldap/codec/LdapMessageGrammar.java         |  4 +--
 .../search/entryChange/EntryChangeGrammar.java     |  6 ++--
 .../search/pagedSearch/PagedResultsGrammar.java    |  2 +-
 .../persistentSearch/PersistentSearchGrammar.java  |  6 ++--
 .../codec/controls/sort/SortRequestGrammar.java    |  7 +++--
 .../codec/controls/sort/SortResponseGrammar.java   |  3 +-
 .../ldap/codec/decorators/AddRequestDecorator.java |  4 +--
 .../codec/decorators/SearchRequestDecorator.java   |  2 +-
 .../search/AttributeValueAssertionFilter.java      |  2 +-
 13 files changed, 80 insertions(+), 49 deletions(-)

diff --git a/i18n/src/main/java/org/apache/directory/api/i18n/I18n.java b/i18n/src/main/java/org/apache/directory/api/i18n/I18n.java
index 1b68b1a..455c9e8 100644
--- a/i18n/src/main/java/org/apache/directory/api/i18n/I18n.java
+++ b/i18n/src/main/java/org/apache/directory/api/i18n/I18n.java
@@ -153,15 +153,9 @@ public enum I18n
     ERR_03208_TIMEOUT( "ERR_03208_TIMEOUT" ),
 
     // ldap
-    ERR_04060( "ERR_04060" ),
-    ERR_04061( "ERR_04061" ),
-    ERR_04062( "ERR_04062" ),
-    ERR_04063( "ERR_04063" ),
-    ERR_04064( "ERR_04064" ),
     ERR_04065( "ERR_04065" ),
     ERR_04070( "ERR_04070" ),
     ERR_04080( "ERR_04080" ),
-    ERR_04109( "ERR_04109" ),
     ERR_04111( "ERR_04111" ),
     ERR_04112( "ERR_04112" ),
     ERR_04113( "ERR_04113" ),
@@ -301,7 +295,6 @@ public enum I18n
     ERR_04476( "ERR_04476" ),
     ERR_04479_INVALID_SYNTAX_VALUE( "ERR_04479_INVALID_SYNTAX_VALUE" ),
     ERR_04480_END_OF_STREAM( "ERR_04480_END_OF_STREAM" ),
-    ERR_04481_ENTRY_NULL_VALUE( "ERR_04481_ENTRY_NULL_VALUE" ),
     
     // ldap-client-api  4100-
     ERR_4100_TLS_HANDSHAKE_ERROR( "ERR_4100_TLS_HANDSHAKE_ERROR" ),
@@ -309,7 +302,9 @@ public enum I18n
     // api-ldap-codec-core   5000-5999
     // api-ldap-codec-core <>        5000-5099
     ERR_05000_NULL_REQUEST_NAME( "ERR_05000_NULL_REQUEST_NAME" ),
-    
+    ERR_05001_EMPTY_MATCHING_RULE( "ERR_05001_EMPTY_MATCHING_RULE" ),
+    ERR_05002_ENTRY_NULL_VALUE( "ERR_05002_ENTRY_NULL_VALUE" ),
+
     // api-ldap-codec-core actions   5100-5199
     ERR_05100_ZERO_LENGTH_MESSAGE_ID_NOT_ALLOWED( "ERR_05100_ZERO_LENGTH_MESSAGE_ID_NOT_ALLOWED" ),
     ERR_05101_NULL_MESSAGE_ID_NOT_ALLOWED( "ERR_05101_NULL_MESSAGE_ID_NOT_ALLOWED" ),
@@ -401,6 +396,7 @@ public enum I18n
     ERR_05500_NULL_MATCHING_RULE_AND_TYPE( "ERR_05500_NULL_MATCHING_RULE_AND_TYPE" ),
     ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER( "ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER" ),
     ERR_05502_NULL_INITIAL_ANY_OR_FINAL_SUBSTRING( "ERR_05502_NULL_INITIAL_ANY_OR_FINAL_SUBSTRING" ),
+    ERR_05503_UNEXPECTED_FILTER_TYPE( "ERR_05503_UNEXPECTED_FILTER_TYPE" ),
 
     // api-ldap-codec-standalone 6000-6999
     ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY( "ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY" ),
@@ -1222,14 +1218,27 @@ public enum I18n
     MSG_05183_SEARCH_RESULT_REFERENCE_RESPONSE( "MSG_05183_SEARCH_RESULT_REFERENCE_RESPONSE" ),
     MSG_05184_SEARCH_REFERENCE_URL( "MSG_05184_SEARCH_REFERENCE_URL" ),
 
-
     // api-ldap-codec-core api       5200-5299
     MSG_5200_DECODED_LDAP_MESSAGE( "MSG_5200_DECODED_LDAP_MESSAGE" ),
     
     // api-ldap-codec-core controls  5300-5399
+    MSG_05300_CHANGE_TYPE( "MSG_05300_CHANGE_TYPE" ),
+    MSG_05301_PREVIOUS_DN( "MSG_05301_PREVIOUS_DN" ),
+    MSG_05302_CHANGE_NUMBER( "MSG_05302_CHANGE_NUMBER" ),
+    MSG_05303_SIZE( "MSG_05303_SIZE" ),
+    MSG_05304_CHANGE_TYPES( "MSG_05304_CHANGE_TYPES" ),
+    MSG_05305_CHANGES_ONLY( "MSG_05305_CHANGES_ONLY" ),
+    MSG_05306_RETURN_ECS( "MSG_05306_RETURN_ECS" ),
+    MSG_05307_ATTRIBUTE_TYPE_DESC( "MSG_05307_ATTRIBUTE_TYPE_DESC" ),
+    MSG_05308_REVERSE_ORDER( "MSG_05308_REVERSE_ORDER" ),
+    MSG_05309_MATCHING_RULE_OID( "MSG_05309_MATCHING_RULE_OID" ),
+    MSG_05310_ATTRIBUTE_TYPE( "MSG_05310_ATTRIBUTE_TYPE" ),
+
     // api-ldap-codec-core osgi      5400-5499
+    // none
+    
     // api-ldap-codec-core search    5500-5599
-
+    // none
     
     // api-ldap-codec-standalone 6000-6999
     MSG_06000_REGISTERED_CONTROL_FACTORY( "MSG_06000_REGISTERED_CONTROL_FACTORY" ),
diff --git a/i18n/src/main/resources/org/apache/directory/api/i18n/errors.properties b/i18n/src/main/resources/org/apache/directory/api/i18n/errors.properties
index 26c3aac..9e5642a 100644
--- a/i18n/src/main/resources/org/apache/directory/api/i18n/errors.properties
+++ b/i18n/src/main/resources/org/apache/directory/api/i18n/errors.properties
@@ -56,10 +56,6 @@ ERR_01305_ABOVE_4_BYTES_INTEGER=The value is more than 4 bytes long. This is not
 ERR_01306_VALUE_NOT_IN_RANGE=The value is not in the range [{0}, {1}]
 ERR_01307_0_BYTES_LONG_LONG=The value is 0 byte long. This is not allowed for a long
 
-
-
-
-
 # asn1-codec
 ERR_01001=Encoded result is not a ByteBuffer: {0}
 
@@ -120,8 +116,9 @@ ERR_03207_SOMETHING_WRONG_HAPPENED=Message failed: something wrong has occurred
 ERR_03208_TIMEOUT=Timeout has occurred
 
 # ldap
+ERR_04064=Ldap decoder failure: The input stream does not contain a full PDU
+ERR_04065=Ldap encoder failed to encode object: {0}, error: {1}
 ERR_04080=The Referrals must not be null
-ERR_04109=The matching rule is empty
 ERR_04111=Could not parse matchedDn while transforming Codec value to Internal: {0}
 ERR_04112=Error while transforming a ExprNode: {0}
 ERR_04113=shouldn''t happen - if it does then we have issues
@@ -261,13 +258,15 @@ ERR_04475=Expected byte[] to normalize
 ERR_04476=Cannot set an AttributeType {0} when another one ({1}) is already present
 ERR_04479_INVALID_SYNTAX_VALUE= The value ''{0}'' does not respect the AttributeType ''{1}'' syntax
 ERR_04480_END_OF_STREAM=End of stream
-ERR_04481_ENTRY_NULL_VALUE=Entry can''t be null
 
 ERR_4100_TLS_HANDSHAKE_ERROR=The TLS handshake failed
 
 # api-ldap-codec-core   5000-5999
 # api-ldap-codec-core <>        5000-5099
 ERR_05000_NULL_REQUEST_NAME=The request name must not be null
+ERR_05001_EMPTY_MATCHING_RULE=The matching rule is empty
+ERR_05002_ENTRY_NULL_VALUE=Entry can''t be null
+
 
 # api-ldap-codec-core actions   5100-5199
 ERR_05100_ZERO_LENGTH_MESSAGE_ID_NOT_ALLOWED=The messageId has a zero length. This is not allowed
@@ -329,11 +328,6 @@ ERR_05155_FLAG_TYPE_INVALID=The types only flag {0} is invalid: {1}. It should b
 ERR_05156_INVALID_ATTRIBUTE_TYPE=The Attribute type {0} is invalid : {1}
 ERR_05157_INVALID_DN=The Dn {0} is invalid : {1}
 
-ERR_04059=Expected either a byte[] or ByteBuffer argument but got a {0}
-ERR_04061=Ldap decoder failure!
-ERR_04064=Ldap decoder failure: The input stream does not contain a full PDU
-ERR_04065=Ldap encoder failed to encode object: {0}, error: {1}
-
 # api-ldap-codec-core api       5200-5299
 ERR_05200_NOT_INITIALIZED_YET=Not initialized yet!
 ERR_05201_INSTANCE_ALREADY_SET=The LdapCodecService is already set to an instance of {0}
@@ -357,17 +351,15 @@ ERR_05309_RETURN_ECS_DECODING_ERROR=failed to decode the returnECs for PSearchCo
 ERR_05310_INVALID_VISIBILITY_FLAG=The visibility flag {0} is invalid: {1}. It should be 0 or 255
 
 # api-ldap-codec-core osgi      5400-5499
-<<<<<<< HEAD
 ERR_05400_CONTROL_ARGUMENT_WAS_NULL=Control argument was null.
 ERR_05401_FIGURE_OUT_HOW_TO_TRANSFORM=Figure out how to transform
 ERR_05402_UNABLE_TO_ENCODE_RESPONSE_VALUE=Unable to decode encoded response value: {0}
 
-=======
->>>>>>> 85a3c1dba3cb60248666bde279b64019e217a9af
 # api-ldap-codec-core search    5500-5599
 ERR_05500_NULL_MATCHING_RULE_AND_TYPE=Cannot have a null matching rule and a null type
 ERR_05501_MORE_THAN_ONE_FILTER_FOR_NOT_FILTER=Cannot have more than one Filter within a Not Filter
 ERR_05502_NULL_INITIAL_ANY_OR_FINAL_SUBSTRING=Cannot have a null initial, any and final substring
+ERR_05503_UNEXPECTED_FILTER_TYPE=Unexpected filter type: {0}
 
 # api-ldap-codec-standalone 6000-6999
 ERR_06000_FAILED_TO_LOAD_DEFAULT_CODEC_FACTORY=Failed to load default codec factory.
@@ -432,6 +424,8 @@ ERR_08302_BAD_UUID_VALUE_INCORRECT_LENGTH=Bad UUID value, its length is incorrec
 
 # api-ldap-extras-codec-api 9000-9999
 # api-ldap-extras-codec-api <>           9000 -  9099
+# none
+
 # api-ldap-extras-codec-api controls     9100 -  9199
 ERR_9100_UNKNOWN_PASSWORD_POLICY_ERROR=Unknown password policy error value {0}
 ERR_9101_UNKNOWN_MODIFY_DN_OP_TYPE=Unknown modify dn operation type {0}
@@ -447,6 +441,7 @@ ERR_9200_INTERGER_DECODING_FAILURE=Failed to decode INTEGER: {0}
 ERR_9300_UNEXPECTED_SYNCINFO=Unexpected SynchronizationInfo: {0}
 
 # api-ldap-extras-sp 10000-10999
+# none
 
 # api-ldap-extras-trigger 11000-11999
 ERR_11000_TRIGGER_SPECIFICATION_INIT_WITH_NULL=TriggerSpecification cannot be initialized with any NULL argument.
@@ -940,7 +935,6 @@ ERR_16077_SCHEMA_MANAGER_CANT_BE_LOADED=SchemaManager can't be loaded: {0}
 ERR_16078_CANNOT_LOAD_UNKNOWN_SCHEMA=Cannot load the unknown schema {0}
 ERR_16079_INVALID_SCHEMA_OBJECT_CANNOT_BE_LOADED=the SchemaObject {0} cannot be added, it''s not a valid LoadableSchemaObject.
 
-
 # api-utils     17000 - 17999
 ERR_17000_UNEXPECTED_PARSER_CONDITION=Unexpected parser condition throwing IllegalStateException.
 ERR_17001_FAILED_OPEN_JAR_MANIFEST=Failed to open jar file or manifest.
diff --git a/i18n/src/main/resources/org/apache/directory/api/i18n/messages.properties b/i18n/src/main/resources/org/apache/directory/api/i18n/messages.properties
index 8746f34..df7cb99 100644
--- a/i18n/src/main/resources/org/apache/directory/api/i18n/messages.properties
+++ b/i18n/src/main/resources/org/apache/directory/api/i18n/messages.properties
@@ -18,6 +18,7 @@
 #  
 #
 # asn1 api
+# none
 
 # asn1 ber <> 1000-1099
 MSG_01000_TAG_DECODED=Tag {0} has been decoded
@@ -45,6 +46,7 @@ MSG_01100_INTEGER_VALUE=read integer value: {0}
 MSG_01101_BITSTRING_VALUE=BITSTRING value: {0}
 
 # asn1 ber ber 1200-1299
+# none
 
 # asn1 ber tlv 1300-1399
 MSG_01300_BOOLEAN_0X00_0XFF=A boolean must be encoded with a 0x00 or a 0xFF value
@@ -140,7 +142,6 @@ MSG_05137_MODIFYING_DN=Modifying Dn {0}
 MSG_05138_MODIFYING_WITH_NEW_RDN=Modifying with new Rdn {0}
 MSG_05139_NULL_NEW_SUPERIOR=The new superior is null, so we will change the entry
 MSG_05140_NEW_SUPERIOR_DN=New superior Dn {0}
-
 MSG_05141_INITIALIZE_AND_FILTER=Initialize AND filter
 MSG_05142_INITIALIZE_APPROX_FILTER=Initialize Approx Match filter
 MSG_05143_INITIALIZE_ATT_DESC_FILTER=Initialize Assertion Value filter
@@ -190,7 +191,21 @@ MSG_05184_SEARCH_REFERENCE_URL=Search reference URL found: {0}
 MSG_5200_DECODED_LDAP_MESSAGE=Decoded LdapMessage: {0}
 
 # api-ldap-codec-core controls  5300-5399
+MSG_05300_CHANGE_TYPE=changeType = {0}
+MSG_05301_PREVIOUS_DN=previousDN = {0}
+MSG_05302_CHANGE_NUMBER=changeNumber = {0}
+MSG_05303_SIZE=size = {0}
+MSG_05304_CHANGE_TYPES=changeTypes = {0}
+MSG_05305_CHANGES_ONLY=changesOnly = {0}
+MSG_05306_RETURN_ECS=returnECs = {0}
+MSG_05307_ATTRIBUTE_TYPE_DESC=AttributeTypeDesc = {0}
+MSG_05308_REVERSE_ORDER=ReverseOrder = {0}
+MSG_05309_MATCHING_RULE_OID=MatchingRuleOid = {0}
+MSG_05310_ATTRIBUTE_TYPE=AttributeType = {0}
+
 # api-ldap-codec-core osgi      5400-5499
+# none
+
 # api-ldap-codec-core search    5500-5599
 
 # api-ldap-codec-standalone 6000-6999
@@ -203,6 +218,7 @@ MSG_06005_EXTENDED_OP_FACTORY_ALREADY_LOADED=Factory for extended operation {0}
 MSG_06006_INTERMEDIATE_FACTORY_ALREADY_LOADED=Factory for Intermediate Response {0} was already loaded
 
 # api-ldap-extras-aci   7000-7999
+# none
 
 # api-ldap-extras-codec 8000-8999
 # api-ldap-extras-codec <>           8000-8099
@@ -248,18 +264,29 @@ MSG_08302_UUID=UUID = {0}
 
 # api-ldap-extras-codec-api 9000-9999
 # api-ldap-extras-codec-api <>           9000 -  9099
+# none
+
 # api-ldap-extras-codec-api controls     9100 -  9199
+# none
+
 # api-ldap-extras-codec-api extended     9200 -  9299
-# api-ldap-extras-codec-api intermediate 9300 -  9399
+# none
 
+# api-ldap-extras-codec-api intermediate 9300 -  9399
+# none
 
 # api-ldap-extras-sp 10000-10999
+# none
 
 # api-ldap-extras-trigger 11000-11999
+# none
 
 # api-ldap-extra-utils <> 12000-12999
+# none
 
 # api-ldap-model <> 13000-13999
+# none
+
 # api-ldap-model cursor       13100-13199
 MSG_13100_CLOSING_EMPTY_CURSOR=Closing EmptyCursor {0}
 MSG_13101_CLOSING_LIST_CURSOR=Closing ListCursor {0}
@@ -277,6 +304,7 @@ MSG_13202_AT_IS_NULL=The attributeType is null
 MSG_13203_MISSING_ATTRIBUTE_IN_ENTRY=The attribute ''{0}'' does not exist in the entry
 
 # api-ldap-model filter       13300-13399
+# none
 
 # api-ldap-model ldif         13400-13499
 MSG_13400_LDIF_VERSION=Ldif version: {0}
@@ -299,6 +327,7 @@ MSG_13414_LDIF_FILE_EMPTY=The ldif file is empty
 MSG_13500_ATTRIBUTE_NOT_IN_SCHEMA=Requested attribute {0} does not exist in the schema, it will be ignored
 
 # api-ldap-model name         13600-13699
+# none
 
 # api-ldap-model schema       13700-13899
 MSG_13700_FAILED_TO_NORMALIZE=Failed to normalize: {0}
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/AttributeValueAssertion.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/AttributeValueAssertion.java
index 60165da..da9cc95 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/AttributeValueAssertion.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/AttributeValueAssertion.java
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.codec;
 
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.codec.api.LdapCodecConstants;
 import org.apache.directory.api.ldap.model.entry.Value;
 import org.apache.directory.api.util.Strings;
@@ -70,10 +71,6 @@ public class AttributeValueAssertion
             {
                 return ( ( Value ) object ).getValue();
             }
-            else if ( object instanceof Value )
-            {
-                return Strings.dumpBytes( ( ( Value ) object ).getBytes() );
-            }
             else
             {
                 return "<unknown type>";
@@ -160,7 +157,7 @@ public class AttributeValueAssertion
                 break;
 
             default:
-                throw new IllegalArgumentException( "Unexpected filter type: " + filterType );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_05503_UNEXPECTED_FILTER_TYPE, filterType ) );
         }
 
         sb.append( dumpObject( assertion ) );
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/LdapMessageGrammar.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/LdapMessageGrammar.java
index 8b8e9a6..e2952f2 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/LdapMessageGrammar.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/LdapMessageGrammar.java
@@ -4868,11 +4868,11 @@ public final class LdapMessageGrammar extends
 
                     if ( tlv.getLength() == 0 )
                     {
-                        String msg = I18n.err( I18n.ERR_04109 );
+                        String msg = I18n.err( I18n.ERR_05001_EMPTY_MATCHING_RULE );
                         LOG.error( msg );
 
                         // It will generate a PROTOCOL_ERROR
-                        throw new DecoderException( I18n.err( I18n.ERR_04109 ) );
+                        throw new DecoderException( msg );
                     }
                     else
                     {
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/entryChange/EntryChangeGrammar.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/entryChange/EntryChangeGrammar.java
index 2bc53aa..d7bc995 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/entryChange/EntryChangeGrammar.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/entryChange/EntryChangeGrammar.java
@@ -110,7 +110,7 @@ public final class EntryChangeGrammar extends AbstractGrammar<EntryChangeContain
 
                                     if ( LOG.isDebugEnabled() )
                                     {
-                                        LOG.debug( "changeType = " + changeType );
+                                        LOG.debug( I18n.msg( I18n.MSG_05300_CHANGE_TYPE, changeType ) );
                                     }
 
                                     container.getEntryChangeDecorator().setChangeType( changeType );
@@ -180,7 +180,7 @@ public final class EntryChangeGrammar extends AbstractGrammar<EntryChangeContain
 
                             if ( LOG.isDebugEnabled() )
                             {
-                                LOG.debug( "previousDN = " + previousDn );
+                                LOG.debug( I18n.msg( I18n.MSG_05301_PREVIOUS_DN, previousDn ) );
                             }
 
                             container.getEntryChangeDecorator().setPreviousDn( previousDn );
@@ -205,7 +205,7 @@ public final class EntryChangeGrammar extends AbstractGrammar<EntryChangeContain
 
                     if ( LOG.isDebugEnabled() )
                     {
-                        LOG.debug( "changeNumber = " + changeNumber );
+                        LOG.debug( I18n.msg( I18n.MSG_05302_CHANGE_NUMBER, changeNumber ) );
                     }
 
                     container.getEntryChangeDecorator().setChangeNumber( changeNumber );
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/pagedSearch/PagedResultsGrammar.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/pagedSearch/PagedResultsGrammar.java
index 13aa5d0..a818cef 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/pagedSearch/PagedResultsGrammar.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/pagedSearch/PagedResultsGrammar.java
@@ -113,7 +113,7 @@ public final class PagedResultsGrammar extends AbstractGrammar<PagedResultsConta
 
                             if ( LOG.isDebugEnabled() )
                             {
-                                LOG.debug( "size = " + size );
+                                LOG.debug( I18n.msg( I18n.MSG_05303_SIZE, size ) );
                             }
 
                             container.getDecorator().setSize( size );
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/persistentSearch/PersistentSearchGrammar.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/persistentSearch/PersistentSearchGrammar.java
index 347d2f3..8560982 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/persistentSearch/PersistentSearchGrammar.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/search/persistentSearch/PersistentSearchGrammar.java
@@ -116,7 +116,7 @@ public final class PersistentSearchGrammar extends AbstractGrammar<PersistentSea
 
                             if ( LOG.isDebugEnabled() )
                             {
-                                LOG.debug( "changeTypes = " + changeTypes );
+                                LOG.debug( I18n.msg( I18n.MSG_05304_CHANGE_TYPES, changeTypes ) );
                             }
 
                             container.getPersistentSearchDecorator().setChangeTypes( changeTypes );
@@ -154,7 +154,7 @@ public final class PersistentSearchGrammar extends AbstractGrammar<PersistentSea
 
                             if ( LOG.isDebugEnabled() )
                             {
-                                LOG.debug( "changesOnly = " + changesOnly );
+                                LOG.debug( I18n.msg( I18n.MSG_05305_CHANGES_ONLY, changesOnly ) );
                             }
 
                             container.getPersistentSearchDecorator().setChangesOnly( changesOnly );
@@ -192,7 +192,7 @@ public final class PersistentSearchGrammar extends AbstractGrammar<PersistentSea
 
                             if ( LOG.isDebugEnabled() )
                             {
-                                LOG.debug( "returnECs = " + returnECs );
+                                LOG.debug( I18n.msg( I18n.MSG_05306_RETURN_ECS, returnECs ) );
                             }
 
                             container.getPersistentSearchDecorator().setReturnECs( returnECs );
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
index a3abdea..5a770ca 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
@@ -32,6 +32,7 @@ import org.apache.directory.api.asn1.ber.tlv.BerValue;
 import org.apache.directory.api.asn1.ber.tlv.BooleanDecoder;
 import org.apache.directory.api.asn1.ber.tlv.BooleanDecoderException;
 import org.apache.directory.api.asn1.ber.tlv.UniversalTag;
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.message.controls.SortKey;
 import org.apache.directory.api.util.Strings;
 import org.slf4j.Logger;
@@ -69,7 +70,7 @@ public final class SortRequestGrammar extends AbstractGrammar<SortRequestContain
                 
                 if ( LOG.isDebugEnabled() )
                 {
-                    LOG.debug( "AttributeTypeDesc = " + atDesc );
+                    LOG.debug( I18n.msg( I18n.MSG_05307_ATTRIBUTE_TYPE_DESC, atDesc ) );
                 }
 
                 SortKey sk = new SortKey( atDesc );
@@ -94,7 +95,7 @@ public final class SortRequestGrammar extends AbstractGrammar<SortRequestContain
 
                     if ( LOG.isDebugEnabled() )
                     {
-                        LOG.debug( "ReverseOrder = " + reverseOrder );
+                        LOG.debug( I18n.msg( I18n.MSG_05308_REVERSE_ORDER, reverseOrder ) );
                     }
 
                     container.getCurrentKey().setReverseOrder( reverseOrder );
@@ -142,7 +143,7 @@ public final class SortRequestGrammar extends AbstractGrammar<SortRequestContain
 
                         if ( LOG.isDebugEnabled() )
                         {
-                            LOG.debug( "MatchingRuleOid = " + matchingRuleOid );
+                            LOG.debug( I18n.msg( I18n.MSG_05309_MATCHING_RULE_OID, matchingRuleOid ) );
                         }
 
                         container.getCurrentKey().setMatchingRuleId( matchingRuleOid );
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
index 991a08d..7faf844 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
@@ -27,6 +27,7 @@ import org.apache.directory.api.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.api.asn1.ber.grammar.GrammarTransition;
 import org.apache.directory.api.asn1.ber.tlv.BerValue;
 import org.apache.directory.api.asn1.ber.tlv.UniversalTag;
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -79,7 +80,7 @@ public final class SortResponseGrammar extends AbstractGrammar<SortResponseConta
 
                         if ( LOG.isDebugEnabled() )
                         {
-                            LOG.debug( "AttributeType = " + atType );
+                            LOG.debug( I18n.msg( I18n.MSG_05310_ATTRIBUTE_TYPE, atType ) );
                         }
                         
                         container.getControl().setAttributeName( atType );
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/AddRequestDecorator.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/AddRequestDecorator.java
index 3af6231..22cba9e 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/AddRequestDecorator.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/AddRequestDecorator.java
@@ -292,7 +292,7 @@ public final class AddRequestDecorator extends SingleReplyRequestDecorator<AddRe
 
         if ( entry == null )
         {
-            throw new IllegalArgumentException( I18n.err( I18n.ERR_04481_ENTRY_NULL_VALUE ) );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_05002_ENTRY_NULL_VALUE ) );
         }
 
         dnBytes = Strings.getBytesUtf8( entry.getDn().getName() );
@@ -450,7 +450,7 @@ public final class AddRequestDecorator extends SingleReplyRequestDecorator<AddRe
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !", boe );
+            throw new EncoderException( I18n.err( I18n.ERR_08212_PDU_BUFFER_TOO_SMALL, boe.getMessage() ) );
         }
     }
 }
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java
index 0461796..b9352ef 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/decorators/SearchRequestDecorator.java
@@ -403,7 +403,7 @@ public class SearchRequestDecorator extends MessageDecorator<SearchRequest> impl
                             break;
 
                         default:
-                            throw new IllegalArgumentException( "Unexpected filter type: " + filterType );
+                            throw new IllegalArgumentException( I18n.err( I18n.ERR_05503_UNEXPECTED_FILTER_TYPE, filterType ) );
                     }
 
                 }
diff --git a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java
index ae74966..72faf2d 100644
--- a/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java
+++ b/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/search/AttributeValueAssertionFilter.java
@@ -211,7 +211,7 @@ public class AttributeValueAssertionFilter extends Filter
                     break;
 
                 default:
-                    throw new IllegalArgumentException( "Unexpected filter type: " + filterType );
+                    throw new IllegalArgumentException( I18n.err( I18n.ERR_05503_UNEXPECTED_FILTER_TYPE, filterType ) );
             }
 
             buffer.put( TLV.getBytes( avaLength ) );

-- 
To stop receiving notification emails like this one, please contact
elecharny@apache.org.