directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1786492 - in /directory/shared/trunk/ldap: model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/ schema/data/src/test/java/org/apache/directo...
Date Sat, 11 Mar 2017 07:45:52 GMT
Author: elecharny
Date: Sat Mar 11 07:45:52 2017
New Revision: 1786492

URL: http://svn.apache.org/viewvc?rev=1786492&view=rev
Log:
Replaced a few error message by a i18n message, used the SyntachCheck INSTANCE in tests

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BooleanSyntaxCheckerTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AccessPointSyntaxChecker.java
Sat Mar 11 07:45:52 2017
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.slf4j.Logger;
@@ -58,7 +59,7 @@ public class AccessPointSyntaxChecker ex
     @Override
     public boolean isValidSyntax( Object value )
     {
-        LOG.debug( "Syntax valid for '{}'", value );
+        LOG.debug( I18n.msg( I18n.MSG_04489_SYNTAX_VALID, value ) );
         return true;
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/AttributeTypeDescriptionSyntaxChecker.java
Sat Mar 11 07:45:52 2017
@@ -22,6 +22,7 @@ package org.apache.directory.api.ldap.mo
 
 import java.text.ParseException;
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.apache.directory.api.ldap.model.schema.parsers.AttributeTypeDescriptionSchemaParser;
@@ -65,8 +66,6 @@ import org.slf4j.LoggerFactory;
  * COLLECTIVE requires usage userApplications.
  * 
  * NO-USER-MODIFICATION requires an operational usage.
- * 
- * 
  * </pre>
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -78,7 +77,7 @@ public class AttributeTypeDescriptionSyn
     private static final Logger LOG = LoggerFactory.getLogger( AttributeTypeDescriptionSyntaxChecker.class
);
 
     /** The schema parser used to parse the AttributeTypeDescription Syntax */
-    private AttributeTypeDescriptionSchemaParser schemaParser = new AttributeTypeDescriptionSchemaParser();
+    private transient AttributeTypeDescriptionSchemaParser schemaParser = new AttributeTypeDescriptionSchemaParser();
     
     /**
      * A static instance of AttributeTypeDescriptionSyntaxChecker
@@ -107,7 +106,7 @@ public class AttributeTypeDescriptionSyn
 
         if ( value == null )
         {
-            LOG.debug( "Syntax invalid for 'null'" );
+            LOG.debug( I18n.err( I18n.ERR_04488_SYNTAX_INVALID, "null" ) );
             return false;
         }
 
@@ -127,12 +126,12 @@ public class AttributeTypeDescriptionSyn
         try
         {
             schemaParser.parseAttributeTypeDescription( strValue );
-            LOG.debug( "Syntax valid for '{}'", value );
+            LOG.debug( I18n.msg( I18n.MSG_04489_SYNTAX_VALID, value ) );
             return true;
         }
         catch ( ParseException pe )
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( I18n.err( I18n.ERR_04488_SYNTAX_INVALID, value ) );
             return false;
         }
     }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BinarySyntaxChecker.java
Sat Mar 11 07:45:52 2017
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
 import org.slf4j.Logger;
@@ -68,7 +69,7 @@ public class BinarySyntaxChecker extends
     @Override
     public boolean isValidSyntax( Object value )
     {
-        LOG.debug( "Syntax valid for '{}'", value );
+        LOG.debug( I18n.msg( I18n.MSG_04489_SYNTAX_VALID, value ) );
         return true;
     }
 }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/BooleanSyntaxChecker.java
Sat Mar 11 07:45:52 2017
@@ -97,11 +97,11 @@ public class BooleanSyntaxChecker extend
 
         if ( valid )
         {
-            LOG.debug( "Syntax valid for '{}'", strValue );
+            LOG.debug( I18n.msg( I18n.MSG_04489_SYNTAX_VALID, strValue ) );
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", strValue );
+            LOG.debug( I18n.err( I18n.ERR_04488_SYNTAX_INVALID, strValue ) );
         }
 
         return valid;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DnSyntaxChecker.java
Sat Mar 11 07:45:52 2017
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.model.schema.syntaxCheckers;
 
 
+import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.SyntaxChecker;
@@ -65,7 +66,7 @@ public class DnSyntaxChecker extends Syn
 
         if ( value == null )
         {
-            LOG.debug( "Syntax invalid for 'null'" );
+            LOG.debug( I18n.err( I18n.ERR_04488_SYNTAX_INVALID, "null" ) );
             return false;
         }
 
@@ -87,7 +88,7 @@ public class DnSyntaxChecker extends Syn
             // TODO: this should be a false, but for 
             // some reason, the principal is empty in 
             // some cases.
-            LOG.debug( "Syntax valid for '{}'", value );
+            LOG.debug( I18n.msg( I18n.MSG_04489_SYNTAX_VALID, strValue ) );
             return true;
         }
 
@@ -96,11 +97,11 @@ public class DnSyntaxChecker extends Syn
 
         if ( result )
         {
-            LOG.debug( "Syntax valid for '{}'", value );
+            LOG.debug( I18n.msg( I18n.MSG_04489_SYNTAX_VALID, strValue ) );
         }
         else
         {
-            LOG.debug( "Syntax invalid for '{}'", value );
+            LOG.debug( I18n.err( I18n.ERR_04488_SYNTAX_INVALID, strValue ) );
         }
 
         return result;

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BooleanSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BooleanSyntaxCheckerTest.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BooleanSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/BooleanSyntaxCheckerTest.java
Sat Mar 11 07:45:52 2017
@@ -40,7 +40,7 @@ import org.junit.runner.RunWith;
 @Concurrency()
 public class BooleanSyntaxCheckerTest
 {
-    BooleanSyntaxChecker checker = new BooleanSyntaxChecker();
+    BooleanSyntaxChecker checker = BooleanSyntaxChecker.INSTANCE;
 
 
     @Test

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java?rev=1786492&r1=1786491&r2=1786492&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
Sat Mar 11 07:45:52 2017
@@ -1018,7 +1018,7 @@ public class SchemaManagerDelTest
         int scrSize = schemaManager.getSyntaxCheckerRegistry().size();
         int goidSize = schemaManager.getGlobalOidRegistry().size();
 
-        SyntaxChecker sc = new BooleanSyntaxChecker();
+        SyntaxChecker sc = BooleanSyntaxChecker.INSTANCE;
         sc.setOid( "0.1.1" );
         assertTrue( schemaManager.add( sc ) );
 
@@ -1051,7 +1051,7 @@ public class SchemaManagerDelTest
         int scrSize = schemaManager.getSyntaxCheckerRegistry().size();
         int goidSize = schemaManager.getGlobalOidRegistry().size();
 
-        SyntaxChecker sc = new BooleanSyntaxChecker();
+        SyntaxChecker sc = BooleanSyntaxChecker.INSTANCE;
         sc.setOid( "0.0" );
         assertFalse( schemaManager.delete( sc ) );
 



Mime
View raw message