From 4e1ea6ff023569a8e27e501b8b05cba6c59490d4 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 27 Jan 2010 22:01:06 +0000
Subject: [PATCH] Fix for issue 4517 (Cannot use control panel to edit entry in replicated base DN after a binary update happened in the entry) Treat the ds-sync-hist in a special manner.  It is an attribute with DirectoryString syntax but it can contain byte[] values expressed in a String format which can completely break the UI and the entry processing.

---
 opends/src/guitools/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java b/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
index be4ed69..76e71fa 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
@@ -66,7 +66,6 @@
  *
  */
 public class CustomSearchResult implements Comparable<CustomSearchResult> {
-  private Name name;
   private String dn;
   private Map<String, List<Object>> attributes;
   private SortedSet<String> attrNames;
@@ -99,6 +98,7 @@
   throws NamingException
   {
     String sName = sr.getName();
+    Name name;
     if ((baseDN != null) && (baseDN.length() > 0))
     {
       if ((sName != null) && (sName.length() > 0))
@@ -137,8 +137,8 @@
       NamingEnumeration<?> en = attrs.getAll();
       while (en.hasMore()) {
         Attribute attr = (Attribute)en.next();
-        String name = attr.getID();
-        attrNames.add(name);
+        String attrName = attr.getID();
+        attrNames.add(attrName);
         List<Object> values = new ArrayList<Object>();
         for (int i=0; i<attr.size(); i++)
         {
@@ -148,7 +148,7 @@
             values.add(v);
           }
         }
-        attributes.put(name.toLowerCase(), values);
+        attributes.put(attrName.toLowerCase(), values);
       }
     }
     toString = calculateToString();
@@ -206,6 +206,19 @@
   /**
    * {@inheritDoc}
    */
+  public CustomSearchResult clone()
+  {
+    CustomSearchResult sr = new CustomSearchResult(dn);
+    sr.attributes = new HashMap<String, List<Object>>(attributes);
+    sr.attrNames = new TreeSet<String>(attrNames);
+    sr.toString = toString;
+    sr.hashCode = hashCode;
+    return sr;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
   public boolean equals(Object o)
   {
     boolean equals = false;

--
Gitblit v1.10.0