Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 87117 invoked from network); 29 Mar 2007 10:20:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Mar 2007 10:20:45 -0000 Received: (qmail 92451 invoked by uid 500); 29 Mar 2007 10:20:52 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 92421 invoked by uid 500); 29 Mar 2007 10:20:52 -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 92400 invoked by uid 99); 29 Mar 2007 10:20:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2007 03:20:52 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME 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; Thu, 29 Mar 2007 03:20:44 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D1B041A9838; Thu, 29 Mar 2007 03:20:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r523661 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Date: Thu, 29 Mar 2007 10:20:21 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070329102023.D1B041A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Thu Mar 29 03:20:06 2007 New Revision: 523661 URL: http://svn.apache.org/viewvc?view=rev&rev=523661 Log: Fixed a potential NPE in the code (defensive code added) Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=523661&r1=523660&r2=523661 ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Thu Mar 29 03:20:06 2007 @@ -128,7 +128,7 @@ */ private Registries registries; - private Set binaries; + private Set binaries; /** * subschemaSubentry attribute's value from Root DSE @@ -179,7 +179,14 @@ topFilter = new TopFilter(); filters.add( binaryAttributeFilter ); filters.add( topFilter ); - binaries = ( Set ) factoryCfg.getEnvironment().get( BINARY_KEY ); + binaries = ( Set ) factoryCfg.getEnvironment().get( BINARY_KEY ); + + if ( binaries == null ) + { + binaries = new HashSet(); + } + + schemaBaseDN = new LdapDN( "ou=schema" ); schemaBaseDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() ); @@ -1722,6 +1729,7 @@ } asBinary = !type.getSyntax().isHumanReadible(); + asBinary = asBinary || ( ( binaries != null ) && ( binaries.contains( type ) ) ); asBinary = asBinary || binaries.contains( type ); if ( asBinary )