You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/08/04 19:13:47 UTC

svn commit: r982332 [4/5] - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/ apacheds/trunk/core-api/src/main/java/...

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java Wed Aug  4 17:13:46 2010
@@ -88,7 +88,7 @@ public class AvlPartition extends Abstra
 
         // initialize the store
         store.setId( getId() );
-        suffix.normalize( schemaManager.getNormalizerMapping() );
+        suffix.normalize( schemaManager );
         store.setSuffixDn( suffix );
 
         for ( AvlIndex<?, Entry> index : indexedAttributes )
@@ -119,10 +119,10 @@ public class AvlPartition extends Abstra
 
 
     /*
-     * TODO requires review 
-     * 
+     * TODO requires review
+     *
      * This getter deviates from the norm. all the partitions
-     * so far written never return a reference to store but I think that in this 
+     * so far written never return a reference to store but I think that in this
      * case the presence of this method gives significant ease and advantage to perform
      * add/delete etc. operations without creating a operation context.
      */

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.core.partition.impl.btree;
 
@@ -218,7 +218,7 @@ public abstract class BTreePartition<ID>
 
     /**
      * Gets the DefaultSearchEngine used by this ContextPartition to search the
-     * Database. 
+     * Database.
      *
      * @return the search engine
      */
@@ -280,9 +280,9 @@ public abstract class BTreePartition<ID>
             DN dn = searchContext.getDn();
             AliasDerefMode derefMode = searchContext.getAliasDerefMode();
             ExprNode filter = searchContext.getFilter();
-    
+
             underlying = searchEngine.cursor( dn, derefMode, filter, searchCtls );
-    
+
             return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, underlying ), searchContext );
         }
         catch ( Exception e )
@@ -308,7 +308,7 @@ public abstract class BTreePartition<ID>
             return entry;
         }
 
