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 6A082D2FF for ; Mon, 10 Dec 2012 17:44:46 +0000 (UTC) Received: (qmail 88192 invoked by uid 500); 10 Dec 2012 17:44:45 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 88090 invoked by uid 500); 10 Dec 2012 17:44:43 -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 88036 invoked by uid 99); 10 Dec 2012 17:44:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2012 17:44:41 +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; Mon, 10 Dec 2012 17:44:38 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CD8C72388A4A; Mon, 10 Dec 2012 17:44:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1419604 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ interceptors/operational/src/main/java/org/apache/directory/server/core/operational/ xdbm-partition/src/main/java/org/... Date: Mon, 10 Dec 2012 17:44:14 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121210174416.CD8C72388A4A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Mon Dec 10 17:44:11 2012 New Revision: 1419604 URL: http://svn.apache.org/viewvc?rev=1419604&view=rev Log: Added the SchemaManager as a parameter in the FilteringOperationContext.contains() method to rget rid of a NPE Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java?rev=1419604&r1=1419603&r2=1419604&view=diff ============================================================================== --- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java (original) +++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/FilteringOperationContext.java Mon Dec 10 17:44:11 2012 @@ -32,6 +32,7 @@ import org.apache.directory.shared.ldap. import org.apache.directory.shared.ldap.model.name.Dn; import org.apache.directory.shared.ldap.model.schema.AttributeType; import org.apache.directory.shared.ldap.model.schema.AttributeTypeOptions; +import org.apache.directory.shared.ldap.model.schema.SchemaManager; import org.apache.directory.shared.ldap.model.schema.SchemaUtils; import org.apache.directory.shared.ldap.model.schema.UsageEnum; import org.apache.directory.shared.util.StringConstants; @@ -187,7 +188,7 @@ public abstract class FilteringOperation * @param attribute The attribute we are looking for * @return true if the attribute is present */ - public boolean contains( String attribute ) + public boolean contains( SchemaManager schemaManager, String attribute ) { if ( isNoAttributes() ) { @@ -196,8 +197,7 @@ public abstract class FilteringOperation try { - AttributeType attributeType = getSession().getDirectoryService(). - getSchemaManager().lookupAttributeTypeRegistry( attribute ); + AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( attribute ); if ( ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS ) && isAllUserAttributes() ) { Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1419604&r1=1419603&r2=1419604&view=diff ============================================================================== --- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original) +++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Mon Dec 10 17:44:11 2012 @@ -646,7 +646,7 @@ public class OperationalAttributeInterce if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS ) { // If it's not in the list of returning attribute, remove it - if ( !lookupContext.contains( attributeType.getOid() ) ) + if ( !lookupContext.contains( schemaManager, attributeType.getOid() ) ) { removedAttributes.add( attributeType ); } @@ -689,7 +689,7 @@ public class OperationalAttributeInterce AttributeType attributeType = attribute.getAttributeType(); // If it's not in the list of returning attribute, remove it - if ( !lookupContext.contains( attributeType.getOid() ) ) + if ( !lookupContext.contains( schemaManager, attributeType.getOid() ) ) { removedAttributes.add( attributeType ); } Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1419604&r1=1419603&r2=1419604&view=diff ============================================================================== --- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java (original) +++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Mon Dec 10 17:44:11 2012 @@ -1119,7 +1119,7 @@ public abstract class AbstractBTreeParti if ( attributeType.getUsage() != UsageEnum.USER_APPLICATIONS ) { - if ( !lookupContext.contains( oid ) ) + if ( !lookupContext.contains( schemaManager, oid ) ) { entry.removeAttributes( attributeType ); } @@ -1138,7 +1138,7 @@ public abstract class AbstractBTreeParti if ( attributeType.getUsage() == UsageEnum.USER_APPLICATIONS ) { - if ( !lookupContext.contains( oid ) ) + if ( !lookupContext.contains( schemaManager, oid ) ) { entry.removeAttributes( attributeType ); } @@ -1166,7 +1166,7 @@ public abstract class AbstractBTreeParti AttributeType attributeType = attribute.getAttributeType(); String oid = attributeType.getOid(); - if ( !lookupContext.contains( oid ) ) + if ( !lookupContext.contains( schemaManager, oid ) ) { entry.removeAttributes( attributeType ); }