directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r433108 - in /directory/trunks/apacheds: core/src/main/java/org/apache/directory/server/core/schema/ server-unit/src/test/java/org/apache/directory/server/
Date Mon, 21 Aug 2006 00:46:55 GMT
Author: akarasulu
Date: Sun Aug 20 17:46:54 2006
New Revision: 433108

URL: http://svn.apache.org/viewvc?rev=433108&view=rev
Log:
Fix for DIRSERVER-646: Replacing an unknown attribute with no values (deletion) causes an
error

Added:
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
      - copied unchanged from r433107, directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=433108&r1=433107&r2=433108&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Sun Aug 20 17:46:54 2006
@@ -821,6 +821,19 @@
         ObjectClassRegistry ocRegistry = this.globalRegistries.getObjectClassRegistry();
         AttributeTypeRegistry atRegistry = this.globalRegistries.getAttributeTypeRegistry();
 
+        // -------------------------------------------------------------------
+        // DIRSERVER-646 Fix: Replacing an unknown attribute with no values 
+        // (deletion) causes an error
+        // -------------------------------------------------------------------
+        
+        if ( mods.length == 1 && 
+             mods[0].getAttribute().size() == 0 && 
+             mods[0].getModificationOp() == DirContext.REPLACE_ATTRIBUTE &&
+             ! atRegistry.hasAttributeType( mods[0].getAttribute().getID() ) )
+        {
+            return;
+        }
+        
         // Now, apply the modifications on the cloned entry before applyong it to the
         // real object.
         for ( int ii = 0; ii < mods.length; ii++ )

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java?rev=433108&r1=433107&r2=433108&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java
(original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddingEntriesWithSpecialCharactersInRDNTest.java
Sun Aug 20 17:46:54 2006
@@ -13,11 +13,12 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  *
- */package org.apache.directory.server;
+ */
+package org.apache.directory.server;
+
 
 import java.util.Hashtable;
 
-import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -31,7 +32,6 @@
 
 import org.apache.directory.server.unit.AbstractServerTest;
 
-import junit.framework.TestCase;
 
 /**
  * Test case to demonstrate DIRSERVER-631 ("Creation of entry with special (and



Mime
View raw message