-        for ( AttributeType attributeType : ( ( Entry ) entry.getOriginalEntry() ).getAttributeTypes() )
+        for ( AttributeType attributeType : ( entry.getOriginalEntry() ).getAttributeTypes() )
         {
             if ( !lookupContext.getAttrsId().contains( attributeType.getOid() ) )
             {
@@ -342,7 +342,7 @@ public abstract class BTreePartition<ID>
     // public abstract methods
 
     // ------------------------------------------------------------------------
-    // Index Operations 
+    // Index Operations
     // ------------------------------------------------------------------------
 
     public abstract void addIndexOn( Index<? extends Object, Entry, ID> index ) throws Exception;
@@ -358,7 +358,7 @@ public abstract class BTreePartition<ID>
 
 
     /**
-     * Gets the Index mapping the primary keys of parents to the 
+     * Gets the Index mapping the primary keys of parents to the
      * primary keys of their children.
      *
      * @return the one level Index
@@ -367,7 +367,7 @@ public abstract class BTreePartition<ID>
 
 
     /**
-     * Gets the Index mapping the primary keys of ancestors to the 
+     * Gets the Index mapping the primary keys of ancestors to the
      * primary keys of their descendants.
      *
      * @return the sub tree level Index
@@ -376,20 +376,20 @@ public abstract class BTreePartition<ID>
 
 
     /**
-     * Gets the alias index mapping parent entries with scope expanding aliases 
+     * Gets the alias index mapping parent entries with scope expanding aliases
      * children one level below them; this system index is used to dereference
      * aliases on one/single level scoped searches.
-     * 
+     *
      * @return the one alias index
      */
     public abstract Index<ID, Entry, ID> getOneAliasIndex();
 
 
     /**
-     * Gets the alias index mapping relative entries with scope expanding 
-     * alias descendents; this system index is used to dereference aliases on 
+     * Gets the alias index mapping relative entries with scope expanding
+     * alias descendents; this system index is used to dereference aliases on
      * subtree scoped searches.
-     * 
+     *
      * @return the sub alias index
      */
     public abstract Index<ID, Entry, ID> getSubAliasIndex();
@@ -398,7 +398,7 @@ public abstract class BTreePartition<ID>
     /**
      * Gets the system index defined on the ALIAS_ATTRIBUTE which for LDAP would
      * be the aliasedObjectName and for X.500 would be aliasedEntryName.
-     * 
+     *
      * @return the index on the ALIAS_ATTRIBUTE
      */
     public abstract Index<String, Entry, ID> getAliasIndex();
@@ -410,10 +410,10 @@ public abstract class BTreePartition<ID>
     public void setSuffix( DN suffix ) throws LdapInvalidDnException
     {
         this.suffix = suffix;
-        
+
         if ( schemaManager != null )
         {
-            this.suffix.normalize( schemaManager.getNormalizerMapping() );
+            this.suffix.normalize( schemaManager );
         }
     }
 
@@ -432,7 +432,7 @@ public abstract class BTreePartition<ID>
 
     public abstract Index<? extends Object, Entry, ID> getSystemIndex( AttributeType attributeType ) throws Exception;
 
-    
+
     public abstract ID getEntryId( DN dn ) throws LdapException;
 
 
@@ -466,9 +466,9 @@ public abstract class BTreePartition<ID>
     /**
      * Gets the count of the total number of entries in the database.
      *
-     * TODO shouldn't this be a BigInteger instead of an int? 
-     * 
-     * @return the number of entries in the database 
+     * TODO shouldn't this be a BigInteger instead of an int?
+     *
+     * @return the number of entries in the database
      * @throws Exception if there is a failure to read the count
      */
     public abstract int count() throws Exception;

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.server.xdbm;
 
@@ -137,7 +137,7 @@ public abstract class AbstractStore<E, I
     /** the relative distinguished name index */
     protected Index<ParentIdAndRdn<ID>, E, ID> rdnIdx;
 
-    
+
     public void init( SchemaManager schemaManager ) throws Exception
     {
         this.schemaManager = schemaManager;
@@ -368,10 +368,10 @@ public abstract class AbstractStore<E, I
 
     /**
      * Convert and initialize an index for a specific store implementation.
-     * 
+     *
      * @param index the index
      * @return the converted and initialized index
-     * @throws Exception 
+     * @throws Exception
      */
     protected abstract Index<?, E, ID> convertAndInit( Index<?, E, ID> index ) throws Exception;
 
@@ -748,7 +748,7 @@ public abstract class AbstractStore<E, I
         // Just to be sure that the DN is normalized
         if ( !dn.isNormalized() )
         {
-            dn.normalize( schemaManager.getNormalizerMapping() );
+            dn.normalize( schemaManager );
         }
 
         int dnSize = dn.size();
@@ -763,7 +763,7 @@ public abstract class AbstractStore<E, I
         {
             key = new ParentIdAndRdn<ID>( curEntryId, dn.getRdn( i ) );
             curEntryId = rdnIdx.forwardLookup( key );
-            
+
             if ( curEntryId == null )
             {
                 break;
@@ -835,7 +835,7 @@ public abstract class AbstractStore<E, I
 
     /**
      * {@inheritDoc}
-     * TODO : We should be able to revert all the changes made to index 
+     * TODO : We should be able to revert all the changes made to index
      * if something went wrong. Also the index should auto-repair : if
      * an entry does not exist in the Master table, then the index must be updated to reflect this.
      */
@@ -851,8 +851,8 @@ public abstract class AbstractStore<E, I
         ID id = master.getNextId( entry );
 
         //
-        // Suffix entry cannot have a parent since it is the root so it is 
-        // capped off using the zero value which no entry can have since 
+        // Suffix entry cannot have a parent since it is the root so it is
+        // capped off using the zero value which no entry can have since
         // entry sequences start at 1.
         //
         DN entryDn = entry.getDn();
@@ -953,7 +953,7 @@ public abstract class AbstractStore<E, I
             {
                 Index<Object, E, ID> idx = ( Index<Object, E, ID> ) getUserIndex( attributeOid );
 
-                // here lookup by attributeId is OK since we got attributeId from 
+                // here lookup by attributeId is OK since we got attributeId from
                 // the entry via the enumeration - it's in there as is for sure
 
                 for ( Value<?> value : attribute )
@@ -1099,7 +1099,7 @@ public abstract class AbstractStore<E, I
             {
                 Index<?, E, ID> index = getUserIndex( attributeOid );
 
-                // here lookup by attributeId is ok since we got attributeId from 
+                // here lookup by attributeId is ok since we got attributeId from
                 // the entry via the enumeration - it's in there as is for sure
                 for ( Value<?> value : attribute )
                 {
@@ -1127,21 +1127,21 @@ public abstract class AbstractStore<E, I
     {
         ID id = getEntryId( dn );
         boolean hasEntry = true;
-        
+
         if ( entry == null )
         {
             hasEntry = false;
             entry = lookup( id );
         }
-        
+
         DN updn = entry.getDn();
 
         newRdn.normalize( schemaManager.getNormalizerMapping() );
 
-        /* 
+        /*
          * H A N D L E   N E W   R D N
          * ====================================================================
-         * Add the new RDN attribute to the entry.  If an index exists on the 
+         * Add the new RDN attribute to the entry.  If an index exists on the
          * new RDN attribute we add the index for this attribute value pair.
          * Also we make sure that the presence index shows the existence of the
          * new RDN attribute within this entry.
@@ -1151,11 +1151,11 @@ public abstract class AbstractStore<E, I
         {
             String newNormType = newAtav.getNormType();
             Object newNormValue = newAtav.getNormValue().get();
-            
+
             if ( ! hasEntry )
             {
                 AttributeType newRdnAttrType = schemaManager.lookupAttributeTypeRegistry( newNormType );
-    
+
                 entry.add( newRdnAttrType, newAtav.getUpValue() );
             }
 
@@ -1175,16 +1175,16 @@ public abstract class AbstractStore<E, I
         /*
          * H A N D L E   O L D   R D N
          * ====================================================================
-         * If the old RDN is to be removed we need to get the attribute and 
-         * value for it.  Keep in mind the old RDN need not be based on the 
+         * If the old RDN is to be removed we need to get the attribute and
+         * value for it.  Keep in mind the old RDN need not be based on the
          * same attr as the new one.  We remove the RDN value from the entry
          * and remove the value/id tuple from the index on the old RDN attr
-         * if any.  We also test if the delete of the old RDN index tuple 
+         * if any.  We also test if the delete of the old RDN index tuple
          * removed all the attribute values of the old RDN using a reverse
-         * lookup.  If so that means we blew away the last value of the old 
-         * RDN attribute.  In this case we need to remove the attrName/id 
+         * lookup.  If so that means we blew away the last value of the old
+         * RDN attribute.  In this case we need to remove the attrName/id
          * tuple from the presence index.
-         * 
+         *
          * We only remove an ATAV of the old RDN if it is not included in the
          * new RDN.
          */
@@ -1233,7 +1233,7 @@ public abstract class AbstractStore<E, I
             }
         }
 
-        
+
         /*
          * H A N D L E   D N   C H A N G E
          * ====================================================================
@@ -1271,36 +1271,36 @@ public abstract class AbstractStore<E, I
     {
     	// Check that the old entry exists
         ID oldId = getEntryId( oldDn );
-        
+
         if ( oldId == null )
         {
             // This is not allowed : the old entry must exist
-        	LdapNoSuchObjectException nse = new LdapNoSuchObjectException( 
+        	LdapNoSuchObjectException nse = new LdapNoSuchObjectException(
                 I18n.err( I18n.ERR_256_NO_SUCH_OBJECT, oldDn ) );
             throw nse;
         }
-        
+
         // Check that the new superior exist
         ID newSuperiorId = getEntryId( newSuperiorDn );
-        
+
         if ( newSuperiorId == null )
         {
             // This is not allowed : the new superior must exist
-        	LdapNoSuchObjectException nse = new LdapNoSuchObjectException( 
+        	LdapNoSuchObjectException nse = new LdapNoSuchObjectException(
                 I18n.err( I18n.ERR_256_NO_SUCH_OBJECT, newSuperiorDn ) );
             throw nse;
         }
-        
+
         DN newDn = newSuperiorDn.add( newRdn );
-        
+
         // Now check that the new entry does not exist
         ID newId = getEntryId( newDn );
-        
+
         if ( newId != null )
         {
             // This is not allowed : we should not be able to move an entry
             // to an existing position
-            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException( 
+            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
                 I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, newSuperiorDn.getName() ) );
             throw ne;
         }
@@ -1322,8 +1322,8 @@ public abstract class AbstractStore<E, I
     {
         move( oldDn, newSuperiorDn, newDn, null );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -1331,23 +1331,23 @@ public abstract class AbstractStore<E, I
     {
         // Check that the parent DN exists
         ID newParentId = getEntryId( newSuperiorDn );
-        
+
         if ( newParentId == null )
         {
             // This is not allowed : the parent must exist
-            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException( 
+            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
                 I18n.err( I18n.ERR_256_NO_SUCH_OBJECT, newSuperiorDn.getName() ) );
             throw ne;
         }
-        
+
         // Now check that the new entry does not exist
         ID newId = getEntryId( newDn );
-        
+
         if ( newId != null )
         {
             // This is not allowed : we should not be able to move an entry
             // to an existing position
-            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException( 
+            LdapEntryAlreadyExistsException ne = new LdapEntryAlreadyExistsException(
                 I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, newSuperiorDn.getName() ) );
             throw ne;
         }
@@ -1359,7 +1359,7 @@ public abstract class AbstractStore<E, I
         /*
          * All aliases including and below oldChildDn, will be affected by
          * the move operation with respect to one and subtree userIndices since
-         * their relationship to ancestors above oldChildDn will be 
+         * their relationship to ancestors above oldChildDn will be
          * destroyed.  For each alias below and including oldChildDn we will
          * drop the index tuples mapping ancestor ids above oldChildDn to the
          * respective target ids of the aliases.
@@ -1380,15 +1380,15 @@ public abstract class AbstractStore<E, I
         ParentIdAndRdn<ID> key = new ParentIdAndRdn<ID>( newParentId, oldDn.getRdn() );
         rdnIdx.add( key, entryId );
 
-        
-        /* 
+
+        /*
          * Read Alias Index Tuples
-         * 
+         *
          * If this is a name change due to a move operation then the one and
          * subtree userIndices for aliases were purged before the aliases were
-         * moved.  Now we must add them for each alias entry we have moved.  
-         * 
-         * aliasTarget is used as a marker to tell us if we're moving an 
+         * moved.  Now we must add them for each alias entry we have moved.
+         *
+         * aliasTarget is used as a marker to tell us if we're moving an
          * alias.  If it is null then the moved entry is not an alias.
          */
         String aliasTarget = aliasIdx.reverseLookup( entryId );
@@ -1397,7 +1397,7 @@ public abstract class AbstractStore<E, I
         {
             addAliasIndices( entryId, buildEntryDn( entryId ), aliasTarget );
         }
-        
+
         // Update the master table with the modified entry
         // Warning : this test is an hack. As we may call the Store API directly
         // we may not have a modified entry to update. For instance, if the ModifierName
@@ -1433,7 +1433,7 @@ public abstract class AbstractStore<E, I
         List<RDN> rdnList = new ArrayList<RDN>();
         String upName = "";
         String normName = "";
-        
+
         do
         {
             ParentIdAndRdn<ID> cur = rdnIdx.reverseLookup( parentId );
@@ -1451,7 +1451,7 @@ public abstract class AbstractStore<E, I
                     normName = normName + "," + rdn.getNormName();
                     upName = upName + "," + rdn.getName();
                 }
-                
+
                 rdnList.add( rdn );
             }
 
@@ -1460,19 +1460,19 @@ public abstract class AbstractStore<E, I
         while ( !parentId.equals( getRootId() ) );
 
         DN dn = new DN( upName, normName, StringTools.getBytesUtf8( normName ), rdnList );
-        
+
         return dn;
     }
 
 
     /**
      * Adds a set of attribute values while affecting the appropriate userIndices.
-     * The entry is not persisted: it is only changed in anticipation for a put 
+     * The entry is not persisted: it is only changed in anticipation for a put
      * into the master table.
      *
      * @param id the primary key of the entry
      * @param entry the entry to alter
-     * @param mods the attribute and values to add 
+     * @param mods the attribute and values to add
      * @throws Exception if index alteration or attribute addition fails
      */
     @SuppressWarnings("unchecked")
@@ -1533,7 +1533,7 @@ public abstract class AbstractStore<E, I
      * @param id the primary key of the entry
      * @param entry the entry to alter
      * @param mods the replacement attribute and values
-     * @throws Exception if index alteration or attribute modification 
+     * @throws Exception if index alteration or attribute modification
      * fails.
      */
     @SuppressWarnings("unchecked")
@@ -1549,7 +1549,7 @@ public abstract class AbstractStore<E, I
         // Special case for the ObjectClass index
         if ( mods.getAttributeType().equals( OBJECT_CLASS_AT ) )
         {
-            // if the id exists in the index drop all existing attribute 
+            // if the id exists in the index drop all existing attribute
             // value index entries and add new ones
             if ( objectClassIdx.reverse( id ) )
             {
@@ -1565,7 +1565,7 @@ public abstract class AbstractStore<E, I
         {
             Index<?, E, ID> index = getUserIndex( modsOid );
 
-            // if the id exists in the index drop all existing attribute 
+            // if the id exists in the index drop all existing attribute
             // value index entries and add new ones
             if ( index.reverse( id ) )
             {
@@ -1577,7 +1577,7 @@ public abstract class AbstractStore<E, I
                 ( ( Index<Object, E, ID> ) index ).add( value.get(), id );
             }
 
-            /* 
+            /*
              * If no attribute values exist for this entryId in the index then
              * we remove the presence index entry for the removed attribute.
              */
@@ -1615,10 +1615,10 @@ public abstract class AbstractStore<E, I
 
 
     /**
-     * Completely removes the set of values for an attribute having the values 
+     * Completely removes the set of values for an attribute having the values
      * supplied while affecting the appropriate userIndices.  The entry is not
-     * persisted: it is only changed in anticipation for a put into the master 
-     * table.  Note that an empty attribute w/o values will remove all the 
+     * persisted: it is only changed in anticipation for a put into the master
+     * table.  Note that an empty attribute w/o values will remove all the
      * values within the entry where as an attribute w/ values will remove those
      * attribute values it contains.
      *
@@ -1641,7 +1641,7 @@ public abstract class AbstractStore<E, I
         if ( mods.getAttributeType().equals( OBJECT_CLASS_AT ) )
         {
             /*
-             * If there are no attribute values in the modifications then this 
+             * If there are no attribute values in the modifications then this
              * implies the complete removal of the attribute from the index. Else
              * we remove individual tuples from the index.
              */
@@ -1662,7 +1662,7 @@ public abstract class AbstractStore<E, I
             Index<?, E, ID> index = getUserIndex( modsOid );
 
             /*
-             * If there are no attribute values in the modifications then this 
+             * If there are no attribute values in the modifications then this
              * implies the complete removal of the attribute from the index. Else
              * we remove individual tuples from the index.
              */
@@ -1678,7 +1678,7 @@ public abstract class AbstractStore<E, I
                 }
             }
 
-            /* 
+            /*
              * If no attribute values exist for this entryId in the index then
              * we remove the presence index entry for the removed attribute.
              */
@@ -1689,11 +1689,11 @@ public abstract class AbstractStore<E, I
         }
 
         AttributeType attrType = schemaManager.lookupAttributeTypeRegistry( modsOid );
-        
+
         /*
-         * If there are no attribute values in the modifications then this 
+         * If there are no attribute values in the modifications then this
          * implies the complete removal of the attribute from the entry. Else
-         * we remove individual attribute values from the entry in mods one 
+         * we remove individual attribute values from the entry in mods one
          * at a time.
          */
         if ( mods.size() == 0 )
@@ -1729,7 +1729,7 @@ public abstract class AbstractStore<E, I
     /**
      * Adds userIndices for an aliasEntry to be added to the database while checking
      * for constrained alias constructs like alias cycles and chaining.
-     * 
+     *
      * @param aliasDn normalized distinguished name for the alias entry
      * @param aliasTarget the user provided aliased entry dn as a string
      * @param aliasId the id of alias entry to add
@@ -1744,17 +1744,17 @@ public abstract class AbstractStore<E, I
         DN ancestorDn; // Name of an alias entry relative
         ID ancestorId; // Id of an alias entry relative
 
-        // Access aliasedObjectName, normalize it and generate the Name 
+        // Access aliasedObjectName, normalize it and generate the Name
         normalizedAliasTargetDn = new DN( aliasTarget, schemaManager );
 
         /*
          * Check For Cycles
-         * 
+         *
          * Before wasting time to lookup more values we check using the target
          * dn to see if we have the possible formation of an alias cycle.  This
-         * happens when the alias refers back to a target that is also a 
+         * happens when the alias refers back to a target that is also a
          * relative of the alias entry.  For detection we test if the aliased
-         * entry Dn starts with the target Dn.  If it does then we know the 
+         * entry Dn starts with the target Dn.  If it does then we know the
          * aliased target is a relative and we have a perspecitive cycle.
          */
         if ( aliasDn.isChildOf( normalizedAliasTargetDn ) )
@@ -1775,8 +1775,8 @@ public abstract class AbstractStore<E, I
 
         /*
          * Check For Aliases External To Naming Context
-         * 
-         * id may be null but the alias may be to a valid entry in 
+         *
+         * id may be null but the alias may be to a valid entry in
          * another namingContext.  Such aliases are not allowed and we
          * need to point it out to the user instead of saying the target
          * does not exist when it potentially could outside of this upSuffix.
@@ -1794,7 +1794,7 @@ public abstract class AbstractStore<E, I
 
         /*
          * Check For Target Existence
-         * 
+         *
          * We do not allow the creation of inconsistent aliases.  Aliases should
          * not be broken links.  If the target does not exist we start screaming
          */
@@ -1809,13 +1809,13 @@ public abstract class AbstractStore<E, I
 
         /*
          * Detect Direct Alias Chain Creation
-         * 
+         *
          * Rather than resusitate the target to test if it is an alias and fail
          * due to chaing creation we use the alias index to determine if the
          * target is an alias.  Hence if the alias we are about to create points
-         * to another alias as its target in the aliasedObjectName attribute, 
-         * then we have a situation where an alias chain is being created.  
-         * Alias chaining is not allowed so we throw and exception. 
+         * to another alias as its target in the aliasedObjectName attribute,
+         * then we have a situation where an alias chain is being created.
+         * Alias chaining is not allowed so we throw and exception.
          */
         if ( null != aliasIdx.reverseLookup( targetId ) )
         {
@@ -1830,7 +1830,7 @@ public abstract class AbstractStore<E, I
 
         /*
          * Handle One Level Scope Alias Index
-         * 
+         *
          * The first relative is special with respect to the one level alias
          * index.  If the target is not a sibling of the alias then we add the
          * index entry maping the parent's id to the aliased target id.
@@ -1850,12 +1850,12 @@ public abstract class AbstractStore<E, I
 
         /*
          * Handle Sub Level Scope Alias Index
-         * 
+         *
          * Walk the list of relatives from the parents up to the upSuffix, testing
          * to see if the alias' target is a descendant of the relative.  If the
          * alias target is not a descentant of the relative it extends the scope
          * and is added to the sub tree scope alias index.  The upSuffix node is
-         * ignored since everything is under its scope.  The first loop 
+         * ignored since everything is under its scope.  The first loop
          * iteration shall handle the parents.
          */
         while ( !ancestorDn.equals( suffixDn ) && null != ancestorId )
@@ -1874,8 +1874,8 @@ public abstract class AbstractStore<E, I
     /**
      * Removes the index entries for an alias before the entry is deleted from
      * the master table.
-     * 
-     * @todo Optimize this by walking the hierarchy index instead of the name 
+     *
+     * @todo Optimize this by walking the hierarchy index instead of the name
      * @param aliasId the id of the alias entry in the master table
      * @throws LdapException if we cannot parse ldap names
      * @throws Exception if we cannot delete index values in the database
@@ -1903,8 +1903,8 @@ public abstract class AbstractStore<E, I
          * linking baseIds to the targetId.  If more than one alias refers to
          * the target then droping all tuples with a value of targetId would
          * make all other aliases to the target inconsistent.
-         * 
-         * We need to walk up the path of alias ancestors until we reach the 
+         *
+         * We need to walk up the path of alias ancestors until we reach the
          * upSuffix, deleting each ( ancestorId, targetId ) tuple in the
          * subtree scope alias.  We only need to do this for the direct parent
          * of the alias on the one level subtree.
@@ -1914,7 +1914,7 @@ public abstract class AbstractStore<E, I
 
         while ( !ancestorDn.equals( suffixDn ) && ancestorDn.size() > suffixDn.size() )
         {
-            ancestorDn = ( DN ) ancestorDn.getPrefix( ancestorDn.size() - 1 );
+            ancestorDn = ancestorDn.getPrefix( ancestorDn.size() - 1 );
             ancestorId = getEntryId( ancestorDn );
 
             subAliasIdx.drop( ancestorId, targetId );
@@ -1929,7 +1929,7 @@ public abstract class AbstractStore<E, I
      * For all aliases including and under the moved base, this method removes
      * one and subtree alias index tuples for old ancestors above the moved base
      * that will no longer be ancestors after the move.
-     * 
+     *
      * @param movedBase the base at which the move occured - the moved node
      * @throws Exception if system userIndices fail
      */
@@ -1945,10 +1945,10 @@ public abstract class AbstractStore<E, I
 
 
     /**
-     * For the alias id all ancestor one and subtree alias tuples are moved 
+     * For the alias id all ancestor one and subtree alias tuples are moved
      * above the moved base.
-     * 
-     * @param aliasId the id of the alias 
+     *
+     * @param aliasId the id of the alias
      * @param movedBase the base where the move occured
      * @throws Exception if userIndices fail
      */
@@ -1959,10 +1959,10 @@ public abstract class AbstractStore<E, I
         DN aliasDn = getEntryDn( aliasId );
 
         /*
-         * Start droping index tuples with the first ancestor right above the 
+         * Start droping index tuples with the first ancestor right above the
          * moved base.  This is the first ancestor effected by the move.
          */
-        DN ancestorDn = ( DN ) movedBase.getPrefix( 1 );
+        DN ancestorDn = movedBase.getPrefix( 1 );
         ID ancestorId = getEntryId( ancestorDn );
 
         /*
@@ -1970,10 +1970,10 @@ public abstract class AbstractStore<E, I
          * linking baseIds to the targetId.  If more than one alias refers to
          * the target then droping all tuples with a value of targetId would
          * make all other aliases to the target inconsistent.
-         * 
-         * We need to walk up the path of alias ancestors right above the moved 
+         *
+         * We need to walk up the path of alias ancestors right above the moved
          * base until we reach the upSuffix, deleting each ( ancestorId,
-         * targetId ) tuple in the subtree scope alias.  We only need to do 
+         * targetId ) tuple in the subtree scope alias.  We only need to do
          * this for the direct parent of the alias on the one level subtree if
          * the moved base is the alias.
          */
@@ -1986,7 +1986,7 @@ public abstract class AbstractStore<E, I
 
         while ( !ancestorDn.equals( suffixDn ) )
         {
-            ancestorDn = ( DN ) ancestorDn.getPrefix( 1 );
+            ancestorDn = ancestorDn.getPrefix( 1 );
             ancestorId = getEntryId( ancestorDn );
 
             subAliasIdx.drop( ancestorId, targetId );
@@ -1996,13 +1996,13 @@ public abstract class AbstractStore<E, I
 
     /**
      * Moves an entry under a new parent.  The operation causes a shift in the
-     * parent child relationships between the old parent, new parent and the 
+     * parent child relationships between the old parent, new parent and the
      * child moved.  All other descendant entries under the child never change
      * their direct parent child relationships.  Hence after the parent child
      * relationship changes are broken at the old parent and set at the new
-     * parent a modifyDn operation is conducted to handle name changes 
+     * parent a modifyDn operation is conducted to handle name changes
      * propagating down through the moved child and its descendants.
-     * 
+     *
      * @param oldChildDn the normalized dn of the child to be moved
      * @param childId the id of the child being moved
      * @param newParentDn the normalized dn of the new parent for the child
@@ -2017,7 +2017,7 @@ public abstract class AbstractStore<E, I
         /*
          * All aliases including and below oldChildDn, will be affected by
          * the move operation with respect to one and subtree userIndices since
-         * their relationship to ancestors above oldChildDn will be 
+         * their relationship to ancestors above oldChildDn will be
          * destroyed.  For each alias below and including oldChildDn we will
          * drop the index tuples mapping ancestor ids above oldChildDn to the
          * respective target ids of the aliases.
@@ -2040,14 +2040,14 @@ public abstract class AbstractStore<E, I
         ParentIdAndRdn<ID> key = new ParentIdAndRdn<ID>( newParentId, newRdn );
         rdnIdx.add( key, childId );
 
-        /* 
+        /*
          * Read Alias Index Tuples
-         * 
+         *
          * If this is a name change due to a move operation then the one and
          * subtree userIndices for aliases were purged before the aliases were
-         * moved.  Now we must add them for each alias entry we have moved.  
-         * 
-         * aliasTarget is used as a marker to tell us if we're moving an 
+         * moved.  Now we must add them for each alias entry we have moved.
+         *
+         * aliasTarget is used as a marker to tell us if we're moving an
          * alias.  If it is null then the moved entry is not an alias.
          */
         String aliasTarget = aliasIdx.reverseLookup( childId );

Modified: directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java (original)
+++ directory/shared/trunk/ldap-schema-manager-tests/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.shared.ldap.subtree;
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith;
 
 /**
  * Unit tests class for Subtree Specification parser (wrapper).
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 @RunWith(ConcurrentJunitRunner.class)
@@ -103,10 +103,10 @@ public class SubtreeSpecificationParserT
 
     /** An invalid specification with completely unrelated content */
     private static final String INVALID_SILLY_THING = "How much wood would a wood chuck chuck if a wood chuck would chuck wood?";
-    
+
     /** holds multithreaded success value */
     boolean isSuccessMultithreaded = true;
-    
+
     /** The schema manager */
     private static SchemaManager schemaManager;
 
@@ -125,12 +125,12 @@ public class SubtreeSpecificationParserT
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
         schemaManager = new DefaultSchemaManager( loader );
-        
+
         schemaManager.loadAllEnabled();
 
         checker = new SubtreeSpecificationChecker( schemaManager );
         parser = new SubtreeSpecificationParser( schemaManager );
-        
+
         TOP_OC = schemaManager.lookupObjectClassRegistry( "top" );
         ALIAS_OC = schemaManager.lookupObjectClassRegistry( "alias" );
         COUNTRY_OC = schemaManager.lookupObjectClassRegistry( "country" );
@@ -281,10 +281,10 @@ public class SubtreeSpecificationParserT
         assertNotNull( ss );
 
         assertEquals( "ou=people", ss.getBase().toString() );
-        assertTrue( ss.getChopBeforeExclusions().contains( new DN( "x=y" ).normalize( schemaManager.getNormalizerMapping() ) ) );
-        assertTrue( ss.getChopBeforeExclusions().contains( new DN( "y=z" ).normalize( schemaManager.getNormalizerMapping() ) ) );
-        assertTrue( ss.getChopAfterExclusions().contains( new DN( "k=l" ).normalize( schemaManager.getNormalizerMapping() ) ) );
-        assertTrue( ss.getChopAfterExclusions().contains( new DN( "l=m" ).normalize( schemaManager.getNormalizerMapping() ) ) );
+        assertTrue( ss.getChopBeforeExclusions().contains( new DN( "x=y" ).normalize( schemaManager ) ) );
+        assertTrue( ss.getChopBeforeExclusions().contains( new DN( "y=z" ).normalize( schemaManager ) ) );
+        assertTrue( ss.getChopAfterExclusions().contains( new DN( "k=l" ).normalize( schemaManager ) ) );
+        assertTrue( ss.getChopAfterExclusions().contains( new DN( "l=m" ).normalize( schemaManager ) ) );
         assertEquals( 7, ss.getMinBaseDistance() );
         assertEquals( 77, ss.getMaxBaseDistance() );
     }
@@ -308,29 +308,29 @@ public class SubtreeSpecificationParserT
         List<Refinement> orList = new ArrayList<Refinement>();
         orList.add( aliasItem );
         orList.add( personItem );
-        
+
         Refinement orRefinement = new OrRefinement( orList );
-        
+
         // The inner AND refinement and:{ item:2.5.6.0, or:... }
         List<Refinement> innerAndList = new ArrayList<Refinement>();
         innerAndList.add( topItem );
         innerAndList.add( orRefinement );
-        
+
         Refinement innerAndRefinement = new AndRefinement( innerAndList );
-        
+
         // The NOT refinement not:item:2.5.6.2
         Refinement notRefinement = new NotRefinement( countryItem );
-        
+
         // The outer AND refinement and:{and:..., not:...}
         List<Refinement> outerAndList = new ArrayList<Refinement>();
         outerAndList.add( innerAndRefinement );
         outerAndList.add( notRefinement );
-        
+
         Refinement outerAndRefinement = new AndRefinement( outerAndList );
 
         StringBuilder buffer = new StringBuilder();
         ss.getRefinement().printRefinementToBuffer( buffer );
-        
+
         //assertEquals( outerAndRefinement.toString(), buffer );
         assertEquals( "and: { and: { item: 2.5.6.0, or: { item: 2.5.6.1, item: person } }, not: item: 2.5.6.2 }", buffer.toString() );
     }
@@ -388,8 +388,8 @@ public class SubtreeSpecificationParserT
             assertNotNull( e );
         }
     }
-    
-    
+
+
     /**
      * Test reusability, especially if the state is resetted.
      */

Modified: directory/shared/trunk/ldap/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/ACIItem.g?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/ACIItem.g Wed Aug  4 17:13:46 2010
@@ -499,7 +499,7 @@ attributeValue
         
         if ( schemaManager != null )
         {        
-          attributeTypeAndValueSetAsDn.normalize( schemaManager.getNormalizerMapping() );
+          attributeTypeAndValueSetAsDn.normalize( schemaManager );
         }
         
         for ( RDN rdn :attributeTypeAndValueSetAsDn.getRdns() )
@@ -1224,7 +1224,7 @@ distinguishedName returns [ DN name ] 
         name = new DN( token.getText() );
         if ( schemaManager != null )
         {
-            name.normalize( schemaManager.getNormalizerMapping() );
+            name.normalize( schemaManager );
         }
         log.debug( "recognized a DistinguishedName: " + token.getText() );
     }

Modified: directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g Wed Aug  4 17:13:46 2010
@@ -350,7 +350,7 @@ distinguishedName returns [ DN name ] 
     token:SAFEUTF8STRING
     {
         name = new DN( token.getText() );
-        name.normalize( schemaManager.getNormalizerMapping() );
+        name.normalize( schemaManager );
         
         log.debug( "recognized a DistinguishedName: " + token.getText() );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java Wed Aug  4 17:13:46 2010
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
 /**
  * A default implementation of a ServerEntry which should suite most
  * use cases.
- * 
+ *
  * This class is final, it should not be extended.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -86,7 +86,7 @@ public class DefaultEntry implements Ent
     // Constructors
     //-------------------------------------------------------------------------
     /**
-     * Creates a new instance of DefaultEntry. 
+     * Creates a new instance of DefaultEntry.
      * <p>
      * This entry <b>must</b> be initialized before being used !
      */
@@ -99,12 +99,12 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Creates a new instance of DefaultEntry, schema aware. 
+     * Creates a new instance of DefaultEntry, schema aware.
      * </p>
      * <p>
      * No attributes will be created.
-     * </p> 
-     * 
+     * </p>
+     *
      * @param schemaManager The reference to the schemaManager
      */
     public DefaultEntry( SchemaManager schemaManager )
@@ -118,9 +118,9 @@ public class DefaultEntry implements Ent
 
 
     /**
-     * Creates a new instance of DefaultEntry, with a 
-     * DN. 
-     * 
+     * Creates a new instance of DefaultEntry, with a
+     * DN.
+     *
      * @param dn The DN for this serverEntry. Can be null.
      */
     public DefaultEntry( DN dn )
@@ -131,12 +131,12 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Creates a new instance of DefaultEntry, schema aware. 
+     * Creates a new instance of DefaultEntry, schema aware.
      * </p>
      * <p>
      * No attributes will be created.
-     * </p> 
-     * 
+     * </p>
+     *
      * @param schemaManager The reference to the schemaManager
      * @param dn The DN for this serverEntry. Can be null.
      */
@@ -152,18 +152,18 @@ public class DefaultEntry implements Ent
         }
 
         this.schemaManager = schemaManager;
-        
+
         normalizeDN( dn );
-        
+
         // Initialize the ObjectClass object
         initObjectClassAT( schemaManager );
     }
 
 
     /**
-     * Creates a new instance of DefaultEntry, with a 
-     * DN and a list of IDs. 
-     * 
+     * Creates a new instance of DefaultEntry, with a
+     * DN and a list of IDs.
+     *
      * @param dn The DN for this serverEntry. Can be null.
      * @param upIds The list of attributes to create.
      */
@@ -181,13 +181,13 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Creates a new instance of DefaultEntry, copying 
-     * another entry. 
+     * Creates a new instance of DefaultEntry, copying
+     * another entry.
      * </p>
      * <p>
      * No attributes will be created.
-     * </p> 
-     * 
+     * </p>
+     *
      * @param schemaManager The reference to the schemaManager
      * @param entry the entry to copy
      */
@@ -209,7 +209,7 @@ public class DefaultEntry implements Ent
         }
 
         normalizeDN( dn );
