Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 68844 invoked from network); 1 Mar 2010 09:26:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Mar 2010 09:26:30 -0000 Received: (qmail 16859 invoked by uid 500); 28 Feb 2010 17:26:29 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 16827 invoked by uid 500); 28 Feb 2010 17:26:29 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 16814 invoked by uid 99); 28 Feb 2010 17:26:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Feb 2010 17:26:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Feb 2010 17:26:26 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9E9E223889BB; Sun, 28 Feb 2010 17:26:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: seelmann@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100228172606.9E9E223889BB@eris.apache.org> 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 Apache Directory Project * @version $Rev$, $Date$ */ -public class AllEntriesCursor extends AbstractIndexCursor +public class AllEntriesCursor extends AbstractIndexCursor { private IndexEntry indexEntry = new ForwardIndexEntry(); - private final IndexCursor wrapped; + private final IndexCursor wrapped; + - public AllEntriesCursor( Store 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 indexEntry ) throws Exception + public void after( IndexEntry 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 indexEntry ) throws Exception + public void before( IndexEntry 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 get() throws Exception + public IndexEntry get() throws Exception { checkNotClosed( "get()" ); - IndexEntry wrappedEntry = wrapped.get(); + IndexEntry 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 extends AbstractIndexCursor { private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 ); - private final IndexCursor wrapped; + private final IndexCursor wrapped; private final List> evaluators; private boolean available = false; - public AndCursor( IndexCursor wrapped, - List> evaluators ) + public AndCursor( IndexCursor wrapped, List> evaluators ) { this.wrapped = wrapped; this.evaluators = optimize( evaluators ); @@ -123,7 +122,7 @@ { checkNotClosed( "previous()" ); - IndexEntry candidate = wrapped.get(); + IndexEntry candidate = wrapped.get(); if ( matches( candidate ) ) { return available = true; @@ -139,7 +138,7 @@ while ( wrapped.next() ) { checkNotClosed( "next()" ); - IndexEntry candidate = wrapped.get(); + IndexEntry 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> - optimize( List> unoptimized ) + private List> optimize( + List> unoptimized ) { - List> optimized = - new ArrayList>( unoptimized.size() ); + List> optimized = new ArrayList>( + unoptimized.size() ); optimized.addAll( unoptimized ); - - Collections.sort( optimized, new Comparator>() + + Collections.sort( optimized, new Comparator>() { public int compare( Evaluator e1, Evaluator e2 ) { @@ -221,7 +220,7 @@ return 1; } - }); + } ); return optimized; } @@ -229,9 +228,9 @@ private boolean matches( IndexEntry indexEntry ) throws Exception { - for ( Evaluator evaluator : evaluators ) + for ( Evaluator 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 { - private final List> evaluators; + private final List> 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> - optimize( List> unoptimized ) + private List> optimize( + List> unoptimized ) { - List> optimized = - new ArrayList>( unoptimized.size() ); + List> optimized = new ArrayList>( + unoptimized.size() ); optimized.addAll( unoptimized ); - Collections.sort( optimized, new Comparator>() + Collections.sort( optimized, new Comparator>() { public int compare( Evaluator e1, Evaluator e2 ) { @@ -94,7 +94,7 @@ return 1; } - }); + } ); return optimized; } @@ -102,9 +102,9 @@ public boolean evaluate( Long id ) throws Exception { - for ( Evaluator evaluator : evaluators ) + for ( Evaluator 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 evaluator : evaluators ) + for ( Evaluator evaluator : evaluators ) { - if ( ! evaluator.evaluate( entry ) ) + if ( !evaluator.evaluate( entry ) ) { return false; } @@ -130,9 +130,9 @@ public boolean evaluate( IndexEntry indexEntry ) throws Exception { - for ( Evaluator evaluator : evaluators ) + for ( Evaluator 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 extends AbstractIndexCursor { - 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 userIdxCursor; + private final IndexCursor userIdxCursor; /** NDN Cursor on all entries in (set when no index on user attribute) */ - private final IndexCursor ndnIdxCursor; + private final IndexCursor 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 index = ( Index ) db.getUserIndex( attribute ); + Index index = ( Index ) 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 candidate = ndnIdxCursor.get(); + IndexEntry 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 candidate = ndnIdxCursor.get(); + IndexEntry 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 ldapComparator; - private final Index idx; + private final Index idx; public ApproximateEvaluator( ApproximateNode node, Store db, SchemaManager schemaManager ) @@ -66,7 +66,7 @@ if ( db.hasUserIndexOn( node.getAttribute() ) ) { //noinspection unchecked - idx = ( Index ) db.getUserIndex( node.getAttribute() ); + idx = ( Index ) 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator descendants = schemaManager.getAttributeTypeRegistry().descendants( + node.getAttribute() ); while ( descendants.hasNext() ) { @@ -146,7 +146,7 @@ } - public boolean evaluate( IndexEntry indexEntry ) throws Exception + public boolean evaluate( IndexEntry 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 build( ExprNode node ) throws Exception + public IndexCursor 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 buildOrCursor( OrNode node ) throws Exception + private IndexCursor buildOrCursor( OrNode node ) throws Exception { List children = node.getChildren(); - List> childCursors = new ArrayList>( children.size() ); - List> childEvaluators - = new ArrayList>( children.size() ); + List> childCursors = new ArrayList>( children.size() ); + List> childEvaluators = new ArrayList>( + 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 buildAndCursor( AndNode node ) throws Exception + private IndexCursor 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 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> childEvaluators = - new ArrayList>( children.size() - 1 ); + List> childEvaluators = new ArrayList>( + 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 childCursor = build( minChild ); + IndexCursor 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 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 long getEqualityScan( SimpleNode node ) throws Exception + private long getEqualityScan( SimpleNode node ) throws Exception { if ( db.hasUserIndexOn( node.getAttribute() ) ) { - Index idx = ( Index ) db.getUserIndex( node.getAttribute() ); + Index idx = ( Index ) 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 long getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws Exception + private long getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws Exception { if ( db.hasUserIndexOn( node.getAttribute() ) ) { @@ -348,7 +348,7 @@ { if ( db.hasUserIndexOn( node.getAttribute() ) ) { - Index idx = db.getPresenceIndex(); + Index 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 db, - CursorBuilder cursorBuilder, EvaluatorBuilder evaluatorBuilder, Optimizer optimizer ) + public DefaultSearchEngine( Store 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 cursor( LdapDN base, AliasDerefMode aliasDerefMode, ExprNode filter, - SearchControls searchCtls ) throws Exception + public IndexCursor 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(); } - + 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 indexEntry = new ForwardIndexEntry(); indexEntry.setId( effectiveBaseId ); optimizer.annotate( filter ); Evaluator evaluator = evaluatorBuilder.build( filter ); - + if ( evaluator.evaluate( indexEntry ) ) { - return new SingletonIndexCursor( indexEntry ); + return new SingletonIndexCursor( indexEntry ); } else { return new EmptyIndexCursor(); } } - + // 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 evaluator( ExprNode filter ) - throws Exception + public Evaluator 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 userIdxCursor; + private final IndexCursor userIdxCursor; /** NDN Cursor on all entries in (set when no index on user attribute) */ - private final IndexCursor ndnIdxCursor; + private final IndexCursor ndnIdxCursor; /** used only when ndnIdxCursor is used (no index on attribute) */ private boolean available = false; @@ -68,7 +68,7 @@ Value value = equalityEvaluator.getExpression().getValue(); if ( db.hasUserIndexOn( attribute ) ) { - Index userIndex = ( Index ) db.getUserIndex( attribute ); + Index userIndex = ( Index ) 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 candidate = ndnIdxCursor.get(); + IndexEntry 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 candidate = ndnIdxCursor.get(); + IndexEntry candidate = ndnIdxCursor.get(); if ( equalityEvaluator.evaluate( candidate ) ) { - return available = true; + return available = true; } } @@ -246,7 +246,7 @@ if ( available ) { - return ( IndexEntry )ndnIdxCursor.get(); + return ( IndexEntry ) 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 BINARY_COMPARATOR = new ByteArrayComparator( null ); - + /** The default String comparator if no comparator has been defined */ private static final Comparator STRING_COMPARATOR = new StringComparator( null ); - - private final Index idx; + + private final Index idx; public EqualityEvaluator( EqualityNode node, Store db, SchemaManager schemaManager ) @@ -111,7 +111,7 @@ } - public boolean evaluate( IndexEntry indexEntry ) throws Exception + public boolean evaluate( IndexEntry 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator 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)value).getNormalizedValue(); - byte[] nodeValue = ((Value)node.getValue()).getNormalizedValue(); - + byte[] serverValue = ( ( Value ) value ).getNormalizedValue(); + byte[] nodeValue = ( ( Value ) node.getValue() ).getNormalizedValue(); + if ( comparator != null ) { - if ( ( ((LdapComparator)comparator).compare( serverValue, nodeValue ) == 0 ) ) + if ( ( ( ( LdapComparator ) comparator ).compare( serverValue, nodeValue ) == 0 ) ) { return true; } @@ -221,21 +221,21 @@ else { // Deal with a String value - String serverValue = ((Value)value).getNormalizedValue(); + String serverValue = ( ( Value ) value ).getNormalizedValue(); String nodeValue = null; - + if ( node.getValue().isBinary() ) { - nodeValue = StringTools.utf8ToString( ((Value)node.getValue()).getNormalizedValue() ); + nodeValue = StringTools.utf8ToString( ( ( Value ) node.getValue() ).getNormalizedValue() ); } else { - nodeValue = ((Value)node.getValue()).getNormalizedValue(); + nodeValue = ( ( Value ) node.getValue() ).getNormalizedValue(); } - + if ( comparator != null ) { - if ( ((LdapComparator)comparator).compare( serverValue, nodeValue ) == 0 ) + if ( ( ( LdapComparator ) 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( 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 children = node.getChildren(); - List> evaluators = - new ArrayList>( children.size() ); + List> evaluators = new ArrayList>( + children.size() ); for ( ExprNode child : children ) { evaluators.add( build( child ) ); @@ -143,8 +143,8 @@ OrEvaluator buildOrEvaluator( OrNode node ) throws Exception { List children = node.getChildren(); - List> evaluators = - new ArrayList>( children.size() ); + List> evaluators = new ArrayList>( + 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 extends AbstractIndexCursor { - 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 userIdxCursor; + private final IndexCursor userIdxCursor; /** NDN Cursor on all entries in (set when no index on user attribute) */ - private final IndexCursor ndnIdxCursor; + private final IndexCursor 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 ) db.getUserIndex( attribute ) ).forwardCursor(); + userIdxCursor = ( ( Index ) 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 advanceTo = new ForwardIndexEntry(); + IndexEntry advanceTo = new ForwardIndexEntry(); advanceTo.setValue( ( V ) greaterEqEvaluator.getExpression().getValue().get() ); userIdxCursor.before( advanceTo ); } @@ -297,8 +296,8 @@ while ( userIdxCursor.previous() ) { checkNotClosed( "previous()" ); - IndexEntry candidate = userIdxCursor.get(); - if ( greaterEqEvaluator.getComparator().compare( candidate.getValue(), + IndexEntry 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 idx; + private final Index idx; public GreaterEqEvaluator( GreaterEqNode node, Store db, SchemaManager schemaManager ) @@ -67,7 +67,7 @@ if ( db.hasUserIndexOn( node.getAttribute() ) ) { //noinspection unchecked - idx = ( Index ) db.getUserIndex( node.getAttribute() ); + idx = ( Index ) db.getUserIndex( node.getAttribute() ); } else { @@ -121,7 +121,7 @@ } - public boolean evaluate( IndexEntry indexEntry ) throws Exception + public boolean evaluate( IndexEntry 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 ) indexEntry, attr ) ) + if ( attr != null && evaluate( ( IndexEntry ) 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator 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 indexEntry, ServerAttribute attribute ) throws Exception + private boolean evaluate( IndexEntry 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 userIdxCursor; + private final IndexCursor userIdxCursor; /** NDN Cursor on all entries in (set when no index on user attribute) */ - private final IndexCursor ndnIdxCursor; + private final IndexCursor 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 ) db.getUserIndex( attribute ) ).forwardCursor(); + userIdxCursor = ( ( Index ) db.getUserIndex( attribute ) ).forwardCursor(); ndnIdxCursor = null; } else { - ndnIdxCursor = ( IndexCursor ) db.getNdnIndex().forwardCursor(); + ndnIdxCursor = ( IndexCursor ) 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 advanceTo = new ForwardIndexEntry(); + IndexEntry advanceTo = new ForwardIndexEntry(); //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 candidate = userIdxCursor.get(); + IndexEntry 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 ldapComparator; - private final Index idx; + private final Index idx; - public LessEqEvaluator( LessEqNode node, Store db, SchemaManager schemaManager ) - throws Exception + public LessEqEvaluator( LessEqNode node, Store db, SchemaManager schemaManager ) throws Exception { this.db = db; this.node = node; @@ -67,7 +66,7 @@ if ( db.hasUserIndexOn( node.getAttribute() ) ) { //noinspection unchecked - idx = ( Index ) db.getUserIndex( node.getAttribute() ); + idx = ( Index ) db.getUserIndex( node.getAttribute() ); } else { @@ -132,7 +131,7 @@ } - public boolean evaluate( IndexEntry indexEntry ) throws Exception + public boolean evaluate( IndexEntry 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 ) indexEntry, attr ) ) + if ( attr != null && evaluate( ( IndexEntry ) 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator 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 ) indexEntry, attr ) ) + if ( attr != null && evaluate( ( IndexEntry ) 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator 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 indexEntry, ServerAttribute attribute ) throws Exception + private boolean evaluate( IndexEntry 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 extends AbstractIndexCursor { private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 ); - private final IndexCursor ndnCursor; + private final IndexCursor ndnCursor; private final Evaluator childEvaluator; private boolean available = false; @SuppressWarnings("unchecked") - public NotCursor( Store db, - Evaluator childEvaluator ) throws Exception + public NotCursor( Store db, Evaluator childEvaluator ) + throws Exception { this.childEvaluator = childEvaluator; - this.ndnCursor = ( IndexCursor ) db.getNdnIndex().forwardCursor(); + this.ndnCursor = ( IndexCursor ) db.getNdnIndex().forwardCursor(); } @@ -119,8 +119,8 @@ while ( ndnCursor.previous() ) { checkNotClosed( "previous()" ); - IndexEntry candidate = ndnCursor.get(); - if ( ! childEvaluator.evaluate( candidate ) ) + IndexEntry candidate = ndnCursor.get(); + if ( !childEvaluator.evaluate( candidate ) ) { return available = true; } @@ -135,8 +135,8 @@ while ( ndnCursor.next() ) { checkNotClosed( "next()" ); - IndexEntry candidate = ndnCursor.get(); - if ( ! childEvaluator.evaluate( candidate ) ) + IndexEntry 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 { private final NotNode node; - private final Evaluator childEvaluator; + private final Evaluator childEvaluator; public NotEvaluator( NotNode node, Evaluator 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 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 scopeCursor; + private final IndexCursor scopeCursor; /** A Cursor over entries brought into scope by alias dereferencing */ - private final Cursor> dereferencedCursor; + private final Cursor> dereferencedCursor; /** Currently active Cursor: we switch between two cursors */ - private Cursor> cursor; + private Cursor> 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 Apache Directory Project * @version $Rev$ */ -public class OneLevelScopeEvaluator implements Evaluator +public class OneLevelScopeEvaluator implements Evaluator { /** 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 candidate ) throws Exception + public boolean evaluate( IndexEntry 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 extends AbstractIndexCursor { private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_722 ); - private final List> cursors; - private final List> evaluators; + private final List> cursors; + private final List> evaluators; private final List> blacklists; private int cursorIndex = -1; private boolean available = false; // TODO - do same evaluator fail fast optimization that we do in AndCursor - public OrCursor( List> cursors, List> evaluators ) + public OrCursor( List> cursors, + List> evaluators ) { if ( cursors.size() <= 1 ) { @@ -170,8 +170,8 @@ while ( cursors.get( cursorIndex ).previous() ) { checkNotClosed( "previous()" ); - IndexEntry candidate = cursors.get( cursorIndex ).get(); - if ( ! isBlackListed( candidate.getId() ) ) + IndexEntry 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 candidate = cursors.get( cursorIndex ).get(); - if ( ! isBlackListed( candidate.getId() ) ) + IndexEntry 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 candidate = cursors.get( cursorIndex ).get(); - if ( ! isBlackListed( candidate.getId() ) ) + IndexEntry 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 candidate = cursors.get( cursorIndex ).get(); - if ( ! isBlackListed( candidate.getId() ) ) + IndexEntry 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> - optimize( List> unoptimized ) + private List> optimize( + List> unoptimized ) { - List> optimized = - new ArrayList>( unoptimized.size() ); + List> optimized = new ArrayList>( + unoptimized.size() ); optimized.addAll( unoptimized ); - Collections.sort( optimized, new Comparator>() + Collections.sort( optimized, new Comparator>() { - public int compare( Evaluator e1, Evaluator e2 ) + public int compare( Evaluator e1, + Evaluator 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 indexEntry ) throws Exception { - for ( Evaluator evaluator : evaluators ) + for ( Evaluator evaluator : evaluators ) { if ( evaluator.evaluate( indexEntry ) ) { @@ -116,7 +117,7 @@ public boolean evaluate( Long id ) throws Exception { - for ( Evaluator evaluator : evaluators ) + for ( Evaluator evaluator : evaluators ) { if ( evaluator.evaluate( id ) ) { @@ -130,7 +131,7 @@ public boolean evaluate( ServerEntry entry ) throws Exception { - for ( Evaluator evaluator : evaluators ) + for ( Evaluator 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 { private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_724 ); - private final IndexCursor ndnCursor; - private final IndexCursor presenceCursor; + private final IndexCursor ndnCursor; + private final IndexCursor presenceCursor; private final PresenceEvaluator presenceEvaluator; private boolean available = false; @@ -191,13 +191,13 @@ while ( ndnCursor.previous() ) { checkNotClosed( "previous()" ); - IndexEntry candidate = ndnCursor.get(); + IndexEntry candidate = ndnCursor.get(); if ( presenceEvaluator.evaluate( candidate ) ) { return available = true; } } - + return available = false; } @@ -213,7 +213,7 @@ while ( ndnCursor.next() ) { checkNotClosed( "next()" ); - IndexEntry candidate = ndnCursor.get(); + IndexEntry 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 db; private final AttributeType type; private final SchemaManager schemaManager; - private final Index idx; + private final Index idx; - public PresenceEvaluator( PresenceNode node, Store db, SchemaManager schemaManager ) - throws Exception + public PresenceEvaluator( PresenceNode node, Store 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 indexEntry ) throws Exception + public boolean evaluate( IndexEntry 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 descendants = - schemaManager.getAttributeTypeRegistry().descendants( node.getAttribute() ); + Iterator descendants = schemaManager.getAttributeTypeRegistry().descendants( + node.getAttribute() ); do {