ci = r.clientOp();
sd = r.serverOp();
r = new InsertionDeletionTransformer().transformOperations(si, cd);
si = r.clientOp();
cd = r.serverOp();
DocOpCollector clientCollector = new DocOpCollector();
DocOpCollector serverCollector = new DocOpCollector();
clientCollector.add(ci);
serverCollector.add(si);
while (!AnnotationTamenessChecker.checkTameness(cp, sp, cd, sd)) {
r = new PreservationPreservationTransformer().transformOperations(cp, sp);
cp = r.clientOp();
sp = r.serverOp();
Pair<DocOp, Pair<DocOp, DocOp>> rc =
new PreservationDeletionTransformer().transformOperations(cp, sd);
Pair<DocOp, Pair<DocOp, DocOp>> rs =
new PreservationDeletionTransformer().transformOperations(sp, cd);
clientCollector.add(rc.first);
serverCollector.add(rs.first);
sp = rc.second.first;
sd = rc.second.second;
cp = rs.second.first;
cd = rs.second.second;
}
r = new DeletionDeletionTransformer().transformOperations(cd, sd);
cd = r.clientOp();
sd = r.serverOp();
clientCollector.add(cd);
serverCollector.add(sd);
return new OperationPair<DocOp>(
clientCollector.composeAll(), serverCollector.composeAll());
// We're catching runtime exceptions here, but checked exceptions may be better.
} catch (RuntimeException e) {
throw new TransformException(e);
}
}