directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r948711 [3/7] - in /directory: apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/ apacheds/trunk/core-integ/src/test/java/org/apache/...
Date Thu, 27 May 2010 08:08:45 GMT
Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java Thu May 27 08:08:44 2010
@@ -34,8 +34,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
+import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
@@ -62,11 +62,11 @@ public class SchemaAwareModificationTest
     private static LdifSchemaLoader loader;
     private static SchemaManager schemaManager;
     private static AttributeType atCN;
-    
+
     // A SINGLE-VALUE attribute
-    private static AttributeType atC;   
-    
-    
+    private static AttributeType atC;
+
+
     /**
      * Serialize a DefaultModification
      */
@@ -100,15 +100,16 @@ public class SchemaAwareModificationTest
                 throw ioe;
             }
         }
-        
+
         return out;
     }
-    
-    
+
+
     /**
      * Deserialize a DefaultModification
      */
-    private DefaultModification deserializeValue( ByteArrayOutputStream out ) throws IOException, ClassNotFoundException, LdapException
+    private DefaultModification deserializeValue( ByteArrayOutputStream out ) throws IOException,
+        ClassNotFoundException, LdapException
     {
         ObjectInputStream oIn = null;
         ByteArrayInputStream in = new ByteArrayInputStream( out.toByteArray() );
@@ -141,33 +142,33 @@ public class SchemaAwareModificationTest
             }
         }
     }
-    
-    
+
+
     /**
      * Initialize the registries once for the whole test suite
      */
     @BeforeClass
     public static void setup() throws Exception
     {
-    	String workingDirectory = System.getProperty( "workingDirectory" );
-    	
+        String workingDirectory = System.getProperty( "workingDirectory" );
+
         if ( workingDirectory == null )
         {
             String path = SchemaAwareModificationTest.class.getResource( "" ).getPath();
             int targetPos = path.indexOf( "target" );
             workingDirectory = path.substring( 0, targetPos + 6 );
         }
-    	
-    	File schemaRepository = new File( workingDirectory, "schema" );
+
+        File schemaRepository = new File( workingDirectory, "schema" );
         SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
         extractor.extractOrCopy( true );
         loader = new LdifSchemaLoader( schemaRepository );
-        
+
         schemaManager = new DefaultSchemaManager( loader );
         schemaManager.loadAllEnabled();
-        
+
         List<Throwable> errors = schemaManager.getErrors();
-        
+
         if ( errors.size() != 0 )
         {
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( errors ) );
@@ -178,18 +179,19 @@ public class SchemaAwareModificationTest
     }
 
 
-    @Test public void testCreateClientModification()
+    @Test
+    public void testCreateClientModification()
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
-        
+
         Modification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
         Modification clone = mod.clone();
-        
+
         attribute.remove( "test2" );
-        
+
         EntryAttribute clonedAttribute = clone.getAttribute();
-        
+
         assertEquals( 1, mod.getAttribute().size() );
         assertTrue( mod.getAttribute().contains( "test1" ) );
 
@@ -197,8 +199,8 @@ public class SchemaAwareModificationTest
         assertTrue( clone.getAttribute().contains( "test1" ) );
         assertTrue( clone.getAttribute().contains( "test2" ) );
     }
-    
-    
+
+
     /**
      * Test the copy constructor with a DefaultModification
      *
@@ -209,21 +211,21 @@ public class SchemaAwareModificationTest
         EntryAttribute attribute = new DefaultEntryAttribute( atC );
         attribute.add( "test1", "test2" );
         Modification serverModification = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
-        
+
         Modification copy = new DefaultModification( schemaManager, serverModification );
-        
+
         assertTrue( copy instanceof DefaultModification );
         assertEquals( copy, serverModification );
-        
+
         serverModification.setOperation( ModificationOperation.REMOVE_ATTRIBUTE );
         assertEquals( ModificationOperation.ADD_ATTRIBUTE, copy.getOperation() );
-        
+
         EntryAttribute attribute2 = new DefaultEntryAttribute( atCN, "t" );
         serverModification.setAttribute( attribute2 );
         assertNotSame( attribute2, copy.getAttribute() );
     }
-    
-    
+
+
     /**
      * Test the copy constructor with a DefaultModification
      *
@@ -234,78 +236,78 @@ public class SchemaAwareModificationTest
         EntryAttribute attribute = new DefaultEntryAttribute( atC.getName() );
         attribute.add( "test1", "test2" );
         Modification clientModification = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
-        
+
         Modification copy = new DefaultModification( schemaManager, clientModification );
-        
+
         assertTrue( copy instanceof DefaultModification );
         assertTrue( copy instanceof DefaultModification );
-        assertFalse( copy.equals(  clientModification ) );
+        assertFalse( copy.equals( clientModification ) );
         assertTrue( copy.getAttribute() instanceof EntryAttribute );
         assertEquals( atC, copy.getAttribute().getAttributeType() );
         assertEquals( ModificationOperation.ADD_ATTRIBUTE, copy.getOperation() );
         assertTrue( copy.getAttribute().contains( "test1", "test2" ) );
-        
+
         clientModification.setOperation( ModificationOperation.REMOVE_ATTRIBUTE );
         assertEquals( ModificationOperation.ADD_ATTRIBUTE, copy.getOperation() );
-        
+
         EntryAttribute attribute2 = new DefaultEntryAttribute( "cn", "t" );
         clientModification.setAttribute( attribute2 );
         assertNotSame( attribute2, copy.getAttribute() );
     }
-    
-    
+
+
     @Test
     public void testSerializationModificationADD() throws ClassNotFoundException, IOException, LdapException
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
-        
+
         DefaultModification mod = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
-        
+
         Modification modSer = deserializeValue( serializeValue( mod ) );
-        
+
         assertEquals( mod, modSer );
     }
-    
-    
+
+
     @Test
     public void testSerializationModificationREPLACE() throws ClassNotFoundException, IOException, LdapException
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
-        
+
         DefaultModification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
-        
+
         Modification modSer = deserializeValue( serializeValue( mod ) );
-        
+
         assertEquals( mod, modSer );
     }
-    
-    
+
+
     @Test
     public void testSerializationModificationREMOVE() throws ClassNotFoundException, IOException, LdapException
     {
         EntryAttribute attribute = new DefaultEntryAttribute( atCN );
         attribute.add( "test1", "test2" );
-        
+
         DefaultModification mod = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
-        
+
         Modification modSer = deserializeValue( serializeValue( mod ) );
-        
+
         assertEquals( mod, modSer );
     }
-    
-    
+
+
     @Test
     public void testSerializationModificationNoAttribute() throws ClassNotFoundException, IOException, LdapException
     {
         Modification mod = new DefaultModification();
-        
+
         mod.setOperation( ModificationOperation.ADD_ATTRIBUTE );
-        
+
         try
         {
-            deserializeValue( serializeValue( (DefaultModification)mod ) );
+            deserializeValue( serializeValue( ( DefaultModification ) mod ) );
             fail();
         }
         catch ( IOException ioe )

Modified: directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java (original)
+++ directory/apacheds/trunk/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapImpl.java Thu May 27 08:08:44 2010
@@ -33,29 +33,30 @@ import java.util.List;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AvlTreeMapImpl<K,V> implements AvlTreeMap<K, V>
+public class AvlTreeMapImpl<K, V> implements AvlTreeMap<K, V>
 {
     /** the root of the tree */
-    private LinkedAvlMapNode<K,V> root;
+    private LinkedAvlMapNode<K, V> root;
 
     /** The Comparator used for comparing the keys */
     private Comparator<K> keyComparator;
 
     /** The Comparator used for comparing the values */
     private Comparator<V> valueComparator;
-    
+
     /** node representing the start of the doubly linked list formed with the tree nodes */
-    private LinkedAvlMapNode<K,V> first;
-    
+    private LinkedAvlMapNode<K, V> first;
+
     /** node representing the end of the doubly linked list formed with the tree nodes */
-    private LinkedAvlMapNode<K,V> last;
-    
+    private LinkedAvlMapNode<K, V> last;
+
     /** flag to allow storing duplicate keys */
     private boolean allowDuplicates;
 
     /** size of the map */
     private int size;
 
