Collection opStates = op.getAffectedItemStates();
for (Iterator osIt = opStates.iterator(); osIt.hasNext();) {
ItemState state = (ItemState) osIt.next();
if (affectedStates.contains(state)) {
// operation needs to be included
if (!affectedStates.containsAll(opStates)) {
// incomplete changelog: need to save a parent as well
String msg = "ChangeLog is not self contained.";
throw new ConstraintViolationException(msg);
}
// no violation: add operation an stop iteration over