-        
+
         // Init the attributes map
         attributes = new HashMap<String, EntryAttribute>( entry.size() );
 
@@ -242,14 +242,14 @@ public class DefaultEntry implements Ent
 
 
     /**
-     * Creates a new instance of DefaultEntry, with a 
-     * DN, a list of ID and schema aware. 
+     * Creates a new instance of DefaultEntry, with a
+     * DN, a list of ID and schema aware.
      * <p>
      * No attributes will be created except the ObjectClass attribute,
-     * which will contains "top". 
+     * which will contains "top".
      * <p>
      * If any of the AttributeType does not exist, they are simply discarded.
-     * 
+     *
      * @param schemaManager The reference to the schemaManager
      * @param dn The DN for this serverEntry. Can be null.
      * @param upIds The list of attributes to create.
@@ -266,9 +266,9 @@ public class DefaultEntry implements Ent
         }
 
         this.schemaManager = schemaManager;
-        
+
         normalizeDN( dn );
-        
+
         initObjectClassAT( schemaManager );
 
         set( upIds );
@@ -277,10 +277,10 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Creates a new instance of DefaultEntry, with a 
+     * Creates a new instance of DefaultEntry, with a
      * DN and a list of EntryAttributes.
-     * </p> 
-     * 
+     * </p>
+     *
      * @param dn The DN for this serverEntry. Can be null
      * @param attributes The list of attributes to create
      */
