directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1163013 [1/2] - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/entry/ core-api/src/main/java/org/apache/directory/server/core/schema/ core-api/...
Date Mon, 29 Aug 2011 21:26:20 GMT
Author: elecharny
Date: Mon Aug 29 21:26:19 2011
New Revision: 1163013

URL: http://svn.apache.org/viewvc?rev=1163013&view=rev
Log:
Used Strings.toLowercase everywhere

Added:
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlNode.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeIterator.java
    directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeSet.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/avl/
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/avl/AvlTreePerfTest.java
    directory/apacheds/trunk/jdbm/test.db
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/IndexTest.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ReferralHandlingMode.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java
    directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
    directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoderTest.java
    directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/TextRecordEncoderTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsUpdateCertificateIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsUpdateCertificateIT.java
    directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
    directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ReferralHandlingMode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ReferralHandlingMode.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ReferralHandlingMode.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ReferralHandlingMode.java Mon Aug 29 21:26:19 2011
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
 import javax.naming.Context;
 
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -79,7 +80,7 @@ public enum ReferralHandlingMode
      */
     public static final ReferralHandlingMode getModeFromJndi( String jndiValue )
     {
-        jndiValue = jndiValue.trim().toLowerCase();
+        jndiValue = Strings.toLowerCase( Strings.trim( jndiValue ) );
         
         if ( jndiValue.equals( "throw" ) )
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/TestServerEntryUtils.java Mon Aug 29 21:26:19 2011
@@ -160,7 +160,7 @@ public class TestServerEntryUtils
             {
                 if ( value.isHumanReadable() )
                 {
-                    return new StringValue( value.getString().toLowerCase() );
+                    return new StringValue( Strings.toLowerCase( value.getString() ) );
                 }
 
                 throw new IllegalStateException( I18n.err( I18n.ERR_473 ) );
@@ -169,7 +169,7 @@ public class TestServerEntryUtils
             
             public String normalize( String value ) throws LdapException
             {
-                return value.toLowerCase();
+                return Strings.toLowerCase( value );
             }
         };
         

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java Mon Aug 29 21:26:19 2011
@@ -66,6 +66,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.NumericOidSyntaxChecker;
 import org.apache.directory.shared.ldap.schemaloader.SchemaEntityFactory;
 import org.apache.directory.shared.util.DateUtils;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -233,7 +234,7 @@ public class SchemaPartitionDaoImpl impl
         }
         else
         {
-            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( oid.toLowerCase() ) ) );
+            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( Strings.toLowerCase( oid ) ) ) );
         }
 
         SearchControls searchControls = new SearchControls();
@@ -285,7 +286,7 @@ public class SchemaPartitionDaoImpl impl
         }
         else
         {
-            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( oid.toLowerCase() ) ) );
+            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( Strings.toLowerCase( oid ) ) ) );
         }
 
         SearchControls searchControls = new SearchControls();
@@ -337,7 +338,7 @@ public class SchemaPartitionDaoImpl impl
         }
         else
         {
-            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( oid.toLowerCase() ) ) );
+            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( Strings.toLowerCase( oid ) ) ) );
         }
 
         SearchControls searchControls = new SearchControls();
@@ -389,7 +390,7 @@ public class SchemaPartitionDaoImpl impl
         }
         else
         {
-            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( oid.toLowerCase() ) ) );
+            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( Strings.toLowerCase( oid ) ) ) );
         }
 
         SearchControls searchControls = new SearchControls();
@@ -441,7 +442,7 @@ public class SchemaPartitionDaoImpl impl
         }
         else
         {
-            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( oid.toLowerCase() ) ) );
+            filter.addNode( new EqualityNode<String>( M_NAME_AT, new StringValue( Strings.toLowerCase( oid ) ) ) );
         }
 
         SearchControls searchControls = new SearchControls();
@@ -519,9 +520,9 @@ public class SchemaPartitionDaoImpl impl
     {
         BranchNode filter = new OrNode();
         SimpleNode<String> nameAVA = new EqualityNode<String>( M_NAME_AT,
-            new StringValue( entityName.toLowerCase() ) );
+            new StringValue( Strings.toLowerCase( entityName ) ) );
         SimpleNode<String> oidAVA = new EqualityNode<String>( M_OID_AT,
-            new StringValue( entityName.toLowerCase() ) );
+            new StringValue( Strings.toLowerCase( entityName ) ) );
         filter.addNode( nameAVA );
         filter.addNode( oidAVA );
         SearchControls searchControls = new SearchControls();
@@ -610,12 +611,12 @@ public class SchemaPartitionDaoImpl impl
         // subfilter for (| (objectClass=metaMatchingRule) (objectClass=metaAttributeType))
         BranchNode or = new OrNode();
         or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT,
-            new StringValue( MetaSchemaConstants.META_MATCHING_RULE_OC.toLowerCase() ) ) );
+            new StringValue( Strings.toLowerCase( MetaSchemaConstants.META_MATCHING_RULE_OC ) ) ) );
         or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT,
-            new StringValue( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC.toLowerCase() ) ) );
+            new StringValue( Strings.toLowerCase( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC ) ) ) );
 
         filter.addNode( or );
-        filter.addNode( new EqualityNode<String>( M_SYNTAX_AT, new StringValue( numericOid.toLowerCase() ) ) );
+        filter.addNode( new EqualityNode<String>( M_SYNTAX_AT, new StringValue( Strings.toLowerCase( numericOid ) ) ) );
 
         SearchControls searchControls = new SearchControls();
         searchControls.setSearchScope( SearchControls.SUBTREE_SCOPE );
@@ -656,7 +657,7 @@ public class SchemaPartitionDaoImpl impl
 
         // ( objectClass = metaAttributeType )
         filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
-            MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC.toLowerCase() ) ) );
+            Strings.toLowerCase( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC ) ) ) );
 
         BranchNode or = new OrNode();
         or.addNode( new EqualityNode<String>( M_ORDERING_AT, new StringValue( mr.getOid() ) ) );
@@ -670,9 +671,9 @@ public class SchemaPartitionDaoImpl impl
         {
             for ( String name : names )
             {
-                or.addNode( new EqualityNode<String>( M_ORDERING_AT, new StringValue( name.toLowerCase() ) ) );
-                or.addNode( new EqualityNode<String>( M_SUBSTRING_AT, new StringValue( name.toLowerCase() ) ) );
-                or.addNode( new EqualityNode<String>( M_EQUALITY_AT, new StringValue( name.toLowerCase() ) ) );
+                or.addNode( new EqualityNode<String>( M_ORDERING_AT, new StringValue( Strings.toLowerCase( name ) ) ) );
+                or.addNode( new EqualityNode<String>( M_SUBSTRING_AT, new StringValue( Strings.toLowerCase( name ) ) ) );
+                or.addNode( new EqualityNode<String>( M_EQUALITY_AT, new StringValue( Strings.toLowerCase( name ) ) ) );
             }
         }
 
