directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r506191 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
Date Mon, 12 Feb 2007 00:29:47 GMT
Author: akarasulu
Date: Sun Feb 11 16:29:47 2007
New Revision: 506191

URL: http://svn.apache.org/viewvc?view=rev&rev=506191
Log:
fixing problem of adding a matchingRule with a non-existant syntax

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?view=diff&rev=506191&r1=506190&r2=506191
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
Sun Feb 11 16:29:47 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.DITContentRule;
@@ -436,6 +437,13 @@
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
+            }
+            
+            if ( ! globalRegistries.getSyntaxRegistry().hasSyntax( desc.getSyntax() ) )
+            {
+                throw new LdapOperationNotSupportedException(
+                    "Cannot create a matchingRule that depends on non-existant syntax: "
+ desc.getSyntax(),
+                    ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
             
             MatchingRuleImpl mr = new MatchingRuleImpl( desc.getNumericOid(), desc.getSyntax(),
globalRegistries );



Mime
View raw message