directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1209611 - /directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
Date Fri, 02 Dec 2011 18:06:51 GMT
Author: elecharny
Date: Fri Dec  2 18:06:51 2011
New Revision: 1209611

URL: http://svn.apache.org/viewvc?rev=1209611&view=rev
Log:
Fixed a NPE in the search request

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java?rev=1209611&r1=1209610&r2=1209611&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/schema/SchemaPartition.java
Fri Dec  2 18:06:51 2011
@@ -52,11 +52,14 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.exception.LdapUnwillingToPerformException;
+import org.apache.directory.shared.ldap.model.filter.ExprNode;
+import org.apache.directory.shared.ldap.model.filter.PresenceNode;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.apache.directory.shared.ldap.model.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.model.message.SearchScope;
 import org.apache.directory.shared.ldap.model.message.controls.Cascade;
 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.SchemaManager;
 import org.apache.directory.shared.ldap.model.schema.SchemaUtils;
 import org.apache.directory.shared.util.DateUtils;
@@ -124,6 +127,9 @@ public final class SchemaPartition exten
     /** A static Dn for the ou=schema partition */
     private static Dn SCHEMA_DN;
 
+    /** The ObjectClass AttributeType */
+    private static AttributeType OBJECT_CLASS_AT;
+
 
     public SchemaPartition( SchemaManager schemaManager )
     {
@@ -139,6 +145,7 @@ public final class SchemaPartition exten
         id = SCHEMA_ID;
         suffixDn = SCHEMA_DN;
         this.schemaManager = schemaManager;
+        OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT_OID
);
     }
     
     
@@ -293,7 +300,8 @@ public final class SchemaPartition exten
             Dn dn = deleteContext.getDn();
             SearchRequest searchRequest = new SearchRequestImpl();
             searchRequest.setBase( dn );
-            searchRequest.setFilter( "ObjectClass=*)" );
+            ExprNode node = new PresenceNode( OBJECT_CLASS_AT );
+            searchRequest.setFilter( node );
             searchRequest.setTypesOnly( true );
             searchRequest.setScope( SearchScope.ONELEVEL );
             



Mime
View raw message