OPENDJ-1088 (CR-2677) Wrong error message and result code when deleting branch as a user with insufficient access rights
Fixed ConcurrentModificationException introduced in r7972 for OPENDJ-475: Incorrect behaviour/result code regarding non-critical controls.
The ConcurrentModificationExcepotion was hidden via several method calls, but generally it takes such form:
1. for (Control c : Operation.getRequestControls()) - directly or via indirect calls
2. AccessControlHandler.isAllowed()
2.1. Operation.removeRequestControl()
3. ConcurrentModificationException on next loop iteration at 1.
LocalBackendWorkflowElement.java:
Replaced isControlAllowed() by removeAllDisallowedControls() that uses Iterator.remove() instead of Operation.removeRequestControl().
LocalBackend*Operation.java:
In handleRequestControls(), processControls() and processRequestControls(), called LocalBackendWorkflowElement.removeAllDisallowedControls() before the for loop + removed call to LocalBackendWorkflowElement.isControlAllowed() in the loop body.
Tiny code cleanups.
ExtendedOperationBasis.java, ECLSearchOperation.java:
Used Iterator.remove() instead of Operation.removeRequestControl().
MultimasterReplication.java:
In findDomain(), used Iterator.remove() instead of Operation.removeRequestControl() + simplified the while loop code.
Operation.java, OperationWrapper.java, PreParseOperation.java:
Removed now unused removeRequestControl().
AbstractOperation.java:
Consequence of the change to Operation.
little code tidy up.