From de17da6e1465decdded23e4b04d85540be3b6933 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sat, 07 Oct 2006 19:05:15 +0000
Subject: [PATCH] Fix a problem in which an attempt to remove the objectClass attribute is successful.  The attempt to remove the entire attribute (without specifying the individual values) was not properly handled and the entry remained unchanged instead of actually removing the values.

---
 opends/src/server/org/opends/server/types/Entry.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/types/Entry.java b/opends/src/server/org/opends/server/types/Entry.java
index 9239ae6..b33b3f1 100644
--- a/opends/src/server/org/opends/server/types/Entry.java
+++ b/opends/src/server/org/opends/server/types/Entry.java
@@ -1539,6 +1539,13 @@
 
     if (attribute.getAttributeType().isObjectClassType())
     {
+      LinkedHashSet<AttributeValue> valueSet = attribute.getValues();
+      if ((valueSet == null) || valueSet.isEmpty())
+      {
+        objectClasses.clear();
+        return true;
+      }
+
       boolean allSuccessful = true;
 
       for (AttributeValue v : attribute.getValues())

--
Gitblit v1.10.0