directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r889322 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Date Thu, 10 Dec 2009 16:42:10 GMT
Author: elecharny
Date: Thu Dec 10 16:42:10 2009
New Revision: 889322

URL: http://svn.apache.org/viewvc?rev=889322&view=rev
Log:
Fix for the LoadableSchemaObject injection pb with a wrong FQCN

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=889322&r1=889321&r2=889322&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Thu Dec 10 16:42:10 2009
@@ -31,6 +31,7 @@
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -1407,7 +1408,20 @@
         }
         else
         {
-            copy = schemaObject;
+            // Check the schemaObject here.
+            if ( ( ( LoadableSchemaObject ) schemaObject ).isValid() )
+            {
+                copy = schemaObject;
+            }
+            else
+            {
+                // We have an invalid SchemaObject, no need to go any further
+                Throwable error = new LdapOperationNotSupportedException( "the SchemaObject
" + schemaObject.getOid()
+                    + " canot be added, it's not a valid LoadableSchemaObject.", ResultCodeEnum.UNWILLING_TO_PERFORM
);
+                errors.add( error );
+
+                return false;
+            }
         }
 
         if ( registries.isRelaxed() )
@@ -1578,7 +1592,7 @@
                 else
                 {
                     // We have some error : reject the deletion and get out
-                    String msg = "Cannot deete the SchemaObject " + schemaObject.getOid()
+ " from the registries, "
+                    String msg = "Cannot delete the SchemaObject " + schemaObject.getOid()
+ " from the registries, "
                         + "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
                     LOG.info( msg );
 



Mime
View raw message