@@ -302,14 +302,14 @@ public class DefaultEntry implements Ent
 
 
     /**
-     * Creates a new instance of DefaultEntry, with a 
-     * DN, a list of ServerAttributes and schema aware. 
+     * Creates a new instance of DefaultEntry, with a
+     * DN, a list of ServerAttributes and schema aware.
      * <p>
      * No attributes will be created except the ObjectClass attribute,
-     * which will contains "top". 
+     * which will contains "top".
      * <p>
      * If any of the AttributeType does not exist, they are simply discarded.
-     * 
+     *
      * @param schemaManager The reference to the schemaManager
      * @param dn The DN for this serverEntry. Can be null
      * @param attributes The list of attributes to create
@@ -328,7 +328,7 @@ public class DefaultEntry implements Ent
         this.schemaManager = schemaManager;
 
         normalizeDN( dn );
-        
+
         initObjectClassAT( schemaManager );
 
         for ( EntryAttribute attribute : attributes )
@@ -348,8 +348,8 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Creates a new instance of DefaultEntry, with a 
-     * DN, a list of attributeTypes and schema aware. 
+     * Creates a new instance of DefaultEntry, with a
+     * DN, a list of attributeTypes and schema aware.
      * </p>
      * <p>
      * The newly created entry is fed with the list of attributeTypes. No
@@ -358,7 +358,7 @@ public class DefaultEntry implements Ent
      * <p>
      * If any of the AttributeType does not exist, they it's simply discarded.
      * </p>
-     * 
+     *
      * @param schemaManager The reference to the schemaManager
      * @param dn The DN for this serverEntry. Can be null.
      * @param attributeTypes The list of attributes to create, without value.
@@ -377,7 +377,7 @@ public class DefaultEntry implements Ent
         this.schemaManager = schemaManager;
 
         normalizeDN( dn );
-        
+
         // Initialize the ObjectClass object
         initObjectClassAT( schemaManager );
 
@@ -388,8 +388,8 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Creates a new instance of DefaultEntry, with a 
-     * DN, an attributeType with the user provided ID, and schema aware. 
+     * Creates a new instance of DefaultEntry, with a
+     * DN, an attributeType with the user provided ID, and schema aware.
      * </p>
      * <p>
      * The newly created entry is fed with the given attributeType. No
@@ -401,7 +401,7 @@ public class DefaultEntry implements Ent
      * <p>
      * We also check that the normalized upID equals the AttributeType ID
      * </p>
-     * 
+     *
      * @param schemaManager The reference to the schemaManager
      * @param dn The DN for this serverEntry. Can be null.
      * @param attributeType The attribute to create, without value.
@@ -421,7 +421,7 @@ public class DefaultEntry implements Ent
         this.schemaManager = schemaManager;
 
         normalizeDN( dn );
-        
+
         // Initialize the ObjectClass object
         initObjectClassAT( schemaManager );
 
@@ -442,12 +442,12 @@ public class DefaultEntry implements Ent
     //-------------------------------------------------------------------------
     /**
      * This method is used to initialize the OBJECT_CLASS_AT attributeType.
-     * 
+     *
      * We want to do it only once, so it's a synchronized method. Note that
      * the alternative would be to call the lookup() every time, but this won't
      * be very efficient, as it will get the AT from a map, which is also
      * synchronized, so here, we have a very minimal cost.
-     * 
+     *
      * We can't do it once as a static part in the body of this class, because
      * the access to the registries is mandatory to get back the AttributeType.
      */
