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

Jean-Noël Rouvignac
03.52.2016 83ae76453e0b08ead8c12bd71c85445bdbbdb590
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/browser/NodeRefresher.java
@@ -510,16 +510,10 @@
          while (sr.hasNext())
          {
            entry = sr.readEntry();
            String name;
            if (entry.getName().isRootDN())
            {
              name = remoteDn;
              entry.setName(remoteDn);
            }
            else
            {
              name = unquoteRelativeName(entry.getName().toString()) + "," + remoteDn;
            }
            entry.setName(name);
            found = true;
          }
          if (!found)
@@ -728,23 +722,13 @@
            continue;
          }
          String name = unquoteRelativeName(r.getName().toString()) + "," + parentDn;
          boolean add = false;
          if (useCustomFilter())
          {
            // Check that is an immediate child: use a faster method by just
            // comparing the number of components.
            DN dn = null;
            try
            {
              dn = DN.valueOf(name);
              add = dn.size() == parentComponents + 1;
            }
            catch (Throwable t)
            {
              throw new RuntimeException("Error decoding dns: "+t, t);
            }
            final DN dn = r.getName();
            add = dn.size() == parentComponents + 1;
            if (!add)
            {
              // Is not a direct child.  Check if the parent has been added,
@@ -766,7 +750,6 @@
          }
          if (add)
          {
            r.setName(name);
            childEntries.add(r);
            // Time to time we update the display
            if (childEntries.size() >= 20) {
@@ -914,32 +897,6 @@
    }
  }
  /**
   * 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. */
  void dump() {
    System.out.println("=============");