Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 58085 invoked from network); 17 Feb 2008 12:19:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Feb 2008 12:19:30 -0000 Received: (qmail 45573 invoked by uid 500); 17 Feb 2008 12:19:24 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 45531 invoked by uid 500); 17 Feb 2008 12:19:24 -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 45520 invoked by uid 99); 17 Feb 2008 12:19:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Feb 2008 04:19:24 -0800 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.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Feb 2008 12:19:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 05C211A9832; Sun, 17 Feb 2008 04:19:09 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r628486 - in /directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries: DefaultComparatorRegistry.java DefaultNormalizerRegistry.java Date: Sun, 17 Feb 2008 12:19:08 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080217121909.05C211A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Sun Feb 17 04:19:07 2008 New Revision: 628486 URL: http://svn.apache.org/viewvc?rev=628486&view=rev Log: Replaced the LOG.isDebugEnabled by a direct check of a static boolean initialized with the LOG status, to avoid numerous checks. Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java?rev=628486&r1=628485&r2=628486&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java Sun Feb 17 04:19:07 2008 @@ -44,11 +44,15 @@ { /** static class logger */ private static final Logger LOG = LoggerFactory.getLogger( DefaultComparatorRegistry.class ); + /** the comparators in this registry */ private final Map byOid; + /** maps oids to a comparator description */ private final Map oidToDescription; + /** A speedup for debug */ + private static final boolean DEBUG = LOG.isDebugEnabled(); // ------------------------------------------------------------------------ // C O N S T R U C T O R S @@ -81,7 +85,8 @@ oidToDescription.put( description.getNumericOid(), description ); byOid.put( description.getNumericOid(), comparator ); - if ( LOG.isDebugEnabled() ) + + if ( DEBUG ) { LOG.debug( "registed comparator with OID: " + description.getNumericOid() ); } @@ -106,10 +111,12 @@ if ( byOid.containsKey( oid ) ) { Comparator c = byOid.get( oid ); - if ( LOG.isDebugEnabled() ) + + if ( DEBUG ) { LOG.debug( "looked up comparator with OID: " + oid ); } + return c; } Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java?rev=628486&r1=628485&r2=628486&view=diff ============================================================================== --- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java (original) +++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java Sun Feb 17 04:19:07 2008 @@ -45,8 +45,13 @@ { /** static class logger */ private static final Logger LOG = LoggerFactory.getLogger( DefaultNormalizerRegistry.class ); + + /** A speedup for debug */ + private static final boolean DEBUG = LOG.isDebugEnabled(); + /** a map of Normalizers looked up by OID */ private final Map byOid; + /** maps an OID to a normalizerDescription */ private final Map oidToDescription; @@ -81,7 +86,8 @@ oidToDescription.put( oid, description ); byOid.put( oid, normalizer ); - if ( LOG.isDebugEnabled() ) + + if ( DEBUG ) { LOG.debug( "registered normalizer with oid: " + oid ); } @@ -96,10 +102,12 @@ } Normalizer normalizer = byOid.get( oid ); - if ( LOG.isDebugEnabled() ) + + if ( DEBUG ) { LOG.debug( "registered normalizer with oid: " + oid ); } + return normalizer; }