+
     /**
      * Creates a new instance of AVLTreeMap without support for duplicate keys.
      *
@@ -65,7 +66,7 @@ public class AvlTreeMapImpl<K,V> impleme
     {
         this( keyComparator, valueComparator, false );
     }
-    
+
 
     public AvlTreeMapImpl( Comparator<K> keyComparator, Comparator<V> valueComparator, boolean allowDuplicates )
     {
@@ -74,7 +75,7 @@ public class AvlTreeMapImpl<K,V> impleme
         this.allowDuplicates = allowDuplicates;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -82,7 +83,7 @@ public class AvlTreeMapImpl<K,V> impleme
     {
         return keyComparator;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -91,42 +92,42 @@ public class AvlTreeMapImpl<K,V> impleme
     {
         return valueComparator;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public V insert( K key, V value )
     {
-        LinkedAvlMapNode<K,V> node, temp;
-        LinkedAvlMapNode<K,V> parent = null;
+        LinkedAvlMapNode<K, V> node, temp;
+        LinkedAvlMapNode<K, V> parent = null;
         int c;
-        
+
         if ( root == null )
         {
-          root = new LinkedAvlMapNode<K,V>( key, value );
-          first = root;
-          last = root;
-          size++;
-          return null;
-        }
-        
-        node = new LinkedAvlMapNode<K,V>( key, value );
-        
+            root = new LinkedAvlMapNode<K, V>( key, value );
+            first = root;
+            last = root;
+            size++;
+            return null;
+        }
+
+        node = new LinkedAvlMapNode<K, V>( key, value );
+
         temp = root;
-        
-        List<LinkedAvlMapNode<K,V>> treePath = new ArrayList<LinkedAvlMapNode<K,V>>();
 
-        while( temp != null )
+        List<LinkedAvlMapNode<K, V>> treePath = new ArrayList<LinkedAvlMapNode<K, V>>();
+
+        while ( temp != null )
         {
-            treePath.add(0, temp ); // last node first, for the sake of balance factor computation
+            treePath.add( 0, temp ); // last node first, for the sake of balance factor computation
             parent = temp;
-            
+
             c = keyComparator.compare( key, temp.getKey() );
-            
-            if( c == 0 )
+
+            if ( c == 0 )
             {
-                if( allowDuplicates )
+                if ( allowDuplicates )
                 {
                     return insertDupKey( value, temp ); // key already exists add another value
                 }
@@ -136,8 +137,8 @@ public class AvlTreeMapImpl<K,V> impleme
                     return temp.value.setSingleton( value );
                 }
             }
-            
-            if( c < 0 )
+
+            if ( c < 0 )
             {
                 temp.isLeft = true;
                 temp = temp.getLeft();
@@ -148,8 +149,8 @@ public class AvlTreeMapImpl<K,V> impleme
                 temp = temp.getRight();
             }
         }
-        
-        if( ( c = keyComparator.compare( key, parent.getKey() ) ) < 0 )
+
+        if ( ( c = keyComparator.compare( key, parent.getKey() ) ) < 0 )
         {
             parent.setLeft( node );
         }
@@ -157,22 +158,22 @@ public class AvlTreeMapImpl<K,V> impleme
         {
             parent.setRight( node );
         }
-        
+
         insertInList( node, parent, c );
-        
+
         treePath.add( 0, node );
-        balance(treePath);
-        
+        balance( treePath );
+
         size++;
         return null;
     }
-    
-    
-    private V insertDupKey( V value, LinkedAvlMapNode<K,V> existingNode )
+
+
+    private V insertDupKey( V value, LinkedAvlMapNode<K, V> existingNode )
     {
         AvlTree<V> dupsTree = null;
-        
-        if( existingNode.value.isOrderedSet() )
+
+        if ( existingNode.value.isOrderedSet() )
         {
             dupsTree = existingNode.value.getOrderedSet();
         }
@@ -183,71 +184,72 @@ public class AvlTreeMapImpl<K,V> impleme
             dupsTree.insert( existingNode.value.getSingleton() );
             existingNode.value.switchToOrderedSet( dupsTree );
         }
-        
+
         // check if value already exists
-        if( dupsTree.find( value ) != null )
+        if ( dupsTree.find( value ) != null )
         {
-        	return value;
+            return value;
         }
-        
+
         // insert value into duplicate key holder
         dupsTree.insert( value );
-        
+
         return null;
     }
-    
-    
-    private void removeFromList(LinkedAvlMapNode<K,V> node)
+
+
+    private void removeFromList( LinkedAvlMapNode<K, V> node )
     {
-        if( node.next == null && node.previous == null ) // should happen in case of tree having single node
+        if ( node.next == null && node.previous == null ) // should happen in case of tree having single node
         {
             first = last = null;
         }
-        else if( node.next == null ) // last node
+        else if ( node.next == null ) // last node
         {
             node.previous.next = null;
             last = node.previous;
         }
-        else if( node.previous == null ) // first node
+        else if ( node.previous == null ) // first node
         {
             node.next.previous = null;
             first = node.next;
         }
-        else // somewhere in middle
+        else
+        // somewhere in middle
         {
             node.previous.next = node.next;
             node.next.previous = node.previous;
         }
-        
+
     }
-    
-    
-    private void insertInList(LinkedAvlMapNode<K,V> node, LinkedAvlMapNode<K,V> parentNode, int pos)
+
+
+    private void insertInList( LinkedAvlMapNode<K, V> node, LinkedAvlMapNode<K, V> parentNode, int pos )
     {
 
-        if( pos < 0 )
+        if ( pos < 0 )
         {
-            if( last == null )
+            if ( last == null )
             {
-              last = parentNode;  
+                last = parentNode;
             }
-            
-            if( parentNode.previous == null )
+
+            if ( parentNode.previous == null )
             {
                 first = node;
             }
             else
             {
-                parentNode.previous.next = node ;
+                parentNode.previous.next = node;
                 node.previous = parentNode.previous;
             }
-            
+
             node.next = parentNode;
             parentNode.previous = node;
         }
-        else if( pos > 0 )
+        else if ( pos > 0 )
         {
-            if( parentNode.next == null )
+            if ( parentNode.next == null )
             {
                 last = node;
             }
@@ -258,35 +260,35 @@ public class AvlTreeMapImpl<K,V> impleme
             }
             node.previous = parentNode;
             parentNode.next = node;
-         }
-        
+        }
+
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public SingletonOrOrderedSet<V> remove( K key )
     {
-        if( key == null )
+        if ( key == null )
         {
             throw new IllegalArgumentException( "key cannot be null" );
         }
-        
-        LinkedAvlMapNode<K,V> temp = null;
-        
-        List<LinkedAvlMapNode<K,V>> treePath = new ArrayList<LinkedAvlMapNode<K,V>>();
-        
-        treePath = find( key, root, treePath);
-        
-        if( treePath == null )
+
+        LinkedAvlMapNode<K, V> temp = null;
+
+        List<LinkedAvlMapNode<K, V>> treePath = new ArrayList<LinkedAvlMapNode<K, V>>();
+
+        treePath = find( key, root, treePath );
+
+        if ( treePath == null )
         {
             return null;
         }
-        
+
         temp = treePath.remove( 0 );
-       
-        if( temp.isLeaf() && ( temp == root ) )
+
+        if ( temp.isLeaf() && ( temp == root ) )
         {
             root = null;
         }
@@ -294,95 +296,96 @@ public class AvlTreeMapImpl<K,V> impleme
         {
             balanceNodesAfterRemove( treePath, temp );
         }
-        
+
         size--;
-       return temp.value;
+        return temp.value;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public V remove( K key, V value )
     {
-        if( key == null || value == null )
+        if ( key == null || value == null )
         {
             throw new IllegalArgumentException( "key or value cannot be null" );
         }
-        
-        LinkedAvlMapNode<K,V> temp = null;
-        
-        List<LinkedAvlMapNode<K,V>> treePath = new ArrayList<LinkedAvlMapNode<K,V>>();
-        
-        treePath = find( key, root, treePath);
-        
-        if( treePath == null )
+
+        LinkedAvlMapNode<K, V> temp = null;
+
+        List<LinkedAvlMapNode<K, V>> treePath = new ArrayList<LinkedAvlMapNode<K, V>>();
+
+        treePath = find( key, root, treePath );
+
+        if ( treePath == null )
         {
             return null;
         }
-        
+
         temp = treePath.remove( 0 );
 
         // check if the value matches
-        if( allowDuplicates )
+        if ( allowDuplicates )
         {
-            if( temp.value.isOrderedSet() )
+            if ( temp.value.isOrderedSet() )
             {
                 AvlTree<V> dupsTree = temp.value.getOrderedSet();
                 V removedVal = dupsTree.remove( value );
-                
+
                 // if the removal is successful and the tree is not empty
                 // we don't need to balance the tree, cause just one value
                 // of the same key was removed
                 // if the tree is empty because of the removal, the entire 
                 // node will be removed which might require balancing, so we continue
                 // further down in this function
-                if( ( removedVal != null ) && ! dupsTree.isEmpty() )
+                if ( ( removedVal != null ) && !dupsTree.isEmpty() )
                 {
                     return removedVal;//no need to balance
                 }
-                 /* 
-                  * if the value is not found then we should return
-                  */
-                else if ( removedVal == null ) 
+                /* 
+                 * if the value is not found then we should return
+                 */
+                else if ( removedVal == null )
                 {
                     return removedVal;//no need to balance
                 }
             }
             else
             {
-                if( valueComparator.compare( temp.value.getSingleton(), value ) != 0 )
+                if ( valueComparator.compare( temp.value.getSingleton(), value ) != 0 )
                 {
                     return null;// no need to balance
                 }
             }
         }
 
