directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r888073 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
Date Mon, 07 Dec 2009 18:48:55 GMT
Author: elecharny
Date: Mon Dec  7 18:48:54 2009
New Revision: 888073

URL: http://svn.apache.org/viewvc?rev=888073&view=rev
Log:
Fix an issue in the getSchema( Entry ) method : if the entry wasn't a Schema, it was still
considered as such. This will fix DIRSERVER-1435

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java?rev=888073&r1=888072&r2=888073&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
Mon Dec  7 18:48:54 2009
@@ -103,6 +103,23 @@
 
     protected Schema getSchema( Entry entry ) throws Exception
     {
+        EntryAttribute objectClasses = entry.get( SchemaConstants.OBJECT_CLASS_AT );
+        boolean isSchema = false;
+
+        for ( Value<?> value : objectClasses )
+        {
+            if ( MetaSchemaConstants.META_SCHEMA_OC.equalsIgnoreCase( value.getString() )
)
+            {
+                isSchema = true;
+                break;
+            }
+        }
+
+        if ( !isSchema )
+        {
+            return null;
+        }
+
         String name;
         String owner;
         String[] dependencies = StringTools.EMPTY_STRINGS;



Mime
View raw message