directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r675482 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Date Thu, 10 Jul 2008 08:58:03 GMT
Author: elecharny
Date: Thu Jul 10 01:58:03 2008
New Revision: 675482

URL: http://svn.apache.org/viewvc?rev=675482&view=rev
Log:
Added some code to deal with modification of non existing attrinute. The code is currently
commented until we fix the changelog.

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=675482&r1=675481&r2=675482&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Thu Jul 10 01:58:03 2008
@@ -1324,11 +1324,26 @@
                     break;
 
                 case REMOVE_ATTRIBUTE:
+                    // First check that the attributeType exists
                     if ( tmpEntry.get( change.getUpId() ) == null )
                     {
                         LOG.error( "Trying to remove an non-existant attribute: " + change.getUpId()
);
                         throw new LdapNoSuchAttributeException();
                     }
+                    
+                    // Then check that all the values exists
+                    /* TODO reactivate this code when ChangeLog is fixed
+                    EntryAttribute toBeRemoved = tmpEntry.get( change.getUpId() );
+                    
+                    for ( Value<?> val:change )
+                    {
+                        if ( !toBeRemoved.contains( val ) )
+                        {
+                            LOG.error( "Trying to remove an non-existant value '{}' for attribute
'{}': ", val, change.getUpId() );
+                            throw new LdapNoSuchAttributeException();
+                        }
+                    }
+                    */
 
                     // We may have to remove the attribute or only some values
                     if ( change.size() == 0 )



Mime
View raw message