-        if( temp.isLeaf() && ( temp == root ) )
+        if ( temp.isLeaf() && ( temp == root ) )
         {
-            if( allowDuplicates )
+            if ( allowDuplicates )
             {
-                if( temp.value.isSingleton() || temp.value.getOrderedSet().isEmpty() )
+                if ( temp.value.isSingleton() || temp.value.getOrderedSet().isEmpty() )
                 {
                     root = null;
                 }
             }
-            else // if dups are not allowed set root to null
+            else
+            // if dups are not allowed set root to null
             {
                 root = null;
             }
-       
+
             size--;
             return value;
         }
 
-       balanceNodesAfterRemove( treePath, temp );
+        balanceNodesAfterRemove( treePath, temp );
 
-       size--;
-       return value;
+        size--;
+        return value;
     }
 
-    
+
     /**
      * changes the order of nodes after a delete operation and then 
      * balances the tree
@@ -390,28 +393,28 @@ public class AvlTreeMapImpl<K,V> impleme
      * @param treePath the path traversed to find the node temp 
      * @param delNode the node to be deleted
      */
-    private void balanceNodesAfterRemove( List<LinkedAvlMapNode<K,V>> treePath, LinkedAvlMapNode<K,V> delNode )
+    private void balanceNodesAfterRemove( List<LinkedAvlMapNode<K, V>> treePath, LinkedAvlMapNode<K, V> delNode )
     {
-        LinkedAvlMapNode<K,V> y = null;
-        
+        LinkedAvlMapNode<K, V> y = null;
+
         // remove from the doubly linked
-        removeFromList( delNode );        
+        removeFromList( delNode );
 
-        if( delNode.isLeaf() )
+        if ( delNode.isLeaf() )
         {
-            if( !treePath.isEmpty() )
+            if ( !treePath.isEmpty() )
             {
                 detachNodes( delNode, treePath.get( 0 ) );
             }
         }
         else
         {
-            if( delNode.left != null )
+            if ( delNode.left != null )
             {
-                List<LinkedAvlMapNode<K,V>> leftTreePath = findMax( delNode.left );
+                List<LinkedAvlMapNode<K, V>> leftTreePath = findMax( delNode.left );
                 y = leftTreePath.remove( 0 );
-                
-                if( leftTreePath.isEmpty() ) // y is the left child of root and y is a leaf
+
+                if ( leftTreePath.isEmpty() ) // y is the left child of root and y is a leaf
                 {
                     detachNodes( y, delNode );
                 }
@@ -419,13 +422,13 @@ public class AvlTreeMapImpl<K,V> impleme
                 {
                     detachNodes( y, leftTreePath.remove( 0 ) );
                 }
-                
+
                 leftTreePath.addAll( treePath );
                 treePath = leftTreePath;
-                
+
                 y.right = delNode.right; // assign the right here left will be assigned in replaceNode()
 
-                if( delNode == root )
+                if ( delNode == root )
                 {
                     y.left = delNode.left;
                     root = y;
@@ -435,12 +438,12 @@ public class AvlTreeMapImpl<K,V> impleme
                     replaceNode( delNode, y, treePath.get( 0 ) );
                 }
             }
-            else if( delNode.right != null )
+            else if ( delNode.right != null )
             {
-                List<LinkedAvlMapNode<K,V>> rightTreePath = findMin( delNode.right );
+                List<LinkedAvlMapNode<K, V>> rightTreePath = findMin( delNode.right );
                 y = rightTreePath.remove( 0 );
-                
-                if( rightTreePath.isEmpty() )
+
+                if ( rightTreePath.isEmpty() )
                 {
                     detachNodes( y, delNode ); // y is the right child of root and y is a leaf
                 }
@@ -448,13 +451,13 @@ public class AvlTreeMapImpl<K,V> impleme
                 {
                     detachNodes( y, rightTreePath.remove( 0 ) );
                 }
-                
+
                 rightTreePath.addAll( treePath );
                 treePath = rightTreePath;
-                
+
                 y.right = delNode.right; // assign the right here left will be assigned in replaceNode()
-                
-                if( delNode == root )
+
+                if ( delNode == root )
                 {
                     y.right = delNode.right;
                     root = y;
@@ -465,12 +468,12 @@ public class AvlTreeMapImpl<K,V> impleme
                 }
             }
         }
-       
-       treePath.add( 0, y ); // y can be null but getBalance returns 0 so np
-       balance( treePath );
+
+        treePath.add( 0, y ); // y can be null but getBalance returns 0 so np
+        balance( treePath );
     }
-    
-    
+
+
     /**
      * Balances the tree by visiting the nodes present in the List of nodes present in the
      * treePath parameter.<br><br>
@@ -482,41 +485,42 @@ public class AvlTreeMapImpl<K,V> impleme
      * 
      * @param treePath the traversed list of LinkedAvlMapNodes after performing an insert/delete operation.
      */
