From commits-return-49187-archive-asf-public=cust-asf.ponee.io@directory.apache.org Sat Mar 24 18:44:58 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0503318064F for ; Sat, 24 Mar 2018 18:44:56 +0100 (CET) Received: (qmail 66331 invoked by uid 500); 24 Mar 2018 17:44:56 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 66319 invoked by uid 99); 24 Mar 2018 17:44:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Mar 2018 17:44:56 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 5D08E8088A; Sat, 24 Mar 2018 17:44:55 +0000 (UTC) Date: Sat, 24 Mar 2018 17:44:55 +0000 To: "commits@directory.apache.org" Subject: [directory-ldap-api] branch master updated: Refactored err/msg for ldap/model/name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152191349532.9569.10469131728618293067@gitbox.apache.org> From: elecharny@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: directory-ldap-api X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 2e23b5aa94dc8cef8858eddc6e61299599f89220 X-Git-Newrev: 98f7a1a3b67037268462adfc1e1d7a70bdf6a0ae X-Git-Rev: 98f7a1a3b67037268462adfc1e1d7a70bdf6a0ae X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 98f7a1a Refactored err/msg for ldap/model/name 98f7a1a is described below commit 98f7a1a3b67037268462adfc1e1d7a70bdf6a0ae Author: Emmanuel Lécharny AuthorDate: Sat Mar 24 18:44:44 2018 +0100 Refactored err/msg for ldap/model/name --- .../java/org/apache/directory/api/i18n/I18n.java | 129 +++++++++++---------- .../apache/directory/api/i18n/errors.properties | 54 +++++---- .../apache/directory/api/ldap/model/name/Ava.java | 52 ++++----- .../apache/directory/api/ldap/model/name/Dn.java | 12 +- .../api/ldap/model/name/FastDnParser.java | 22 ++-- .../apache/directory/api/ldap/model/name/Rdn.java | 13 +-- 6 files changed, 145 insertions(+), 137 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 26af843..f1e1b13 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 @@ -98,42 +98,42 @@ public enum I18n //ERR_00041_CURRENT_LENGTH_EXCEED_EXPECTED_LENGTH( "ERR_00041_CURRENT_LENGTH_EXCEED_EXPECTED_LENGTH" ), // dsml-parser - ERR_03001( "ERR_03001"), - ERR_03002( "ERR_03002"), - ERR_03003( "ERR_03003"), - ERR_03004( "ERR_03004"), - ERR_03005( "ERR_03005"), - ERR_03006( "ERR_03006"), - ERR_03007( "ERR_03007"), - ERR_03008( "ERR_03008"), - ERR_03009( "ERR_03009"), - ERR_03010( "ERR_03010"), - ERR_03011( "ERR_03011"), - ERR_03012( "ERR_03012"), - ERR_03013( "ERR_03013"), - ERR_03014( "ERR_03014"), - ERR_03015( "ERR_03015"), - ERR_03016( "ERR_03016"), - ERR_03017( "ERR_03017"), - ERR_03018( "ERR_03018"), - ERR_03019( "ERR_03019"), - ERR_03020( "ERR_03020"), - ERR_03021( "ERR_03021"), - ERR_03022( "ERR_03022"), - ERR_03023( "ERR_03023"), - ERR_03024( "ERR_03024"), - ERR_03025( "ERR_00025"), - ERR_03026( "ERR_03026"), - ERR_03027( "ERR_03027"), - ERR_03028( "ERR_03028"), - ERR_03029( "ERR_03029"), - ERR_03030( "ERR_03030"), - ERR_03031( "ERR_03031"), - ERR_03032( "ERR_03032"), - ERR_03033( "ERR_03033"), - ERR_03034( "ERR_03034"), - ERR_03035( "ERR_03035"), - ERR_03036( "ERR_03036"), + ERR_03001( "ERR_03001" ), + ERR_03002( "ERR_03002" ), + ERR_03003( "ERR_03003" ), + ERR_03004( "ERR_03004" ), + ERR_03005( "ERR_03005" ), + ERR_03006( "ERR_03006" ), + ERR_03007( "ERR_03007" ), + ERR_03008( "ERR_03008" ), + ERR_03009( "ERR_03009" ), + ERR_03010( "ERR_03010" ), + ERR_03011( "ERR_03011" ), + ERR_03012( "ERR_03012" ), + ERR_03013( "ERR_03013" ), + ERR_03014( "ERR_03014" ), + ERR_03015( "ERR_03015" ), + ERR_03016( "ERR_03016" ), + ERR_03017( "ERR_03017" ), + ERR_03018( "ERR_03018" ), + ERR_03019( "ERR_03019" ), + ERR_03020( "ERR_03020" ), + ERR_03021( "ERR_03021" ), + ERR_03022( "ERR_03022" ), + ERR_03023( "ERR_03023" ), + ERR_03024( "ERR_03024" ), + ERR_03025( "ERR_00025" ), + ERR_03026( "ERR_03026" ), + ERR_03027( "ERR_03027" ), + ERR_03028( "ERR_03028" ), + ERR_03029( "ERR_03029" ), + ERR_03030( "ERR_03030" ), + ERR_03031( "ERR_03031" ), + ERR_03032( "ERR_03032" ), + ERR_03033( "ERR_03033" ), + ERR_03034( "ERR_03034" ), + ERR_03035( "ERR_03035" ), + ERR_03036( "ERR_03036" ), ERR_03037( "ERR_03037" ), ERR_03038( "ERR_03038" ), ERR_03039( "ERR_03039" ), @@ -309,34 +309,9 @@ public enum I18n ERR_04182( "ERR_04182" ), ERR_04183( "ERR_04183" ), ERR_04184( "ERR_04184" ), - ERR_04188( "ERR_04188" ), ERR_04189( "ERR_04189" ), ERR_04190( "ERR_04190" ), ERR_04191( "ERR_04191" ), - ERR_04192( "ERR_04192" ), - ERR_04193( "ERR_04193" ), - ERR_04194( "ERR_04194" ), - ERR_04195( "ERR_04195" ), - ERR_04196( "ERR_04196" ), - ERR_04197( "ERR_04197" ), - ERR_04198( "ERR_04198" ), - ERR_04199( "ERR_04199" ), - ERR_04200( "ERR_04200" ), - ERR_04201( "ERR_04201" ), - ERR_04202( "ERR_04202" ), - ERR_04203( "ERR_04203" ), - ERR_04204( "ERR_04204" ), - ERR_04205( "ERR_04205" ), - ERR_04206( "ERR_04206" ), - ERR_04207( "ERR_04207" ), - ERR_04208( "ERR_04208" ), - ERR_04209_EMPTY_TYPE_NOT_ALLOWED( "ERR_04209_EMPTY_TYPE_NOT_ALLOWED" ), - ERR_04210( "ERR_04210" ), - ERR_04211( "ERR_04211" ), - ERR_04212( "ERR_04212" ), - ERR_04213( "ERR_04213" ), - ERR_04214( "ERR_04214" ), - ERR_04215( "ERR_04215" ), ERR_04216( "ERR_04216" ), ERR_04217( "ERR_04217" ), ERR_04218( "ERR_04218" ), @@ -562,7 +537,7 @@ public enum I18n ERR_12014_BASE64_DN_EXPECTED( "ERR_12014_BASE64_DN_EXPECTED" ), ERR_12015_INVALID_BASE64_DN( "ERR_12015_INVALID_BASE64_DN" ), ERR_12080( "ERR_12080" ), - ERR_12087( "ERR_12087 "), + ERR_12087( "ERR_12087 " ), // api-ldap-model 13000 - 13999 // cursor 13100 - 13199 @@ -751,6 +726,36 @@ public enum I18n ERR_13515_UNEXPECTED_MOD_OP( "ERR_13515_UNEXPECTED_MOD_OP" ), ERR_13516_UNEXPECTED_MESSAGE_TYPE( "ERR_13516_UNEXPECTED_MESSAGE_TYPE" ), + // name 13600 - 13699 + ERR_13600_TYPE_IS_NULL_OR_EMPTY( "ERR_13600_TYPE_IS_NULL_OR_EMPTY" ), + ERR_13601_EXPECTED_COMMA_SEMI_COLON( "ERR_13601_EXPECTED_COMMA_SEMI_COLON" ), + ERR_13602_RDN_EMPTY( "ERR_13602_RDN_EMPTY" ), + ERR_13603_NULL_RDN( "ERR_13603_NULL_RDN" ), + ERR_13604_START_AT_EXPECTED( "ERR_13604_START_AT_EXPECTED" ), + ERR_13605_START_AT_DESCR_EXPECTED( "ERR_13605_START_AT_DESCR_EXPECTED" ), + ERR_13606_EXPECTED_NUMERICOID( "ERR_13606_EXPECTED_NUMERICOID" ), + ERR_13607_DOT_MISSING_IN_OID( "ERR_13607_DOT_MISSING_IN_OID" ), + ERR_13608_START_AT_NUMERICOID_EXPECTED( "ERR_13608_START_AT_NUMERICOID_EXPECTED" ), + ERR_13609_EQUAL_EXPECTED( "ERR_13609_EQUAL_EXPECTED" ), + ERR_13610_NO_MORE_CHAR_AVAILABLE( "ERR_13610_NO_MORE_CHAR_AVAILABLE" ), + ERR_13611_VALUE_MISSING_ON_RDN( "ERR_13611_VALUE_MISSING_ON_RDN" ), + ERR_13612_POSITION_NOT_IN_RANGE( "ERR_13612_POSITION_NOT_IN_RANGE" ), + ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER( "ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER" ), + ERR_13614_VALUE_NOT_IN_HEX_FORM( "ERR_13614_VALUE_NOT_IN_HEX_FORM" ), + ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED( "ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED" ), + ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL( "ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL" ), + ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL( "ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL" ), + ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL( "ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL" ), + ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL( "ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL" ), + ERR_13620_CANNOT_NORMALIZE_VALUE( "ERR_13620_CANNOT_NORMALIZE_VALUE" ), + ERR_13621_ASSERTION_FAILURE( "ERR_13621_ASSERTION_FAILURE" ), + ERR_13622_DN_OR_RDN_NULL( "ERR_13622_DN_OR_RDN_NULL" ), + ERR_13623_INVALID_POSITION( "ERR_13623_INVALID_POSITION" ), + ERR_13624_CANNOT_SERIALIZE_NULL_DN( "ERR_13624_CANNOT_SERIALIZE_NULL_DN" ), + ERR_13625_INVALID_RDN( "ERR_13625_INVALID_RDN" ), + ERR_13626_INVALID_RDN_DUPLICATE_AVA( "ERR_13626_INVALID_RDN_DUPLICATE_AVA" ), + + // api-ldap-net-mina 14000 - 14999 // api-ldap-schema-converter 15000 - 15999 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 72dbe9c..936f438 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 @@ -275,34 +275,9 @@ ERR_04181=Count not find the Provider class {0} ERR_04182=Count not invoke the Provider''s factory method: {0}.getProvider() - it may not exist! ERR_04183=Count not invoke the Provider''s factory method: {0}.getProvider() - it does seem to be a public method! ERR_04184=Call to Provider''s factory method: {0}.getProvider() threw the following exception:\n{1} -ERR_04188=The type cannot be empty or null ERR_04189=The User Provided type cannot be empty or null ERR_04190=The User provided name does not contains an ''='' ERR_04191=The AVA type cannot be null or empty -ERR_04192=Unexpected character ''{0}'' at position {1}. Excpected '','' or '';''. -ERR_04193=RDN must not be empty -ERR_04194=RDN must not be null -ERR_04195=Unexpected character ''{0}'' at position {1}. Excpected start of attributeType. -ERR_04196=Unexpected character ''{0}'' at position {1}. Excpected start of attributeType descr. -ERR_04197=Unexpected character ''{0}'' at position {1}. Excpected numericoid. -ERR_04198=Numeric OID must contain at least one dot. -ERR_04199=Unexpected character ''{0}'' at position {1}. Excpected start of attributeType numericoid. -ERR_04200=Unexpected character ''{0}'' at position {1}. Excpected EQUALS ''=''. -ERR_04201=No more characters available at position {0} -ERR_04202=A value is missing on some RDN -ERR_04203=Impossible to get the position {0}, the DN only has {1} RDNs -ERR_04204=Failed to parse RDN for name {0} -ERR_04205=Exceeded number of elements in the current object -ERR_04206=The posn({0}) should be in the range [0, {1}] -ERR_04207=The clone operation has failed -ERR_04208=Assertion failure: cannot clone the object -ERR_04209_EMPTY_TYPE_NOT_ALLOWED=Empty type not allowed in a DN -ERR_04210=Cannot serialize a NULL DN -ERR_04211=The DN should have been normalized before being serialized -ERR_04212=The DN should have been normalized before being serialized {0} -ERR_04213=This value is not in hex form, we have an odd number of hex chars -ERR_04214=This value is not in hex form -ERR_04215=Unescaped special characters are not allowed ERR_04216=This class is not aware of schema information and cannot normalize ERR_04217=None of the arguments are Comparable objects:\n\targ1 \= {0}\n\targ2 \= {1} ERR_04218=I do not know how to handle dn comparisons with objects of class: {0} @@ -720,6 +695,35 @@ ERR_13514_UNKNOWN_SORT_RESPONSE_RESULT=Unknown sort response result code {0} ERR_13515_UNEXPECTED_MOD_OP=Unexpected ModificationOperation ERR_13516_UNEXPECTED_MESSAGE_TYPE=Unexpected MessageTypeEnum {0} +# name 13600-13699 +ERR_13600_TYPE_IS_NULL_OR_EMPTY=The type cannot be empty or null +ERR_13601_EXPECTED_COMMA_SEMI_COLON=Unexpected character ''{0}'' at position {1}. Excpected '','' or '';''. +ERR_13602_RDN_EMPTY=RDN must not be empty +ERR_13603_NULL_RDN=RDN must not be null +ERR_13604_START_AT_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected start of attributeType. +ERR_13605_START_AT_DESCR_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected start of attributeType descr. +ERR_13606_EXPECTED_NUMERICOID=Unexpected character ''{0}'' at position {1}. Expected numericoid. +ERR_13607_DOT_MISSING_IN_OID=Numeric OID must contain at least one dot. +ERR_13608_START_AT_NUMERICOID_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected start of attributeType numericoid. +ERR_13609_EQUAL_EXPECTED=Unexpected character ''{0}'' at position {1}. Expected EQUALS ''=''. +ERR_13610_NO_MORE_CHAR_AVAILABLE=No more characters available at position {0} +ERR_13611_VALUE_MISSING_ON_RDN=A value is missing on some RDN +ERR_13612_POSITION_NOT_IN_RANGE=The posn({0}) should be in the range [0, {1}] +ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER=This value is not in hex form, we have an odd number of hex chars +ERR_13614_VALUE_NOT_IN_HEX_FORM=This value is not in hex form +ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED=Unescaped special characters are not allowed +ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL=Cannot serialize an wrong ATAV, the upName should not be null or empty +ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL=Cannot serialize an wrong ATAV, the upType should not be null or empty +ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL=Cannot serialize an wrong ATAV, the normType should not be null or empty +ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL=Cannot serialize an wrong ATAV, the value should not be null +ERR_13620_CANNOT_NORMALIZE_VALUE=Cannot normalize the value +ERR_13621_ASSERTION_FAILURE=Assertion failure +ERR_13622_DN_OR_RDN_NULL=Either the dn or the rdn is null +ERR_13623_INVALID_POSITION=Invalid position: {0} +ERR_13624_CANNOT_SERIALIZE_NULL_DN_=Cannot serialize a NULL Dn"; +ERR_13625_INVALID_RDN=Invalid RDN +ERR_13626_INVALID_RDN_DUPLICATE_AVA=Invalid RDN: the {0} is already present in the RDN + # api-ldap-net-mina 14000-14999 # api-ldap-schema-converter 15000-15999 diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Ava.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Ava.java index f10376e..14f231e 100644 --- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Ava.java +++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Ava.java @@ -228,7 +228,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapException le ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le ); } @@ -239,7 +239,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapInvalidAttributeValueException liave ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, liave ); } @@ -277,7 +277,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapException le ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le ); } @@ -288,7 +288,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapInvalidAttributeValueException liave ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, liave ); } @@ -343,7 +343,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapException le ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le ); } @@ -354,7 +354,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapInvalidAttributeValueException liave ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, liave ); } @@ -391,7 +391,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapException le ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le ); } @@ -402,7 +402,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapInvalidAttributeValueException liave ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, liave ); } @@ -471,7 +471,7 @@ public class Ava implements Externalizable, Cloneable, Comparable { if ( Strings.isEmpty( normTypeTrimmed ) ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message ); } @@ -604,7 +604,7 @@ public class Ava implements Externalizable, Cloneable, Comparable { if ( Strings.isEmpty( normTypeTrimmed ) ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message ); } @@ -666,7 +666,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } else { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le ); } @@ -688,7 +688,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapException le ) { - String message = I18n.err( I18n.ERR_04188 ); + String message = I18n.err( I18n.ERR_13600_TYPE_IS_NULL_OR_EMPTY ); LOG.error( message ); throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le ); } @@ -1450,7 +1450,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( CloneNotSupportedException cnse ) { - throw new Error( "Assertion failure", cnse ); + throw new Error( I18n.err( I18n.ERR_13621_ASSERTION_FAILURE ), cnse ); } } @@ -1560,7 +1560,7 @@ public class Ava implements Externalizable, Cloneable, Comparable } catch ( LdapException le ) { - LOG.error( "Cannot normalize the value", le.getMessage() ); + LOG.error( I18n.err( I18n.ERR_13620_CANNOT_NORMALIZE_VALUE ), le.getMessage() ); return false; } } @@ -1600,23 +1600,23 @@ public class Ava implements Externalizable, Cloneable, Comparable || Strings.isEmpty( normType ) || ( value.isNull() ) ) { - String message = "Cannot serialize an wrong ATAV, "; + String message; if ( Strings.isEmpty( upName ) ) { - message += "the upName should not be null or empty"; + message = I18n.err( I18n.ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL ); } else if ( Strings.isEmpty( upType ) ) { - message += "the upType should not be null or empty"; + message = I18n.err( I18n.ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL ); } else if ( Strings.isEmpty( normType ) ) { - message += "the normType should not be null or empty"; + message = I18n.err( I18n.ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL ); } - else if ( value.isNull() ) + else { - message += "the value should not be null"; + message = I18n.err( I18n.ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL ); } LOG.error( message ); @@ -1833,23 +1833,23 @@ public class Ava implements Externalizable, Cloneable, Comparable || Strings.isEmpty( normType ) || ( value.isNull() ) ) { - String message = "Cannot serialize a wrong ATAV, "; + String message; if ( Strings.isEmpty( upName ) ) { - message += "the upName should not be null or empty"; + message = I18n.err( I18n.ERR_13616_CANNOT_SERIALIZE_AVA_UPNAME_NULL ); } else if ( Strings.isEmpty( upType ) ) { - message += "the upType should not be null or empty"; + message = I18n.err( I18n.ERR_13617_CANNOT_SERIALIZE_AVA_UPTYPE_NULL ); } else if ( Strings.isEmpty( normType ) ) { - message += "the normType should not be null or empty"; + message = I18n.err( I18n.ERR_13618_CANNOT_SERIALIZE_AVA_NORMTYPE_NULL ); } - else if ( value.isNull() ) + else { - message += "the value should not be null"; + message = I18n.err( I18n.ERR_13619_CANNOT_SERIALIZE_AVA_VALUE_NULL ); } LOG.error( message ); diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java index d3340cd..a554b0e 100644 --- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java +++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Dn.java @@ -294,7 +294,7 @@ public class Dn implements Iterable, Externalizable if ( !isFirst && valueExpected ) { - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04202 ) ); + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13611_VALUE_MISSING_ON_RDN ) ); } // Stores the representations of a Dn : internal (as a string and as a @@ -352,7 +352,7 @@ public class Dn implements Iterable, Externalizable { if ( ( dn == null ) || ( rdn == null ) ) { - throw new IllegalArgumentException( "Either the dn or the rdn is null" ); + throw new IllegalArgumentException( I18n.err( I18n.ERR_13622_DN_OR_RDN_NULL ) ); } for ( Rdn rdnParent : dn ) @@ -696,7 +696,7 @@ public class Dn implements Iterable, Externalizable if ( ( posn < 0 ) || ( posn >= rdns.size() ) ) { - throw new IllegalArgumentException( "Invalid position : " + posn ); + throw new IllegalArgumentException( I18n.err( I18n.ERR_13623_INVALID_POSITION, posn ) ); } return rdns.get( posn ); @@ -789,7 +789,7 @@ public class Dn implements Iterable, Externalizable if ( length > rdns.size() ) { - String message = I18n.err( I18n.ERR_04206, length, rdns.size() ); + String message = I18n.err( I18n.ERR_13612_POSITION_NOT_IN_RANGE, length, rdns.size() ); LOG.error( message ); throw new ArrayIndexOutOfBoundsException( message ); } @@ -877,7 +877,7 @@ public class Dn implements Iterable, Externalizable if ( length > rdns.size() ) { - String message = I18n.err( I18n.ERR_04206, length, rdns.size() ); + String message = I18n.err( I18n.ERR_13612_POSITION_NOT_IN_RANGE, length, rdns.size() ); LOG.error( message ); throw new ArrayIndexOutOfBoundsException( message ); } @@ -1247,7 +1247,7 @@ public class Dn implements Iterable, Externalizable { if ( upName == null ) { - String message = "Cannot serialize a NULL Dn"; + String message = I18n.err( I18n.ERR_13624_CANNOT_SERIALIZE_NULL_DN ); LOG.error( message ); throw new IOException( message ); } diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java index 264da23..713bda1 100644 --- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java +++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/FastDnParser.java @@ -129,7 +129,7 @@ import org.apache.directory.api.util.Strings; break; default: - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04192, c, + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13601_EXPECTED_COMMA_SEMI_COLON, c, pos.start ) ); } } @@ -150,12 +150,12 @@ import org.apache.directory.api.util.Strings; { if ( Strings.isEmpty( name ) ) { - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04193 ) ); + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13602_RDN_EMPTY ) ); } if ( rdn == null ) { - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04194 ) ); + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13603_NULL_RDN ) ); } Position pos = new Position(); @@ -340,7 +340,7 @@ import org.apache.directory.api.util.Strings; default: // error - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04195, c, + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13604_START_AT_EXPECTED, c, pos.start ) ); } } @@ -444,7 +444,7 @@ import org.apache.directory.api.util.Strings; default: // error - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04196, c, + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13605_START_AT_DESCR_EXPECTED, c, pos.start ) ); } } @@ -491,7 +491,7 @@ import org.apache.directory.api.util.Strings; default: throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( - I18n.ERR_04197, c, pos.start ) ); + I18n.ERR_13606_EXPECTED_NUMERICOID, c, pos.start ) ); } break; @@ -538,7 +538,7 @@ import org.apache.directory.api.util.Strings; default: throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( - I18n.ERR_04197, c, pos.start ) ); + I18n.ERR_13606_EXPECTED_NUMERICOID, c, pos.start ) ); } } @@ -554,11 +554,11 @@ import org.apache.directory.api.util.Strings; } else { - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04198 ) ); + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13607_DOT_MISSING_IN_OID ) ); } default: - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04199, c, + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13608_START_AT_NUMERICOID_EXPECTED, c, pos.start ) ); } } @@ -579,7 +579,7 @@ import org.apache.directory.api.util.Strings; if ( c != '=' ) { - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04200, c, pos.start ) ); + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13609_EQUAL_EXPECTED, c, pos.start ) ); } } @@ -650,7 +650,7 @@ import org.apache.directory.api.util.Strings; { if ( !hasMoreChars( pos ) ) { - throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04201, pos.start ) ); + throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_13610_NO_MORE_CHAR_AVAILABLE, pos.start ) ); } char c = name[pos.start]; diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java index e30464a..e90ea63 100644 --- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java +++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/name/Rdn.java @@ -232,7 +232,7 @@ public class Rdn implements Cloneable, Externalizable, Iterable, Comparable if ( upName.length() < rdn.length() ) { - throw new LdapInvalidDnException( "Invalid RDN" ); + throw new LdapInvalidDnException( I18n.err( I18n.ERR_13625_INVALID_RDN ) ); } upName = rdn; @@ -718,8 +718,7 @@ public class Rdn implements Cloneable, Externalizable, Iterable, Comparable // Check that the first AVA is not for the same attribute if ( ava.equals( addedAva ) ) { - throw new LdapInvalidDnException( "Invalid RDN: the " + normalizedType - + " is already present in the RDN" ); + throw new LdapInvalidDnException( I18n.err( I18n.ERR_13626_INVALID_RDN_DUPLICATE_AVA, normalizedType ) ); } // First, create the List and the hashMap @@ -1014,7 +1013,7 @@ public class Rdn implements Cloneable, Externalizable, Iterable, Comparable } catch ( CloneNotSupportedException cnse ) { - throw new Error( "Assertion failure", cnse ); + throw new Error( I18n.err( I18n.ERR_13621_ASSERTION_FAILURE ), cnse ); } } @@ -1313,7 +1312,7 @@ public class Rdn implements Cloneable, Externalizable, Iterable, Comparable if ( ( chars.length % 2 ) != 1 ) { - throw new IllegalArgumentException( I18n.err( I18n.ERR_04213 ) ); + throw new IllegalArgumentException( I18n.err( I18n.ERR_13613_VALUE_NOT_IN_HEX_FORM_ODD_NUMBER ) ); } // HexString form @@ -1328,7 +1327,7 @@ public class Rdn implements Cloneable, Externalizable, Iterable, Comparable } else { - throw new IllegalArgumentException( I18n.err( I18n.ERR_04214 ) ); + throw new IllegalArgumentException( I18n.err( I18n.ERR_13614_VALUE_NOT_IN_HEX_FORM ) ); } } @@ -1414,7 +1413,7 @@ public class Rdn implements Cloneable, Externalizable, Iterable, Comparable case ' ': if ( ( i == 0 ) || ( i == chars.length - 1 ) ) { - throw new IllegalArgumentException( I18n.err( I18n.ERR_04215 ) ); + throw new IllegalArgumentException( I18n.err( I18n.ERR_13615_UNESCAPED_CHARS_NOT_ALLOWED ) ); } else { -- To stop receiving notification emails like this one, please contact elecharny@apache.org.