@@ -755,9 +756,9 @@ public class SchemaPartitionDaoImpl impl
         // ( objectClass = metaAttributeType )
         BranchNode or = new OrNode();
         or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT,
-            new StringValue( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC.toLowerCase() ) ) );
+            new StringValue( Strings.toLowerCase( MetaSchemaConstants.META_ATTRIBUTE_TYPE_OC ) ) ) );
         or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT,
-            new StringValue( MetaSchemaConstants.META_OBJECT_CLASS_OC.toLowerCase() ) ) );
+            new StringValue( Strings.toLowerCase( MetaSchemaConstants.META_OBJECT_CLASS_OC ) ) ) );
         filter.addNode( or );
 
         or = new OrNode();
@@ -810,9 +811,9 @@ public class SchemaPartitionDaoImpl impl
         BranchNode filter = new AndNode();
 
         filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT,
-            new StringValue( MetaSchemaConstants.META_SCHEMA_OC.toLowerCase() ) ) );
+            new StringValue( Strings.toLowerCase( MetaSchemaConstants.META_SCHEMA_OC ) ) ) );
         filter.addNode( new EqualityNode<String>( M_DEPENDENCIES_AT,
-            new StringValue( schemaName.toLowerCase() ) ) );
+            new StringValue( Strings.toLowerCase( schemaName ) ) ) );
 
         SearchControls searchControls = new SearchControls();
         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
@@ -852,9 +853,9 @@ public class SchemaPartitionDaoImpl impl
         BranchNode filter = new AndNode();
 
         filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
-            MetaSchemaConstants.META_SCHEMA_OC.toLowerCase() ) ) );
+            Strings.toLowerCase( MetaSchemaConstants.META_SCHEMA_OC ) ) ) );
         filter.addNode( new EqualityNode<String>( M_DEPENDENCIES_AT, new StringValue(
-            schemaName.toLowerCase() ) ) );
+            Strings.toLowerCase( schemaName ) ) ) );
 
         SearchControls searchControls = new SearchControls();
         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
@@ -928,12 +929,12 @@ public class SchemaPartitionDaoImpl impl
         BranchNode filter = new AndNode();
 
         BranchNode or = new OrNode();
-        or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue( MetaSchemaConstants.META_NAME_FORM_OC
-            .toLowerCase() ) ) );
-        or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue( MetaSchemaConstants.META_OBJECT_CLASS_OC
-            .toLowerCase() ) ) );
+        or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue( 
+            Strings.toLowerCase( MetaSchemaConstants.META_NAME_FORM_OC ) ) ) );
+        or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue( 
+            Strings.toLowerCase( MetaSchemaConstants.META_OBJECT_CLASS_OC ) ) ) );
         or.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
-            MetaSchemaConstants.META_DIT_CONTENT_RULE_OC.toLowerCase() ) ) );
+            Strings.toLowerCase( MetaSchemaConstants.META_DIT_CONTENT_RULE_OC ) ) ) );
         filter.addNode( or );
 
         or = new OrNode();

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java Mon Aug 29 21:26:19 2011
@@ -48,6 +48,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.registries.ObjectClassRegistry;
 import org.apache.directory.shared.ldap.model.schema.registries.Registries;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -105,17 +106,17 @@ public class RegistrySynchronizerAdaptor
 
     static 
     {
-        VALID_OU_VALUES.add( SchemaConstants.NORMALIZERS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.COMPARATORS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.SYNTAX_CHECKERS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( "syntaxes".toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.MATCHING_RULES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.MATCHING_RULE_USE_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.ATTRIBUTE_TYPES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.OBJECT_CLASSES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.NAME_FORMS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.DIT_CONTENT_RULES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.DIT_STRUCTURE_RULES_AT.toLowerCase() );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.NORMALIZERS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.COMPARATORS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.SYNTAX_CHECKERS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( "syntaxes" ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.MATCHING_RULES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.MATCHING_RULE_USE_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.ATTRIBUTE_TYPES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.OBJECT_CLASSES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.NAME_FORMS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.DIT_CONTENT_RULES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.DIT_STRUCTURE_RULES_AT ) );
     }
 
 
@@ -197,7 +198,7 @@ public class RegistrySynchronizerAdaptor
             }
             
             String ouValue = addContext.getDn().getRdn().getNormValue().getString();
-            ouValue = ouValue.trim().toLowerCase();
+            ouValue = Strings.toLowerCase( Strings.trim( ouValue ) );
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )
             {
@@ -253,7 +254,7 @@ public class RegistrySynchronizerAdaptor
             }
             
             String ouValue = deleteContext.getDn().getRdn().getNormValue().getString();