@@ -521,7 +521,7 @@ public class DefaultEntry implements Ent
     /**
      * Add a new EntryAttribute, with its upId. If the upId is null,
      * default to the AttributeType name.
-     * 
+     *
      * Updates the AttributeMap.
      */
     protected void createAttribute( String upId, AttributeType attributeType, byte[]... values )
@@ -535,7 +535,7 @@ public class DefaultEntry implements Ent
     /**
      * Add a new EntryAttribute, with its upId. If the upId is null,
      * default to the AttributeType name.
-     * 
+     *
      * Updates the AttributeMap.
      */
     protected void createAttribute( String upId, AttributeType attributeType, String... values )
@@ -549,7 +549,7 @@ public class DefaultEntry implements Ent
     /**
      * Add a new EntryAttribute, with its upId. If the upId is null,
      * default to the AttributeType name.
-     * 
+     *
      * Updates the AttributeMap.
      */
     protected void createAttribute( String upId, AttributeType attributeType, Value<?>... values )
@@ -610,14 +610,14 @@ public class DefaultEntry implements Ent
 
         if ( attribute != null )
         {
-            // This Attribute already exist, we add the values 
+            // This Attribute already exist, we add the values
             // into it
             attribute.add( values );
         }
         else
         {
             // We have to create a new Attribute and set the values.
-            // The upId, which is set to null, will be setup by the 
+            // The upId, which is set to null, will be setup by the
             // createAttribute method
             createAttribute( null, attributeType, values );
         }
@@ -640,14 +640,14 @@ public class DefaultEntry implements Ent
 
         if ( attribute != null )
         {
-            // This Attribute already exist, we add the values 
+            // This Attribute already exist, we add the values
             // into it
             attribute.add( values );
         }
         else
         {
             // We have to create a new Attribute and set the values.
-            // The upId, which is set to null, will be setup by the 
+            // The upId, which is set to null, will be setup by the
             // createAttribute method
             createAttribute( null, attributeType, values );
         }
