From 180047559f8f1afa70bcda3d9c9d5d8e38773e28 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 11 Nov 2008 01:23:12 +0000
Subject: [PATCH] Fix for issue 3580 (Control panel : Java Excep  when accessing to Manage entries/cn=backup).

---
 opends/src/guitools/org/opends/guitools/controlpanel/browser/NodeRefresher.java |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/browser/NodeRefresher.java b/opends/src/guitools/org/opends/guitools/controlpanel/browser/NodeRefresher.java
index d238712..08605b7 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/browser/NodeRefresher.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/browser/NodeRefresher.java
@@ -699,7 +699,7 @@
         }
         else
         {
-          name = r.getName()+","+parentDn;
+          name = unquoteRelativeName(r.getName())+","+parentDn;
         }
         boolean add = false;
         if (useCustomFilter())
@@ -900,6 +900,31 @@
     }
   }
 
+  /**
+   * Removes the quotes surrounding the provided name.  JNDI can return relative
+   * names with this format.
+   * @param name the relative name to be treated.
+   * @return an String representing the provided relative name without
+   * surrounding quotes.
+   */
+  private String unquoteRelativeName(String name)
+  {
+    if ((name.length() > 0) && (name.charAt(0) == '"'))
+    {
+      if (name.charAt(name.length() - 1) == '"')
+      {
+        return name.substring(1, name.length() - 1);
+      }
+      else
+      {
+        return name.substring(1);
+      }
+    }
+    else
+    {
+      return name;
+    }
+  }
 
   /**
    * DEBUG : Dump the state of the task.

--
Gitblit v1.10.0