-    private void balance( List<LinkedAvlMapNode<K,V>> treePath )
+    private void balance( List<LinkedAvlMapNode<K, V>> treePath )
     {
-        LinkedAvlMapNode<K,V> parentNode = null;
-        
+        LinkedAvlMapNode<K, V> parentNode = null;
+
         int size = treePath.size();
-        
-        for( LinkedAvlMapNode<K,V> node: treePath )
+
+        for ( LinkedAvlMapNode<K, V> node : treePath )
         {
             int balFactor = getBalance( node );
 
-            if( node != root && treePath.indexOf( node ) < ( size - 1 ) )
+            if ( node != root && treePath.indexOf( node ) < ( size - 1 ) )
             {
                 parentNode = treePath.get( treePath.indexOf( node ) + 1 );
             }
 
-            if( balFactor > 1 )
+            if ( balFactor > 1 )
             {
-                if( getBalance( node.right ) <= -1)
+                if ( getBalance( node.right ) <= -1 )
                 {
                     //------rotate double-left--------
                     rotateSingleRight( node.right, node );
                     rotateSingleLeft( node, parentNode );
                 }
-                else // rotate single-left
+                else
+                // rotate single-left
                 {
-                   rotateSingleLeft( node, parentNode );
+                    rotateSingleLeft( node, parentNode );
                 }
             }
-            else if( balFactor < -1 )
+            else if ( balFactor < -1 )
             {
-                if( getBalance( node.left ) >= 1)
+                if ( getBalance( node.left ) >= 1 )
                 {
-                   //------rotate double-right--------
-                   rotateSingleLeft( node.left, node ); 
-                   rotateSingleRight( node, parentNode );
+                    //------rotate double-right--------
+                    rotateSingleLeft( node.left, node );
+                    rotateSingleRight( node, parentNode );
                 }
                 else
                 {
@@ -525,17 +529,17 @@ public class AvlTreeMapImpl<K,V> impleme
             }
         }
     }
-    
+
 
     /**
      * {@inheritDoc}
      */
     public boolean isEmpty()
     {
-      return root == null;   
+        return root == null;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -544,8 +548,8 @@ public class AvlTreeMapImpl<K,V> impleme
     {
         return size;
     }
-    
-    
+
+
     /**
      * Set the root of the tree.
      * 
@@ -553,12 +557,12 @@ public class AvlTreeMapImpl<K,V> impleme
      *
      * @param root the root of the tree
      */
-    /* no protection */ void setRoot( LinkedAvlMapNode<K,V> root )
+    /* no protection */void setRoot( LinkedAvlMapNode<K, V> root )
     {
         this.root = root;
     }
 
-    
+
     /**
      * Set the first element of the tree
      * 
@@ -566,12 +570,12 @@ public class AvlTreeMapImpl<K,V> impleme
      *
      * @param first the first element to be added
      */
-    /* no protection */  void setFirst( LinkedAvlMapNode<K,V> first )
+    /* no protection */void setFirst( LinkedAvlMapNode<K, V> first )
     {
         this.first = first;
     }
 
-    
+
     /**
      * Set the last element of the tree
      * 
@@ -579,7 +583,7 @@ public class AvlTreeMapImpl<K,V> impleme
      *
      * @param last the last element to be added
      */
-    /* no protection */  void setLast( LinkedAvlMapNode<K,V> last )
+    /* no protection */void setLast( LinkedAvlMapNode<K, V> last )
     {
         this.last = last;
     }
@@ -588,127 +592,128 @@ public class AvlTreeMapImpl<K,V> impleme
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> getRoot()
+    public LinkedAvlMapNode<K, V> getRoot()
     {
         return root;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public List<K> getKeys()
     {
         List<K> keys = new ArrayList<K>();
-        LinkedAvlMapNode<K,V> node = first;
-        
-        while( node != null )
+        LinkedAvlMapNode<K, V> node = first;
+
+        while ( node != null )
         {
             keys.add( node.key );
             node = node.next;
         }
-        
+
         return keys;
     }
 
+
     /**
      * {@inheritDoc}
      */
-    public void printTree() 
+    public void printTree()
     {
-        if( isEmpty() )
+        if ( isEmpty() )
         {
             System.out.println( "Tree is empty" );
             return;
         }
-        
+
         getRoot().setDepth( 0 );
 
         System.out.println( getRoot() );
-        
+
         visit( getRoot().getRight(), getRoot() );
-        
+
         visit( getRoot().getLeft(), getRoot() );
     }
-    
+
 
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> getFirst()
+    public LinkedAvlMapNode<K, V> getFirst()
     {
         return first;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> getLast()
+    public LinkedAvlMapNode<K, V> getLast()
     {
         return last;
     }
 
-    
+
     /**
      * Rotate the node left side once.
      *
      * @param node the LinkedAvlMapNode to be rotated
      * @param parentNode parent LinkedAvlMapNode of node
      */
-    private void rotateSingleLeft(LinkedAvlMapNode<K,V> node, LinkedAvlMapNode<K,V> parentNode)
+    private void rotateSingleLeft( LinkedAvlMapNode<K, V> node, LinkedAvlMapNode<K, V> parentNode )
     {
-        LinkedAvlMapNode<K,V> temp;
+        LinkedAvlMapNode<K, V> temp;
         //------rotate single-left--------
-        
+
         temp = node.right;
         node.right = temp.left;
         temp.left = node;
-        
-        if( node == root )
+
+        if ( node == root )
         {
-          root = temp;  
+            root = temp;
         }
-        else if( parentNode != null )
+        else if ( parentNode != null )
         {
-            if( parentNode.left == node )
+            if ( parentNode.left == node )
             {
                 parentNode.left = temp;
             }
-            else if( parentNode.right == node )
+            else if ( parentNode.right == node )
             {
                 parentNode.right = temp;
             }
         }
     }
-    
-    
+
+
     /**
      * Rotate the node right side once.
      *
      * @param node the LinkedAvlMapNode to be rotated
      * @param parentNode parent LinkedAvlMapNode of node
      */
-    private void rotateSingleRight(LinkedAvlMapNode<K,V> node, LinkedAvlMapNode<K,V> parentNode)
+    private void rotateSingleRight( LinkedAvlMapNode<K, V> node, LinkedAvlMapNode<K, V> parentNode )
     {
-        LinkedAvlMapNode<K,V> temp;
+        LinkedAvlMapNode<K, V> temp;
         //------rotate single-right--------
-        
+
         temp = node.left;
         node.left = temp.right;
         temp.right = node;
-       
-        if( node == root )
+
+        if ( node == root )
         {
-          root = temp;  
+            root = temp;
         }
-        else if( parentNode != null )
+        else if ( parentNode != null )
         {
-            if( parentNode.left == node )
+            if ( parentNode.left == node )
             {
                 parentNode.left = temp;
             }
-            else if( parentNode.right == node )
+            else if ( parentNode.right == node )
             {
                 parentNode.right = temp;
             }
@@ -717,13 +722,13 @@ public class AvlTreeMapImpl<K,V> impleme
          when the 'parentNode' param is null then the node under rotation is a child of ROOT.
          Most likely this condition executes when the root node is deleted and balancing is required.
          */
-        else if( root != null && root.left == node )
+        else if ( root != null && root.left == node )
         {
             root.left = temp;
             // no need to check for right node
         }
     }
-        
+
 
     /**
      * Detach a LinkedAvlMapNode from its parent
@@ -731,15 +736,15 @@ public class AvlTreeMapImpl<K,V> impleme
      * @param node the LinkedAvlMapNode to be detached
      * @param parentNode the parent LinkedAvlMapNode of the node
      */
-    private void detachNodes(LinkedAvlMapNode<K,V> node, LinkedAvlMapNode<K,V> parentNode)
+    private void detachNodes( LinkedAvlMapNode<K, V> node, LinkedAvlMapNode<K, V> parentNode )
     {
-        if( parentNode != null )
+        if ( parentNode != null )
         {
-            if( node == parentNode.left )
+            if ( node == parentNode.left )
             {
                 parentNode.left = node.left;
             }
-            else if( node == parentNode.right )
+            else if ( node == parentNode.right )
             {
                 parentNode.right = node.left;
             }
@@ -755,24 +760,25 @@ public class AvlTreeMapImpl<K,V> impleme
      * @param replaceNode the LinkedAvlMapNode to replace the deleteNode
      * @param parentNode the parent LinkedAvlMapNode of deleteNode
      */
-    private void replaceNode(LinkedAvlMapNode<K,V> deleteNode, LinkedAvlMapNode<K,V> replaceNode, LinkedAvlMapNode<K,V> parentNode)
+    private void replaceNode( LinkedAvlMapNode<K, V> deleteNode, LinkedAvlMapNode<K, V> replaceNode,
+        LinkedAvlMapNode<K, V> parentNode )
     {
-        if( parentNode != null )
+        if ( parentNode != null )
         {
             replaceNode.left = deleteNode.left;
-            
-            if( deleteNode == parentNode.left )
+
+            if ( deleteNode == parentNode.left )
             {
                 parentNode.left = replaceNode;
             }
-            else if( deleteNode == parentNode.right )
+            else if ( deleteNode == parentNode.right )
             {
                 parentNode.right = replaceNode;
             }
         }
     }
-    
-    
+
+
     /**
      * 
      * Find a LinkedAvlMapNode with the given key value in the tree starting from the startNode.
@@ -782,31 +788,32 @@ public class AvlTreeMapImpl<K,V> impleme
      * @param path the list to be filled with traversed nodes
      * @return the list of traversed LinkedAvlMapNodes.
      */
-    private List<LinkedAvlMapNode<K,V>> find( K key, LinkedAvlMapNode<K,V> startNode, List<LinkedAvlMapNode<K,V>> path )
+    private List<LinkedAvlMapNode<K, V>> find( K key, LinkedAvlMapNode<K, V> startNode,
+        List<LinkedAvlMapNode<K, V>> path )
     {
         int c;
-        
-        if( startNode == null )
+
+        if ( startNode == null )
         {
             return null;
         }
-        
+
         path.add( 0, startNode );
         c = keyComparator.compare( key, startNode.key );
-        
-        if( c == 0 )
+
+        if ( c == 0 )
         {
             return path;
         }
-        else if( c > 0 )
+        else if ( c > 0 )
         {
             return find( key, startNode.right, path );
         }
-        else if( c < 0 )
+        else if ( c < 0 )
         {
             return find( key, startNode.left, path );
         }
-        
+
         return null;
     }
 
@@ -814,15 +821,15 @@ public class AvlTreeMapImpl<K,V> impleme
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> findGreater( K key )
+    public LinkedAvlMapNode<K, V> findGreater( K key )
     {
-        LinkedAvlMapNode<K,V> result = fetchNonNullNode( key, root, root);
+        LinkedAvlMapNode<K, V> result = fetchNonNullNode( key, root, root );
 
-        if( result == null )
+        if ( result == null )
         {
             return null;
         }
-        else if( keyComparator.compare( key, result.key ) < 0 )
+        else if ( keyComparator.compare( key, result.key ) < 0 )
         {
             return result;
         }
@@ -834,15 +841,15 @@ public class AvlTreeMapImpl<K,V> impleme
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> findGreaterOrEqual( K key )
+    public LinkedAvlMapNode<K, V> findGreaterOrEqual( K key )
     {
-        LinkedAvlMapNode<K,V> result = fetchNonNullNode( key, root, root);
+        LinkedAvlMapNode<K, V> result = fetchNonNullNode( key, root, root );
 
-        if( result == null )
+        if ( result == null )
         {
             return null;
         }
-        else if( keyComparator.compare( key, result.key ) <= 0 )
+        else if ( keyComparator.compare( key, result.key ) <= 0 )
         {
             return result;
         }
@@ -854,15 +861,15 @@ public class AvlTreeMapImpl<K,V> impleme
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> findLess( K key )
+    public LinkedAvlMapNode<K, V> findLess( K key )
     {
-        LinkedAvlMapNode<K,V> result = fetchNonNullNode( key, root, root);
+        LinkedAvlMapNode<K, V> result = fetchNonNullNode( key, root, root );
 
-        if( result == null )
+        if ( result == null )
         {
             return null;
         }
-        else if( keyComparator.compare( key, result.key ) > 0 )
+        else if ( keyComparator.compare( key, result.key ) > 0 )
         {
             return result;
         }
@@ -874,15 +881,15 @@ public class AvlTreeMapImpl<K,V> impleme
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> findLessOrEqual( K key )
+    public LinkedAvlMapNode<K, V> findLessOrEqual( K key )
     {
-        LinkedAvlMapNode<K,V> result = fetchNonNullNode( key, root, root);
+        LinkedAvlMapNode<K, V> result = fetchNonNullNode( key, root, root );
 
-        if( result == null )
+        if ( result == null )
         {
             return null;
         }
-        else if( keyComparator.compare( key, result.key ) >= 0 )
+        else if ( keyComparator.compare( key, result.key ) >= 0 )
         {
             return result;
         }
@@ -896,68 +903,70 @@ public class AvlTreeMapImpl<K,V> impleme
      * is not present. This method should not be used as general purpose lookup method.
      * This is written to assist the findGreater, findLess methods. 
      */
-    private LinkedAvlMapNode<K,V> fetchNonNullNode( K key, LinkedAvlMapNode<K,V> startNode, LinkedAvlMapNode<K,V> parent )
+    private LinkedAvlMapNode<K, V> fetchNonNullNode( K key, LinkedAvlMapNode<K, V> startNode,
+        LinkedAvlMapNode<K, V> parent )
     {
-        
-        if( startNode == null )
+
+        if ( startNode == null )
         {
             return parent;
         }
-        
+
         int c = keyComparator.compare( key, startNode.key );
-        
+
         parent = startNode;
 
-        if( c > 0 )
+        if ( c > 0 )
         {
             return fetchNonNullNode( key, startNode.right, parent );
         }
-        else if( c < 0 )
+        else if ( c < 0 )
         {
             return fetchNonNullNode( key, startNode.left, parent );
         }
-        
+
         return startNode;
     }
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> find( K key )
+    public LinkedAvlMapNode<K, V> find( K key )
     {
-        return find( key, root);
+        return find( key, root );
     }
-    
+
 
     /**
      * {@inheritDoc}
      */
-    public LinkedAvlMapNode<K,V> find( K key, V value )
+    public LinkedAvlMapNode<K, V> find( K key, V value )
     {
-        if( key == null || value == null )
+        if ( key == null || value == null )
         {
             return null;
         }
-        
-        LinkedAvlMapNode<K,V> node = find( key, root );
-        
-        if( node == null )
+
+        LinkedAvlMapNode<K, V> node = find( key, root );
+
+        if ( node == null )
         {
             return null;
         }
-        
-        if( node.value.isOrderedSet() )
+
+        if ( node.value.isOrderedSet() )
         {
             AvlTree<V> dupsTree = node.value.getOrderedSet();
-            
-            if( dupsTree.find( value ) == null )
+
+            if ( dupsTree.find( value ) == null )
             {
                 return null;
             }
         }
         else
         {
-            if( valueComparator.compare( node.value.getSingleton(), value ) != 0 )
+            if ( valueComparator.compare( node.value.getSingleton(), value ) != 0 )
             {
                 return null;
             }
@@ -966,157 +975,157 @@ public class AvlTreeMapImpl<K,V> impleme
         return node;
     }
 
-    
-    private LinkedAvlMapNode<K,V> find( K key, LinkedAvlMapNode<K,V> startNode)
+
+    private LinkedAvlMapNode<K, V> find( K key, LinkedAvlMapNode<K, V> startNode )
     {
         int c;
-        
-        if( startNode == null )
+
+        if ( startNode == null )
         {
             return null;
         }
-        
+
         c = keyComparator.compare( key, startNode.key );
-        
-        if( c > 0 )
+
+        if ( c > 0 )
         {
             startNode.isLeft = false;
             return find( key, startNode.right );
         }
-        else if( c < 0 )
+        else if ( c < 0 )
         {
             startNode.isLeft = true;
             return find( key, startNode.left );
         }
-        
+
         return startNode;
     }
-    
-    
+
+
     /**
      * Find the LinkedAvlMapNode having the max key value in the tree starting from the startNode.
      *
      * @param startNode starting node of a subtree/tree
      * @return the list of traversed LinkedAvlMapNodes.
      */
-    private List<LinkedAvlMapNode<K,V>> findMax( LinkedAvlMapNode<K,V> startNode )
+    private List<LinkedAvlMapNode<K, V>> findMax( LinkedAvlMapNode<K, V> startNode )
     {
-        LinkedAvlMapNode<K,V> x = startNode;
-        LinkedAvlMapNode<K,V> y = null;
-        List<LinkedAvlMapNode<K,V>> path;
-        
-        if( x == null )
+        LinkedAvlMapNode<K, V> x = startNode;
+        LinkedAvlMapNode<K, V> y = null;
+        List<LinkedAvlMapNode<K, V>> path;
+
+        if ( x == null )
         {
             return null;
         }
-        
-        while( x.right != null )
+
+        while ( x.right != null )
         {
             x.isLeft = false;
             y = x;
             x = x.right;
         }
-        
-        path = new ArrayList<LinkedAvlMapNode<K,V>>(2);
+
+        path = new ArrayList<LinkedAvlMapNode<K, V>>( 2 );
         path.add( x );
-        
+
         if ( y != null )
         {
-          path.add( y );  
+            path.add( y );
         }
-        
+
         return path;
     }
 
-    
+
     /**
      * Find the LinkedAvlMapNode having the min key value in the tree starting from the startNode.
      *
      * @param startNode starting node of a subtree/tree
      * @return the list of traversed LinkedAvlMapNodes.
      */
-    private List<LinkedAvlMapNode<K,V>> findMin( LinkedAvlMapNode<K,V> startNode )
+    private List<LinkedAvlMapNode<K, V>> findMin( LinkedAvlMapNode<K, V> startNode )
     {
-        LinkedAvlMapNode<K,V> x = startNode;
-        LinkedAvlMapNode<K,V> y = null;
-        List<LinkedAvlMapNode<K,V>> path;
-       
-        if( x == null )
+        LinkedAvlMapNode<K, V> x = startNode;
+        LinkedAvlMapNode<K, V> y = null;
+        List<LinkedAvlMapNode<K, V>> path;
+
+        if ( x == null )
         {
             return null;
         }
-       
-        while( x.left != null )
+
+        while ( x.left != null )
         {
             x.isLeft = true;
             y = x;
             x = x.left;
         }
-        
-        path = new ArrayList<LinkedAvlMapNode<K,V>>(2);
+
+        path = new ArrayList<LinkedAvlMapNode<K, V>>( 2 );
         path.add( x );
-        
+
         if ( y != null )
         {
-          path.add( y );  
+            path.add( y );
         }
-        
+
         return path;
     }
-   
-    
+
+
     /**
      * Get balance-factor of the given LinkedAvlMapNode.
      *
      * @param node a LinkedAvlMapNode 
      * @return balance-factor of the node
      */
-    private int getBalance( LinkedAvlMapNode<K,V> node )
+    private int getBalance( LinkedAvlMapNode<K, V> node )
     {
-        if( node == null)
+        if ( node == null )
         {
             return 0;
         }
-        
+
         return node.getBalance();
     }
-    
-    
-    private void visit( LinkedAvlMapNode<K,V> node, LinkedAvlMapNode<K,V> parentNode ) 
+
+
+    private void visit( LinkedAvlMapNode<K, V> node, LinkedAvlMapNode<K, V> parentNode )
     {
-        if( node == null )
+        if ( node == null )
         {
             return;
         }
-        
-        if( !node.isLeaf() )
+
+        if ( !node.isLeaf() )
         {
             node.setDepth( parentNode.getDepth() + 1 );
         }
-        
-        for( int i=0; i < parentNode.getDepth(); i++ )
+
+        for ( int i = 0; i < parentNode.getDepth(); i++ )
         {
             System.out.print( "|  " );
         }
 
         String type = "";
-        if( node == parentNode.left )
+        if ( node == parentNode.left )
         {
             type = "L";
         }
-        else if( node == parentNode.right )
+        else if ( node == parentNode.right )
         {
             type = "R";
         }
-        
+
         System.out.println( "|--" + node + type );
-        
+
         if ( node.getRight() != null )
         {
             visit( node.getRight(), node );
         }
-        
-        if( node.getLeft() != null )
+
+        if ( node.getLeft() != null )
         {
             visit( node.getLeft(), node );
         }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Thu May 27 08:08:44 2010
@@ -82,59 +82,47 @@ public class MetaSyntaxCheckerHandlerIT 
     @Test
     public void testAddSyntaxCheckerToEnabledSchema() throws Exception
     {
-        Attributes attrs = LdifUtils.createAttributes( 
-            "objectClass: top",
-            "objectClass: metaTop",
-            "objectClass: metaSyntaxChecker",
-            "m-fqcn", OctetStringSyntaxChecker.class.getName(),
-            "m-oid", OID,
+        Attributes attrs = LdifUtils.createAttributes( "objectClass: top", "objectClass: metaTop",
+            "objectClass: metaSyntaxChecker", "m-fqcn", OctetStringSyntaxChecker.class.getName(), "m-oid", OID,
             "m-description: A test syntaxChecker" );
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
-        
+
         assertTrue( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
         assertEquals( schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, OctetStringSyntaxChecker.class );
         assertTrue( isOnDisk( dn ) );
     }
-    
-    
+
+
     @Test
     public void testAddSyntaxCheckerToDisabledSchema() throws Exception
     {
-        Attributes attrs = LdifUtils.createAttributes( 
-            "objectClass: top",
-            "objectClass: metaTop",
-            "objectClass: metaSyntaxChecker",
-            "m-fqcn", OctetStringSyntaxChecker.class.getName(),
-            "m-oid", OID,
+        Attributes attrs = LdifUtils.createAttributes( "objectClass: top", "objectClass: metaTop",
+            "objectClass: metaSyntaxChecker", "m-fqcn", OctetStringSyntaxChecker.class.getName(), "m-oid", OID,
             "m-description: A test syntaxChecker" );
-        
+
         // nis is by default inactive
         DN dn = getSyntaxCheckerContainer( "nis" );
         dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
-        
-        assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries", 
+
+        assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries",
             schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
         assertTrue( isOnDisk( dn ) );
     }
-    
-    
+
+
     @Test
     public void testAddSyntaxCheckerToUnloadedSchema() throws Exception
     {
-        Attributes attrs = LdifUtils.createAttributes( 
-            "objectClass: top",
-            "objectClass: metaTop",
-            "objectClass: metaSyntaxChecker",
-            "m-fqcn", OctetStringSyntaxChecker.class.getName(),
-            "m-oid", OID,
+        Attributes attrs = LdifUtils.createAttributes( "objectClass: top", "objectClass: metaTop",
+            "objectClass: metaSyntaxChecker", "m-fqcn", OctetStringSyntaxChecker.class.getName(), "m-oid", OID,
             "m-description: A test syntaxChecker" );
-        
+
         // nis is by default inactive
         DN dn = getSyntaxCheckerContainer( "notloaded" );
         dn.add( "m-oid" + "=" + OID );
@@ -144,12 +132,12 @@ public class MetaSyntaxCheckerHandlerIT 
             getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
             fail( "Should not be there" );
         }
-        catch( NameNotFoundException nnfe )
+        catch ( NameNotFoundException nnfe )
         {
             // Expected result.
         }
-        
-        assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries", 
+
+        assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries",
             schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
         assertFalse( isOnDisk( dn ) );
     }
@@ -160,25 +148,21 @@ public class MetaSyntaxCheckerHandlerIT 
     {
         InputStream in = getClass().getResourceAsStream( "DummySyntaxChecker.bytecode" );
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        
+
         while ( in.available() > 0 )
         {
             out.write( in.read() );
         }
-        
-        Attributes attrs = LdifUtils.createAttributes( 
-            "objectClass: top",
-            "objectClass: metaTop",
-            "objectClass: metaSyntaxChecker",
-            "m-fqcn", "org.apache.directory.shared.ldap.schema.syntaxCheckers.DummySyntaxChecker",
-            "m-bytecode", out.toByteArray(),
-            "m-oid", OID,
-            "m-description: A test syntaxChecker" );
-        
+
+        Attributes attrs = LdifUtils.createAttributes( "objectClass: top", "objectClass: metaTop",
+            "objectClass: metaSyntaxChecker", "m-fqcn",
+            "org.apache.directory.shared.ldap.schema.syntaxCheckers.DummySyntaxChecker", "m-bytecode", out
+                .toByteArray(), "m-oid", OID, "m-description: A test syntaxChecker" );
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
-        
+
         assertTrue( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
         assertEquals( schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
@@ -192,84 +176,80 @@ public class MetaSyntaxCheckerHandlerIT 
     {
         InputStream in = getClass().getResourceAsStream( "DummySyntaxChecker.bytecode" );
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        
+
         while ( in.available() > 0 )
         {
             out.write( in.read() );
         }
-        
-        Attributes attrs = LdifUtils.createAttributes( 
-            "objectClass: top",
-            "objectClass: metaTop",
-            "objectClass: metaSyntaxChecker",
-            "m-fqcn", "org.apache.directory.shared.ldap.schema.syntaxCheckers.DummySyntaxChecker",
-            "m-bytecode", out.toByteArray(),
-            "m-oid", OID,
-            "m-description: A test syntaxChecker" );
-        
+
+        Attributes attrs = LdifUtils.createAttributes( "objectClass: top", "objectClass: metaTop",
+            "objectClass: metaSyntaxChecker", "m-fqcn",
+            "org.apache.directory.shared.ldap.schema.syntaxCheckers.DummySyntaxChecker", "m-bytecode", out
+                .toByteArray(), "m-oid", OID, "m-description: A test syntaxChecker" );
+
         DN dn = getSyntaxCheckerContainer( "nis" );
         dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
-        
+
         assertFalse( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
         assertTrue( isOnDisk( dn ) );
     }
-    
-    
+
+
     @Test
     public void testDeleteSyntaxCheckerFromEnabledSchema() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
-        
-        assertTrue( "syntaxChecker should be removed from the registry after being deleted", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+
+        assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
         assertTrue( isOnDisk( dn ) );
-        
+
         getSchemaContext( service ).destroySubcontext( DN.toName( dn ) );
 
-        assertFalse( "syntaxChecker should be removed from the registry after being deleted", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertFalse( "syntaxChecker should be removed from the registry after being deleted", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
 
         try
         {
             schemaManager.getSyntaxCheckerRegistry().lookup( OID );
             fail( "syntaxChecker lookup should fail after deleting the syntaxChecker" );
         }
-        catch( LdapException e )
+        catch ( LdapException e )
         {
         }
-        
+
         assertFalse( isOnDisk( dn ) );
     }
-    
-    
+
+
     @Test
     public void testDeleteSyntaxCheckerFromDisabledSchema() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
-        
-        assertTrue( "syntaxChecker should be removed from the registry after being deleted", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+
+        assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
         assertTrue( isOnDisk( dn ) );
 
         getSchemaContext( service ).destroySubcontext( DN.toName( dn ) );
 
-        assertFalse( "syntaxChecker should be removed from the registry after being deleted", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertFalse( "syntaxChecker should be removed from the registry after being deleted", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
 
         try
         {
             schemaManager.getSyntaxCheckerRegistry().lookup( OID );
             fail( "syntaxChecker lookup should fail after deleting the syntaxChecker" );
         }
-        catch( LdapException e )
+        catch ( LdapException e )
         {
         }
-        
+
         assertFalse( isOnDisk( dn ) );
     }
 
@@ -281,13 +261,13 @@ public class MetaSyntaxCheckerHandlerIT 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
         newdn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
-        assertFalse( "old syntaxChecker OID should be removed from the registry after being renamed", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertFalse( "old syntaxChecker OID should be removed from the registry after being renamed", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
 
         //noinspection EmptyCatchBlock
         try
@@ -295,7 +275,7 @@ public class MetaSyntaxCheckerHandlerIT 
             schemaManager.getSyntaxCheckerRegistry().lookup( OID );
             fail( "syntaxChecker lookup should fail after deleting the syntaxChecker" );
         }
-        catch( LdapException e )
+        catch ( LdapException e )
         {
         }
 
@@ -310,20 +290,20 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testMoveSyntaxChecker() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
         newdn.add( "m-oid" + "=" + OID );
-        
+
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
-        assertTrue( "syntaxChecker OID should still be present", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        
-        assertEquals( "syntaxChecker schema should be set to apache not apachemeta", 
-            schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apache" );
+        assertTrue( "syntaxChecker OID should still be present", schemaManager.getSyntaxCheckerRegistry()
+            .contains( OID ) );
+
+        assertEquals( "syntaxChecker schema should be set to apache not apachemeta", schemaManager
+            .getSyntaxCheckerRegistry().getSchemaName( OID ), "apache" );
 
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, OctetStringSyntaxChecker.class );
@@ -335,77 +315,77 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testMoveSyntaxCheckerAndChangeRdn() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
         newdn.add( "m-oid" + "=" + NEW_OID );
-        
+
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
-        assertFalse( "old syntaxChecker OID should NOT be present", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        
-        assertTrue( "new syntaxChecker OID should be present", 
-            schemaManager.getSyntaxCheckerRegistry().contains( NEW_OID ) );
-        
-        assertEquals( "syntaxChecker with new oid should have schema set to apache NOT apachemeta", 
-            schemaManager.getSyntaxCheckerRegistry().getSchemaName( NEW_OID ), "apache" );
+        assertFalse( "old syntaxChecker OID should NOT be present", schemaManager.getSyntaxCheckerRegistry().contains(
+            OID ) );
+
+        assertTrue( "new syntaxChecker OID should be present", schemaManager.getSyntaxCheckerRegistry().contains(
+            NEW_OID ) );
+
+        assertEquals( "syntaxChecker with new oid should have schema set to apache NOT apachemeta", schemaManager
+            .getSyntaxCheckerRegistry().getSchemaName( NEW_OID ), "apache" );
 
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( NEW_OID ).getClass();
         assertEquals( clazz, OctetStringSyntaxChecker.class );
     }
 
-    
+
     @Test
     @Ignore
     public void testModifySyntaxCheckerWithModificationItems() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
-        
+
         ModificationItem[] mods = new ModificationItem[1];
         Attribute attr = new BasicAttribute( "m-fqcn", BogusSyntaxChecker.class.getName() );
         mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
         getSchemaContext( service ).modifyAttributes( DN.toName( dn ), mods );
 
-        assertTrue( "syntaxChecker OID should still be present", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        
-        assertEquals( "syntaxChecker schema should be set to apachemeta", 
-            schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
+        assertTrue( "syntaxChecker OID should still be present", schemaManager.getSyntaxCheckerRegistry()
+            .contains( OID ) );
+
+        assertEquals( "syntaxChecker schema should be set to apachemeta", schemaManager.getSyntaxCheckerRegistry()
+            .getSchemaName( OID ), "apachemeta" );
 
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, BogusSyntaxChecker.class );
     }
 
-    
+
     @Test
     @Ignore
     public void testModifySyntaxCheckerWithAttributes() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
-        
+
         Attributes mods = new BasicAttributes( true );
         mods.put( "m-fqcn", BogusSyntaxChecker.class.getName() );
         getSchemaContext( service ).modifyAttributes( DN.toName( dn ), DirContext.REPLACE_ATTRIBUTE, mods );
 
-        assertTrue( "syntaxChecker OID should still be present", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        
-        assertEquals( "syntaxChecker schema should be set to apachemeta", 
-            schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
+        assertTrue( "syntaxChecker OID should still be present", schemaManager.getSyntaxCheckerRegistry()
+            .contains( OID ) );
+
+        assertEquals( "syntaxChecker schema should be set to apachemeta", schemaManager.getSyntaxCheckerRegistry()
+            .getSchemaName( OID ), "apachemeta" );
 
         Class<?> clazz = schemaManager.getSyntaxCheckerRegistry().lookup( OID ).getClass();
         assertEquals( clazz, BogusSyntaxChecker.class );
     }
-    
+
 
     // ----------------------------------------------------------------------
     // Test move, rename, and delete when a MR exists and uses the Normalizer
@@ -415,19 +395,15 @@ public class MetaSyntaxCheckerHandlerIT 
     {
         DN scDn = getSyntaxCheckerContainer( "apachemeta" );
         scDn.add( "m-oid" + "=" + OID );
-        
+
         // Create a new SyntaxChecker
         testAddSyntaxCheckerToEnabledSchema();
         assertTrue( isOnDisk( scDn ) );
         assertTrue( service.getSchemaManager().getSyntaxCheckerRegistry().contains( OID ) );
-        
+
         // Create a Syntax using this comparator
-        Attributes attrs = LdifUtils.createAttributes( 
-            "objectClass: top",
-            "objectClass: metaTop",
-            "objectClass: metaSyntax",
-            "m-oid", OID,
-            "m-description: test" );
+        Attributes attrs = LdifUtils.createAttributes( "objectClass: top", "objectClass: metaTop",
+            "objectClass: metaSyntax", "m-oid", OID, "m-description: test" );
 
         DN sDn = getSyntaxContainer( "apachemeta" );
         sDn.add( "m-oid" + "=" + OID );
@@ -442,45 +418,45 @@ public class MetaSyntaxCheckerHandlerIT 
         // Post-checks
         assertTrue( isOnDisk( sDn ) );
         assertTrue( service.getSchemaManager().getLdapSyntaxRegistry().contains( OID ) );
-        
+
         try
         {
             getSchemaContext( service ).destroySubcontext( DN.toName( scDn ) );
             fail( "should not be able to delete a syntaxChecker in use" );
         }
-        catch( OperationNotSupportedException e ) 
+        catch ( OperationNotSupportedException e )
         {
         }
 
-        assertTrue( "syntaxChecker should still be in the registry after delete failure", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertTrue( "syntaxChecker should still be in the registry after delete failure", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
     }
-    
-    
+
+
     @Test
     @Ignore
     public void testMoveSyntaxCheckerWhenInUse() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
         newdn.add( "m-oid" + "=" + OID );
-        
+
         try
         {
             getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
             fail( "should not be able to move a syntaxChecker in use" );
         }
-        catch( OperationNotSupportedException e ) 
+        catch ( OperationNotSupportedException e )
         {
         }
 
-        assertTrue( "syntaxChecker should still be in the registry after move failure", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertTrue( "syntaxChecker should still be in the registry after move failure", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
         schemaManager.getLdapSyntaxRegistry().unregister( OID );
         schemaManager.getGlobalOidRegistry().unregister( OID );
     }
@@ -492,29 +468,29 @@ public class MetaSyntaxCheckerHandlerIT 
     {
         testAddSyntaxCheckerToEnabledSchema();
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
         newdn.add( "m-oid" + "=" + NEW_OID );
-        
+
         try
         {
             getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
             fail( "should not be able to move a syntaxChecker in use" );
         }
-        catch( OperationNotSupportedException e ) 
+        catch ( OperationNotSupportedException e )
         {
         }
 
-        assertTrue( "syntaxChecker should still be in the registry after move failure", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertTrue( "syntaxChecker should still be in the registry after move failure", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
         schemaManager.getLdapSyntaxRegistry().unregister( OID );
         schemaManager.getGlobalOidRegistry().unregister( OID );
     }
 
-    
+
     @Test
     @Ignore
     public void testRenameSyntaxCheckerWhenInUse() throws Exception
@@ -523,21 +499,21 @@ public class MetaSyntaxCheckerHandlerIT 
         dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
-        
+
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
         newdn.add( "m-oid" + "=" + NEW_OID );
-        
+
         try
         {
             getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
             fail( "should not be able to rename a syntaxChecker in use" );
         }
-        catch( OperationNotSupportedException e ) 
+        catch ( OperationNotSupportedException e )
         {
         }
 
-        assertTrue( "syntaxChecker should still be in the registry after rename failure", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertTrue( "syntaxChecker should still be in the registry after rename failure", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
         schemaManager.getLdapSyntaxRegistry().unregister( OID );
         schemaManager.getGlobalOidRegistry().unregister( OID );
     }
@@ -547,30 +523,29 @@ public class MetaSyntaxCheckerHandlerIT 
     // Let's try some freaky stuff
     // ----------------------------------------------------------------------
 
-
     @Test
     @Ignore
     public void testMoveSyntaxCheckerToTop() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         DN top = new DN();
         top.add( "m-oid" + "=" + OID );
-        
+
         try
         {
             getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( top ) );
             fail( "should not be able to move a syntaxChecker up to ou=schema" );
         }
-        catch( InvalidNameException e ) 
+        catch ( InvalidNameException e )
         {
         }
 
-        assertTrue( "syntaxChecker should still be in the registry after move failure", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertTrue( "syntaxChecker should still be in the registry after move failure", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
     }
 
 
@@ -579,44 +554,44 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testMoveSyntaxCheckerToComparatorContainer() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         DN newdn = new DN( "ou=comparators,cn=apachemeta" );
         newdn.add( "m-oid" + "=" + OID );
-        
+
         try
         {
             getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
             fail( "should not be able to move a syntaxChecker into comparators container" );
         }
-        catch( InvalidNameException e ) 
+        catch ( InvalidNameException e )
         {
         }
 
-        assertTrue( "syntaxChecker should still be in the registry after move failure", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertTrue( "syntaxChecker should still be in the registry after move failure", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
     }
-    
-    
+
+
     @Test
     @Ignore
     public void testMoveSyntaxCheckerToDisabledSchema() throws Exception
     {
         testAddSyntaxCheckerToEnabledSchema();
-        
+
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
         dn.add( "m-oid" + "=" + OID );
 
         // nis is inactive by default
         DN newdn = getSyntaxCheckerContainer( "nis" );
         newdn.add( "m-oid" + "=" + OID );
-        
+
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
-        assertFalse( "syntaxChecker OID should no longer be present", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertFalse( "syntaxChecker OID should no longer be present", schemaManager.getSyntaxCheckerRegistry()
+            .contains( OID ) );
     }
 
 
@@ -625,52 +600,53 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testMoveSyntaxCheckerToEnabledSchema() throws Exception
     {
         testAddSyntaxCheckerToDisabledSchema();
-        
+
         // nis is inactive by default
         DN dn = getSyntaxCheckerContainer( "nis" );
         dn.add( "m-oid" + "=" + OID );
 
-        assertFalse( "syntaxChecker OID should NOT be present when added to disabled nis schema", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
+        assertFalse( "syntaxChecker OID should NOT be present when added to disabled nis schema", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
         newdn.add( "m-oid" + "=" + OID );
-        
+
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
-        assertTrue( "syntaxChecker OID should be present when moved to enabled schema", 
-            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
-        
-        assertEquals( "syntaxChecker should be in apachemeta schema after move", 
-            schemaManager.getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
+        assertTrue( "syntaxChecker OID should be present when moved to enabled schema", schemaManager
+            .getSyntaxCheckerRegistry().contains( OID ) );
+
+        assertEquals( "syntaxChecker should be in apachemeta schema after move", schemaManager
+            .getSyntaxCheckerRegistry().getSchemaName( OID ), "apachemeta" );
     }
 
-    
     public static class BogusSyntaxChecker extends SyntaxChecker
     {
         private static final long serialVersionUID = 1L;
 
+
         public BogusSyntaxChecker()
         {
-        	super(OID);
+            super( OID );
         }
-        
+
+
         public boolean isValidSyntax( Object value )
         {
             return false;
         }
     }
 
-    
     class DummySyntax extends LdapSyntax
     {
         private static final long serialVersionUID = 1L;
 
+
         public DummySyntax()
         {
             super( OID );
             addName( "dummy" );
-            isObsolete = false; 
+            isObsolete = false;
             isHumanReadable = false;
             syntaxChecker = null;
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java Thu May 27 08:08:44 2010
@@ -70,32 +70,31 @@ public class FilterNormalizingVisitor im
 
     /** the global registries used to resolve OIDs for attributeType ids */
     private final SchemaManager schemaManager;
-    
 
     /**
      * Chars which need to be escaped in a filter
      * '\0' | '(' | ')' | '*' | '\'
      */
     private static final boolean[] FILTER_CHAR =
-        { 
-            true,  false, false, false, false, false, false, false, // 00 -> 07 NULL
+        { true, false, false, false, false, false, false, false, // 00 -> 07 NULL
             false, false, false, false, false, false, false, false, // 08 -> 0F
             false, false, false, false, false, false, false, false, // 10 -> 17
             false, false, false, false, false, false, false, false, // 18 -> 1F
             false, false, false, false, false, false, false, false, // 20 -> 27
-            true,  true,  true,  false, false, false, false, false, // 28 -> 2F '(', ')', '*'
+            true, true, true, false, false, false, false, false, // 28 -> 2F '(', ')', '*'
             false, false, false, false, false, false, false, false, // 30 -> 37
             false, false, false, false, false, false, false, false, // 38 -> 3F 
             false, false, false, false, false, false, false, false, // 40 -> 47
             false, false, false, false, false, false, false, false, // 48 -> 4F
             false, false, false, false, false, false, false, false, // 50 -> 57
-            false, false, false, false, true,  false, false, false, // 58 -> 5F '\'
+            false, false, false, false, true, false, false, false, // 58 -> 5F '\'
             false, false, false, false, false, false, false, false, // 60 -> 67
             false, false, false, false, false, false, false, false, // 68 -> 6F
             false, false, false, false, false, false, false, false, // 70 -> 77
-            false, false, false, false, false, false, false, false  // 78 -> 7F
+            false, false, false, false, false, false, false, false // 78 -> 7F
         };
-    
+
+
     /**
      * Check if the given char is a filter escaped char
      * &lt;filterEscapedChars&gt; ::= '\0' | '(' | ')' | '*' | '\'
@@ -143,12 +142,11 @@ public class FilterNormalizingVisitor im
 
             if ( attributeType.getSyntax().isHumanReadable() )
             {
-                normalized = new StringValue( 
-                    (String) ncn.normalizeByName( attribute, value.getString() ) );
+                normalized = new StringValue( ( String ) ncn.normalizeByName( attribute, value.getString() ) );
             }
             else
             {
-                normalized = (Value<?>)ncn.normalizeByName( attribute, value.getBytes() );
+                normalized = ( Value<?> ) ncn.normalizeByName( attribute, value.getBytes() );
             }
 
             return normalized;
@@ -204,7 +202,7 @@ public class FilterNormalizingVisitor im
 
         node.setAttribute( schemaManager.getAttributeTypeRegistry().getOidByName( node.getAttribute() ) );
         node.setValue( normalized );
-        
+
         return node;
     }
 
@@ -427,54 +425,54 @@ public class FilterNormalizingVisitor im
      * @param node the node to visit
      * @return the visited node
      */
-    public Object visit( ExprNode node ) 
+    public Object visit( ExprNode node )
     {
-    	try
-    	{
-	        // -------------------------------------------------------------------
-	        // Handle PresenceNodes
-	        // -------------------------------------------------------------------
-	
-	        if ( node instanceof PresenceNode )
-	        {
-	            return visitPresenceNode( ( PresenceNode ) node );
-	        }
-	
-	        // -------------------------------------------------------------------
-	        // Handle BranchNodes (AndNode, NotNode and OrNode)
-	        // -------------------------------------------------------------------
-	
-	        else if ( node instanceof BranchNode )
-	        {
-	            return visitBranchNode( ( BranchNode ) node );
-	        }
-	
-	        // -------------------------------------------------------------------
-	        // Handle SimpleNodes (ApproximateNode, EqualityNode, GreaterEqNode,
-	        // and LesserEqNode) 
-	        // -------------------------------------------------------------------
-	
-	        else if ( node instanceof SimpleNode )
-	        {
-	            return visitSimpleNode( ( SimpleNode ) node );
-	        }
-	        else if ( node instanceof ExtensibleNode )
-	        {
-	            return visitExtensibleNode( ( ExtensibleNode ) node );
-	        }
-	        else if ( node instanceof SubstringNode )
-	        {
-	            return visitSubstringNode( ( SubstringNode ) node );
-	        }
-	        else
-	        {
-	            return null;
-	        }
-    	}
-    	catch( LdapException e )
-    	{
-    		throw new RuntimeException( e );
-    	}
+        try
+        {
+            // -------------------------------------------------------------------
+            // Handle PresenceNodes
+            // -------------------------------------------------------------------
+
+            if ( node instanceof PresenceNode )
+            {
+                return visitPresenceNode( ( PresenceNode ) node );
+            }
+
+            // -------------------------------------------------------------------
+            // Handle BranchNodes (AndNode, NotNode and OrNode)
+            // -------------------------------------------------------------------
+
+            else if ( node instanceof BranchNode )
+            {
+                return visitBranchNode( ( BranchNode ) node );
+            }
+
+            // -------------------------------------------------------------------
+            // Handle SimpleNodes (ApproximateNode, EqualityNode, GreaterEqNode,
+            // and LesserEqNode) 
+            // -------------------------------------------------------------------
+
+            else if ( node instanceof SimpleNode )
+            {
+                return visitSimpleNode( ( SimpleNode ) node );
+            }
+            else if ( node instanceof ExtensibleNode )
+            {
+                return visitExtensibleNode( ( ExtensibleNode ) node );
+            }
+            else if ( node instanceof SubstringNode )
+            {
+                return visitSubstringNode( ( SubstringNode ) node );
+            }
+            else
+            {
+                return null;
+            }
+        }
+        catch ( LdapException e )
+        {
+            throw new RuntimeException( e );
+        }
     }
 
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java?rev=948711&r1=948710&r2=948711&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/DummyAttributeTypeRegistry.java Thu May 27 08:08:44 2010
@@ -46,12 +46,12 @@ import org.apache.directory.shared.ldap.
  * @version $Rev$, $Date$
  *
  */
-public class DummyAttributeTypeRegistry extends DefaultSchemaObjectRegistry<AttributeType> 
+public class DummyAttributeTypeRegistry extends DefaultSchemaObjectRegistry<AttributeType>
 {
     private final boolean returnOperational;
 
 
-    public DummyAttributeTypeRegistry(boolean returnOperational)
+    public DummyAttributeTypeRegistry( boolean returnOperational )
     {
         super( SchemaObjectType.ATTRIBUTE_TYPE, new OidRegistry() );
         this.returnOperational = returnOperational;
@@ -64,7 +64,7 @@ public class DummyAttributeTypeRegistry 
 
         MatchingRule equality = new MatchingRule( "1.1.1" );
         equality.setNormalizer( normalizer );
-        
+
         AttributeType attributeType = new AttributeType( id );
         attributeType.setEquality( equality );
         attributeType.setSingleValued( false );
@@ -83,7 +83,7 @@ public class DummyAttributeTypeRegistry 
             attributeType.setSyntax( syntax );
             attributeType.setUserModifiable( true );
         }
-        
+
         return attributeType;
     }
 
@@ -106,7 +106,7 @@ public class DummyAttributeTypeRegistry 
     }
 
 
-    public Map<String,OidNormalizer> getNormalizerMapping()
+    public Map<String, OidNormalizer> getNormalizerMapping()
     {
         return null;
     }
@@ -132,7 +132,7 @@ public class DummyAttributeTypeRegistry 
 
     public AttributeType unregister( String numericOid ) throws LdapException
     {
-    	return null;
+        return null;
     }
 
 
@@ -146,19 +146,17 @@ public class DummyAttributeTypeRegistry 
         return null;
     }
 
-    
-    public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor ) 
-    throws LdapException
+
+    public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor ) throws LdapException
     {
     }
 
-    
-    public void registerDescendants( AttributeType attributeType, AttributeType ancestor ) 
-    throws LdapException
+
+    public void registerDescendants( AttributeType attributeType, AttributeType ancestor ) throws LdapException
     {
     }
-    
-    
+
+
     public void addMappingFor( AttributeType attributeType ) throws LdapException
     {
     }



Mime
View raw message