mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
11.23.2008 180047559f8f1afa70bcda3d9c9d5d8e38773e28
Fix for issue 3580 (Control panel : Java Excep  when accessing to Manage entries/cn=backup).

Unquote the relative JNDI name before creating the DN of the node.
1 files modified
27 ■■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/browser/NodeRefresher.java 27 ●●●●● patch | view | raw | blame | history
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.