-            ouValue = ouValue.trim().toLowerCase();
+            ouValue = Strings.toLowerCase( Strings.trim( ouValue ) );
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )
             {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Mon Aug 29 21:26:19 2011
@@ -588,7 +588,7 @@ public class SchemaSynchronizer implemen
             {
                 String dependency = value.getString();
 
-                if ( schemaManager.getLoadedSchema( Strings.toLowerCase(dependency) ) == null )
+                if ( schemaManager.getLoadedSchema( Strings.toLowerCase( dependency ) ) == null )
                 {
                     throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
                         I18n.err( I18n.ERR_385, dependency ) );

Added: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlNode.java?rev=1163013&view=auto
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlNode.java (added)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlNode.java Mon Aug 29 21:26:19 2011
@@ -0,0 +1,58 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core.avltree.avl;
+
+
+/**
+ * AVL Tree Set node
+ * 
+ * @author Vladimir Lysyy (http://bobah.net)
+ *
+ */
+final class AvlNode<T extends Comparable<T>>
+{
+    public AvlNode<T> parent = null;
+    public AvlNode<T> left = null;
+    public AvlNode<T> right = null;
+
+    public int height = 0;
+    public int balance = 0;
+    public T value = null;
+
+
+    public AvlNode( AvlNode<T> parent, T value )
+    {
+        this.parent = parent;
+        this.value = value;
+    }
+
+
+    public AvlNode<T> reset( AvlNode<T> parent, T value )
+    {
+        this.parent = parent;
+        left = null;
+        right = null;
+
+        height = 0;
+        this.value = value;
+
+        return this;
+    }
+}
\ No newline at end of file

Added: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeIterator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeIterator.java?rev=1163013&view=auto
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeIterator.java (added)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeIterator.java Mon Aug 29 21:26:19 2011
@@ -0,0 +1,102 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core.avltree.avl;
+
+
+import java.util.Iterator;
+
+
+/**
+ * AVL Tree Set iterator
+ * 
+ * @author Vladimir Lysyy (http://bobah.net)
+ *
+ */
+final class AvlTreeIterator<T extends Comparable<T>> implements Iterator<T>
+{
+    private AvlNode<T> root;
+    private AvlNode<T> next = null;
+    private boolean initial = true;
+
+
+    public AvlTreeIterator( AvlNode<T> root )
+    {
+        this.root = root;
+        find_next();
+    }
+
+
+    @Override
+    public boolean hasNext()
+    {
+        return next != null || ( initial && root != null );
+    }
+
+
+    @Override
+    public T next()
+    {
+        T value = next == null ? null : next.value;
+        find_next();
+        return value;
+    }
+
+
+    public void find_next()
+    {
+        if ( next == null )
+        {
+            if ( root == null || !initial )
+                return;
+            initial = false;
+            next = root;
+            while ( next.left != null )
+                next = next.left;
+        }
+        else
+        {
+            if ( next.right != null )
+            {
+                next = next.right;
+                while ( next.left != null )
+                    next = next.left;
+            }
+            else
+            {
+                AvlNode<T> parent = next.parent;
+
+                while ( parent != null && parent.left != next )
+                {
+                    next = parent;
+                    parent = next.parent;
+                }
+
+                next = parent;
+            }
+        }
+    }
+
+
+    @Override
+    public void remove()
+    {
+        assert false : "not supported";
+    }
+}
\ No newline at end of file

Added: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeSet.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeSet.java?rev=1163013&view=auto
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeSet.java (added)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/avl/AvlTreeSet.java Mon Aug 29 21:26:19 2011
@@ -0,0 +1,304 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core.avltree.avl;
+
+import java.util.Iterator;
+import java.util.Stack;
+
+/**
+ * AVL Tree Set
+ * 
+ * @author Vladimir Lysyy (http://bobah.net)
+ *
+ */
+public class AvlTreeSet<T extends Comparable<T>> implements Iterable<T> {
+
+  private AvlNode<T> tree;
+  private int size = 0;
+
+  final boolean useFreeList;
+
+  public AvlTreeSet() {
+    this(false);
+  }
+
+  public AvlTreeSet(boolean useFreeList) {
+    this.useFreeList = useFreeList;
+  }
+  
+  public final int height() { 
+    return (tree == null) ? 0 : tree.height + 1;
+  }
+
+  public final int size() { 
+    return size;
+  }
+
+  public final Iterator<T> iterator() {
+    return new AvlTreeIterator<T>(tree);
+  }
+  
+  public final boolean insert(T value) {
+    // empty tree case
+    if (tree == null) {
+      tree = new_node(null, value);
+      ++size;
+      return true;
+    }
+
+    AvlNode<T> node = tree;
+
+    // find the place and insert the value
+    int cmp = value.compareTo(node.value);
+    for (; cmp != 0; cmp = value.compareTo(node.value)) {
+      if (cmp < 0) {
+        if (node.left == null) { node.left = new_node(node, value); break; }
+        else node = node.left;
+      }
+      else if (cmp > 0) {
+        if (node.right == null) { node.right = new_node(node, value); break; }
+        else node = node.right;
+      }
+      else assert false : "should never happen";
+    }
+
+    // node with _value_ already exists
+    if (cmp == 0) return false;
+    rebalance_up(node);
+    ++ size;
+
+    return true;
+  }
+
+  Stack<AvlNode<T>> free_list = new Stack<AvlNode<T>>();
+  private final AvlNode<T> new_node(AvlNode<T> parent, T value) {
+    if (!useFreeList || free_list.isEmpty()) return new AvlNode<T>(parent, value);
+    else {
+      AvlNode<T> node = free_list.pop();
+      return node.reset(parent, value);
+    }
+  }
+
+  private final void recycle_node(AvlNode<T> node) {
+    if (!useFreeList) return;
+
+    // keep free list size not bigger than tree size
+    while (free_list.size() > size) free_list.pop();
+    if (free_list.size() == size) return;
+
+    free_list.push(node);
+  }
+
+  private void rebalance_up(AvlNode<T> node) {
+    while (node != null) {
+      int height_before = node.height;
+      update_height(node);
+
+      // rebalance
+      if (node.balance == -2) node = big_right_rotation(node);
+      else if (node.balance == 2) node = big_left_rotation(node);
+
+      if (node.parent == null) tree = node;
+      
+      // if parent node is not affected
+      if (height_before == node.height) break; 
+
+      node = node.parent;
+    }
+  }
+
+  public final boolean remove(T value) {
+    AvlNode<T> node = tree;
+    if (node == null) return false;
+
+    // find the node to be removed
+    for (int cmp = value.compareTo(node.value); cmp != 0; cmp = value.compareTo(node.value)) {
+      node = (cmp < 0) ? node.left : node.right;
+      if (node == null) return false;
+    }
+
+    // find a replacement node (if needed)
+    final int LEFT = -1;
+    final int RIGHT = 1;
+    final int NONE = 0;
+    int replaceFrom = NONE;
+    if (node.left != null && node.right == null) {
+      replaceFrom = LEFT;
+    }
+    else if (node.right != null && node.left == null) {
+      replaceFrom = RIGHT;
+    }
+    else if (node.right != null && node.left != null) {
+      if (node.balance < 0) {
+        replaceFrom = LEFT;
+      }
+      else if (node.balance > 0) {
+        replaceFrom = RIGHT;
+      }
+      else {
+        replaceFrom = LEFT; // TODO: asymmetry
+      }
+    }
+    else { // node is itself a leaf, replacement is not needed
+      if (node.parent == null) { // the tree root, single node in the tree
+        tree = null; --size;
+        recycle_node(node);
+        return true;
+      }
+      else { // non-root leaf node
+        // detach from parent
+        if (node.parent.left == node) node.parent.left = null;
+        else                          node.parent.right = null;
+
+        AvlNode<T> dead = node;
+        node = node.parent; // update heights/rebalance from node's parents up (the bottom of this method)
+        recycle_node(dead);
+        replaceFrom = NONE;
+      }
+    }
+
+    if (replaceFrom != NONE) {
+      AvlNode<T> leaf = null;
+      if (replaceFrom == LEFT) {
+        leaf = node.left;
+        while (leaf.left != null || leaf.right != null) {
+          if (leaf.right != null) leaf = leaf.right;
+          else leaf = small_right_rotation(leaf); // the rotation should ensure (leaf.right != null) on the next iteration
+        }
+      }
+      else if (replaceFrom == RIGHT) {
+        leaf = node.right;
+        while (leaf.right != null || leaf.left != null) {
+          if (leaf.left != null) leaf = leaf.left;
+          else leaf = small_left_rotation(leaf); // the rotation should ensure (leaf.left != null) on the next iteration
+        }
+      }
+      else assert false : "should never happen";
+
+      assert leaf != null : "replacement leaf should always exist at this point";
+
+      // detach leaf from its parent
+      if (leaf.parent.left == leaf) leaf.parent.left = null;
+      else if (leaf.parent.right == leaf) leaf.parent.right = null;
+      else assert false : "broken parent/child reference in the tree";
+
+      node.value = leaf.value; // replace node value with leaf's value
+      node = leaf.parent; // change recursion point down so that below down-up update picks up
+      // everything from leaf's parent up
+
+      recycle_node(leaf);
+    }
+
+    rebalance_up(node);
+
+    -- size;
+
+    return true;
+  }
+
+  public final boolean contains(T value) {
+    AvlNode<T> node = tree;
+    while (node != null) {
+      int cmp = value.compareTo(node.value);
+      if (cmp < 0) node = node.left;
+      else if (cmp > 0) node = node.right;
+      else return true;
+    }
+    return false;
+
+  }
+
+  private static final <T extends Comparable<T>> void update_height(AvlNode<T> node) {
+    int left_height = (node.left == null) ? -1 : node.left.height;
+    int right_height = (node.right == null) ? -1 : node.right.height;
+    node.height = 1 + (right_height > left_height ? right_height : left_height);
+    node.balance = right_height - left_height;
+  }
+
+  private static final <T extends Comparable<T>> AvlNode<T> small_left_rotation(AvlNode<T> node) {
+    assert node.balance > 0 : "null right child in small_left";
+
+    // update child references
+    AvlNode<T> right = node.right;
+    node.right = right.left;
+    right.left = node;
+
+    // update parent references
+    if (node.right != null) node.right.parent = node;
+    right.parent = node.parent;
+
+    if (right.parent != null) {
+      if (right.parent.left == node) node.parent.left = right;
+      else                          node.parent.right = right;
+    }
+
+    node.parent = right;
+
+    update_height(node);
+    update_height(right);
+
+    return right;
+  }
+
+  private static final <T extends Comparable<T>> AvlNode<T> small_right_rotation(AvlNode<T> node) {
+    assert node.balance < 0 : "null left child in small_right";
+
+    // update child references
+    AvlNode<T> left = node.left;
+    node.left = left.right;
+    left.right = node;
+
+    // update parent references
+    if (node.left != null) node.left.parent = node;
+    left.parent = node.parent;
+
+    if (left.parent != null) {
+      if (left.parent.left == node) node.parent.left = left;
+      else                          node.parent.right = left;
+    }
+
+    node.parent = left;
+
+    update_height(node);
+    update_height(left);
+
+    return left;
+  }
+
+  private static final <T extends Comparable<T>> AvlNode<T> big_left_rotation(AvlNode<T> node) {
+    assert node.right != null : "null right child in big_left";
+
+    if (node.right.balance < 0) node.right = small_right_rotation(node.right);
+
+    update_height(node);
+
+    return small_left_rotation(node);
+  }
+
+  private static final  <T extends Comparable<T>> AvlNode<T> big_right_rotation(AvlNode<T> node) {
+    assert node.left != null : "null right child in big_right";
+
+    if (node.left.balance > 0) node.left = small_left_rotation(node.left);
+
+    update_height(node);
+
+    return small_right_rotation(node);
+  }
+}

Added: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/avl/AvlTreePerfTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/avl/AvlTreePerfTest.java?rev=1163013&view=auto
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/avl/AvlTreePerfTest.java (added)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/avl/AvlTreePerfTest.java Mon Aug 29 21:26:19 2011
@@ -0,0 +1,324 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.core.avltree.avl;
+
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.directory.server.core.avltree.AvlTreeMarshaller;
+import org.apache.directory.server.core.avltree.IntegerKeyMarshaller;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * 
+ * Performance test cases for AVLTree implementation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class AvlTreePerfTest
+{
+    AvlTreeSet<Integer> tree;
+    
+    static String tempDir = System.getProperty( "java.io.tmpdir" );
+   
+    static File setSerialFile = new File( tempDir + File.separator + "hashset.ser" );
+    static File treeSerialFile = new File( tempDir + File.separator + "avltree.ser" );
+    
+    Set<Integer> set;
+    
+    long start, end;
+
+    int numKeys = 1000000;
+
+    Comparator<Integer> comparator = new Comparator<Integer>() 
+    {
+      public int compare( Integer i1, Integer i2 )
+      {
+          return i1.compareTo( i2 );
+      }
+    
+    };
+    
+    AvlTreeMarshaller<Integer> treeMarshaller = new AvlTreeMarshaller<Integer>( comparator, new IntegerKeyMarshaller() );
+
+    private final static Logger LOG = LoggerFactory.getLogger( AvlTreePerfTest.class );
+    
+    @Before
+    public void createTree()
+    {
+      tree = new AvlTreeSet<Integer>();  
+      
+      set = new HashSet<Integer>();
+      
+      start = end = 0;
+    }
+    
+    
+    @AfterClass
+    public static void deleteFiles()
+    {
+        setSerialFile.delete();
+        treeSerialFile.delete();
+    }
+    
+    
+    @Test
+    public void testRBTreeInsertPerf()
+    {
+        start = System.nanoTime();
+        
+        for( int i=0; i < numKeys; i++ )
+        {
+            set.add( i );
+        }
+        
+        end = System.nanoTime();
+     
+        System.out.println( "total time for inserting " + numKeys + " items into the RBTree-->" +  getTime( start, end ) );
+        
+    }
+
+    
+    @Test
+    @Ignore
+    public void testRBTreeLookupPerf()
+    {
+        for( int i=0; i < numKeys; i++ )
+        {
+            set.add( i );
+        }
+        
+        start = System.nanoTime();
+       
+        set.contains( 70 );
+        set.contains( -1000 );
+        set.contains( 10 );
+        set.contains( 90 );
+        set.contains( 9999 );
+        
+       end = System.nanoTime();
+       
+       System.out.println( "total time took to read an item from set " + getTime( start, end ) ) ;
+    }
+    
+    
+    @Test
+    @Ignore
+    public void testRemoveFromRBTree()
+    {
+        for( int i=0; i < numKeys; i++ )
+        {
+            set.add( i );
+        }
+        
+        start = System.nanoTime();
+        
+        set.remove( 90 );
+        set.remove( 912 );
+        set.remove( -1 );
+        set.remove( 192 );
+        
+        end = System.nanoTime();
+        
+        System.out.println( "total time took to remove an item from set " + getTime( start, end ) ) ;
+
+    }
+    
+    
+    @Test
+    public void testAvlTreeInsertPerf()
+    {
+        start = System.nanoTime();
+        
+        for( int i=0; i < numKeys; i++ )
+        {
+            tree.insert( i );
+        }
+
+        end = System.nanoTime();
+        
+        System.out.println("total time for inserting " + numKeys + " items into the AVLTree-->" + getTime(start, end));
+    }
+    
+    
+    @Test
+    @Ignore
+    public void testAVLTreeLookupPerf()
+    {
+        
+        for( int i=0; i < numKeys; i++ )
+        {
+            tree.insert( i );
+        }
+        
+        start = System.nanoTime();
+        
+        tree.contains( 70 );
+        tree.contains( -1000 );
+        tree.contains( 10 );
+        tree.contains( 90 );
+        tree.contains( 9999 );
+        
+        end = System.nanoTime();
+        
+        System.out.println("total time took to read an item from tree " + getTime( start, end ) ) ;
+    }
+    
+    
+    @Test
+    @Ignore
+    public void testAVLTreeRemovePerf()
+    {
+        for( int i=0; i < numKeys; i++ )
+        {
+            tree.insert( i );
+        }
+        
+        start = System.nanoTime();
+        
+        tree.remove( 90 );
+        tree.remove( 912 );
+        tree.remove( -1 );
+        tree.remove( 192 );
+        
+        end = System.nanoTime();
+        
+        System.out.println("total time took to remove an item from AVLTree " + getTime( start, end ) ) ;
+
+    }
+    
+    
+    @Test
+    @Ignore
+    public void testRBTreeSerializationPerf() throws Exception
+    {
+        FileOutputStream fout = new FileOutputStream( setSerialFile );
+        ObjectOutputStream objOut = new ObjectOutputStream( fout );
+        
+        Set<Integer> set = new HashSet<Integer>();
+        
+        for( int i=0; i < numKeys; i++ )
+        {
+            set.add( i );
+        }
+        
+        long start = System.nanoTime();
+        
+        objOut.writeObject( set );
+        objOut.flush();
+        objOut.close();
+        
+        long end = System.nanoTime();
+        
+        System.out.println( "total time taken for serializing HashSet ->" + getTime( start, end ) );
+    }
+    
+    
+    @SuppressWarnings("unchecked")
+    @Test
+    @Ignore
+    public void testRBTreeDeserializationPerf() throws Exception
+    {
+     // read test
+        FileInputStream fin = new FileInputStream( setSerialFile );
+        ObjectInputStream objIn = new ObjectInputStream( fin );
+        
+        start = System.nanoTime();
+        
+        set = ( HashSet ) objIn.readObject();
+        
+        end = System.nanoTime();
+        
+        System.out.println("total time taken for reconstructing a serialized HashSet ->" + getTime( start, end ) );
+    }
+    
+    
+    /*
+    @Test
+    public void testAVLTreeSerializationPerf() throws Exception
+    {
+      
+      for( int i=0; i < numKeys; i++ )
+      {
+          tree.insert( i );
+      }
+      
+      FileOutputStream fout = new FileOutputStream( treeSerialFile );
+    
+      start = System.nanoTime();
+      
+      fout.write( treeMarshaller.serialize( tree ) );
+      fout.flush();
+      fout.close();
+      
+      end = System.nanoTime();
+      
+      System.out.println( "total time taken for serializing AVLTree ->" + getTime( start, end ) );
+    }
+
+    
+    @Test
+    public void testAVLTreeDeserializationPerf() throws Exception
+    {
+        FileInputStream fin = new FileInputStream( treeSerialFile );
+
+        byte data[] = new byte[ ( int ) treeSerialFile.length() ];
+        
+        start = System.nanoTime();
+        
+        fin.read(data);
+        tree = (AvlTree<Integer>) treeMarshaller.deserialize( data );
+        
+        end = System.nanoTime();
+        System.out.println("total time taken for reconstructing a serialized AVLTree ->" + getTime( start, end ) );
+    }
+    */
+    
+    
+    /**
+     * calculates the total time taken in milli seconds by taking the start and end time in nano seconds. 
+     */
+    private String getTime(long nanoStartTime, long nanoEndTime)
+    {
+        long temp = nanoEndTime - nanoStartTime;
+        
+        if( temp == 0)
+        {
+            return "0 msec";
+        }
+        
+       double d = temp / (1000 * 1000);
+        
+       return String.valueOf( d ) + " msec";
+    }
+}

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java Mon Aug 29 21:26:19 2011
@@ -46,6 +46,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.model.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
+import org.bouncycastle.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -116,7 +117,7 @@ public class UniqueMemberIT extends Abst
                 
                 while ( values.hasMoreElements() )
                 {
-                    String value = ( (String)values.nextElement() ).toLowerCase();
+                    String value = Strings.toLowerCase( ( (String)values.nextElement() ) );
                     assertTrue( expectedValues.contains( value ) );
                     expectedValues.remove( value );
                 }
@@ -188,7 +189,7 @@ public class UniqueMemberIT extends Abst
                 
                 while ( values.hasMoreElements() )
                 {
-                    String value = ( (String)values.nextElement() ).toLowerCase();
+                    String value = Strings.toLowerCase( ( (String)values.nextElement() ) );
                     assertTrue( expectedValues.contains( value ) );
                     expectedValues.remove( value );
                 }
@@ -312,7 +313,7 @@ public class UniqueMemberIT extends Abst
         while ( list.hasMore() )
         {
             SearchResult result = list.next();
-            map.put( result.getName().toLowerCase(), result.getAttributes() );
+            map.put( Strings.toLowerCase( result.getName() ), result.getAttributes() );
         }
 
         assertEquals( "Expected number of results returned was incorrect!", 1, map.size() );
@@ -364,7 +365,7 @@ public class UniqueMemberIT extends Abst
         while ( list.hasMore() )
         {
             SearchResult result = list.next();
-            map.put( result.getName().toLowerCase(), result.getAttributes() );
+            map.put( Strings.toLowerCase( result.getName() ), result.getAttributes() );
         }
 
         assertEquals( "Expected number of results returned was incorrect!", 1, map.size() );
@@ -455,7 +456,7 @@ public class UniqueMemberIT extends Abst
         while ( list.hasMore() )
         {
             SearchResult result = list.next();
-            map.put( result.getName().toLowerCase(), result.getAttributes() );
+            map.put( Strings.toLowerCase( result.getName() ), result.getAttributes() );
         }
 
         assertEquals( "Expected number of results returned was incorrect!", 1, map.size() );

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java Mon Aug 29 21:26:19 2011
@@ -57,7 +57,7 @@ public abstract class AbstractMetaSchema
         for ( Rdn rdn : dn )
         {
             sb.append( '/' );
-            sb.append( Strings.toLowerCase(rdn.getName()) );
+            sb.append( Strings.toLowerCase( rdn.getName() ) );
         }
 
         sb.append( ".ldif" );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java Mon Aug 29 21:26:19 2011
@@ -113,21 +113,21 @@ public class AdministrativePointIntercep
     // Initialize the ROLES field
     static
     {
-        ROLES.add( SchemaConstants.AUTONOMOUS_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.AUTONOMOUS_AREA ) );
         ROLES.add( SchemaConstants.AUTONOMOUS_AREA_OID );
-        ROLES.add( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA ) );
         ROLES.add( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA_OID );
-        ROLES.add( SchemaConstants.ACCESS_CONTROL_INNER_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.ACCESS_CONTROL_INNER_AREA ) );
         ROLES.add( SchemaConstants.ACCESS_CONTROL_INNER_AREA_OID );
