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

boli
22.47.2007 9a72955d0b08a0a1b3116d9eaba993c77c84d8c1
opends/src/server/org/opends/server/backends/RootDSEBackend.java
@@ -396,7 +396,7 @@
  public ConditionResult hasSubordinates(DN entryDN)
         throws DirectoryException
  {
    long ret = numSubordinates(entryDN);
    long ret = numSubordinates(entryDN, false);
    if(ret < 0)
    {
      return ConditionResult.UNDEFINED;
@@ -417,7 +417,7 @@
   * {@inheritDoc}
   */
  @Override()
  public long numSubordinates(DN entryDN)
  public long numSubordinates(DN entryDN, boolean subtree)
         throws DirectoryException
  {
    if (entryDN == null || ! entryDN.isNullDN())
@@ -439,9 +439,21 @@
    for (DN subBase : baseMap.keySet())
    {
      if (DirectoryServer.entryExists(subBase))
      Backend b = baseMap.get(subBase);
      Entry subBaseEntry = b.getEntry(subBase);
      if (subBaseEntry != null)
      {
        count++;
        if(subtree)
        {
          long subCount = b.numSubordinates(subBase, true);
          if(subCount < 0)
          {
            return -1;
          }
          count += subCount;
        }
        count ++;
      }
    }