@@ -670,14 +670,14 @@ public class DefaultEntry implements Ent
 
         if ( attribute != null )
         {
-            // This Attribute already exist, we add the values 
+            // This Attribute already exist, we add the values
             // into it
             attribute.add( values );
         }
         else
         {
             // We have to create a new Attribute and set the values.
-            // The upId, which is set to null, will be setup by the 
+            // The upId, which is set to null, will be setup by the
             // createAttribute method
             createAttribute( null, attributeType, values );
         }
@@ -697,13 +697,13 @@ public class DefaultEntry implements Ent
             throw new UnsupportedOperationException( message );
         }
 
-        EntryAttribute attribute = ( EntryAttribute ) attributes.get( attributeType.getOid() );
+        EntryAttribute attribute = attributes.get( attributeType.getOid() );
 
         upId = getUpId( upId, attributeType );
 
         if ( attribute != null )
         {
-            // This Attribute already exist, we add the values 
+            // This Attribute already exist, we add the values
             // into it
             attribute.add( values );
             attribute.setUpId( upId, attributeType );
@@ -731,11 +731,11 @@ public class DefaultEntry implements Ent
 
         upId = getUpId( upId, attributeType );
 
-        EntryAttribute attribute = ( EntryAttribute ) attributes.get( attributeType.getOid() );
+        EntryAttribute attribute = attributes.get( attributeType.getOid() );
 
         if ( attribute != null )
         {
-            // This Attribute already exist, we add the values 
+            // This Attribute already exist, we add the values
             // into it
             attribute.add( values );
             attribute.setUpId( upId, attributeType );
@@ -761,11 +761,11 @@ public class DefaultEntry implements Ent
 
         upId = getUpId( upId, attributeType );
 
-        EntryAttribute attribute = ( EntryAttribute ) attributes.get( attributeType.getOid() );
+        EntryAttribute attribute = attributes.get( attributeType.getOid() );
 
         if ( attribute != null )
         {
-            // This Attribute already exist, we add the values 
+            // This Attribute already exist, we add the values
             // into it
             attribute.add( values );
             attribute.setUpId( upId, attributeType );
@@ -862,7 +862,7 @@ public class DefaultEntry implements Ent
 
             if ( attribute != null )
             {
-                // This Attribute already exist, we add the values 
+                // This Attribute already exist, we add the values
                 // into it. (If the values already exists, they will
                 // not be added, but this is done in the add() method)
                 attribute.add( values );
@@ -904,7 +904,7 @@ public class DefaultEntry implements Ent
 
             if ( attribute != null )
             {
-                // This Attribute already exist, we add the values 
+                // This Attribute already exist, we add the values
                 // into it. (If the values already exists, they will
                 // not be added, but this is done in the add() method)
                 attribute.add( values );
@@ -946,7 +946,7 @@ public class DefaultEntry implements Ent
 
             if ( attribute != null )
             {
-                // This Attribute already exist, we add the values 
+                // This Attribute already exist, we add the values
                 // into it. (If the values already exists, they will
                 // not be added, but this is done in the add() method)
                 attribute.add( values );
@@ -1556,7 +1556,7 @@ public class DefaultEntry implements Ent
                     throw new IllegalArgumentException( message );
                 }
 
-                // Search for the corresponding AttributeType, based on the upID 
+                // Search for the corresponding AttributeType, based on the upID
                 AttributeType attributeType = null;
 
                 try
@@ -1596,7 +1596,7 @@ public class DefaultEntry implements Ent
 
 
     /**
-     * {@inheritDoc}     
+     * {@inheritDoc}
      **/
     public List<EntryAttribute> set( AttributeType... attributeTypes )
     {
@@ -1654,7 +1654,7 @@ public class DefaultEntry implements Ent
                 }
 
                 // add the new one
-                this.attributes.put( id, ( EntryAttribute ) attribute );
+                this.attributes.put( id, attribute );
             }
         }
         else
@@ -2052,10 +2052,10 @@ public class DefaultEntry implements Ent
 
     /**
      * <p>
-     * Removes the attribute with the specified AttributeTypes. 
+     * Removes the attribute with the specified AttributeTypes.
      * </p>
      * <p>
-     * The removed attribute are returned by this method. 
+     * The removed attribute are returned by this method.
      * </p>
      * <p>
      * If there is no attribute with the specified AttributeTypes,
@@ -2179,14 +2179,14 @@ public class DefaultEntry implements Ent
      * will be removed too.
      * </p>
      * <p>
-     * If the attribute does not exist, nothing is done and the method returns 
+     * If the attribute does not exist, nothing is done and the method returns
      * <code>false</code>
-     * </p> 
+     * </p>
      *
-     * @param upId The attribute ID  
+     * @param upId The attribute ID
      * @param values the values to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
-     * if not all the values have been removed or if the attribute does not exist. 
+     * if not all the values have been removed or if the attribute does not exist.
      */
     public boolean remove( String upId, byte[]... values ) throws LdapException
     {
@@ -2268,14 +2268,14 @@ public class DefaultEntry implements Ent
      * will be removed too.
      * </p>
      * <p>
-     * If the attribute does not exist, nothing is done and the method returns 
+     * If the attribute does not exist, nothing is done and the method returns
      * <code>false</code>
-     * </p> 
+     * </p>
      *
-     * @param upId The attribute ID  
+     * @param upId The attribute ID
      * @param values the attributes to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
-     * if not all the values have been removed or if the attribute does not exist. 
+     * if not all the values have been removed or if the attribute does not exist.
      */
     public boolean remove( String upId, String... values ) throws LdapException
     {
@@ -2356,14 +2356,14 @@ public class DefaultEntry implements Ent
      * will be removed too.
      * </p>
      * <p>
-     * If the attribute does not exist, nothing is done and the method returns 
+     * If the attribute does not exist, nothing is done and the method returns
      * <code>false</code>
-     * </p> 
+     * </p>
      *
-     * @param upId The attribute ID  
+     * @param upId The attribute ID
      * @param values the attributes to be removed
      * @return <code>true</code> if at least a value is removed, <code>false</code>
-     * if not all the values have been removed or if the attribute does not exist. 
+     * if not all the values have been removed or if the attribute does not exist.
      */
     public boolean remove( String upId, Value<?>... values ) throws LdapException
     {
@@ -2522,7 +2522,7 @@ public class DefaultEntry implements Ent
 
     /**
      * @see Externalizable#writeExternal(ObjectOutput)<p>
-     * 
+     *
      * This is the place where we serialize entries, and all theirs
      * elements.
      * <p>
@@ -2551,7 +2551,7 @@ public class DefaultEntry implements Ent
             out.writeObject( dn );
         }
 
-        // Then the attributes. 
+        // Then the attributes.
         // Store the attributes' nulber first
         out.writeInt( attributes.size() );
 
@@ -2608,15 +2608,15 @@ public class DefaultEntry implements Ent
 
     /**
      * Serialize an Entry.
-     * 
+     *
      * The structure is the following :
      * <b>[a byte] : if the DN is empty 0 will be written else 1
      * <b>[RDN]</b> : The entry's RDN.
-     * <b>[numberAttr]</b> : the bumber of attributes. Can be 0 
-     * <b>[attribute's oid]*</b> : The attribute's OID to get back 
+     * <b>[numberAttr]</b> : the bumber of attributes. Can be 0
+     * <b>[attribute's oid]*</b> : The attribute's OID to get back
      * the attributeType on deserialization
      * <b>[Attribute]*</b> The attribute
-     * 
+     *
      * @param out the buffer in which the data will be serialized
      * @throws IOException if the serialization failed
      */
@@ -2678,8 +2678,8 @@ public class DefaultEntry implements Ent
 
 
     /**
-     * Deserialize an entry. 
-     * 
+     * Deserialize an entry.
+     *
      * @param in The buffer containing the serialized serverEntry
      * @throws IOException if there was a problem when deserializing
      * @throws ClassNotFoundException if we can't deserialize an expected object
@@ -2759,12 +2759,12 @@ public class DefaultEntry implements Ent
         /*
         // We have to sort the Attributes if we want to compare two entries
         SortedMap<String, EntryAttribute> sortedMap = new TreeMap<String, EntryAttribute>();
-        
+
         for ( String id:attributes.keySet() )
         {
             sortedMap.put( id, attributes.get( id ) );
         }
-        
+
         for ( String id:sortedMap.keySet() )
         {
             h = h*17 + sortedMap.get( id ).hashCode();
@@ -2778,7 +2778,7 @@ public class DefaultEntry implements Ent
      * before the comparison can be done.
      *
      * @see java.lang.Object#hashCode()
-     * @return the instance's hash code 
+     * @return the instance's hash code
      */
     public int hashCode()
     {
@@ -2888,7 +2888,7 @@ public class DefaultEntry implements Ent
         {
             return false;
         }
-        
+
         // Each attribute must be equal
         for ( EntryAttribute attribute:other )
         {
@@ -2897,7 +2897,7 @@ public class DefaultEntry implements Ent
                 return false;
             }
         }
-        
+
         return true;
         */
     }
@@ -2973,11 +2973,11 @@ public class DefaultEntry implements Ent
 
         return sb.toString();
     }
-    
-    
+
+
     /**
      * normalizes the given DN if it was not already normalized
-     * 
+     *
      * @param dn the DN to be normalized
      */
     private void normalizeDN( DN dn )
@@ -2987,7 +2987,7 @@ public class DefaultEntry implements Ent
             try
             {
                 // The dn must be normalized
-                dn.normalize( schemaManager.getNormalizerMapping() );
+                dn.normalize( schemaManager );
             }
             catch ( LdapException ne )
             {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=982332&r1=982331&r2=982332&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java Wed Aug  4 17:13:46 2010
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 
 package org.apache.directory.shared.ldap.name;
@@ -121,7 +121,7 @@ public class DN implements Cloneable, Se
         this( ( SchemaManager ) null );
     }
 
-    
+
     /**
      * Construct an empty DN object
      */
@@ -133,7 +133,7 @@ public class DN implements Cloneable, Se
         normalized = new AtomicBoolean( true );
     }
 
-    
+
     /**
      * @see #DN(DN, SchemaManager)
      */
@@ -159,20 +159,20 @@ public class DN implements Cloneable, Se
             for ( int ii = 0; ii < dn.size(); ii++ )
             {
                 String nameComponent = dn.get( ii );
-                
+
                 if ( nameComponent.length() > 0 )
                 {
                     RDN newRdn = new RDN( nameComponent, schemaManager );
-                    
+
                     rdns.add( 0, newRdn );
                 }
             }
         }
 
         toUpName();
-        
+
         normalized = new AtomicBoolean();
-        
+
         if( schemaManager != null )
         {
             normalize( schemaManager.getNormalizerMapping() );
@@ -194,7 +194,7 @@ public class DN implements Cloneable, Se
     }
 
 
-    
+
     /**
      * Parse a String and checks that it is a valid DN <br>
      * <p>
@@ -214,9 +214,9 @@ public class DN implements Cloneable, Se
         {
             DnParser.parseInternal( upName, rdns );
         }
-        
+
         normalized = new AtomicBoolean();
-        
+
         if( schemaManager != null )
         {
             this.schemaManager = schemaManager;
@@ -234,7 +234,7 @@ public class DN implements Cloneable, Se
         this.upName = upName;
     }
 
-    
+
     /**
      * @see #DN(SchemaManager, String...)
      */
@@ -243,18 +243,18 @@ public class DN implements Cloneable, Se
         this( null, upRdns );
     }
 
-    
+
     /**
      * Creates a new instance of DN, using varargs to declare the RDNs. Each
      * String is either a full RDN, or a couple of AttributeType DI and a value.
      * If the String contains a '=' symbol, the the constructor will assume that
-     * the String arg contains afull RDN, otherwise, it will consider that the 
+     * the String arg contains afull RDN, otherwise, it will consider that the
      * following arg is the value.
      * An example of usage would be :
      * <pre>
      * String exampleName = "example";
      * String baseDn = "dc=apache,dc=org";
-     * 
+     *
      * DN dn = new DN(
      *     "cn=Test",
      *     "ou", exampleName,
@@ -270,7 +270,7 @@ public class DN implements Cloneable, Se
         StringBuilder sb = new StringBuilder();
         boolean valueExpected = false;
         boolean isFirst = true;
-        
+
         for ( String upRdn : upRdns )
         {
             if ( isFirst )
@@ -281,11 +281,11 @@ public class DN implements Cloneable, Se
             {
                 sb.append( ',' );
             }
-            
+
             if ( !valueExpected )
             {
                 sb.append( upRdn );
-                
+
                 if ( upRdn.indexOf( '=' ) == -1 )
                 {
                     valueExpected = true;
@@ -294,23 +294,23 @@ public class DN implements Cloneable, Se
             else
             {
                 sb.append( "=" ).append( upRdn );
-                
+
                 valueExpected = false;
             }
         }
-        
+
         if ( valueExpected )
         {
             throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, I18n.err( I18n.ERR_04202 ) );
         }
 
         normalized = new AtomicBoolean();
-        
+
         // Stores the representations of a DN : internal (as a string and as a
         // byte[]) and external.
         upName = sb.toString();
         DnParser.parseInternal( upName, rdns );
-        
+
         if( schemaManager != null )
         {
             this.schemaManager = schemaManager;
@@ -322,11 +322,11 @@ public class DN implements Cloneable, Se
             normalizeInternal();
         }
     }
-    
+
 
     /**
      * Create a DN while deserializing it.
-     * 
+     *
      * Note : this constructor is used only by the deserialization method.
      * @param upName The user provided name
      * @param normName the normalized name
@@ -340,12 +340,12 @@ public class DN implements Cloneable, Se
         this.bytes = bytes;
     }
 
-    
+
     /**
      * Creates a DN.
-     * 
-     * Note: This is mostly used internally in the server 
-     * 
+     *
+     * Note: This is mostly used internally in the server
+     *
      * @param upName The user provided name
      * @param normName the normalized name
      * @param bytes the name as a byte[]
@@ -359,7 +359,7 @@ public class DN implements Cloneable, Se
 
 
     /**
-     * 
+     *
      * Creates a DN by based on the given RDN.
      *
      * @param rdn the RDN to be used in the DN
@@ -367,7 +367,7 @@ public class DN implements Cloneable, Se
     public DN( RDN rdn )
     {
         rdns.add( rdn );
-        
+
         if( rdn.isNormalized() )
         {
             this.normName = rdn.getNormName();
@@ -383,7 +383,7 @@ public class DN implements Cloneable, Se
         }
     }
 
-    
+
     /**
      * Static factory which creates a normalized DN from a String and a Map of OIDs.
      *
@@ -401,9 +401,9 @@ public class DN implements Cloneable, Se
         }
 
         DN newDn = new DN( name );
-        
+
         Enumeration<RDN> rdns = newDn.getAllRdn();
-        
+
         // Loop on all RDNs
         while ( rdns.hasMoreElements() )
         {
@@ -413,10 +413,10 @@ public class DN implements Cloneable, Se
             rdn.normalize();
             rdn.setUpName( upName );
         }
-        
+
         newDn.normalizeInternal();
         newDn.normalized.set( true );
-        
+
         return newDn;
     }
 
@@ -656,9 +656,9 @@ public class DN implements Cloneable, Se
 
     /**
      * Sets the up name.
-     * 
+     *
      * Package private because DN is immutable, only used by the DN parser.
-     * 
+     *
      * @param upName the new up name
      */
     void setUpName( String upName )
@@ -678,7 +678,7 @@ public class DN implements Cloneable, Se
         {
             normName = toNormName();
         }
-        
+
         return normName;
     }
 