-        ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA ) );
         ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA_OID );
-        ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA ) );
         ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA_OID );
-        ROLES.add( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA ) );
         ROLES.add( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA_OID );
-        ROLES.add( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA ) );
         ROLES.add( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA_OID );
-        ROLES.add( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA.toLowerCase() );
+        ROLES.add( Strings.toLowerCase( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA ) );
         ROLES.add( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA_OID );
     }
 
@@ -137,20 +137,20 @@ public class AdministrativePointIntercep
     // Initialize the roles/oid map
     static
     {
-        ROLES_OID.put( SchemaConstants.AUTONOMOUS_AREA.toLowerCase(), SchemaConstants.AUTONOMOUS_AREA_OID );
-        ROLES_OID.put( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.AUTONOMOUS_AREA ), SchemaConstants.AUTONOMOUS_AREA_OID );
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA ),
             SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA_OID );
-        ROLES_OID.put( SchemaConstants.ACCESS_CONTROL_INNER_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.ACCESS_CONTROL_INNER_AREA ),
             SchemaConstants.ACCESS_CONTROL_INNER_AREA_OID );
-        ROLES_OID.put( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA ),
             SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA_OID );
-        ROLES_OID.put( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA ),
             SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA_OID );
-        ROLES_OID.put( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA ),
             SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA_OID );
