You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/12/10 18:44:14 UTC
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/...
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 );
}