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

gbellato
19.51.2007 2d70624201e72e6d4c23f39696537d573f39712d
fix for issue 1212 namingConflict test trigger an assert from the static group

When it is enabled, the synchronization code can sometimes decide to abandon
an add operation. In such case the handleConflictResolution() method
of the SynchronizationProvider will return a code indicating to stop the
OperationProcessing.
However when doing this, the ChangeListener are still invoked
at the end of the AddOperation processing.
Since the operation has not been processed, the ChangeListeners are given
a null entry parameter but the StaticGroup code that runs as a ChangeListener
makes the assumptions that the entry is always non null at this point.
This currently causes the following assert when running the test
synchronization.UpdateOperationTest.namingConflicts()

The change notification listeners will only be invoked if the result
code for the operation is "SUCCESS", and at that point in the processing
it should only be SUCCESS if the update was actually applied. If the
synchronization code decided to abort the operation the
the provider.handleConflictResolution() therefore now set
a Cancel Result code.





1 files modified
2 ■■■ changed files
opends/src/server/org/opends/server/synchronization/plugin/SynchronizationDomain.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/synchronization/plugin/SynchronizationDomain.java
@@ -590,7 +590,7 @@
      String uuid = ctx.getEntryUid();
      if (findEntryDN(uuid) != null)
      {
        addOperation.setResultCode(ResultCode.SUCCESS);
        addOperation.setResultCode(ResultCode.CANCELED);
        return new SynchronizationProviderResult(false);
      }