@@ -706,7 +706,7 @@ public class DN implements Cloneable, Se
 
     /**
      * Get an UTF-8 representation of the normalized form of the DN
-     * 
+     *
      * @param dn The DN.
      * @return A byte[] representation of the DN
      */
@@ -720,7 +720,7 @@ public class DN implements Cloneable, Se
      * Tells if the current DN is a parent of another DN.<br>
      * For instance, <b>dc=com</b> is a parent
      * of <b>dc=example, dc=com</b>
-     * 
+     *
      * @param dn The child
      * @return true if the current DN is a parent of the given DN
      */
@@ -735,13 +735,13 @@ public class DN implements Cloneable, Se
             return false;
         }
     }
-    
+
 
     /**
      * Tells if the current DN is a parent of another DN.<br>
      * For instance, <b>dc=com</b> is a parent
      * of <b>dc=example, dc=com</b>
-     * 
+     *
      * @param dn The child
      * @return true if the current DN is a parent of the given DN
      */
@@ -751,7 +751,7 @@ public class DN implements Cloneable, Se
         {
             return false;
         }
-        
+
         return dn.isChildOf( this );
     }
 
@@ -760,7 +760,7 @@ public class DN implements Cloneable, Se
      * Tells if a DN is a child of another DN.<br>
      * For instance, <b>dc=example, dc=com</b> is a child
      * of <b>dc=com</b>
-     * 
+     *
      * @param dn The parent
      * @return true if the current DN is a child of the given DN
      */
@@ -775,13 +775,13 @@ public class DN implements Cloneable, Se
             return false;
         }
     }
-    
+
 
     /**
      * Tells if a DN is a child of another DN.<br>
      * For instance, <b>dc=example, dc=apache, dc=com</b> is a child
      * of <b>dc=com</b>
-     * 
+     *
      * @param dn The parent
      * @return true if the current DN is a child of the given DN
      */
@@ -862,22 +862,22 @@ public class DN implements Cloneable, Se
 
         return true;
     }
-    
-    
+
+
     /**
      * Tells if the DN contains no RDN
-     * 
+     *
      * @return <code>true</code> if the DN is empty
      */
     public boolean isEmpty()
     {
         return ( rdns.size() == 0 );
     }
-    
-    
+
+
     /**
      * Tells if the DN is the RootDSE DN (ie, an empty DN)
-     * 
+     *
      * @return <code>true</code> if the DN is the RootDSE's DN
      */
     public boolean isRootDSE()
