I was doing some testing to validate my understanding of composition
when I ran into a case that (I assumed) shouldn't succeed and should
instead throw an exception.
Here's the code:
DocOpBuilder docOp = new DocOpBuilder();
docOp.characters("ABCDEF");
BufferedDocOp doc = docOp.build();
System.out.println(doc.toString()); // Prints: ++"ABCDEF";
DocOpCollector col = new DocOpCollector();
docOp = new DocOpBuilder();
docOp.retain(1);
docOp.deleteCharacters("B");
docOp.retain(4);
col.add(docOp.build());
docOp = new DocOpBuilder();
docOp.retain(2);
docOp.deleteCharacters("C");
docOp.retain(3);
col.add(docOp.build());
doc = Composer.compose(doc, col.composeAll());
System.out.println(doc.toString()); // Prints: ++"ACEF";
When I wrote this I assumed that it would fail on the second to last
line, but instead it succeeds.
Does this just represent one of the cases where stricter operation
validation hasn't been implemented yet?
Similar naive (un-transformed) compositions involving
deleteElementStart() and updateAttributes() do fail with an exception.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Wave
Protocol" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/wave-protocol?hl=en
-~----------~----~----~----~------~----~------~--~---