-        ROLES_OID.put( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA ),
             SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA_OID );
-        ROLES_OID.put( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA.toLowerCase(),
+        ROLES_OID.put( Strings.toLowerCase( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA ),
             SchemaConstants.TRIGGER_EXECUTION_INNER_AREA_OID );
     }
 
@@ -159,11 +159,11 @@ public class AdministrativePointIntercep
 
     static
     {
-        INNER_AREA_ROLES.add( SchemaConstants.ACCESS_CONTROL_INNER_AREA.toLowerCase() );
+        INNER_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.ACCESS_CONTROL_INNER_AREA ) );
         INNER_AREA_ROLES.add( SchemaConstants.ACCESS_CONTROL_INNER_AREA_OID );
-        INNER_AREA_ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA.toLowerCase() );
+        INNER_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA ) );
         INNER_AREA_ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_INNER_AREA_OID );
-        INNER_AREA_ROLES.add( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA.toLowerCase() );
+        INNER_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA ) );
         INNER_AREA_ROLES.add( SchemaConstants.TRIGGER_EXECUTION_INNER_AREA_OID );
     }
 
@@ -172,13 +172,13 @@ public class AdministrativePointIntercep
 
     static
     {
-        SPECIFIC_AREA_ROLES.add( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA.toLowerCase() );
+        SPECIFIC_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA ) );
         SPECIFIC_AREA_ROLES.add( SchemaConstants.ACCESS_CONTROL_SPECIFIC_AREA_OID );
