Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A79979F9E for ; Fri, 28 Sep 2012 15:58:29 +0000 (UTC) Received: (qmail 3171 invoked by uid 500); 28 Sep 2012 15:58:29 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 3137 invoked by uid 500); 28 Sep 2012 15:58: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 3128 invoked by uid 99); 28 Sep 2012 15:58:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2012 15:58:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 28 Sep 2012 15:58:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id B6D5123888EA for ; Fri, 28 Sep 2012 15:57:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1391514 - /directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g Date: Fri, 28 Sep 2012 15:57:42 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120928155742.B6D5123888EA@eris.apache.org> Author: elecharny Date: Fri Sep 28 15:57:42 2012 New Revision: 1391514 URL: http://svn.apache.org/viewvc?rev=1391514&view=rev Log: Fixed some potential NPE when trying to access a null SchemaManager (see DIRSTUDIO-833) Modified: directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g Modified: directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g?rev=1391514&r1=1391513&r2=1391514&view=diff ============================================================================== --- directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g (original) +++ directory/shared/trunk/ldap/extras/aci/src/main/antlr/ACIItem.g Fri Sep 28 15:57:42 2012 @@ -599,7 +599,15 @@ aMaxValueCount returns [ MaxValueCountEl { try { - attributeType = schemaManager.lookupAttributeTypeRegistry( oid ); + if ( schemaManager != null ) + { + attributeType = schemaManager.lookupAttributeTypeRegistry( oid ); + } + else + { + attributeType = new AttributeType( oid ); + } + maxValueCount = new MaxValueCountElem( attributeType, token2Integer( token ) ); } catch ( LdapException le ) @@ -670,8 +678,17 @@ restrictedValue returns [ RestrictedByEl { try { - attributeType = schemaManager.lookupAttributeTypeRegistry( typeOid ); - valueInAttributeType = schemaManager.lookupAttributeTypeRegistry( valuesInOid ); + if ( schemaManager != null ) + { + attributeType = schemaManager.lookupAttributeTypeRegistry( typeOid ); + valueInAttributeType = schemaManager.lookupAttributeTypeRegistry( valuesInOid ); + } + else + { + attributeType = new AttributeType( typeOid ); + valueInAttributeType = new AttributeType( valuesInOid ); + } + restrictedValue = new RestrictedByElem( attributeType, valueInAttributeType ); } catch ( LdapException le ) @@ -695,7 +712,15 @@ attributeTypeSet returns [ Set