@@ -887,14 +887,14 @@ public class DN implements Cloneable, Se
 
 
     /**
-     * Get the given RDN as a String. The position is used in the 
-     * reverse order. Assuming that we have a DN like 
+     * Get the given RDN as a String. The position is used in the
+     * reverse order. Assuming that we have a DN like
      * <pre>dc=example,dc=apache,dc=org</pre>
      * then :
      * <li><code>get(0)</code> will return dc=org</li>
      * <li><code>get(1)</code> will return dc=apache</li>
      * <li><code>get(2)</code> will return dc=example</li>
-     * 
+     *
      * @param posn The position of the wanted RDN in the DN.
      */
     public String get( int posn )
@@ -1103,12 +1103,12 @@ public class DN implements Cloneable, Se
         {
             return this;
         }
-        
+
         DN clonedDn = ( DN ) clone();
-        
+
         // Concatenate the rdns
         clonedDn.rdns.addAll( clonedDn.size() - posn, dn.rdns );
-        
+
         if ( StringTools.isEmpty( normName ) )
         {
             clonedDn.normName = dn.normName;
@@ -1133,7 +1133,7 @@ public class DN implements Cloneable, Se
         return addAll( rdns.size(), suffix );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1145,7 +1145,7 @@ public class DN implements Cloneable, Se
         }
 
         DN clonedDn = ( DN ) clone();
-        
+
         // Concatenate the rdns
         clonedDn.rdns.addAll( clonedDn.size() - posn, dn.rdns );
 
@@ -1170,7 +1170,7 @@ public class DN implements Cloneable, Se
                 clonedDn.normalizeInternal();
                 clonedDn.normalized.set( false );
             }
-            
+
             clonedDn.toUpName();
         }
 
@@ -1191,9 +1191,9 @@ public class DN implements Cloneable, Se
         DN clonedDn = ( DN ) clone();
         // We have to parse the nameComponent which is given as an argument
         RDN newRdn = new RDN( comp, schemaManager );
-        
+
         clonedDn.rdns.add( 0, newRdn );
-        
+
         if( schemaManager != null )
         {
             clonedDn.normalize( schemaManager );
@@ -1203,7 +1203,7 @@ public class DN implements Cloneable, Se
             clonedDn.normalizeInternal();
             clonedDn.normalized.set( false );
         }
-        
+
         clonedDn.toUpName();
 
         return clonedDn;
@@ -1219,9 +1219,9 @@ public class DN implements Cloneable, Se
     public DN add( RDN newRdn )
     {
         DN clonedDn = ( DN ) clone();
-        
+
         clonedDn.rdns.add( 0, newRdn );
-        
+
         // FIXME this try-catch block shouldn't be here
         // instead this method should throw the LdapInvalidDnException
         try
@@ -1247,7 +1247,7 @@ public class DN implements Cloneable, Se
         {
             LOG.error( e.getMessage(), e );
         }
-        
+
         clonedDn.toUpName();
 
         return clonedDn;
@@ -1270,7 +1270,7 @@ public class DN implements Cloneable, Se
         RDN newRdn = new RDN( comp );
 
         DN clonedDn = ( DN ) clone();
-        
+
         int realPos = clonedDn.size() - posn;
         clonedDn.rdns.add( realPos, newRdn );
 
@@ -1313,7 +1313,7 @@ public class DN implements Cloneable, Se
         return clonedDn;
     }
 
-    
+
     /**
      * removes a child (RDN) present at the given position
      *
@@ -1327,8 +1327,8 @@ public class DN implements Cloneable, Se
         normalizeInternal();
         toUpName();
     }
-    
-    
+
+
     /**
      * Gets the parent DN of this DN. Null if this DN doesn't have a parent, i.e. because it
      * is the empty DN.
@@ -1459,9 +1459,9 @@ public class DN implements Cloneable, Se
                 {
                     try
                     {
-                        return new AVA( 
-                            atav.getUpType(), 
-                            oidNormalizer.getAttributeTypeOid(), 
+                        return new AVA(
+                            atav.getUpType(),
+                            oidNormalizer.getAttributeTypeOid(),
                             atav.getUpValue(),
                             oidNormalizer.getNormalizer().normalize( atav.getNormValue() ),
                             atav.getUpName() );
@@ -1526,13 +1526,13 @@ public class DN implements Cloneable, Se
      * aliases. As we still have the UP name of each RDN, we will be able to
      * provide both representation of the DN. example : dn: 2.5.4.3=People,
      * dc=example, domainComponent=com will be transformed to : 2.5.4.3=People,
-     * 0.9.2342.19200300.100.1.25=example, 0.9.2342.19200300.100.1.25=com 
+     * 0.9.2342.19200300.100.1.25=example, 0.9.2342.19200300.100.1.25=com
      * because 2.5.4.3 is the OID for cn and dc is the first
-     * alias of the couple of aliases (dc, domaincomponent), which OID is 
-     * 0.9.2342.19200300.100.1.25. 
-     * This is really important do have such a representation, as 'cn' and 
+     * alias of the couple of aliases (dc, domaincomponent), which OID is
+     * 0.9.2342.19200300.100.1.25.
+     * This is really important do have such a representation, as 'cn' and
      * 'commonname' share the same OID.
-     * 
+     *
      * @param dn The DN to transform.
      * @param oidsMap The mapping between names and oids.
      * @return A normalized form of the DN.
@@ -1569,11 +1569,11 @@ public class DN implements Cloneable, Se
      * aliases. As we still have the UP name of each RDN, we will be able to
      * provide both representation of the DN. example : dn: 2.5.4.3=People,
      * dc=example, domainComponent=com will be transformed to : 2.5.4.3=People,
-     * 0.9.2342.19200300.100.1.25=example, 0.9.2342.19200300.100.1.25=com 
+     * 0.9.2342.19200300.100.1.25=example, 0.9.2342.19200300.100.1.25=com
      * because 2.5.4.3 is the OID for cn and dc is the first
-     * alias of the couple of aliases (dc, domaincomponent), which OID is 
-     * 0.9.2342.19200300.100.1.25. 
-     * This is really important do have such a representation, as 'cn' and 
+     * alias of the couple of aliases (dc, domaincomponent), which OID is
+     * 0.9.2342.19200300.100.1.25.
+     * This is really important do have such a representation, as 'cn' and
      * 'commonname' share the same OID.
      *
      * @param oidsMap The mapping between names and oids.
@@ -1582,7 +1582,7 @@ public class DN implements Cloneable, Se
      */
     public DN normalize( Map<String, OidNormalizer> oidsMap ) throws LdapInvalidDnException
     {
-        
+
         if ( ( oidsMap == null ) || ( oidsMap.isEmpty() ) )
         {
             return this;
@@ -1590,9 +1590,9 @@ public class DN implements Cloneable, Se
 
         if( normalized.get() )
         {
-           return this; 
+           return this;
         }
-        
+
         synchronized ( this )
         {
             if ( size() == 0 )
@@ -1600,33 +1600,33 @@ public class DN implements Cloneable, Se
                 normalized.set( true );
                 return this;
             }
-            
+
             Enumeration<RDN> localRdns = getAllRdn();
-            
+
             // Loop on all RDNs
             while ( localRdns.hasMoreElements() )
             {
                 RDN rdn = localRdns.nextElement();
-                
+
                 rdn.normalize( oidsMap );
             }
-            
+
             normalizeInternal();
-            
+
             normalized.set( true );
-            
+
             return this;
         }
     }
 
-    
+
     /**
      * normalizes the DN @see {@link #normalize(Map)} however
      * if the schema manager of the DN is null then sets the given schema manager
      * as the DN's schema manager.
-     * 
+     *
      * If both, the given schema manager and that of the DN are null then the
-     * {@link #normalizeInternal()} will be called. 
+     * {@link #normalizeInternal()} will be called.
      *
      */
     public DN normalize( SchemaManager schemaManager ) throws LdapInvalidDnException
@@ -1635,17 +1635,17 @@ public class DN implements Cloneable, Se
         {
             this.schemaManager = schemaManager;
         }
-        
+
         if( this.schemaManager != null )
         {
             return normalize( schemaManager.getNormalizerMapping() );
         }
 
         normalizeInternal();
-        
+
         return this;
     }
-    
+
 
     /**
      * Check if a DistinguishedName is syntactically valid.
@@ -1658,7 +1658,7 @@ public class DN implements Cloneable, Se
     {
         return DnParser.validateInternal( dn );
     }
-    
+
 
     /**
      * Tells if the DN has already been normalized or not
@@ -1682,7 +1682,7 @@ public class DN implements Cloneable, Se
         try
         {
             DN dn = new DN( name.toString() );
-        
+
             return dn;
         }
         catch ( LdapInvalidDnException lide )
@@ -1692,8 +1692,8 @@ public class DN implements Cloneable, Se
             return null;
         }
     }
-    
-    
+
+
     /**
      * Convert a DN to a {@link javax.naming.Name}
      *
@@ -1705,7 +1705,7 @@ public class DN implements Cloneable, Se
         try
         {
             Name name = new LdapName( dn.toString() );
-        
+
             return name;
         }
         catch ( InvalidNameException ine )