directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r917212 [1/3] - in /directory/apacheds/trunk/xdbm-search/src: main/java/org/apache/directory/server/xdbm/search/impl/ test/java/org/apache/directory/server/xdbm/search/impl/
Date Sun, 28 Feb 2010 17:26:05 GMT
Author: seelmann
Date: Sun Feb 28 17:26:04 2010
New Revision: 917212

URL: http://svn.apache.org/viewvc?rev=917212&view=rev
Log:
formatting

Modified:
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NoOpOptimizer.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
    directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeEvaluator.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/BogusSyntax.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/FilterNormalizingVisitor.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/PresenceTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
    directory/apacheds/trunk/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeTest.java

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java Sun Feb 28 17:26:04 2010
@@ -34,19 +34,19 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AllEntriesCursor extends AbstractIndexCursor<Long,ServerEntry>
+public class AllEntriesCursor extends AbstractIndexCursor<Long, ServerEntry>
 {
     private IndexEntry<Long, ServerEntry> indexEntry = new ForwardIndexEntry<Long, ServerEntry>();
-    private final IndexCursor<String,ServerEntry> wrapped;
+    private final IndexCursor<String, ServerEntry> wrapped;
+
 
-    
     public AllEntriesCursor( Store<ServerEntry> db ) throws Exception
     {
         // Get a reverse cursor because we want to sort by ID
         wrapped = db.getNdnIndex().reverseCursor();
     }
-    
-    
+
+
     /* 
      * @see org.apache.directory.server.xdbm.IndexCursor#afterValue(Long, Object)
      */
@@ -70,7 +70,7 @@
     /* 
      * @see org.apache.directory.server.core.cursor.Cursor#after(java.lang.Object)
      */
-    public void after( IndexEntry<Long,ServerEntry> indexEntry ) throws Exception
+    public void after( IndexEntry<Long, ServerEntry> indexEntry ) throws Exception
     {
         checkNotClosed( "after()" );
         wrapped.afterValue( indexEntry.getId(), null );
@@ -99,7 +99,7 @@
     /* 
      * @see org.apache.directory.server.core.cursor.Cursor#before(java.lang.Object)
      */
-    public void before( IndexEntry<Long,ServerEntry> indexEntry ) throws Exception
+    public void before( IndexEntry<Long, ServerEntry> indexEntry ) throws Exception
     {
         checkNotClosed( "before()" );
         wrapped.beforeValue( indexEntry.getId(), null );
@@ -129,10 +129,10 @@
     /* 
      * @see org.apache.directory.server.core.cursor.Cursor#get()
      */
-    public IndexEntry<Long,ServerEntry> get() throws Exception
+    public IndexEntry<Long, ServerEntry> get() throws Exception
     {
         checkNotClosed( "get()" );
-        IndexEntry<String,ServerEntry> wrappedEntry = wrapped.get();
+        IndexEntry<String, ServerEntry> wrappedEntry = wrapped.get();
         indexEntry.setId( wrappedEntry.getId() );
         indexEntry.setValue( wrappedEntry.getId() );
         indexEntry.setObject( wrappedEntry.getObject() );

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java Sun Feb 28 17:26:04 2010
@@ -44,13 +44,12 @@
 public class AndCursor<V> extends AbstractIndexCursor<V, ServerEntry>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
-    private final IndexCursor<V,ServerEntry> wrapped;
+    private final IndexCursor<V, ServerEntry> wrapped;
     private final List<Evaluator<? extends ExprNode, ServerEntry>> evaluators;
     private boolean available = false;
 
 
-    public AndCursor( IndexCursor<V, ServerEntry> wrapped,
-                      List<Evaluator<? extends ExprNode, ServerEntry>> evaluators )
+    public AndCursor( IndexCursor<V, ServerEntry> wrapped, List<Evaluator<? extends ExprNode, ServerEntry>> evaluators )
     {
         this.wrapped = wrapped;
         this.evaluators = optimize( evaluators );
@@ -123,7 +122,7 @@
         {
             checkNotClosed( "previous()" );
 
-            IndexEntry<?,ServerEntry> candidate = wrapped.get();
+            IndexEntry<?, ServerEntry> candidate = wrapped.get();
             if ( matches( candidate ) )
             {
                 return available = true;
@@ -139,7 +138,7 @@
         while ( wrapped.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?,ServerEntry> candidate = wrapped.get();
+            IndexEntry<?, ServerEntry> candidate = wrapped.get();
             if ( matches( candidate ) )
             {
                 return available = true;
@@ -189,14 +188,14 @@
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with increasing scan count ordering
      */
-    private List<Evaluator<? extends ExprNode,ServerEntry>>
-        optimize( List<Evaluator<? extends ExprNode,ServerEntry>> unoptimized )
+    private List<Evaluator<? extends ExprNode, ServerEntry>> optimize(
+        List<Evaluator<? extends ExprNode, ServerEntry>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode,ServerEntry>> optimized =
-            new ArrayList<Evaluator<? extends ExprNode,ServerEntry>>( unoptimized.size() );
+        List<Evaluator<? extends ExprNode, ServerEntry>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            unoptimized.size() );
         optimized.addAll( unoptimized );
-        
-        Collections.sort( optimized, new Comparator<Evaluator<?,ServerEntry>>()
+
+        Collections.sort( optimized, new Comparator<Evaluator<?, ServerEntry>>()
         {
             public int compare( Evaluator<?, ServerEntry> e1, Evaluator<?, ServerEntry> e2 )
             {
@@ -221,7 +220,7 @@
 
                 return 1;
             }
-        });
+        } );
 
         return optimized;
     }
@@ -229,9 +228,9 @@
 
     private boolean matches( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
-            if ( ! evaluator.evaluate( indexEntry ) )
+            if ( !evaluator.evaluate( indexEntry ) )
             {
                 return false;
             }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java Sun Feb 28 17:26:04 2010
@@ -40,7 +40,7 @@
  */
 public class AndEvaluator implements Evaluator<AndNode, ServerEntry>
 {
-    private final List<Evaluator<? extends ExprNode,ServerEntry>> evaluators;
+    private final List<Evaluator<? extends ExprNode, ServerEntry>> evaluators;
 
     private final AndNode node;
 
@@ -63,13 +63,13 @@
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with increasing scan count ordering
      */
-    private List<Evaluator<? extends ExprNode,ServerEntry>>
-        optimize( List<Evaluator<? extends ExprNode,ServerEntry>> unoptimized )
+    private List<Evaluator<? extends ExprNode, ServerEntry>> optimize(
+        List<Evaluator<? extends ExprNode, ServerEntry>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode,ServerEntry>> optimized =
-            new ArrayList<Evaluator<? extends ExprNode,ServerEntry>>( unoptimized.size() );
+        List<Evaluator<? extends ExprNode, ServerEntry>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            unoptimized.size() );
         optimized.addAll( unoptimized );
-        Collections.sort( optimized, new Comparator<Evaluator<?,ServerEntry>>()
+        Collections.sort( optimized, new Comparator<Evaluator<?, ServerEntry>>()
         {
             public int compare( Evaluator<?, ServerEntry> e1, Evaluator<?, ServerEntry> e2 )
             {
@@ -94,7 +94,7 @@
 
                 return 1;
             }
-        });
+        } );
 
         return optimized;
     }
@@ -102,9 +102,9 @@
 
     public boolean evaluate( Long id ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
-            if ( ! evaluator.evaluate( id ) )
+            if ( !evaluator.evaluate( id ) )
             {
                 return false;
             }
@@ -116,9 +116,9 @@
 
     public boolean evaluate( ServerEntry entry ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
-            if ( ! evaluator.evaluate( entry ) )
+            if ( !evaluator.evaluate( entry ) )
             {
                 return false;
             }
@@ -130,9 +130,9 @@
 
     public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
-            if ( ! evaluator.evaluate( indexEntry ) )
+            if ( !evaluator.evaluate( indexEntry ) )
             {
                 return false;
             }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java Sun Feb 28 17:26:04 2010
@@ -45,17 +45,16 @@
  */
 public class ApproximateCursor<V> extends AbstractIndexCursor<V, ServerEntry>
 {
-    private static final String UNSUPPORTED_MSG =
-        "ApproximateCursors only support positioning by element when a user index exists on the asserted attribute.";
+    private static final String UNSUPPORTED_MSG = "ApproximateCursors only support positioning by element when a user index exists on the asserted attribute.";
 
     /** An approximate evaluator for candidates */
     private final ApproximateEvaluator approximateEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V,ServerEntry> userIdxCursor;
+    private final IndexCursor<V, ServerEntry> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String,ServerEntry> ndnIdxCursor;
+    private final IndexCursor<String, ServerEntry> ndnIdxCursor;
 
     /** used only when ndnIdxCursor is used (no index on attribute) */
     private boolean available = false;
@@ -70,7 +69,7 @@
         if ( db.hasUserIndexOn( attribute ) )
         {
             //noinspection unchecked
-            Index<V,ServerEntry> index = ( Index<V, ServerEntry> ) db.getUserIndex( attribute );
+            Index<V, ServerEntry> index = ( Index<V, ServerEntry> ) db.getUserIndex( attribute );
             userIdxCursor = index.forwardCursor( value.get() );
             ndnIdxCursor = null;
         }
@@ -200,13 +199,13 @@
             return userIdxCursor.previous();
         }
 
-        while( ndnIdxCursor.previous() )
+        while ( ndnIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?,ServerEntry> candidate = ndnIdxCursor.get();
+            IndexEntry<?, ServerEntry> candidate = ndnIdxCursor.get();
             if ( approximateEvaluator.evaluate( candidate ) )
             {
-                 return available = true;
+                return available = true;
             }
         }
 
@@ -221,13 +220,13 @@
             return userIdxCursor.next();
         }
 
-        while( ndnIdxCursor.next() )
+        while ( ndnIdxCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?,ServerEntry> candidate = ndnIdxCursor.get();
+            IndexEntry<?, ServerEntry> candidate = ndnIdxCursor.get();
             if ( approximateEvaluator.evaluate( candidate ) )
             {
-                 return available = true;
+                return available = true;
             }
         }
 

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java Sun Feb 28 17:26:04 2010
@@ -53,7 +53,7 @@
     private final AttributeType type;
     private final Normalizer normalizer;
     private final LdapComparator<? super Object> ldapComparator;
-    private final Index<Object,ServerEntry> idx;
+    private final Index<Object, ServerEntry> idx;
 
 
     public ApproximateEvaluator( ApproximateNode node, Store<ServerEntry> db, SchemaManager schemaManager )
@@ -66,7 +66,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = ( Index<Object,ServerEntry> ) db.getUserIndex( node.getAttribute() );
+            idx = ( Index<Object, ServerEntry> ) db.getUserIndex( node.getAttribute() );
             type = null;
             normalizer = null;
             ldapComparator = null;
@@ -114,8 +114,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             while ( descendants.hasNext() )
             {
@@ -146,7 +146,7 @@
     }
 
 
-    public boolean evaluate( IndexEntry<?,ServerEntry> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
         if ( idx != null )
         {

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java Sun Feb 28 17:26:04 2010
@@ -65,7 +65,7 @@
     }
 
 
-    public IndexCursor<?,ServerEntry> build( ExprNode node ) throws Exception
+    public IndexCursor<?, ServerEntry> build( ExprNode node ) throws Exception
     {
         switch ( node.getAssertionType() )
         {
@@ -73,19 +73,19 @@
 
             case APPROXIMATE:
                 return new ApproximateCursor( db, ( ApproximateEvaluator ) evaluatorBuilder.build( node ) );
-            
+
             case EQUALITY:
                 return new EqualityCursor( db, ( EqualityEvaluator ) evaluatorBuilder.build( node ) );
-            
+
             case GREATEREQ:
                 return new GreaterEqCursor( db, ( GreaterEqEvaluator ) evaluatorBuilder.build( node ) );
-            
+
             case LESSEQ:
                 return new LessEqCursor( db, ( LessEqEvaluator ) evaluatorBuilder.build( node ) );
-            
+
             case PRESENCE:
                 return new PresenceCursor( db, ( PresenceEvaluator ) evaluatorBuilder.build( node ) );
-            
+
             case SCOPE:
                 if ( ( ( ScopeNode ) node ).getScope() == SearchScope.ONELEVEL )
                 {
@@ -95,22 +95,22 @@
                 {
                     return new SubtreeScopeCursor( db, ( SubtreeScopeEvaluator ) evaluatorBuilder.build( node ) );
                 }
-                
+
             case SUBSTRING:
                 return new SubstringCursor( db, ( SubstringEvaluator ) evaluatorBuilder.build( node ) );
 
-            /* ---------- LOGICAL OPERATORS ---------- */
+                /* ---------- LOGICAL OPERATORS ---------- */
 
             case AND:
                 return buildAndCursor( ( AndNode ) node );
-                
+
             case NOT:
-                return new NotCursor( db, evaluatorBuilder.build( ( ( NotNode ) node).getFirstChild() ) );
-            
+                return new NotCursor( db, evaluatorBuilder.build( ( ( NotNode ) node ).getFirstChild() ) );
+
             case OR:
                 return buildOrCursor( ( OrNode ) node );
 
-            /* ----------  NOT IMPLEMENTED  ---------- */
+                /* ----------  NOT IMPLEMENTED  ---------- */
 
             case ASSERTION:
             case EXTENSIBLE:
@@ -129,12 +129,12 @@
      * @return Cursor over candidates satisfying disjunction expression
      * @throws Exception on db access failures
      */
-    private IndexCursor<?,ServerEntry> buildOrCursor( OrNode node ) throws Exception
+    private IndexCursor<?, ServerEntry> buildOrCursor( OrNode node ) throws Exception
     {
         List<ExprNode> children = node.getChildren();
-        List<IndexCursor<?,ServerEntry>> childCursors = new ArrayList<IndexCursor<?,ServerEntry>>( children.size() );
-        List<Evaluator<? extends ExprNode, ServerEntry>> childEvaluators
-            = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>( children.size() );
+        List<IndexCursor<?, ServerEntry>> childCursors = new ArrayList<IndexCursor<?, ServerEntry>>( children.size() );
+        List<Evaluator<? extends ExprNode, ServerEntry>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            children.size() );
 
         // Recursively create Cursors and Evaluators for each child expression node
         for ( ExprNode child : children )
@@ -155,7 +155,7 @@
      * @return Cursor over the conjunction expression
      * @throws Exception on db access failures
      */
-    private IndexCursor<?,ServerEntry> buildAndCursor( AndNode node ) throws Exception
+    private IndexCursor<?, ServerEntry> buildAndCursor( AndNode node ) throws Exception
     {
         int minIndex = 0;
         long minValue = Long.MAX_VALUE;
@@ -168,12 +168,12 @@
          * we will use for iteration by creating a Cursor over its expression.
          */
         final List<ExprNode> children = node.getChildren();
-        
+
         for ( int ii = 0; ii < children.size(); ii++ )
         {
             ExprNode child = children.get( ii );
             Object count = child.get( "count" );
-            if( count == null )
+            if ( count == null )
             {
                 continue;
             }
@@ -188,8 +188,8 @@
 
         // Once found we build the child Evaluators minus the one for the minChild
         ExprNode minChild = children.get( minIndex );
-        List<Evaluator<? extends ExprNode, ServerEntry>> childEvaluators =
-            new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>( children.size() - 1 );
+        List<Evaluator<? extends ExprNode, ServerEntry>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            children.size() - 1 );
         for ( ExprNode child : children )
         {
             if ( child == minChild )
@@ -201,7 +201,7 @@
         }
 
         // Do recursive call to build min child Cursor then create AndCursor
-        IndexCursor<?,ServerEntry> childCursor = build( minChild );
+        IndexCursor<?, ServerEntry> childCursor = build( minChild );
         return new AndCursor( childCursor, childEvaluators );
     }
 }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java Sun Feb 28 17:26:04 2010
@@ -55,7 +55,7 @@
     /** the database this optimizer operates on */
     private final Store<E> db;
     private Long contextEntryId;
-    
+
 
     /**
      * Creates an optimizer on a database.
@@ -67,7 +67,7 @@
         this.db = db;
     }
 
-    
+
     private Long getContextEntryId()
     {
         if ( contextEntryId == null )
@@ -81,15 +81,15 @@
                 // might not have been created
             }
         }
-        
+
         if ( contextEntryId == null )
         {
             return 1L;
         }
-        
+
         return contextEntryId;
     }
-    
+
 
     /**
      * Annotates the expression tree to determine optimal evaluation order based
@@ -177,11 +177,11 @@
         {
             if ( node instanceof AndNode )
             {
-                count = getConjunctionScan( (AndNode)node );
+                count = getConjunctionScan( ( AndNode ) node );
             }
             else if ( node instanceof OrNode )
             {
-                count = getDisjunctionScan( (OrNode)node );
+                count = getDisjunctionScan( ( OrNode ) node );
             }
             else if ( node instanceof NotNode )
             {
@@ -257,7 +257,7 @@
             annotate( child );
             total += ( Long ) child.get( "count" );
         }
-        
+
         return total;
     }
 
@@ -271,11 +271,11 @@
      * @throws Exception if there is an error accessing an index
      */
     @SuppressWarnings("unchecked")
-    private<V> long getEqualityScan( SimpleNode<V> node ) throws Exception
+    private <V> long getEqualityScan( SimpleNode<V> node ) throws Exception
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
-            Index<V,E> idx = ( Index<V, E> ) db.getUserIndex( node.getAttribute() );
+            Index<V, E> idx = ( Index<V, E> ) db.getUserIndex( node.getAttribute() );
             return idx.count( node.getValue().get() );
         }
 
@@ -294,7 +294,7 @@
      * @throws Exception if there is an error accessing an index
      */
     @SuppressWarnings("unchecked")
-    private<V> long getGreaterLessScan( SimpleNode<V> node, boolean isGreaterThan ) throws Exception
+    private <V> long getGreaterLessScan( SimpleNode<V> node, boolean isGreaterThan ) throws Exception
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
@@ -348,7 +348,7 @@
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
-            Index<String,E> idx = db.getPresenceIndex();
+            Index<String, E> idx = db.getPresenceIndex();
             return idx.count( node.getAttribute() );
         }
 
@@ -370,10 +370,10 @@
         {
             case OBJECT:
                 return 1L;
-            
+
             case ONELEVEL:
                 return db.getChildCount( id );
-                
+
             case SUBTREE:
                 if ( id == getContextEntryId() )
                 {
@@ -383,7 +383,7 @@
                 {
                     return db.getSubLevelIndex().count( id );
                 }
-            
+
             default:
                 throw new IllegalArgumentException( I18n.err( I18n.ERR_713 ) );
         }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java Sun Feb 28 17:26:04 2010
@@ -63,7 +63,6 @@
     // ------------------------------------------------------------------------
     // C O N S T R U C T O R S
     // ------------------------------------------------------------------------
-    
 
     /**
      * Creates a DefaultSearchEngine for searching a Database without setting
@@ -73,8 +72,8 @@
      * @param evaluatorBuilder an expression evaluator builder
      * @param optimizer an optimizer to use during search
      */
-    public DefaultSearchEngine( Store<ServerEntry> db,
-                                CursorBuilder cursorBuilder, EvaluatorBuilder evaluatorBuilder, Optimizer optimizer )
+    public DefaultSearchEngine( Store<ServerEntry> db, CursorBuilder cursorBuilder, EvaluatorBuilder evaluatorBuilder,
+        Optimizer optimizer )
     {
         this.db = db;
         this.optimizer = optimizer;
@@ -97,19 +96,19 @@
     /**
      * @see SearchEngine#cursor(LdapDN, AliasDerefMode, ExprNode, SearchControls)
      */
-    public IndexCursor<Long,ServerEntry> cursor( LdapDN base, AliasDerefMode aliasDerefMode, ExprNode filter,
-                                                     SearchControls searchCtls ) throws Exception
+    public IndexCursor<Long, ServerEntry> cursor( LdapDN base, AliasDerefMode aliasDerefMode, ExprNode filter,
+        SearchControls searchCtls ) throws Exception
     {
         LdapDN effectiveBase;
         Long baseId = db.getEntryId( base.toString() );
-        
+
         // Check that we have an entry, otherwise we can immediately get out
         if ( baseId == null )
         {
             // The entry is not found : ciao !
             return new EmptyIndexCursor<Long, ServerEntry>();
         }
-        
+
         String aliasedBase = db.getAliasIndex().reverseLookup( baseId );
 
         // --------------------------------------------------------------------
@@ -121,7 +120,7 @@
          * occur on finding the base then we set the effective base to the
          * given base.
          */
-        if ( ( null == aliasedBase ) || ! aliasDerefMode.isDerefFindingBase() )
+        if ( ( null == aliasedBase ) || !aliasDerefMode.isDerefFindingBase() )
         {
             effectiveBase = base;
         }
@@ -135,7 +134,7 @@
         {
             effectiveBase = new LdapDN( aliasedBase );
         }
-        
+
         // --------------------------------------------------------------------
         // Specifically Handle Object Level Scope
         // --------------------------------------------------------------------
@@ -145,28 +144,28 @@
             Long effectiveBaseId = baseId;
             if ( effectiveBase != base )
             {
-                effectiveBaseId = db.getEntryId( effectiveBase.toNormName() ); 
+                effectiveBaseId = db.getEntryId( effectiveBase.toNormName() );
             }
-            
+
             IndexEntry<Long, ServerEntry> indexEntry = new ForwardIndexEntry<Long, ServerEntry>();
             indexEntry.setId( effectiveBaseId );
             optimizer.annotate( filter );
             Evaluator<? extends ExprNode, ServerEntry> evaluator = evaluatorBuilder.build( filter );
-            
+
             if ( evaluator.evaluate( indexEntry ) )
             {
-                return new SingletonIndexCursor<Long,ServerEntry>( indexEntry );
+                return new SingletonIndexCursor<Long, ServerEntry>( indexEntry );
             }
             else
             {
                 return new EmptyIndexCursor<Long, ServerEntry>();
             }
         }
-        
+
         // Add the scope node using the effective base to the filter
         BranchNode root = new AndNode();
-        ExprNode node = new ScopeNode( aliasDerefMode, effectiveBase.toString(), 
-            SearchScope.getSearchScope( searchCtls.getSearchScope() ) );
+        ExprNode node = new ScopeNode( aliasDerefMode, effectiveBase.toString(), SearchScope.getSearchScope( searchCtls
+            .getSearchScope() ) );
         root.getChildren().add( node );
         root.getChildren().add( filter );
 
@@ -179,8 +178,7 @@
     /**
      * @see SearchEngine#evaluator(ExprNode)
      */
-    public Evaluator<? extends ExprNode, ServerEntry> evaluator( ExprNode filter )
-        throws Exception
+    public Evaluator<? extends ExprNode, ServerEntry> evaluator( ExprNode filter ) throws Exception
     {
         return evaluatorBuilder.build( filter );
     }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java Sun Feb 28 17:26:04 2010
@@ -50,10 +50,10 @@
     private final EqualityEvaluator equalityEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V,ServerEntry> userIdxCursor;
+    private final IndexCursor<V, ServerEntry> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String,ServerEntry> ndnIdxCursor;
+    private final IndexCursor<String, ServerEntry> ndnIdxCursor;
 
     /** used only when ndnIdxCursor is used (no index on attribute) */
     private boolean available = false;
@@ -68,7 +68,7 @@
         Value<V> value = equalityEvaluator.getExpression().getValue();
         if ( db.hasUserIndexOn( attribute ) )
         {
-            Index<V,ServerEntry> userIndex = ( Index<V, ServerEntry> ) db.getUserIndex( attribute ); 
+            Index<V, ServerEntry> userIndex = ( Index<V, ServerEntry> ) db.getUserIndex( attribute );
             userIdxCursor = userIndex.forwardCursor( value.get() );
             ndnIdxCursor = null;
         }
@@ -199,13 +199,13 @@
             return userIdxCursor.previous();
         }
 
-        while( ndnIdxCursor.previous() )
+        while ( ndnIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?,ServerEntry> candidate = ndnIdxCursor.get();
+            IndexEntry<?, ServerEntry> candidate = ndnIdxCursor.get();
             if ( equalityEvaluator.evaluate( candidate ) )
             {
-                 return available = true;
+                return available = true;
             }
         }
 
@@ -221,13 +221,13 @@
             return userIdxCursor.next();
         }
 
-        while( ndnIdxCursor.next() )
+        while ( ndnIdxCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?,ServerEntry> candidate = ndnIdxCursor.get();
+            IndexEntry<?, ServerEntry> candidate = ndnIdxCursor.get();
             if ( equalityEvaluator.evaluate( candidate ) )
             {
-                 return available = true;
+                return available = true;
             }
         }
 
@@ -246,7 +246,7 @@
 
         if ( available )
         {
-            return ( IndexEntry<V, ServerEntry> )ndnIdxCursor.get();
+            return ( IndexEntry<V, ServerEntry> ) ndnIdxCursor.get();
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java Sun Feb 28 17:26:04 2010
@@ -56,17 +56,17 @@
     private final SchemaManager schemaManager;
     private final AttributeType type;
     private final Normalizer normalizer;
-    
+
     /** The comparator to use */
     private final LdapComparator<?> comparator;
-    
+
     /** The default byte[] comparator if no comparator has been defined */
     private static final Comparator<byte[]> BINARY_COMPARATOR = new ByteArrayComparator( null );
-    
+
     /** The default String comparator if no comparator has been defined */
     private static final Comparator<String> STRING_COMPARATOR = new StringComparator( null );
-    
-    private final Index<T,ServerEntry> idx;
+
+    private final Index<T, ServerEntry> idx;
 
 
     public EqualityEvaluator( EqualityNode<T> node, Store<ServerEntry> db, SchemaManager schemaManager )
@@ -111,7 +111,7 @@
     }
 
 
-    public boolean evaluate( IndexEntry<?,ServerEntry> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
         if ( idx != null )
         {
@@ -150,8 +150,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             while ( descendants.hasNext() )
             {
@@ -178,10 +178,10 @@
             return idx.reverse( id );
         }
 
-        return evaluate ( db.lookup( id ) );
+        return evaluate( db.lookup( id ) );
     }
-    
-    
+
+
     // TODO - determine if comparator and index entry should have the Value
     // wrapper or the raw normalized value
     private boolean evaluate( ServerAttribute attribute ) throws Exception
@@ -195,17 +195,17 @@
         for ( Value<?> value : attribute )
         {
             value.normalize( normalizer );
-            
+
             //noinspection unchecked
             if ( value.isBinary() )
             {
                 // Deal with a binary value
-                byte[] serverValue = ((Value<byte[]>)value).getNormalizedValue();
-                byte[] nodeValue = ((Value<byte[]>)node.getValue()).getNormalizedValue();
-                
+                byte[] serverValue = ( ( Value<byte[]> ) value ).getNormalizedValue();
+                byte[] nodeValue = ( ( Value<byte[]> ) node.getValue() ).getNormalizedValue();
+
                 if ( comparator != null )
                 {
-                    if ( ( ((LdapComparator<byte[]>)comparator).compare( serverValue, nodeValue ) == 0 ) )
+                    if ( ( ( ( LdapComparator<byte[]> ) comparator ).compare( serverValue, nodeValue ) == 0 ) )
                     {
                         return true;
                     }
@@ -221,21 +221,21 @@
             else
             {
                 // Deal with a String value
-                String serverValue = ((Value<String>)value).getNormalizedValue();
+                String serverValue = ( ( Value<String> ) value ).getNormalizedValue();
                 String nodeValue = null;
-                
+
                 if ( node.getValue().isBinary() )
                 {
-                    nodeValue = StringTools.utf8ToString( ((Value<byte[]>)node.getValue()).getNormalizedValue() );
+                    nodeValue = StringTools.utf8ToString( ( ( Value<byte[]> ) node.getValue() ).getNormalizedValue() );
                 }
                 else
                 {
-                    nodeValue = ((Value<String>)node.getValue()).getNormalizedValue();
+                    nodeValue = ( ( Value<String> ) node.getValue() ).getNormalizedValue();
                 }
-                
+
                 if ( comparator != null )
                 {
-                    if ( ((LdapComparator<String>)comparator).compare( serverValue, nodeValue ) == 0 )
+                    if ( ( ( LdapComparator<String> ) comparator ).compare( serverValue, nodeValue ) == 0 )
                     {
                         return true;
                     }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java Sun Feb 28 17:26:04 2010
@@ -78,19 +78,19 @@
 
             case APPROXIMATE:
                 return new ApproximateEvaluator( ( ApproximateNode ) node, db, schemaManager );
-                
+
             case EQUALITY:
                 return new EqualityEvaluator( ( EqualityNode ) node, db, schemaManager );
-                
+
             case GREATEREQ:
                 return new GreaterEqEvaluator( ( GreaterEqNode ) node, db, schemaManager );
-                
+
             case LESSEQ:
                 return new LessEqEvaluator( ( LessEqNode ) node, db, schemaManager );
-                
+
             case PRESENCE:
                 return new PresenceEvaluator( ( PresenceNode ) node, db, schemaManager );
-                
+
             case SCOPE:
                 if ( ( ( ScopeNode ) node ).getScope() == SearchScope.ONELEVEL )
                 {
@@ -100,22 +100,22 @@
                 {
                     return new SubtreeScopeEvaluator<ServerEntry>( db, ( ScopeNode ) node );
                 }
-                
+
             case SUBSTRING:
                 return new SubstringEvaluator( ( SubstringNode ) node, db, schemaManager );
 
-            /* ---------- LOGICAL OPERATORS ---------- */
+                /* ---------- LOGICAL OPERATORS ---------- */
 
             case AND:
                 return buildAndEvaluator( ( AndNode ) node );
-                
+
             case NOT:
-                return new NotEvaluator( ( NotNode ) node, build( ( ( NotNode ) node).getFirstChild() ) );
-                
+                return new NotEvaluator( ( NotNode ) node, build( ( ( NotNode ) node ).getFirstChild() ) );
+
             case OR:
                 return buildOrEvaluator( ( OrNode ) node );
 
-            /* ----------  NOT IMPLEMENTED  ---------- */
+                /* ----------  NOT IMPLEMENTED  ---------- */
 
             case ASSERTION:
             case EXTENSIBLE:
@@ -130,8 +130,8 @@
     AndEvaluator buildAndEvaluator( AndNode node ) throws Exception
     {
         List<ExprNode> children = node.getChildren();
-        List<Evaluator<? extends ExprNode,ServerEntry>> evaluators =
-            new ArrayList<Evaluator<? extends ExprNode,ServerEntry>>( children.size() );
+        List<Evaluator<? extends ExprNode, ServerEntry>> evaluators = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            children.size() );
         for ( ExprNode child : children )
         {
             evaluators.add( build( child ) );
@@ -143,8 +143,8 @@
     OrEvaluator buildOrEvaluator( OrNode node ) throws Exception
     {
         List<ExprNode> children = node.getChildren();
-        List<Evaluator<? extends ExprNode,ServerEntry>> evaluators =
-            new ArrayList<Evaluator<? extends ExprNode,ServerEntry>>( children.size() );
+        List<Evaluator<? extends ExprNode, ServerEntry>> evaluators = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            children.size() );
         for ( ExprNode child : children )
         {
             evaluators.add( build( child ) );

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java Sun Feb 28 17:26:04 2010
@@ -43,17 +43,16 @@
  */
 public class GreaterEqCursor<V> extends AbstractIndexCursor<V, ServerEntry>
 {
-    private static final String UNSUPPORTED_MSG =
-        "GreaterEqCursors only support positioning by element when a user index exists on the asserted attribute.";
+    private static final String UNSUPPORTED_MSG = "GreaterEqCursors only support positioning by element when a user index exists on the asserted attribute.";
 
     /** An greater eq evaluator for candidates */
     private final GreaterEqEvaluator greaterEqEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V,ServerEntry> userIdxCursor;
+    private final IndexCursor<V, ServerEntry> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String,ServerEntry> ndnIdxCursor;
+    private final IndexCursor<String, ServerEntry> ndnIdxCursor;
 
     /**
      * Used to store indexEntry from ndnCandidate so it can be saved after
@@ -74,7 +73,7 @@
         String attribute = greaterEqEvaluator.getExpression().getAttribute();
         if ( db.hasUserIndexOn( attribute ) )
         {
-            userIdxCursor = ( ( Index<V,ServerEntry> ) db.getUserIndex( attribute ) ).forwardCursor();
+            userIdxCursor = ( ( Index<V, ServerEntry> ) db.getUserIndex( attribute ) ).forwardCursor();
             ndnIdxCursor = null;
         }
         else
@@ -105,8 +104,8 @@
              * userIdxCursor before the first element.  Otherwise we let the
              * underlying userIdx Cursor position the element.
              */
-            if ( greaterEqEvaluator.getComparator().compare( value,
-                 greaterEqEvaluator.getExpression().getValue().get() ) <= 0 )
+            if ( greaterEqEvaluator.getComparator()
+                .compare( value, greaterEqEvaluator.getExpression().getValue().get() ) <= 0 )
             {
                 beforeFirst();
                 return;
@@ -129,7 +128,7 @@
         if ( userIdxCursor != null )
         {
             int comparedValue = greaterEqEvaluator.getComparator().compare( value,
-                 greaterEqEvaluator.getExpression().getValue().get() );
+                greaterEqEvaluator.getExpression().getValue().get() );
 
             /*
              * First we need to check and make sure this element is within
@@ -177,7 +176,7 @@
              * underlying userIdx Cursor position the element.
              */
             if ( greaterEqEvaluator.getComparator().compare( element.getValue(),
-                 greaterEqEvaluator.getExpression().getValue().get() ) <= 0 )
+                greaterEqEvaluator.getExpression().getValue().get() ) <= 0 )
             {
                 beforeFirst();
                 return;
@@ -200,7 +199,7 @@
         if ( userIdxCursor != null )
         {
             int comparedValue = greaterEqEvaluator.getComparator().compare( element.getValue(),
-                 greaterEqEvaluator.getExpression().getValue().get() );
+                greaterEqEvaluator.getExpression().getValue().get() );
 
             /*
              * First we need to check and make sure this element is within
@@ -239,7 +238,7 @@
         checkNotClosed( "beforeFirst()" );
         if ( userIdxCursor != null )
         {
-            IndexEntry<V,ServerEntry> advanceTo = new ForwardIndexEntry<V,ServerEntry>();
+            IndexEntry<V, ServerEntry> advanceTo = new ForwardIndexEntry<V, ServerEntry>();
             advanceTo.setValue( ( V ) greaterEqEvaluator.getExpression().getValue().get() );
             userIdxCursor.before( advanceTo );
         }
@@ -297,8 +296,8 @@
             while ( userIdxCursor.previous() )
             {
                 checkNotClosed( "previous()" );
-                IndexEntry<?,ServerEntry> candidate = userIdxCursor.get();
-                if ( greaterEqEvaluator.getComparator().compare( candidate.getValue(), 
+                IndexEntry<?, ServerEntry> candidate = userIdxCursor.get();
+                if ( greaterEqEvaluator.getComparator().compare( candidate.getValue(),
                     greaterEqEvaluator.getExpression().getValue().get() ) >= 0 )
                 {
                     return available = true;
@@ -308,13 +307,13 @@
             return available = false;
         }
 
-        while( ndnIdxCursor.previous() )
+        while ( ndnIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
             ndnCandidate = ndnIdxCursor.get();
             if ( greaterEqEvaluator.evaluate( ndnCandidate ) )
             {
-                 return available = true;
+                return available = true;
             }
         }
 
@@ -334,13 +333,13 @@
             return available = userIdxCursor.next();
         }
 
-        while( ndnIdxCursor.next() )
+        while ( ndnIdxCursor.next() )
         {
             checkNotClosed( "next()" );
             ndnCandidate = ndnIdxCursor.get();
             if ( greaterEqEvaluator.evaluate( ndnCandidate ) )
             {
-                 return available = true;
+                return available = true;
             }
         }
 

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java Sun Feb 28 17:26:04 2010
@@ -53,7 +53,7 @@
     private final AttributeType type;
     private final Normalizer normalizer;
     private final Comparator comparator;
-    private final Index<Object,ServerEntry> idx;
+    private final Index<Object, ServerEntry> idx;
 
 
     public GreaterEqEvaluator( GreaterEqNode node, Store<ServerEntry> db, SchemaManager schemaManager )
@@ -67,7 +67,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = ( Index<Object,ServerEntry> ) db.getUserIndex( node.getAttribute() );
+            idx = ( Index<Object, ServerEntry> ) db.getUserIndex( node.getAttribute() );
         }
         else
         {
@@ -121,7 +121,7 @@
     }
 
 
-    public boolean evaluate( IndexEntry<?,ServerEntry> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
         if ( idx != null )
         {
@@ -150,7 +150,7 @@
 
         // if the attribute exists and has a greater than or equal value return true
         //noinspection unchecked
-        if ( attr != null && evaluate( ( IndexEntry<Object,ServerEntry> ) indexEntry, attr ) )
+        if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry> ) indexEntry, attr ) )
         {
             return true;
         }
@@ -163,8 +163,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             while ( descendants.hasNext() )
             {
@@ -192,7 +192,7 @@
             return idx.reverseGreaterOrEq( id, node.getValue().get() );
         }
 
-        return evaluate ( db.lookup( id ) );
+        return evaluate( db.lookup( id ) );
     }
 
 
@@ -215,8 +215,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             while ( descendants.hasNext() )
             {
@@ -238,7 +238,7 @@
 
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value 
-    private boolean evaluate( IndexEntry<Object,ServerEntry> indexEntry, ServerAttribute attribute ) throws Exception
+    private boolean evaluate( IndexEntry<Object, ServerEntry> indexEntry, ServerAttribute attribute ) throws Exception
     {
         /*
          * Cycle through the attribute values testing normalized version

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java Sun Feb 28 17:26:04 2010
@@ -49,10 +49,10 @@
     private final LessEqEvaluator lessEqEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V,ServerEntry> userIdxCursor;
+    private final IndexCursor<V, ServerEntry> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<V,ServerEntry> ndnIdxCursor;
+    private final IndexCursor<V, ServerEntry> ndnIdxCursor;
 
     /**
      * Used to store indexEntry from ndnCandidate so it can be saved after
@@ -73,12 +73,12 @@
         String attribute = lessEqEvaluator.getExpression().getAttribute();
         if ( db.hasUserIndexOn( attribute ) )
         {
-            userIdxCursor = ( ( Index<V,ServerEntry> ) db.getUserIndex( attribute ) ).forwardCursor();
+            userIdxCursor = ( ( Index<V, ServerEntry> ) db.getUserIndex( attribute ) ).forwardCursor();
             ndnIdxCursor = null;
         }
         else
         {
-            ndnIdxCursor = ( IndexCursor<V,ServerEntry> ) db.getNdnIndex().forwardCursor();
+            ndnIdxCursor = ( IndexCursor<V, ServerEntry> ) db.getNdnIndex().forwardCursor();
             userIdxCursor = null;
         }
     }
@@ -110,7 +110,7 @@
              */
             //noinspection unchecked
             int compareValue = lessEqEvaluator.getLdapComparator().compare( value,
-                 lessEqEvaluator.getExpression().getValue().get() );
+                lessEqEvaluator.getExpression().getValue().get() );
 
             if ( compareValue > 0 )
             {
@@ -154,7 +154,7 @@
              * before() method of the userIdxCursor.
              */
             int compareValue = lessEqEvaluator.getLdapComparator().compare( element.getValue(),
-                 lessEqEvaluator.getExpression().getValue().get() );
+                lessEqEvaluator.getExpression().getValue().get() );
 
             if ( compareValue > 0 )
             {
@@ -185,7 +185,7 @@
         if ( userIdxCursor != null )
         {
             int comparedValue = lessEqEvaluator.getLdapComparator().compare( value,
-                 lessEqEvaluator.getExpression().getValue().get() );
+                lessEqEvaluator.getExpression().getValue().get() );
 
             /*
              * First we need to check and make sure this element is within
@@ -221,7 +221,7 @@
         if ( userIdxCursor != null )
         {
             int comparedValue = lessEqEvaluator.getLdapComparator().compare( element.getValue(),
-                 lessEqEvaluator.getExpression().getValue().get() );
+                lessEqEvaluator.getExpression().getValue().get() );
 
             /*
              * First we need to check and make sure this element is within
@@ -273,7 +273,7 @@
         checkNotClosed( "afterLast()" );
         if ( userIdxCursor != null )
         {
-            IndexEntry<V,ServerEntry> advanceTo = new ForwardIndexEntry<V,ServerEntry>();
+            IndexEntry<V, ServerEntry> advanceTo = new ForwardIndexEntry<V, ServerEntry>();
             //noinspection unchecked
             advanceTo.setValue( ( V ) lessEqEvaluator.getExpression().getValue().get() );
             userIdxCursor.after( advanceTo );
@@ -316,13 +316,13 @@
             return available = userIdxCursor.previous();
         }
 
-        while( ndnIdxCursor.previous() )
+        while ( ndnIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
             ndnCandidate = ndnIdxCursor.get();
             if ( lessEqEvaluator.evaluate( ndnCandidate ) )
             {
-                 return available = true;
+                return available = true;
             }
             else
             {
@@ -348,9 +348,9 @@
             while ( userIdxCursor.next() )
             {
                 checkNotClosed( "next()" );
-                IndexEntry<?,ServerEntry> candidate = userIdxCursor.get();
+                IndexEntry<?, ServerEntry> candidate = userIdxCursor.get();
                 if ( lessEqEvaluator.getLdapComparator().compare( candidate.getValue(),
-                     lessEqEvaluator.getExpression().getValue().get() ) <= 0 )
+                    lessEqEvaluator.getExpression().getValue().get() ) <= 0 )
                 {
                     return available = true;
                 }
@@ -359,13 +359,13 @@
             return available = false;
         }
 
-        while( ndnIdxCursor.next() )
+        while ( ndnIdxCursor.next() )
         {
             checkNotClosed( "next()" );
             ndnCandidate = ndnIdxCursor.get();
             if ( lessEqEvaluator.evaluate( ndnCandidate ) )
             {
-                 return available = true;
+                return available = true;
             }
             else
             {
@@ -422,6 +422,6 @@
         {
             ndnIdxCursor.close();
             ndnCandidate = null;
-         }
+        }
     }
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java Sun Feb 28 17:26:04 2010
@@ -53,11 +53,10 @@
     private final AttributeType type;
     private final Normalizer normalizer;
     private final LdapComparator<? super Object> ldapComparator;
-    private final Index<Object,ServerEntry> idx;
+    private final Index<Object, ServerEntry> idx;
 
 
-    public LessEqEvaluator( LessEqNode node, Store<ServerEntry> db, SchemaManager schemaManager )
-        throws Exception
+    public LessEqEvaluator( LessEqNode node, Store<ServerEntry> db, SchemaManager schemaManager ) throws Exception
     {
         this.db = db;
         this.node = node;
@@ -67,7 +66,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = ( Index<Object,ServerEntry> ) db.getUserIndex( node.getAttribute() );
+            idx = ( Index<Object, ServerEntry> ) db.getUserIndex( node.getAttribute() );
         }
         else
         {
@@ -132,7 +131,7 @@
     }
 
 
-    public boolean evaluate( IndexEntry<?,ServerEntry> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
         if ( idx != null )
         {
@@ -147,7 +146,7 @@
             entry = db.lookup( indexEntry.getId() );
             indexEntry.setObject( entry );
         }
-        
+
         if ( null == entry )
         {
             return false;
@@ -158,7 +157,7 @@
 
         // if the attribute does not exist just return false
         //noinspection unchecked
-        if ( attr != null && evaluate( ( IndexEntry<Object,ServerEntry> ) indexEntry, attr ) )
+        if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry> ) indexEntry, attr ) )
         {
             return true;
         }
@@ -171,8 +170,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             while ( descendants.hasNext() )
             {
@@ -181,7 +180,7 @@
                 attr = ( ServerAttribute ) entry.get( descendant );
 
                 //noinspection unchecked
-                if ( attr != null && evaluate( ( IndexEntry<Object,ServerEntry> ) indexEntry, attr ) )
+                if ( attr != null && evaluate( ( IndexEntry<Object, ServerEntry> ) indexEntry, attr ) )
                 {
                     return true;
                 }
@@ -212,8 +211,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             while ( descendants.hasNext() )
             {
@@ -235,7 +234,7 @@
 
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value
-    private boolean evaluate( IndexEntry<Object,ServerEntry> indexEntry, ServerAttribute attribute ) throws Exception
+    private boolean evaluate( IndexEntry<Object, ServerEntry> indexEntry, ServerAttribute attribute ) throws Exception
     {
         /*
          * Cycle through the attribute values testing normalized version

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NoOpOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NoOpOptimizer.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NoOpOptimizer.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NoOpOptimizer.java Sun Feb 28 17:26:04 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.xdbm.search.impl;
 
+
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.filter.BranchNode;
@@ -38,7 +39,8 @@
 {
     /** the maximum size for a count Integer.MAX_VALUE as a BigInteger */
     private static final Long MAX = Long.MAX_VALUE;
-    
+
+
     public Long annotate( ExprNode node ) throws NamingException
     {
         if ( node.isLeaf() )
@@ -46,14 +48,14 @@
             node.set( "count", MAX );
             return MAX;
         }
-        
+
         BranchNode bnode = ( BranchNode ) node;
         if ( bnode.getChildren().size() == 0 )
         {
             bnode.set( "count", MAX );
             return MAX;
         }
-        
+
         final int limit = bnode.getChildren().size();
         for ( int ii = 0; ii < limit; ii++ )
         {

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java Sun Feb 28 17:26:04 2010
@@ -40,17 +40,17 @@
 public class NotCursor<V> extends AbstractIndexCursor<V, ServerEntry>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 );
-    private final IndexCursor<V,ServerEntry> ndnCursor;
+    private final IndexCursor<V, ServerEntry> ndnCursor;
     private final Evaluator<? extends ExprNode, ServerEntry> childEvaluator;
     private boolean available = false;
 
 
     @SuppressWarnings("unchecked")
-    public NotCursor( Store<ServerEntry> db,
-                      Evaluator<? extends ExprNode, ServerEntry> childEvaluator ) throws Exception
+    public NotCursor( Store<ServerEntry> db, Evaluator<? extends ExprNode, ServerEntry> childEvaluator )
+        throws Exception
     {
         this.childEvaluator = childEvaluator;
-        this.ndnCursor = ( IndexCursor<V,ServerEntry> ) db.getNdnIndex().forwardCursor();
+        this.ndnCursor = ( IndexCursor<V, ServerEntry> ) db.getNdnIndex().forwardCursor();
     }
 
 
@@ -119,8 +119,8 @@
         while ( ndnCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?,ServerEntry> candidate = ndnCursor.get();
-            if ( ! childEvaluator.evaluate( candidate ) )
+            IndexEntry<?, ServerEntry> candidate = ndnCursor.get();
+            if ( !childEvaluator.evaluate( candidate ) )
             {
                 return available = true;
             }
@@ -135,8 +135,8 @@
         while ( ndnCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?,ServerEntry> candidate = ndnCursor.get();
-            if ( ! childEvaluator.evaluate( candidate ) )
+            IndexEntry<?, ServerEntry> candidate = ndnCursor.get();
+            if ( !childEvaluator.evaluate( candidate ) )
             {
                 return available = true;
             }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java Sun Feb 28 17:26:04 2010
@@ -36,7 +36,7 @@
 public class NotEvaluator implements Evaluator<NotNode, ServerEntry>
 {
     private final NotNode node;
-    private final Evaluator<? extends ExprNode,ServerEntry> childEvaluator;
+    private final Evaluator<? extends ExprNode, ServerEntry> childEvaluator;
 
 
     public NotEvaluator( NotNode node, Evaluator<? extends ExprNode, ServerEntry> childEvaluator )
@@ -48,19 +48,19 @@
 
     public boolean evaluate( Long id ) throws Exception
     {
-        return ! childEvaluator.evaluate( id );
+        return !childEvaluator.evaluate( id );
     }
 
 
     public boolean evaluate( ServerEntry entry ) throws Exception
     {
-        return ! childEvaluator.evaluate( entry );
+        return !childEvaluator.evaluate( entry );
     }
 
 
     public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
-        return ! childEvaluator.evaluate( indexEntry );
+        return !childEvaluator.evaluate( indexEntry );
     }
 
 

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java Sun Feb 28 17:26:04 2010
@@ -50,13 +50,13 @@
     private final OneLevelScopeEvaluator evaluator;
 
     /** A Cursor over the entries in the scope of the search base */
-    private final IndexCursor<Long,ServerEntry> scopeCursor;
+    private final IndexCursor<Long, ServerEntry> scopeCursor;
 
     /** A Cursor over entries brought into scope by alias dereferencing */
-    private final Cursor<IndexEntry<Long,ServerEntry>> dereferencedCursor;
+    private final Cursor<IndexEntry<Long, ServerEntry>> dereferencedCursor;
 
     /** Currently active Cursor: we switch between two cursors */
-    private Cursor<IndexEntry<Long,ServerEntry>> cursor;
+    private Cursor<IndexEntry<Long, ServerEntry>> cursor;
 
     /** Whether or not this Cursor is positioned so an entry is available */
     private boolean available = false;
@@ -203,7 +203,7 @@
          * last element.
          */
         available = cursor.previous();
-        if ( ! available )
+        if ( !available )
         {
             cursor = scopeCursor;
             cursor.afterLast();
@@ -273,7 +273,7 @@
          * dereferencedCursor and try a previous call after positioning past
          * it's last element.
          */
-        if ( ! available )
+        if ( !available )
         {
             if ( dereferencedCursor != null )
             {
@@ -303,7 +303,6 @@
 
     public boolean isElementReused()
     {
-        return scopeCursor.isElementReused() ||
-            ( dereferencedCursor != null && dereferencedCursor.isElementReused() );
+        return scopeCursor.isElementReused() || ( dereferencedCursor != null && dereferencedCursor.isElementReused() );
     }
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java Sun Feb 28 17:26:04 2010
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class OneLevelScopeEvaluator<E> implements Evaluator<ScopeNode,E>
+public class OneLevelScopeEvaluator<E> implements Evaluator<ScopeNode, E>
 {
     /** The ScopeNode containing initial search scope constraints */
     private final ScopeNode node;
@@ -67,8 +67,7 @@
 
         this.db = db;
         baseId = db.getEntryId( node.getBaseDn() );
-        dereferencing = node.getDerefAliases().isDerefInSearching() ||
-            node.getDerefAliases().isDerefAlways();
+        dereferencing = node.getDerefAliases().isDerefInSearching() || node.getDerefAliases().isDerefAlways();
     }
 
 
@@ -90,7 +89,7 @@
          * dereferencing is not enabled then we return the results of the child
          * test.
          */
-        if ( ! dereferencing )
+        if ( !dereferencing )
         {
             return isChild;
         }
@@ -152,7 +151,7 @@
      * @throws Exception if db lookups fail
      * @see org.apache.directory.server.xdbm.search.Evaluator#evaluate(IndexEntry)
      */
-    public boolean evaluate( IndexEntry<?,E> candidate ) throws Exception
+    public boolean evaluate( IndexEntry<?, E> candidate ) throws Exception
     {
         boolean isChild = db.getOneLevelIndex().forward( baseId, candidate.getId() );
 
@@ -161,7 +160,7 @@
          * dereferencing is not enabled then we return the results of the child
          * test.
          */
-        if ( ! dereferencing )
+        if ( !dereferencing )
         {
             return isChild;
         }

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java Sun Feb 28 17:26:04 2010
@@ -36,7 +36,6 @@
 import org.apache.directory.shared.ldap.filter.ExprNode;
 
 
-
 /**
  * A Cursor returning candidates satisfying a logical disjunction expression.
  *
@@ -46,15 +45,16 @@
 public class OrCursor<V> extends AbstractIndexCursor<V, ServerEntry>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_722 );
-    private final List<IndexCursor<V,ServerEntry>> cursors;
-    private final List<Evaluator<? extends ExprNode,ServerEntry>> evaluators;
+    private final List<IndexCursor<V, ServerEntry>> cursors;
+    private final List<Evaluator<? extends ExprNode, ServerEntry>> evaluators;
     private final List<Set<Long>> blacklists;
     private int cursorIndex = -1;
     private boolean available = false;
 
 
     // TODO - do same evaluator fail fast optimization that we do in AndCursor
-    public OrCursor( List<IndexCursor<V, ServerEntry>> cursors, List<Evaluator<? extends ExprNode,ServerEntry>> evaluators )
+    public OrCursor( List<IndexCursor<V, ServerEntry>> cursors,
+        List<Evaluator<? extends ExprNode, ServerEntry>> evaluators )
     {
         if ( cursors.size() <= 1 )
         {
@@ -170,8 +170,8 @@
         while ( cursors.get( cursorIndex ).previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?,ServerEntry> candidate = cursors.get( cursorIndex ).get();
-            if ( ! isBlackListed( candidate.getId() ) )
+            IndexEntry<?, ServerEntry> candidate = cursors.get( cursorIndex ).get();
+            if ( !isBlackListed( candidate.getId() ) )
             {
                 blackListIfDuplicate( candidate );
                 return available = true;
@@ -187,8 +187,8 @@
             while ( cursors.get( cursorIndex ).previous() )
             {
                 checkNotClosed( "previous()" );
-                IndexEntry<?,ServerEntry> candidate = cursors.get( cursorIndex ).get();
-                if ( ! isBlackListed( candidate.getId() ) )
+                IndexEntry<?, ServerEntry> candidate = cursors.get( cursorIndex ).get();
+                if ( !isBlackListed( candidate.getId() ) )
                 {
                     blackListIfDuplicate( candidate );
                     return available = true;
@@ -205,8 +205,8 @@
         while ( cursors.get( cursorIndex ).next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?,ServerEntry> candidate = cursors.get( cursorIndex ).get();
-            if ( ! isBlackListed( candidate.getId() ) )
+            IndexEntry<?, ServerEntry> candidate = cursors.get( cursorIndex ).get();
+            if ( !isBlackListed( candidate.getId() ) )
             {
                 blackListIfDuplicate( candidate );
                 return available = true;
@@ -222,8 +222,8 @@
             while ( cursors.get( cursorIndex ).next() )
             {
                 checkNotClosed( "previous()" );
-                IndexEntry<?,ServerEntry> candidate = cursors.get( cursorIndex ).get();
-                if ( ! isBlackListed( candidate.getId() ) )
+                IndexEntry<?, ServerEntry> candidate = cursors.get( cursorIndex ).get();
+                if ( !isBlackListed( candidate.getId() ) )
                 {
                     blackListIfDuplicate( candidate );
                     return available = true;

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/OrEvaluator.java Sun Feb 28 17:26:04 2010
@@ -63,15 +63,16 @@
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with decreasing scan count ordering
      */
-    private List<Evaluator<? extends ExprNode,ServerEntry>>
-        optimize( List<Evaluator<? extends ExprNode, ServerEntry>> unoptimized )
+    private List<Evaluator<? extends ExprNode, ServerEntry>> optimize(
+        List<Evaluator<? extends ExprNode, ServerEntry>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode, ServerEntry>> optimized =
-            new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>( unoptimized.size() );
+        List<Evaluator<? extends ExprNode, ServerEntry>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+            unoptimized.size() );
         optimized.addAll( unoptimized );
-        Collections.sort( optimized, new Comparator<Evaluator<? extends ExprNode,ServerEntry>>()
+        Collections.sort( optimized, new Comparator<Evaluator<? extends ExprNode, ServerEntry>>()
         {
-            public int compare( Evaluator<? extends ExprNode, ServerEntry> e1, Evaluator<? extends ExprNode, ServerEntry> e2 )
+            public int compare( Evaluator<? extends ExprNode, ServerEntry> e1,
+                Evaluator<? extends ExprNode, ServerEntry> e2 )
             {
                 long scanCount1 = ( Long ) e1.getExpression().get( "count" );
                 long scanCount2 = ( Long ) e2.getExpression().get( "count" );
@@ -94,7 +95,7 @@
 
                 return -1;
             }
-        });
+        } );
 
         return optimized;
     }
@@ -102,7 +103,7 @@
 
     public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
             if ( evaluator.evaluate( indexEntry ) )
             {
@@ -116,7 +117,7 @@
 
     public boolean evaluate( Long id ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
             if ( evaluator.evaluate( id ) )
             {
@@ -130,7 +131,7 @@
 
     public boolean evaluate( ServerEntry entry ) throws Exception
     {
-        for ( Evaluator<?,ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
         {
             if ( evaluator.evaluate( entry ) )
             {

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java Sun Feb 28 17:26:04 2010
@@ -39,8 +39,8 @@
 public class PresenceCursor extends AbstractIndexCursor<String, ServerEntry>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_724 );
-    private final IndexCursor<String,ServerEntry> ndnCursor;
-    private final IndexCursor<String,ServerEntry> presenceCursor;
+    private final IndexCursor<String, ServerEntry> ndnCursor;
+    private final IndexCursor<String, ServerEntry> presenceCursor;
     private final PresenceEvaluator presenceEvaluator;
     private boolean available = false;
 
@@ -191,13 +191,13 @@
         while ( ndnCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?,ServerEntry> candidate = ndnCursor.get();
+            IndexEntry<?, ServerEntry> candidate = ndnCursor.get();
             if ( presenceEvaluator.evaluate( candidate ) )
             {
                 return available = true;
             }
         }
-        
+
         return available = false;
     }
 
@@ -213,7 +213,7 @@
         while ( ndnCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?,ServerEntry> candidate = ndnCursor.get();
+            IndexEntry<?, ServerEntry> candidate = ndnCursor.get();
             if ( presenceEvaluator.evaluate( candidate ) )
             {
                 return available = true;

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java?rev=917212&r1=917211&r2=917212&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java Sun Feb 28 17:26:04 2010
@@ -46,11 +46,10 @@
     private final Store<ServerEntry> db;
     private final AttributeType type;
     private final SchemaManager schemaManager;
-    private final Index<String,ServerEntry> idx;
+    private final Index<String, ServerEntry> idx;
 
 
-    public PresenceEvaluator( PresenceNode node, Store<ServerEntry> db, SchemaManager schemaManager )
-        throws Exception
+    public PresenceEvaluator( PresenceNode node, Store<ServerEntry> db, SchemaManager schemaManager ) throws Exception
     {
         this.db = db;
         this.node = node;
@@ -82,7 +81,7 @@
 
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value
-    public boolean evaluate( IndexEntry<?,ServerEntry> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
     {
         if ( idx != null )
         {
@@ -136,8 +135,8 @@
             // TODO check to see if descendant handling is necessary for the
             // index so we can match properly even when for example a name
             // attribute is used instead of more specific commonName
-            Iterator<AttributeType> descendants =
-                schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() );
+            Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants(
+                node.getAttribute() );
 
             do
             {



Mime
View raw message