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

Jean-Noel Rouvignac
10.34.2013 cf77cf6a4f637497f28a4230f7bc7f5dbc8524a2
ECLServerHandler.java:
Fixed a regression introduced in r9677. It was found by Christophe Sovant with the functional test suite:
When throwing a DirectoryException with ERR_RESYNC_REQUIRED_UNKNOWN_DOMAIN_IN_PROVIDED_COOKIE, the domainCtxts is read before it is written to.
This code should have been changed to iterate on the Set<DomainContext> rather than the domainCtxts field which has not been assigned at this point.
1 files modified
11 ■■■■ changed files
opends/src/server/org/opends/server/replication/server/ECLServerHandler.java 11 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ECLServerHandler.java
@@ -833,9 +833,8 @@
      // If there are domain missing in the provided cookie,
      // the request is rejected and a full resync is required.
      throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
        ERR_RESYNC_REQUIRED_MISSING_DOMAIN_IN_PROVIDED_COOKIE.get(
            missingDomains,
            "<" + providedCookie + missingDomains + ">"));
          ERR_RESYNC_REQUIRED_MISSING_DOMAIN_IN_PROVIDED_COOKIE.get(
              missingDomains, "<" + providedCookie + missingDomains + ">"));
    }
    /*
@@ -863,14 +862,14 @@
      This domain has probably been removed or replication disabled on it.
      The request is rejected and full resync is required.
      */
      StringBuilder sb = new StringBuilder();
      for (DomainContext domainCtxt : domainCtxts) {
      final StringBuilder sb = new StringBuilder();
      for (DomainContext domainCtxt : results) {
        sb.append(domainCtxt.rsDomain.getBaseDN()).append(":")
          .append(domainCtxt.startState).append(";");
      }
      throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
          ERR_RESYNC_REQUIRED_UNKNOWN_DOMAIN_IN_PROVIDED_COOKIE.get(
              startStatesFromProvidedCookie.toString() ,sb.toString()));
              startStatesFromProvidedCookie.toString(), sb.toString()));
    }
    return results;