-        SPECIFIC_AREA_ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA.toLowerCase() );
+        SPECIFIC_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA ) );
         SPECIFIC_AREA_ROLES.add( SchemaConstants.COLLECTIVE_ATTRIBUTE_SPECIFIC_AREA_OID );
-        SPECIFIC_AREA_ROLES.add( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA.toLowerCase() );
+        SPECIFIC_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA ) );
         SPECIFIC_AREA_ROLES.add( SchemaConstants.SUB_SCHEMA_ADMIN_SPECIFIC_AREA_OID );
-        SPECIFIC_AREA_ROLES.add( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA.toLowerCase() );
+        SPECIFIC_AREA_ROLES.add( Strings.toLowerCase( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA ) );
         SPECIFIC_AREA_ROLES.add( SchemaConstants.TRIGGER_EXECUTION_SPECIFIC_AREA_OID );
     }
 
@@ -603,7 +603,7 @@ public class AdministrativePointIntercep
      */
     private void checkAddRole( Value<?> role, Attribute adminPoint, Dn dn ) throws LdapException
     {
-        String roleStr = Strings.toLowerCase(Strings.trim(role.getString()));
+        String roleStr = Strings.toLowerCase( Strings.trim( role.getString() ) );
 
         // Check that the added AdministrativeRole is valid
         if ( !ROLES.contains( roleStr ) )
@@ -658,7 +658,7 @@ public class AdministrativePointIntercep
      */
     private void checkDelRole( Value<?> role, Attribute adminPoint, Dn dn ) throws LdapException
     {
-        String roleStr = Strings.toLowerCase(Strings.trim(role.getString()));
+        String roleStr = Strings.toLowerCase( Strings.trim( role.getString() ) );
 
         // Check that the removed AdministrativeRole is valid
         if ( !ROLES.contains( roleStr ) )
@@ -802,7 +802,7 @@ public class AdministrativePointIntercep
      */
     private boolean isValidRole( String role )
     {
-        return ROLES.contains( Strings.toLowerCase(Strings.trim(role)) );
+        return ROLES.contains( Strings.toLowerCase( Strings.trim( role ) ) );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java Mon Aug 29 21:26:19 2011
@@ -101,7 +101,7 @@ public class PasswordUtil
                     return null;
                 }
 
-                String algorithm = new String( credentials, 1, pos - 1 ).toLowerCase();
+                String algorithm = Strings.toLowerCase( new String( credentials, 1, pos - 1 ) );
 
                 return LdapSecurityConstants.getAlgorithm( algorithm );
             }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Mon Aug 29 21:26:19 2011
@@ -94,6 +94,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.registries.Schema;
 import org.apache.directory.shared.ldap.model.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.OctetStringSyntaxChecker;
+import org.bouncycastle.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -889,7 +890,7 @@ public class SchemaInterceptor extends B
 
             if ( !ocName.equalsIgnoreCase( SchemaConstants.TOP_OC ) )
             {
-                String ocLowerName = ocName.toLowerCase();
+                String ocLowerName = Strings.toLowerCase( ocName );
 
                 ObjectClass objectClass = schemaManager.lookupObjectClassRegistry( ocLowerName );
 
@@ -905,7 +906,7 @@ public class SchemaInterceptor extends B
                 {
                     for ( ObjectClass oc : ocSuperiors )
                     {
-                        if ( !objectClasses.contains( oc.getName().toLowerCase() ) )
+                        if ( !objectClasses.contains( Strings.toLowerCase( oc.getName() ) ) )
                         {
                             objectClasses.add( oc.getName() );
                             objectClassesUP.add( oc.getName() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java Mon Aug 29 21:26:19 2011
@@ -47,6 +47,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.parsers.NormalizerDescription;
 import org.apache.directory.shared.ldap.model.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.model.schema.registries.SchemaLoader;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,17 +96,17 @@ public class SchemaSubentryManager
     
     static 
     {
-        VALID_OU_VALUES.add( SchemaConstants.NORMALIZERS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.COMPARATORS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.SYNTAX_CHECKERS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( "syntaxes".toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.MATCHING_RULES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.MATCHING_RULE_USE_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.ATTRIBUTE_TYPES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.OBJECT_CLASSES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.NAME_FORMS_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.DIT_CONTENT_RULES_AT.toLowerCase() );
-        VALID_OU_VALUES.add( SchemaConstants.DIT_STRUCTURE_RULES_AT.toLowerCase() );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.NORMALIZERS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.COMPARATORS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.SYNTAX_CHECKERS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( "syntaxes" ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.MATCHING_RULES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.MATCHING_RULE_USE_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.ATTRIBUTE_TYPES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.OBJECT_CLASSES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.NAME_FORMS_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.DIT_CONTENT_RULES_AT ) );
+        VALID_OU_VALUES.add( Strings.toLowerCase( SchemaConstants.DIT_STRUCTURE_RULES_AT ) );
     }
 
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyOidRegistry.java Mon Aug 29 21:26:19 2011
@@ -27,6 +27,7 @@ import java.util.Map;
 
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.schema.registries.OidRegistry;
+import org.bouncycastle.util.Strings;
 
 
 /**
@@ -39,7 +40,7 @@ class DummyOidRegistry extends OidRegist
 {
     public String getOid( String name ) throws LdapException
     {
-        return name.toLowerCase();
+        return Strings.toLowerCase( name );
     }
 
 

Added: directory/apacheds/trunk/jdbm/test.db
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm/test.db?rev=1163013&view=auto
==============================================================================
    (empty)

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosCatalog.java Mon Aug 29 21:26:19 2011
@@ -24,6 +24,7 @@ package org.apache.directory.server.kerb
 import java.util.Map;
 
 import org.apache.directory.server.protocol.shared.catalog.Catalog;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -49,7 +50,7 @@ class KerberosCatalog implements Catalog
 
     public String getBaseDn( String name )
     {
-        name = name.toLowerCase();
+        name = Strings.toLowerCase( name );
 
         if ( name.endsWith( "." ) )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/types/EncryptionType.java Mon Aug 29 21:26:19 2011
@@ -23,6 +23,9 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.shared.util.Strings;
+
+
 
 /**
  * A type-safe enumeration of Kerberos encryption types.
@@ -177,7 +180,7 @@ public enum EncryptionType
     {
         for ( EncryptionType type : EncryptionType.values() )
         {
-            encryptionTypesByName.put( type.getName().toLowerCase(), type );
+            encryptionTypesByName.put( Strings.toLowerCase( type.getName() ), type );
             encryptionTypesByValue.put( type.getValue(), type );
         }
     }
@@ -255,7 +258,7 @@ public enum EncryptionType
             return UNKNOWN;
         }
         
-        String lcType = type.toLowerCase();
+        String lcType = Strings.toLowerCase( type );
         
         if ( encryptionTypesByName.containsKey( lcType ) )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/VendorHelper.java Mon Aug 29 21:26:19 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.kerberos.shared.crypto.encryption;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * Helper for determining whether various ciphers are supported by the JRE.  For now
@@ -28,7 +30,7 @@ package org.apache.directory.server.kerb
  */
 public class VendorHelper
 {
-    private static final String vendor = System.getProperty( "java.vendor" ).toLowerCase();
+    private static final String vendor = Strings.toLowerCase( System.getProperty( "java.vendor" ) );
 
 
     static String getTripleDesAlgorithm()

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/EncKrbCredPartDecoderTest.java Mon Aug 29 21:26:19 2011
@@ -32,8 +32,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.encKrbCredPart.EncKrbCredPartContainer;
 import org.apache.directory.shared.kerberos.codec.types.EncryptionType;
@@ -41,6 +41,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
 import org.apache.directory.shared.kerberos.components.HostAddress;
 import org.apache.directory.shared.kerberos.components.KrbCredInfo;
+import org.apache.directory.shared.util.Strings;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -131,14 +132,14 @@ public class EncKrbCredPartDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = EncKrbCrePartFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = EncKrbCrePartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             for ( int j = i + 1; j < size; j++ )
             {
                 fieldValHolder = optionalFieldValueList.get( j );
                 presentFieldList.add( fieldValHolder );
-                f = EncKrbCrePartFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+                f = EncKrbCrePartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
                 f.set( expected, fieldValHolder.value );
             }
 
@@ -184,7 +185,7 @@ public class EncKrbCredPartDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = encKrbCredPartFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = encKrbCredPartFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
@@ -222,7 +223,7 @@ public class EncKrbCredPartDecoderTest
         Map<String, Field> fieldNameMap = getFieldMap( decoded );
         for ( FieldValueHolder fh : presentFieldList )
         {
-            Field actualField = fieldNameMap.get( fh.fieldName.toLowerCase() );
+            Field actualField = fieldNameMap.get( Strings.toLowerCase( fh.fieldName ) );
             Object decodedValue = actualField.get( decoded );
 
             //System.out.println( fh.fieldName + " expected: " + fh.value + " , actual: " + decodedValue );
@@ -246,7 +247,7 @@ public class EncKrbCredPartDecoderTest
         for ( Field f : fields )
         {
             f.setAccessible( true );
-            fieldNameMap.put( f.getName().toLowerCase(), f );
+            fieldNameMap.put( Strings.toLowerCase( f.getName() ), f );
         }
 
         return fieldNameMap;

Modified: directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java (original)
+++ directory/apacheds/trunk/kerberos-codec/src/test/java/org/apache/directory/shared/kerberos/codec/KrbCredInfoDecoderTest.java Mon Aug 29 21:26:19 2011
@@ -45,6 +45,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.components.PrincipalName;
 import org.apache.directory.shared.kerberos.flags.TicketFlag;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
+import org.apache.directory.shared.util.Strings;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -158,14 +159,14 @@ public class KrbCredInfoDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             for ( int j = i + 1; j < size; j++ )
             {
                 fieldValHolder = optionalFieldValueList.get( j );
                 presentFieldList.add( fieldValHolder );
-                f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+                f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
                 f.set( expected, fieldValHolder.value );
             }
 
@@ -213,7 +214,7 @@ public class KrbCredInfoDecoderTest
             FieldValueHolder fieldValHolder = optionalFieldValueList.get( i );
             presentFieldList.add( fieldValHolder );
 
-            Field f = krbCredInfoFieldNameMap.get( fieldValHolder.fieldName.toLowerCase() );
+            Field f = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fieldValHolder.fieldName ) );
             f.set( expected, fieldValHolder.value );
 
             ByteBuffer stream = ByteBuffer.allocate( expected.computeLength() );
@@ -254,7 +255,7 @@ public class KrbCredInfoDecoderTest
 
         for ( FieldValueHolder fh : presentFieldList )
         {
-            Field actualField = krbCredInfoFieldNameMap.get( fh.fieldName.toLowerCase() );
+            Field actualField = krbCredInfoFieldNameMap.get( Strings.toLowerCase( fh.fieldName ) );
             Object decodedValue = actualField.get( decoded );
 
             //System.out.println( fh.fieldName + " expected: " + fh.value + " , actual: " + decodedValue );
@@ -278,7 +279,7 @@ public class KrbCredInfoDecoderTest
         for ( Field f : fields )
         {
             f.setAccessible( true );
-            fieldNameMap.put( f.getName().toLowerCase(), f );
+            fieldNameMap.put( Strings.toLowerCase( f.getName() ), f );
         }
 
         return fieldNameMap;

Modified: directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java (original)
+++ directory/apacheds/trunk/kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/AbstractKerberosITest.java Mon Aug 29 21:26:19 2011
@@ -44,6 +44,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.util.Strings;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -287,8 +288,8 @@ public class AbstractKerberosITest exten
         data += "}" + SystemUtils.LINE_SEPARATOR;
 
         data += "[domain_realm]" + SystemUtils.LINE_SEPARATOR;
-        data += "." + REALM.toLowerCase() + " = " + REALM + SystemUtils.LINE_SEPARATOR;
-        data += REALM.toLowerCase() + " = " + REALM + SystemUtils.LINE_SEPARATOR;
+        data += "." + Strings.toLowerCase( REALM ) + " = " + REALM + SystemUtils.LINE_SEPARATOR;
+        data += Strings.toLowerCase( REALM ) + " = " + REALM + SystemUtils.LINE_SEPARATOR;
 
         FileUtils.writeStringToFile( file, data );
 

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Mon Aug 29 21:26:19 2011
@@ -670,7 +670,7 @@ public class LdifPartition extends Abstr
             }
         }
 
-        return sb.toString().toLowerCase();
+        return Strings.toLowerCase( sb.toString() );
     }
 
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordImpl.java Mon Aug 29 21:26:19 2011
@@ -23,6 +23,8 @@ package org.apache.directory.server.dns.
 
 import java.util.Map;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * The answer, authority, and additional sections all share the same
@@ -152,7 +154,7 @@ public class ResourceRecordImpl implemen
      */
     public String get( String id )
     {
-        return ( String ) attributes.get( id.toLowerCase() );
+        return ( String ) attributes.get( Strings.toLowerCase( id ) );
     }
 
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/messages/ResourceRecordModifier.java Mon Aug 29 21:26:19 2011
@@ -23,6 +23,8 @@ package org.apache.directory.server.dns.
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.directory.shared.util.Strings;
+
 
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -90,6 +92,6 @@ public class ResourceRecordModifier
      */
     public void put( String id, String value )
     {
-        attributes.put( id.toLowerCase(), value );
+        attributes.put( Strings.toLowerCase( id ), value );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/CanonicalNameRecordEncoderTest.java Mon Aug 29 21:26:19 2011
@@ -45,6 +45,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -63,7 +64,7 @@ public class CanonicalNameRecordEncoderT
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), cname );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), cname );
         return map;
     }
 

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoderTest.java Mon Aug 29 21:26:19 2011
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -44,8 +45,8 @@ public class MailExchangeRecordEncoderTe
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.MX_PREFERENCE.toLowerCase(), mxPreference );
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), mxHost );
+        map.put( Strings.toLowerCase( DnsAttribute.MX_PREFERENCE ), mxPreference );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), mxHost );
         return map;
     }
 

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/NameServerRecordEncoderTest.java Mon Aug 29 21:26:19 2011
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -43,7 +44,7 @@ public class NameServerRecordEncoderTest
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), nsName );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), nsName );
         return map;
     }
 

Modified: directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java?rev=1163013&r1=1163012&r2=1163013&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java (original)
+++ directory/apacheds/trunk/protocol-dns/src/test/java/org/apache/directory/server/dns/io/encoder/PointerRecordEncoderTest.java Mon Aug 29 21:26:19 2011
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.server.dns.store.DnsAttribute;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 
 
@@ -43,7 +44,7 @@ public class PointerRecordEncoderTest ex
     protected Map<String, Object> getAttributes()
     {
         Map<String, Object> map = new HashMap<String, Object>();
-        map.put( DnsAttribute.DOMAIN_NAME.toLowerCase(), ptrName );
+        map.put( Strings.toLowerCase( DnsAttribute.DOMAIN_NAME ), ptrName );
         return map;
     }
 



Mime
View raw message