}
private OTOperation translateFrom(final OTOperation remoteOp,
final OTOperation basedOn) {
OpPair transformedFrom = basedOn.getTransformedFrom();
if (transformedFrom == null) {
return remoteOp;
}
else {
final List<OpPair> translationVector = new ArrayList<OpPair>();
OTOperation last = basedOn;
OTOperation op = basedOn;
while ((transformedFrom = op.getTransformedFrom()) != null) {
OTOperation root = transformedFrom.getLocalOp();
int baseRev;
do {
baseRev = root.getRevision();
} while (root.getTransformedFrom() != null && (root = root.getTransformedFrom().getRemoteOp()) != null);
if (remoteOp.getTransformedFrom() == null || baseRev > remoteOp.getLastRevisionTx()) {
translationVector.add(transformedFrom);
}
op = transformedFrom.getRemoteOp();
if (last.equals(op)) {
continue;
}